Merge branch 'release/2.8.3.2308.01' into cutom/个税相关
# Conflicts: # pc4mobx/hrmSalary/apis/ledger.js
This commit is contained in:
commit
94c675007d
|
|
@ -21,6 +21,16 @@ export const deleteExtEmp = (params) => {
|
|||
return postFetch("/api/bs/hrmsalary/extEmp/delete", params);
|
||||
};
|
||||
|
||||
//非系统人员-导入预览
|
||||
export const extEmpPreview = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/extEmp/preview", params);
|
||||
};
|
||||
|
||||
//非系统人员-导入
|
||||
export const importExtEmp = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/extEmp/importExtEmp", params);
|
||||
};
|
||||
|
||||
//非系统人员-详情
|
||||
export const detail = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/extEmp/detail", "get", params);
|
||||
|
|
|
|||
|
|
@ -163,7 +163,14 @@ export const testFormual = params => {
|
|||
|
||||
// 根据id获取formual
|
||||
export const detailFormual = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/formula/detail', 'GET', params);
|
||||
return fetch('/api/bs/hrmsalary/formula/detail', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -362,3 +362,7 @@ export const salarysobRangeImportData = params => {
|
|||
export const saveTaxMapping = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/tax/saveTaxMapping", params);
|
||||
};
|
||||
//薪资账套-获取薪资账套中薪资项目明细
|
||||
export const getSalaryItemForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,107 +1,108 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
|
||||
export const getForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/scheme/getForm', 'get', params);
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/scheme/getForm", "get", params);
|
||||
};
|
||||
export const getTable = params => {
|
||||
// return WeaTools.callApi('/api/bs/hrmsalary/scheme/getTable', 'get', params);
|
||||
return fetch('/api/bs/hrmsalary/scheme/getTable', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
// return WeaTools.callApi('/api/bs/hrmsalary/scheme/getTable', 'get', params);
|
||||
return fetch("/api/bs/hrmsalary/scheme/getTable", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
export const createScheme = params => {
|
||||
return fetch('/api/bs/hrmsalary/scheme/insert', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
return fetch("/api/bs/hrmsalary/scheme/insert", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
export const updateScheme = params => {
|
||||
return fetch('/api/bs/hrmsalary/scheme/update', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
return fetch("/api/bs/hrmsalary/scheme/update", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
export const getCopyForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/scheme/copyForm', 'get', params);
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/scheme/copyForm", "get", params);
|
||||
};
|
||||
export const copyScheme = params => {
|
||||
return fetch(`/api/bs/hrmsalary/scheme/copyScheme?id=${params.id}&schemeName=${params.schemeName}`, {
|
||||
method: 'GET',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => res.json())
|
||||
return fetch(`/api/bs/hrmsalary/scheme/copyScheme?id=${params.id}&schemeName=${params.schemeName}`, {
|
||||
method: "GET",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
}).then(res => res.json());
|
||||
};
|
||||
export const deleteScheme = params => {
|
||||
return fetch('/api/bs/hrmsalary/scheme/delete', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
return fetch("/api/bs/hrmsalary/scheme/delete", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
||||
|
||||
export const getCustomCategoryForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryForm', 'get', params);
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/sicategory/customCategoryForm", "get", params);
|
||||
};
|
||||
export const getCustomCategoryList = params => {
|
||||
// return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryList', 'get', params);
|
||||
return fetch('/api/bs/hrmsalary/sicategory/customCategoryList', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
// return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryList', 'get', params);
|
||||
return fetch("/api/bs/hrmsalary/sicategory/customCategoryList", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
export const createSICategory = params => {
|
||||
return fetch('/api/bs/hrmsalary/sicategory/createSICategory', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
return fetch("/api/bs/hrmsalary/sicategory/createSICategory", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
export const updateCustomCategory = params => {
|
||||
return fetch('/api/bs/hrmsalary/sicategory/updateCustomCategoryName', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
return fetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryName", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
export const deleteCustomCategory = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/sicategory/deleteCustomCategory', 'post', params);
|
||||
export const deleteCustomCategory = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/sicategory/deleteCustomCategory", params);
|
||||
};
|
||||
export const updateCustomCategoryStatus = params => {
|
||||
return fetch('/api/bs/hrmsalary/sicategory/updateCustomCategoryStatus', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
return fetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryStatus", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export default class CustomForm extends React.Component {
|
|||
item.options &&
|
||||
<WeaSelect
|
||||
detailtype={2}
|
||||
disabled={disabledValue}
|
||||
// disabled={disabledValue}
|
||||
viewAttr={item.rules === "required" ? 3 : 2}
|
||||
value={request[item.domkey[0]]}
|
||||
options={item.options.map(o => ({ showname: o.showname, key: o.key }))}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 非系统人员导入
|
||||
* Description:
|
||||
* Date: 2023/8/1
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import ImportModal from "../../../components/importModal";
|
||||
import { extEmpPreview, importExtEmp } from "../../../apis/externalPersonManage";
|
||||
|
||||
class ExternalPersonImport extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
previewDataSource: [],
|
||||
previewColumns: [],
|
||||
importResult: {}
|
||||
};
|
||||
}
|
||||
|
||||
extEmpPreview = (params) => {
|
||||
extEmpPreview(params).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { headers, list } = data;
|
||||
this.setState({
|
||||
previewColumns: _.map(headers, (it, dataIndex) => ({ title: it, dataIndex })),
|
||||
previewDataSource: _.map(list, item => {
|
||||
return _.reduce(item, (pre, cur, key) => (_.assign(pre, { [key]: cur })), {});
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleImportFile = (params) => {
|
||||
importExtEmp(params).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
importResult: data
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { previewDataSource, previewColumns, importResult } = this.state;
|
||||
return (
|
||||
<ImportModal
|
||||
isInit={false} {...this.props}
|
||||
columns={previewColumns}
|
||||
slideDataSource={previewDataSource}
|
||||
importResult={importResult}
|
||||
previewImport={this.extEmpPreview}
|
||||
importFile={this.handleImportFile}
|
||||
templateLink={`/api/bs/hrmsalary/extEmp/importtemplate/export`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ExternalPersonImport;
|
||||
|
|
@ -156,7 +156,7 @@ export const condition = [
|
|||
conditionType: "INPUT",
|
||||
domkey: ["mobile"],
|
||||
fieldcol: 18,
|
||||
label: "手机",
|
||||
label: "手机号",
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
|
|
|
|||
|
|
@ -6,14 +6,17 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaTab, WeaTable, WeaTop } from "ecCom";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTable, WeaTop } from "ecCom";
|
||||
import ExternalPersonManageEditSlide from "./components/externalPersonManageEditSlide";
|
||||
import ExternalPersonImport from "./components/externalPersonImport";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import { getSearchs } from "../../util";
|
||||
import { condition, searchCondition } from "./conditions";
|
||||
import { deleteExtEmp, listPage } from "../../apis/externalPersonManage";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("externalPersonManageStore", "taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
|
|
@ -26,6 +29,9 @@ class Index extends Component {
|
|||
showSearchAd: false,
|
||||
externalPersonManagePayload: {
|
||||
visible: false, title: "新建", id: ""
|
||||
},
|
||||
externalPersonImportPayload: {
|
||||
visiable: false, step: 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -99,7 +105,10 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { showSearchAd, externalPersonManagePayload, loading, pageInfo, selectedRowKeys, dataSource } = this.state;
|
||||
const {
|
||||
showSearchAd, externalPersonManagePayload, loading,
|
||||
pageInfo, selectedRowKeys, dataSource, externalPersonImportPayload
|
||||
} = this.state;
|
||||
const {
|
||||
externalPersonManageStore: { form, addForm },
|
||||
taxAgentStore: { showOperateBtn, showSalaryItemBtn }
|
||||
|
|
@ -132,8 +141,24 @@ class Index extends Component {
|
|||
<div className="externalPerCont">
|
||||
<WeaTab
|
||||
buttons={(showOperateBtn || showSalaryItemBtn) ? [
|
||||
<WeaHelpfulTip
|
||||
title={getLabel(111, "非系统人员,且需要缴纳社保福利以及代发工资的人员,需在本表维护人员信息")}
|
||||
placement="topRight"
|
||||
/>,
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
externalPersonImportPayload: {
|
||||
...externalPersonImportPayload,
|
||||
visiable: true,
|
||||
step: 0
|
||||
}
|
||||
})}>{getLabel(32935, "导入")}</Button>,
|
||||
<Button type="primary" onClick={() => this.handleAdd()}>新建</Button>
|
||||
] : []}
|
||||
] : [
|
||||
<WeaHelpfulTip
|
||||
title={getLabel(111, "非系统人员,且需要缴纳社保福利以及代发工资的人员,需在本表维护人员信息")}
|
||||
placement="topRight"
|
||||
/>
|
||||
]}
|
||||
searchType={["base", "advanced"]} showSearchAd={showSearchAd}
|
||||
setShowSearchAd={(showSearchAd) => this.setState({ showSearchAd })}
|
||||
searchsAd={getSearchs(form, searchCondition, 2)}
|
||||
|
|
@ -170,6 +195,32 @@ class Index extends Component {
|
|||
showOperateBtn={showOperateBtn || showSalaryItemBtn} form={addForm} condition={condition}
|
||||
onCancel={this.handleCancel} {...externalPersonManagePayload}
|
||||
/>
|
||||
{
|
||||
externalPersonImportPayload.visiable &&
|
||||
<ExternalPersonImport
|
||||
{...externalPersonImportPayload}
|
||||
setStep={(step) => {
|
||||
this.setState({ externalPersonImportPayload: { ...externalPersonImportPayload, step } });
|
||||
}}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
externalPersonImportPayload: {
|
||||
...externalPersonImportPayload,
|
||||
visiable: false,
|
||||
step: 0
|
||||
}
|
||||
});
|
||||
}}
|
||||
onFinish={() => {
|
||||
this.setState({
|
||||
externalPersonImportPayload: {
|
||||
...externalPersonImportPayload,
|
||||
visiable: false, step: 0
|
||||
}
|
||||
}, () => this.listPage());
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</WeaTop>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -168,6 +168,11 @@
|
|||
}
|
||||
|
||||
.categroyListWrapper {
|
||||
.wea-search-group {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.titleNormalWrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
@ -180,6 +185,11 @@
|
|||
}
|
||||
|
||||
.titleWrapper {
|
||||
span {
|
||||
font-weight: 600;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
|
|
@ -201,6 +211,16 @@
|
|||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
.topTitle {
|
||||
padding: 5px 12px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.active {
|
||||
background: #e9f7ff;
|
||||
color: #5d9cec;
|
||||
}
|
||||
|
||||
.titleLeft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -235,11 +255,28 @@
|
|||
|
||||
.moveModalWrapper {
|
||||
.ant-radio-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 33.33%);
|
||||
|
||||
.ant-radio-wrapper {
|
||||
margin: 4px 16px;
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.salaryItemEditWrapper {
|
||||
.wea-search-group {
|
||||
padding: 0;
|
||||
border: 1px solid #e5e5e5;
|
||||
border-bottom: none;
|
||||
|
||||
.wea-content {
|
||||
padding: 0;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 4px 16px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,12 @@ class LedgerMovoTo extends Component {
|
|||
>
|
||||
<WeaSearchGroup showGroup needTigger={false}>
|
||||
<WeaSelect
|
||||
options={dataList}
|
||||
options={_.filter(dataList, item => item.showname === "未分类")}
|
||||
detailtype={3} value={value}
|
||||
onChange={onChangeMoveVal}
|
||||
/>
|
||||
<WeaSelect
|
||||
options={_.filter(dataList, item => item.showname !== "未分类")}
|
||||
detailtype={3} value={value}
|
||||
onChange={onChangeMoveVal}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资账套-编辑薪资项目项
|
||||
* Description:
|
||||
* Date: 2023/07/19
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaSlideModal } from "ecCom";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import SalaryItemForm from "../../salaryItem/salaryItemForm";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class LedgerSalaryItemEditSlide extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
handleChange = (params) => {
|
||||
const request = { ...this.props.request, ...params };
|
||||
const key = Object.keys(params)[0];
|
||||
this.props.onUpdateRequest(request, key);
|
||||
};
|
||||
handleShowFormal = () => this.props.onEditFormnul();
|
||||
|
||||
render() {
|
||||
return (
|
||||
<WeaSlideModal
|
||||
{...this.props}
|
||||
className="salaryItemEditWrapper"
|
||||
top={0} width={80} height={100}
|
||||
direction="right" measure="%"
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={getLabel(111, "编辑薪资项目")} showOperateBtn
|
||||
loading={this.props.loading} editable onSave={this.props.onSave}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<div style={{ padding: 16 }}>
|
||||
{
|
||||
this.props.visible &&
|
||||
<SalaryItemForm
|
||||
{...this.props} editable
|
||||
onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerSalaryItemEditSlide;
|
||||
|
|
@ -6,15 +6,16 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaButtonIcon, WeaSearchGroup } from "ecCom";
|
||||
import { WeaButtonIcon, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||
import { Button, Modal } from "antd";
|
||||
import CategoryAddModal from "./categoryAddModal";
|
||||
import LedgerSalaryItemAddModal from "./ledgerSalaryItemAddModal";
|
||||
import LedgerSalaryItemTable from "./ledgerSalaryItemTable";
|
||||
import FormalFormModal from "../../salaryItem/formalFormModal";
|
||||
import LedgerMovoTo from "./ledgerMovoTo";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
class LedgerSalaryItemNormal extends Component {
|
||||
|
|
@ -28,51 +29,14 @@ class LedgerSalaryItemNormal extends Component {
|
|||
name: "",
|
||||
id: ""
|
||||
},
|
||||
editFormulModal: {
|
||||
visible: false,
|
||||
formulaId: "",
|
||||
valueType: "",
|
||||
dataType: ""
|
||||
},
|
||||
//公式保存数据
|
||||
formnulField: {},
|
||||
formnulId: "",
|
||||
moveModalPayload: {
|
||||
visible: false, title: "",
|
||||
dataList: [], record: null, value: ""
|
||||
}
|
||||
},
|
||||
salaryItemKeywords: ""
|
||||
};
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.handleResetFormnul();
|
||||
}
|
||||
|
||||
handleEditFormnul = (field, record) => {
|
||||
const { valueType, formulaId, dateType: dataType, id, key } = record;
|
||||
const { editFormulModal } = this.state;
|
||||
this.setState({
|
||||
editFormulModal: {
|
||||
...editFormulModal,
|
||||
visible: true,
|
||||
valueType, formulaId, dataType
|
||||
},
|
||||
formnulField: field,
|
||||
formnulId: id || key
|
||||
});
|
||||
};
|
||||
handleSaveFormnul = (data) => {
|
||||
const { onSaveFormnul } = this.props;
|
||||
const { formnulField, formnulId } = this.state;
|
||||
const tmpV = _.cloneDeep(formnulField.items);
|
||||
const formnulData = _.map(tmpV, it => {
|
||||
if (it.id === formnulId || it.key === formnulId) {
|
||||
return { ...it, formulaId: data.id, formulaContent: data.formula };
|
||||
}
|
||||
return { ...it };
|
||||
});
|
||||
onSaveFormnul(formnulField.uuid, formnulData);
|
||||
};
|
||||
handleAddCategory = (name = "", id = "") => {
|
||||
const { categoryModal } = this.state;
|
||||
this.setState({
|
||||
|
|
@ -127,23 +91,6 @@ class LedgerSalaryItemNormal extends Component {
|
|||
}
|
||||
}, () => form.resetForm());
|
||||
};
|
||||
handleCloseFormnul = () => {
|
||||
const { editFormulModal } = this.state;
|
||||
this.setState({
|
||||
editFormulModal: {
|
||||
...editFormulModal,
|
||||
visible: false,
|
||||
formulaId: "",
|
||||
valueType: "", dataType: ""
|
||||
}
|
||||
});
|
||||
};
|
||||
handleResetFormnul = () => {
|
||||
this.setState({
|
||||
formnulField: {},
|
||||
formnulId: ""
|
||||
});
|
||||
};
|
||||
handleCancelMove = () => {
|
||||
this.setState({
|
||||
moveModalPayload: {
|
||||
|
|
@ -184,6 +131,8 @@ class LedgerSalaryItemNormal extends Component {
|
|||
|
||||
render() {
|
||||
const {
|
||||
editId,
|
||||
saveSalarySobId,
|
||||
dataSource,
|
||||
onSaveCategory,
|
||||
onDropCategoryItem,
|
||||
|
|
@ -194,15 +143,23 @@ class LedgerSalaryItemNormal extends Component {
|
|||
taxAgentStore
|
||||
} = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const { categoryModal, addCategoryItemsVisible, editFormulModal, moveModalPayload } = this.state;
|
||||
const { categoryModal, addCategoryItemsVisible, moveModalPayload, salaryItemKeywords } = this.state;
|
||||
const newDateSource = _.map(dataSource, item => {
|
||||
return {
|
||||
...item,
|
||||
items: _.filter(item.items || [], child => child.name.indexOf(salaryItemKeywords) !== -1)
|
||||
};
|
||||
});
|
||||
return (
|
||||
<WeaSearchGroup needTigger={false} showGroup
|
||||
title={<TitleComp showOperateBtn={showOperateBtn} titleName={incomeCategoriesTitleName}
|
||||
onAddCategory={this.handleAddCategory}/>}>
|
||||
onAddCategory={this.handleAddCategory} keyword={salaryItemKeywords}
|
||||
onChange={val => this.setState({ salaryItemKeywords: val })}
|
||||
/>}>
|
||||
<div className="categroyListWrapper">
|
||||
{
|
||||
_.map(dataSource, field => {
|
||||
const { items } = field;
|
||||
_.map(newDateSource, field => {
|
||||
const { items, id, uuid } = field;
|
||||
return <WeaSearchGroup
|
||||
needTigger showGroup
|
||||
title={
|
||||
|
|
@ -220,12 +177,13 @@ class LedgerSalaryItemNormal extends Component {
|
|||
}
|
||||
>
|
||||
<LedgerSalaryItemTable
|
||||
dataSource={items}
|
||||
tableData={items}
|
||||
dataSource={_.find(dataSource, childItem => childItem.id === id || childItem.uuid === uuid).items}
|
||||
salarySobId={editId || saveSalarySobId}
|
||||
selectedRowKeys={field.selectedRowKeys || []}
|
||||
onDropCategoryItem={(data) => onDropCategoryItem(field, data)}
|
||||
onHandleItemhide={(data) => onHandleItemhide(field, data)}
|
||||
onChangeSelectedRowKeys={(data) => onChangeSelectedRowKeys(field, data)}
|
||||
onEditFormnul={(data) => this.handleEditFormnul(field, data)}
|
||||
onMoveTo={this.handleMoveTo}
|
||||
/>
|
||||
</WeaSearchGroup>;
|
||||
|
|
@ -248,15 +206,6 @@ class LedgerSalaryItemNormal extends Component {
|
|||
onSaveCategory={onSaveCategory}
|
||||
onCancel={this.handleClose}
|
||||
/>
|
||||
{/*公式编辑*/}
|
||||
{
|
||||
editFormulModal.visible &&
|
||||
<FormalFormModal
|
||||
{...editFormulModal}
|
||||
onSaveFormal={this.handleSaveFormnul}
|
||||
onCancel={this.handleCloseFormnul}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</WeaSearchGroup>
|
||||
);
|
||||
|
|
@ -304,12 +253,17 @@ const TitleNormalComp = (props) => {
|
|||
};
|
||||
|
||||
const TitleComp = (props) => {
|
||||
const { onAddCategory, titleName, showOperateBtn } = props;
|
||||
const { onAddCategory, titleName, showOperateBtn, salaryItemKeywords, onChange } = props;
|
||||
return <div className="titleWrapper">
|
||||
<span>{titleName}</span>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Button type="ghost" onClick={() => onAddCategory()}>新增分类</Button>
|
||||
}
|
||||
<div><span className="topTitle active">{titleName}</span></div>
|
||||
<div>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Button type="ghost" onClick={() => onAddCategory()} style={{ marginRight: 10 }}>新增分类</Button>
|
||||
}
|
||||
<WeaInputSearch value={salaryItemKeywords} onChange={onChange}
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")}
|
||||
/>
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,13 +5,31 @@
|
|||
* Date: 2022/12/13
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaHelpfulTip, WeaTable } from "ecCom";
|
||||
import { WeaCheckbox, WeaHelpfulTip, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import LedgerSalaryItemEditSlide from "./ledgerSalaryItemEditSlide";
|
||||
import { getSalaryItemForm } from "../../../apis/ledger";
|
||||
import { commonEnumList } from "../../../apis/ruleconfig";
|
||||
import FormalFormModal from "../../salaryItem/formalFormModal";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class LedgerSalaryItemTable extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedRowKeys: []
|
||||
selectedRowKeys: [],
|
||||
originRecord: {},
|
||||
salaryItemPayload: {
|
||||
visible: false, record: {},
|
||||
request: {}, isLedger: true,
|
||||
userStatusList: [], loading: false
|
||||
},
|
||||
editFormulModal: {
|
||||
visible: false,
|
||||
formulaId: "",
|
||||
valueType: "",
|
||||
dataType: ""
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -46,15 +64,172 @@ class LedgerSalaryItemTable extends Component {
|
|||
})
|
||||
);
|
||||
};
|
||||
handleChangeSalaryItem = (data, id) => {
|
||||
const { dataSource, onHandleItemhide } = this.props;
|
||||
onHandleItemhide(
|
||||
_.map([...dataSource], item => {
|
||||
if (id === item.salaryItemId) {
|
||||
return {
|
||||
...item,
|
||||
...data
|
||||
};
|
||||
}
|
||||
return { ...item };
|
||||
})
|
||||
);
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 编辑薪资项目
|
||||
* Params:
|
||||
* Date: 2023/7/19
|
||||
*/
|
||||
handleEditSalaryItem = async (record) => {
|
||||
const { salarySobId, dataSource } = this.props, { salaryItemId, id } = record;
|
||||
const {
|
||||
itemHide: hideDefault,
|
||||
valueType, name, description,
|
||||
roundingMode, formulaId, dataType, useInEmployeeSalary,
|
||||
pattern, canEdit, formulaContent, originFormulaContent, originSqlContent
|
||||
} = _.find(dataSource, it => it.salaryItemId === salaryItemId);
|
||||
const { data: userStatusList } = await commonEnumList({ enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" });
|
||||
if (id) {
|
||||
getSalaryItemForm({ salarySobId, salaryItemId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
originRecord: _.find(dataSource, it => it.salaryItemId === salaryItemId),
|
||||
salaryItemPayload: {
|
||||
...this.state.salaryItemPayload,
|
||||
visible: true,
|
||||
request: {
|
||||
...data,
|
||||
useInEmployeeSalary: !_.isNil(data.useInEmployeeSalary) ? data.useInEmployeeSalary : "0",
|
||||
hideDefault: _.isNil(hideDefault) ? "0" : hideDefault, valueType, roundingMode, pattern,
|
||||
formulaContent: formulaContent ? formulaContent : data.formulaContent,
|
||||
originFormulaContent: originFormulaContent ? originFormulaContent : data.originFormulaContent,
|
||||
originSqlContent: originSqlContent ? originSqlContent : data.originSqlContent,
|
||||
formulaId: formulaId ? formulaId : data.formulaId
|
||||
},
|
||||
record,
|
||||
userStatusList: _.map(userStatusList, it => ({ key: it.value.toString(), showname: it.defaultLabel }))
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
salaryItemPayload: {
|
||||
...this.state.salaryItemPayload,
|
||||
visible: true,
|
||||
request: {
|
||||
canEdit, dataType, description,
|
||||
formulaContent, formulaId, name,
|
||||
hideDefault: _.isNil(hideDefault) ? "0" : hideDefault,
|
||||
valueType, roundingMode, pattern,
|
||||
originFormulaContent, originSqlContent,
|
||||
useInEmployeeSalary: !_.isNil(useInEmployeeSalary) ? useInEmployeeSalary : "0"
|
||||
},
|
||||
record,
|
||||
userStatusList: _.map(userStatusList, it => ({ key: it.value.toString(), showname: it.defaultLabel }))
|
||||
},
|
||||
originRecord: _.find(dataSource, it => it.salaryItemId === salaryItemId)
|
||||
});
|
||||
}
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 保存薪资项目
|
||||
* Params:
|
||||
* Date: 2023/7/19
|
||||
*/
|
||||
handleSaveItem = () => {
|
||||
const { salaryItemPayload } = this.state;
|
||||
const { request, record } = salaryItemPayload;
|
||||
this.setState({
|
||||
salaryItemPayload: { ...salaryItemPayload, visible: false }
|
||||
});
|
||||
const { salaryItemId } = record;
|
||||
const {
|
||||
hideDefault, roundingMode, pattern, valueType,
|
||||
originFormulaContent, originSqlContent, formulaId
|
||||
} = request;
|
||||
this.handleChangeSalaryItem({
|
||||
itemHide: hideDefault.toString(),
|
||||
roundingMode, pattern, valueType,
|
||||
formulaContent: valueType.toString() === "2" ? originFormulaContent : originSqlContent,
|
||||
formulaId: ((valueType.toString() === "3" && (!originSqlContent || originSqlContent === " ")) || (valueType.toString() === "2" && (!originFormulaContent || originFormulaContent === " ")) || valueType.toString() === "1") ? "" : formulaId,
|
||||
//不能改成其他空值
|
||||
originFormulaContent: ((valueType.toString() === "3" && (!originSqlContent) || originSqlContent === " ") || (valueType.toString() === "1") || (valueType.toString() === "3" && originSqlContent)) ? " " : originFormulaContent,
|
||||
originSqlContent: ((valueType.toString() === "2" && (!originFormulaContent || originFormulaContent === " ")) || (valueType.toString() === "1") || (valueType.toString() === "2" && originFormulaContent)) ? " " : originSqlContent
|
||||
}, salaryItemId);
|
||||
};
|
||||
handleEditFormnul = () => {
|
||||
const { salaryItemPayload, editFormulModal } = this.state;
|
||||
const { record } = salaryItemPayload;
|
||||
const { valueType, formulaId, dataType, originFormulaContent, originSqlContent } = record;
|
||||
this.setState({
|
||||
editFormulModal: {
|
||||
...editFormulModal, visible: true, valueType, dataType,
|
||||
formulaId: ((valueType.toString() === "2" && (originFormulaContent || originFormulaContent !== " ")) || valueType.toString() === "3" && (originSqlContent || originSqlContent === " ")) ? formulaId : ""
|
||||
}
|
||||
});
|
||||
};
|
||||
handleCloseFormnul = () => {
|
||||
const { editFormulModal } = this.state;
|
||||
this.setState({
|
||||
editFormulModal: {
|
||||
...editFormulModal,
|
||||
visible: false,
|
||||
formulaId: "",
|
||||
valueType: "", dataType: ""
|
||||
}
|
||||
});
|
||||
};
|
||||
handleSaveFormnul = (data) => {
|
||||
const { salaryItemPayload } = this.state;
|
||||
const { record } = salaryItemPayload;
|
||||
const { salaryItemId } = record;
|
||||
const { dataSource, onHandleItemhide } = this.props;
|
||||
const tmpV = _.cloneDeep(dataSource);
|
||||
const formnulData = _.map(tmpV, it => {
|
||||
if (it.salaryItemId === salaryItemId) {
|
||||
return {
|
||||
...it,
|
||||
formulaId: data.id, formulaContent: data.formula,
|
||||
originFormulaContent: data.referenceType === "formula" ? data.formula : "",
|
||||
originSqlContent: data.referenceType === "sql" ? data.formula : ""
|
||||
};
|
||||
}
|
||||
return { ...it };
|
||||
});
|
||||
this.setState({
|
||||
salaryItemPayload: {
|
||||
...salaryItemPayload,
|
||||
request: {
|
||||
...salaryItemPayload.request,
|
||||
formulaId: data.id,
|
||||
originFormulaContent: data.referenceType === "formula" ? data.formula : "",
|
||||
originSqlContent: data.referenceType === "sql" ? data.formula : ""
|
||||
},
|
||||
record: {
|
||||
...salaryItemPayload.record,
|
||||
formulaId: data.id,
|
||||
originFormulaContent: data.referenceType === "formula" ? data.formula : "",
|
||||
originSqlContent: data.referenceType === "sql" ? data.formula : ""
|
||||
}
|
||||
}
|
||||
}, () => {
|
||||
this.handleCloseFormnul();
|
||||
onHandleItemhide(formnulData);
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { salaryItemPayload, editFormulModal, originRecord } = this.state;
|
||||
const { onHandleItemhide } = this.props;
|
||||
const {
|
||||
dataSource,
|
||||
onDropCategoryItem,
|
||||
onChangeSelectedRowKeys,
|
||||
onEditFormnul,
|
||||
selectedRowKeys,
|
||||
onMoveTo
|
||||
tableData, dataSource, onDropCategoryItem,
|
||||
onChangeSelectedRowKeys, selectedRowKeys, onMoveTo
|
||||
} = this.props;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
|
|
@ -65,7 +240,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
disabled: !record.canDelete
|
||||
})
|
||||
};
|
||||
const checkValue = (!_.isEmpty(dataSource) && _.every(dataSource, it => it.itemHide && it.itemHide === "1")) ? "1" : "0";
|
||||
const checkValue = (!_.isEmpty(tableData) && _.every(tableData, it => it.itemHide && it.itemHide === "1")) ? "1" : "0";
|
||||
const columns = [
|
||||
{
|
||||
title: "名称",
|
||||
|
|
@ -77,18 +252,12 @@ class LedgerSalaryItemTable extends Component {
|
|||
<span style={{ marginRight: 8 }}>核算公式</span>
|
||||
<WeaHelpfulTip title={<HelpContent/>} placement="bottom" width={200}/>
|
||||
</span>,
|
||||
dataIndex: "formulaContent",
|
||||
key: "formulaContent",
|
||||
render: (text, record) => {
|
||||
if (record.canEdit) {
|
||||
return (
|
||||
<span className="linkWapper">
|
||||
<a href="javascript: void(0);" onClick={() => onEditFormnul(record)}> {text} </a>
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
return <span> {text} </span>;
|
||||
}
|
||||
dataIndex: "valueType",
|
||||
key: "valueType",
|
||||
render: (e, record) => {
|
||||
const { valueType } = record;
|
||||
const key = !_.isNil(valueType) ? valueType : "";
|
||||
return <span> {key.toString() === "1" ? "输入" : key.toString() === "2" ? "自定义公式" : key.toString() === "3" ? "SQL" : ""} </span>;
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -116,26 +285,71 @@ class LedgerSalaryItemTable extends Component {
|
|||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
key: "operate",
|
||||
width: 100,
|
||||
width: 120,
|
||||
render: (_, record) => (
|
||||
<a href="javascript:void(0);" onClick={() => onMoveTo(record)}>移动到</a>
|
||||
<React.Fragment>
|
||||
<a href="javascript:void(0);" onClick={() => this.handleEditSalaryItem(record)}
|
||||
style={{ marginRight: 10 }}>编辑</a>
|
||||
<a href="javascript:void(0);" onClick={() => onMoveTo(record)}>移动到</a>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
];
|
||||
return (
|
||||
<WeaTable
|
||||
rowKey={record => record.id || record.key}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={dataSource}
|
||||
columns={columns}
|
||||
onRow={(record, index) => ({
|
||||
index,
|
||||
moveRow: record
|
||||
})}
|
||||
pagination={false}
|
||||
onDrop={onDropCategoryItem}
|
||||
draggable={true}
|
||||
/>
|
||||
<React.Fragment>
|
||||
<WeaTable
|
||||
rowKey={record => record.id || record.key}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={tableData}
|
||||
columns={columns}
|
||||
onRow={(record, index) => ({
|
||||
index,
|
||||
moveRow: record
|
||||
})}
|
||||
pagination={false}
|
||||
onDrop={onDropCategoryItem}
|
||||
draggable={dataSource.length === tableData.length}
|
||||
/>
|
||||
<LedgerSalaryItemEditSlide
|
||||
{...salaryItemPayload}
|
||||
onUpdateRequest={(request, key) => {
|
||||
this.setState({
|
||||
salaryItemPayload: {
|
||||
...salaryItemPayload,
|
||||
request,
|
||||
record: key === "valueType" ? {
|
||||
...salaryItemPayload.record,
|
||||
[key]: request[key]
|
||||
} : { ...salaryItemPayload.record }
|
||||
}
|
||||
});
|
||||
}}
|
||||
onEditFormnul={this.handleEditFormnul}
|
||||
onSave={this.handleSaveItem}
|
||||
onClose={() => this.setState({
|
||||
salaryItemPayload: {
|
||||
...salaryItemPayload, visible: false
|
||||
}
|
||||
}, () => {
|
||||
const result = _.map(_.cloneDeep(dataSource), it => {
|
||||
if (it.salaryItemId === originRecord.salaryItemId) {
|
||||
return { ...originRecord };
|
||||
}
|
||||
return { ...it };
|
||||
});
|
||||
onHandleItemhide(result);
|
||||
})}
|
||||
/>
|
||||
{/*公式编辑*/}
|
||||
{
|
||||
editFormulModal.visible &&
|
||||
<FormalFormModal
|
||||
{...editFormulModal}
|
||||
onSaveFormal={this.handleSaveFormnul}
|
||||
onCancel={this.handleCloseFormnul}
|
||||
/>
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import "./index.less";
|
|||
const { getLabel } = WeaLocaleProvider;
|
||||
const Step = WeaSteps.Step;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@inject("taxAgentStore", "ledgerStore")
|
||||
@observer
|
||||
class LedgerSlide extends Component {
|
||||
constructor(props) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import { WeaInputSearch, WeaTop } from "ecCom";
|
|||
import { Button } from "antd";
|
||||
import LedgerTable from "./components/ledgerTable";
|
||||
import LedgerSlide from "./components/ledgerSlide";
|
||||
import "./index.less";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
|
|
@ -67,7 +68,7 @@ class Index extends Component {
|
|||
];
|
||||
return (
|
||||
<WeaTop
|
||||
title="薪资账套"
|
||||
title="薪资账套" className="ledgerOuter"
|
||||
icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D"
|
||||
showDropIcon={false}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
.ledgerOuter {
|
||||
.wea-new-top {
|
||||
.ant-col-10 {
|
||||
span:nth-child(2) {
|
||||
margin-top: -6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ledgerWrapper {
|
||||
height: 100%;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,12 @@ export default class Payroll extends React.Component {
|
|||
|
||||
getReplenishForm = (isEdit = false, params = {}) => {
|
||||
const { payrollStore } = this.props;
|
||||
const { templateBaseData, salaryTemplateShowSet, setReplenishSalaryTemplateSalaryItemSet } = payrollStore;
|
||||
const {
|
||||
templateBaseData,
|
||||
salaryTemplateShowSet,
|
||||
setReplenishSalaryTemplateSalaryItemSet,
|
||||
setSalaryBillItemNameSet
|
||||
} = payrollStore;
|
||||
if (!salaryTemplateShowSet.theme && !isEdit) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
|
|
@ -77,10 +82,12 @@ export default class Payroll extends React.Component {
|
|||
if (!isEdit) {
|
||||
this.setState({ currentStep: this.state.currentStep + 1 }, () => {
|
||||
setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet);
|
||||
setSalaryBillItemNameSet(data.salaryBillItemNameSet);
|
||||
window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
});
|
||||
} else {
|
||||
setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet);
|
||||
setSalaryBillItemNameSet(data.salaryBillItemNameSet);
|
||||
window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
}
|
||||
}
|
||||
|
|
@ -261,7 +268,9 @@ export default class Payroll extends React.Component {
|
|||
setTemplateTableSelectedRowKeys,
|
||||
deletePayroll,
|
||||
templateBaseData,
|
||||
setTemplateTablePageInfo
|
||||
setTemplateTablePageInfo,
|
||||
setSalaryBillItemNameSetting,
|
||||
salaryBillItemNameSetting
|
||||
} = payrollStore;
|
||||
const { currentStep, selectedTab, templateSearchValue, templateSelect, startDate, endDate } = this.state;
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
|
|
@ -316,7 +325,7 @@ export default class Payroll extends React.Component {
|
|||
{
|
||||
showOperateBtn &&
|
||||
<Button type="primary" onClick={() => {
|
||||
this.setState({ stepSlideVisible: true });
|
||||
this.setState({ stepSlideVisible: true, currentStep: 0 });
|
||||
}}>新建</Button>
|
||||
}
|
||||
{
|
||||
|
|
@ -465,10 +474,16 @@ export default class Payroll extends React.Component {
|
|||
customOperate={
|
||||
currentStep === 0 ? [
|
||||
<Button type="primary" onClick={() => {
|
||||
setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => {
|
||||
return { ...it, salaryTemplateId: "", itemShowNameSetting: [] };
|
||||
}));
|
||||
nextStep();
|
||||
}}>下一步</Button>
|
||||
] : currentStep === 1 ? [
|
||||
<Button type="default" onClick={() => {
|
||||
setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => {
|
||||
return { ...it, salaryTemplateId: "", itemShowNameSetting: [] };
|
||||
}));
|
||||
prevStep();
|
||||
}}>上一步</Button>,
|
||||
<Button type="primary" onClick={() => this.getReplenishForm()}>下一步</Button>,
|
||||
|
|
@ -477,6 +492,9 @@ export default class Payroll extends React.Component {
|
|||
}}>预览</Button>
|
||||
] : currentStep === 2 ? [
|
||||
<Button type="default" onClick={() => {
|
||||
setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => {
|
||||
return { ...it, salaryTemplateId: "", itemShowNameSetting: [] };
|
||||
}));
|
||||
prevStep();
|
||||
}}>上一步</Button>,
|
||||
<Button type="primary" onClick={this.handleSave}>保存</Button>
|
||||
|
|
@ -506,7 +524,7 @@ export default class Payroll extends React.Component {
|
|||
className="slideOuterWrapper"
|
||||
visible={this.state.editSlideVisible}
|
||||
top={0}
|
||||
width={50}
|
||||
width={65}
|
||||
height={100}
|
||||
direction="right"
|
||||
measure="%"
|
||||
|
|
@ -539,6 +557,9 @@ export default class Payroll extends React.Component {
|
|||
}
|
||||
subItemChange={(selectedTab) => {
|
||||
this.setState({ selectedTab: Number(selectedTab) }, () => {
|
||||
setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => {
|
||||
return { ...it, salaryTemplateId: "", itemShowNameSetting: [] };
|
||||
}));
|
||||
if (this.state.selectedTab === 2) this.getReplenishForm(true, { id: this.state.templateCurrentId });
|
||||
});
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ class SalaryItemSettings extends Component {
|
|||
};
|
||||
getAvailableSalaryItemSet = (record, title) => {
|
||||
const payload = {
|
||||
salaryTemplateId: this.props.salaryTemplateId,
|
||||
salarySobId: this.props.salarySobId,
|
||||
existSalaryItemIds: _.map(record.items, it => it.id),
|
||||
groupId: record.groupId,
|
||||
|
|
@ -149,6 +150,7 @@ class SalaryItemSettings extends Component {
|
|||
const { dataList } = this.state;
|
||||
const payload = {
|
||||
salarySobId,
|
||||
salaryTemplateId: this.props.salaryTemplateId,
|
||||
existSalaryGroupIds: _.map(dataList, it => it.groupId),
|
||||
isReplenish: this.props.isReplenish
|
||||
};
|
||||
|
|
@ -217,8 +219,6 @@ class SalaryItemSettings extends Component {
|
|||
}
|
||||
};
|
||||
handleEditSalaryItemName = (item, field, viewAttr) => {
|
||||
//暂时关闭
|
||||
return;
|
||||
const { groupId } = item, { salaryItemId } = field, { dataList } = this.state;
|
||||
if (groupId === "111111111111111111") return;
|
||||
this.setState({
|
||||
|
|
@ -255,7 +255,7 @@ class SalaryItemSettings extends Component {
|
|||
...item,
|
||||
items: _.map(item.items, child => {
|
||||
if (child.salaryItemId === salaryItemId) {
|
||||
return { ...child, salaryItemShowName: name, name };
|
||||
return { ...child, salaryItemShowName: name, name: name ? name : child.originName };
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
|
|
@ -268,7 +268,18 @@ class SalaryItemSettings extends Component {
|
|||
salaryItemShowName: originName === name ? "" : name
|
||||
}], itemShowNamesetting, "salaryItemId")
|
||||
}, () => {
|
||||
this.props.onChangeSalaryItem(this.state.dataList);
|
||||
const modifySalaryItemids = _.reduce(this.state.itemShowNamesetting, (pre, cur) => [...pre, cur.salaryItemId], []);
|
||||
const convertDataList = _.map(this.state.dataList, it => {
|
||||
if (it.groupId === "111111111111111111") return { ...it };
|
||||
return {
|
||||
...it,
|
||||
items: _.map(it.items, item => {
|
||||
if (modifySalaryItemids.includes(item.salaryItemId)) return { ...item };
|
||||
return { ...item, name: item.salaryItemShowName };
|
||||
})
|
||||
};
|
||||
});
|
||||
this.props.onChangeSalaryItem(convertDataList);
|
||||
this.props.onChangeSalaryItemShowNamesetting(this.state.itemShowNamesetting);
|
||||
});
|
||||
};
|
||||
|
|
@ -307,9 +318,36 @@ class SalaryItemSettings extends Component {
|
|||
})
|
||||
)}
|
||||
renderNodeItem={(filed) => {
|
||||
const salaryBillItemNameObj = salaryBillItemNameSet[filed.id] || {};
|
||||
return <div className="salaryItemList">
|
||||
<div className="salaryItem" title={filed.name}>
|
||||
<div className="salaryItemName">{filed.name}</div>
|
||||
<div className="salaryItem"
|
||||
title={
|
||||
(item.groupId !== "111111111111111111" && (!_.isEmpty(salaryBillItemNameObj) || (filed.salaryItemShowName !== filed.originName))) ?
|
||||
`${filed.salaryItemShowName}(${filed.originName})` :
|
||||
filed.name
|
||||
}
|
||||
>
|
||||
{
|
||||
filed.viewAttr === 2 ?
|
||||
<WeaInput
|
||||
value={
|
||||
item.groupId !== "111111111111111111" ?
|
||||
filed.salaryItemShowName :
|
||||
filed.name
|
||||
}
|
||||
id="salaryItemInput"
|
||||
onBlur={() => this.handleEditSalaryItemName(item, filed, 1)}
|
||||
onChange={(val) => this.handleChangeSalaryItemShowName(item, filed, val)}
|
||||
/> :
|
||||
<div className="salaryItemName"
|
||||
onClick={() => this.handleEditSalaryItemName(item, filed, 2)}>
|
||||
{
|
||||
(item.groupId !== "111111111111111111" && (!_.isEmpty(salaryBillItemNameObj) || (filed.salaryItemShowName !== filed.originName))) ?
|
||||
`${filed.salaryItemShowName}(${filed.originName})` :
|
||||
filed.name
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<Icon type="cross" onClick={() => this.handleDeleteSalaryItem(item, filed)}/>
|
||||
</div>
|
||||
</div>;
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ export default class ShowSettingForm extends React.Component {
|
|||
>
|
||||
<SalaryItemSettings
|
||||
ref={dom => this.salaryItemSettingsRef = dom}
|
||||
dataSource={salaryItemSet}
|
||||
dataSource={salaryItemSet} salaryTemplateId={this.props.id || ""}
|
||||
onChangeSalaryItem={this.handleChangeSalaryItem}
|
||||
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
|
||||
salarySobId={toJS(templateBaseData).salarySob}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ export default class TemplateSettingForm extends React.Component {
|
|||
onChangeSalaryItem={this.handleChangeSalaryItem}
|
||||
onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting}
|
||||
salarySobId={toJS(templateBaseData).salarySob}
|
||||
salaryTemplateId={this.props.id || ""}
|
||||
isReplenish={true} salaryBillItemNameSet={salaryBillItemNameSet}
|
||||
/>
|
||||
</WeaSearchGroup>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
}
|
||||
|
||||
handleChange = (params) => {
|
||||
let request = { ...this.props.request, ...params };
|
||||
this.props.onChange(request);
|
||||
this.props.onChange({ ...this.props.request, ...params });
|
||||
};
|
||||
|
||||
handleShowFormal = () => {
|
||||
|
|
@ -25,7 +24,11 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
|
||||
// 保存公式成功回调
|
||||
handleSaveFormal = (data) => {
|
||||
this.handleChange({ formulaId: data.id, formulaContent: data.formula });
|
||||
this.handleChange({
|
||||
formulaId: data.id, formulaContent: data.formula,
|
||||
originFormulaContent: data.referenceType === "formula" ? data.formula : "",
|
||||
originSqlContent: data.referenceType === "sql" ? data.formula : ""
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -39,11 +39,14 @@ export default class FormalFormModal extends React.Component {
|
|||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { salaryItemStore, formulaId, valueType } = this.props;
|
||||
const { salaryAcctImportTemplateParam, setSearchFields, detailFormual } = salaryItemStore;
|
||||
setSearchFields([]);
|
||||
if (!!this.props.formulaId && this.props.formulaId != 0) {
|
||||
detailFormual(this.props.formulaId).then(data => {
|
||||
detailFormual({
|
||||
formulaId,
|
||||
returnType: (valueType.toString() === "2" || valueType.toString() === "FORMULA") ? "formula" : "sql"
|
||||
}).then(data => {
|
||||
this.parameters = data.parameters;
|
||||
this.referenceType = data.referenceType;
|
||||
this.extendParam = data.extendParam;
|
||||
|
|
|
|||
|
|
@ -274,6 +274,7 @@ export default class SalaryItem extends React.Component {
|
|||
// 新建和修改保存的回调
|
||||
const handleSlideSave = (continueFlag) => {
|
||||
const { salaryItemStore: { saveItem, request, getTableDatas } } = this.props;
|
||||
const payload = _.cloneDeep(request);
|
||||
const { name, sharedType, taxAgentIds } = request;
|
||||
if (!name || (sharedType === "1" && !taxAgentIds)) {
|
||||
Modal.warning({
|
||||
|
|
@ -282,7 +283,7 @@ export default class SalaryItem extends React.Component {
|
|||
});
|
||||
return;
|
||||
}
|
||||
saveItem(request, continueFlag).then(() => {
|
||||
saveItem(payload, continueFlag).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,20 @@
|
|||
* Date: 2023/2/9
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaFormItem, WeaInput, WeaInputNumber, WeaSearchGroup, WeaSelect, WeaTextarea } from "ecCom";
|
||||
import {
|
||||
WeaCheckbox,
|
||||
WeaFormItem,
|
||||
WeaInput,
|
||||
WeaInputNumber,
|
||||
WeaLocaleProvider,
|
||||
WeaSearchGroup,
|
||||
WeaSelect,
|
||||
WeaTextarea
|
||||
} from "ecCom";
|
||||
import { salaryItemFields, valTakeOptions } from "./columns";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryItemForm extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -18,12 +29,21 @@ class SalaryItemForm extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
const { salaryItemFieldsList } = this.state;
|
||||
const { request, editable, record, isAdd, taxAgentAdminOption } = this.props;
|
||||
const { systemType, sharedType, valueType } = request;
|
||||
const { request, editable, record, isAdd = false, taxAgentAdminOption, isLedger = false } = this.props;
|
||||
const { systemType = "", sharedType, valueType, useInEmployeeSalary } = request;
|
||||
this.setState({
|
||||
salaryItemFieldsList: _.map(salaryItemFieldsList, item => {
|
||||
const { key } = item;
|
||||
switch (key) {
|
||||
case "useDefault":
|
||||
case "sortedIndex":
|
||||
case "dataType":
|
||||
case "description":
|
||||
return {
|
||||
...item,
|
||||
viewAttr: (!isLedger && ((editable && record.canEdit) || isAdd)) ? 2 : 1,
|
||||
display: !isLedger
|
||||
};
|
||||
case "useInEmployeeSalary":
|
||||
return {
|
||||
...item,
|
||||
|
|
@ -44,23 +64,30 @@ class SalaryItemForm extends Component {
|
|||
display: (!_.isNil(sharedType) && sharedType.toString() === "1") && (!_.isNil(systemType) && systemType.toString() === "0"),
|
||||
options: taxAgentAdminOption
|
||||
};
|
||||
case "hideDefault":
|
||||
return {
|
||||
...item,
|
||||
viewAttr: 2,
|
||||
tip: isLedger ? getLabel(111, "开启后,薪资核算不会展示该项目,但是不影响该项目的核算值") : item.tip
|
||||
};
|
||||
case "valueType":
|
||||
return {
|
||||
...item,
|
||||
viewAttr: isAdd ? 2 : 1
|
||||
viewAttr: (useInEmployeeSalary.toString() === "0" && ((isLedger && record.canEdit) || (editable && record.canEdit) || isAdd)) ? 2 : 1
|
||||
};
|
||||
case "formulaContent":
|
||||
return {
|
||||
...item,
|
||||
display: valueType === "2" || valueType === "3",
|
||||
viewAttr: (editable && record.canEdit) || isAdd ? 2 : 1
|
||||
key: valueType.toString() === "3" ? "originSqlContent" : "originFormulaContent",
|
||||
display: useInEmployeeSalary.toString() === "0" && valueType && (valueType.toString() === "2" || valueType.toString() === "3"),
|
||||
viewAttr: (isLedger && record.canEdit) || (editable && record.canEdit) || isAdd ? 2 : 1
|
||||
};
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
viewAttr: (key === "name" && ((editable && record.canEdit) || isAdd)) ? 3 : (key !== "name" && ((editable && record.canEdit) || isAdd)) ? 2 : 1
|
||||
viewAttr: (key === "name" && ((editable && record.canEdit && !isLedger) || isAdd)) ? 3 : (key !== "name" && ((editable && record.canEdit) || isAdd)) ? 2 : 1
|
||||
};
|
||||
})
|
||||
});
|
||||
|
|
@ -73,9 +100,10 @@ class SalaryItemForm extends Component {
|
|||
salaryItemFieldsList: _.map(salaryItemFieldsList, item => {
|
||||
if (key === "sharedType" && item.key === "taxAgentIds") {
|
||||
return { ...item, display: v === "1", viewAttr: 3 };
|
||||
} else if (key === "valueType" && item.key === "formulaContent") {
|
||||
} else if (key === "valueType" && (item.key === "originSqlContent" || item.key === "originFormulaContent")) {
|
||||
return {
|
||||
...item,
|
||||
key: v === "3" ? "originSqlContent" : "originFormulaContent",
|
||||
label: v === "2" ? "公式" : v === "3" ? "SQL" : "",
|
||||
display: v === "2" || v === "3"
|
||||
};
|
||||
|
|
@ -83,11 +111,11 @@ class SalaryItemForm extends Component {
|
|||
return { ...item };
|
||||
})
|
||||
}, () => {
|
||||
if (key === "valueType") {
|
||||
onChangeFieldsItem({ formulaContent: "", formulaId: 0, valueType: v });
|
||||
} else {
|
||||
onChangeFieldsItem({ [key]: (key === "useDefault" || key === "useInEmployeeSalary" || key === "hideDefault") ? Number(v) : v });
|
||||
}
|
||||
// if (key === "valueType" && !this.props.isLedger) {
|
||||
// onChangeFieldsItem({ formulaContent: "", formulaId: 0, valueType: v });
|
||||
// } else {
|
||||
onChangeFieldsItem({ [key]: (key === "useDefault" || key === "useInEmployeeSalary" || key === "hideDefault") ? Number(v) : v });
|
||||
// }
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -105,7 +133,7 @@ class SalaryItemForm extends Component {
|
|||
(type === "INPUT" && display) ?
|
||||
<WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 12 }}>
|
||||
<WeaInput viewAttr={viewAttr} value={value}
|
||||
onClick={() => key === "formulaContent" && onShowFormal()}
|
||||
onClick={() => (key === "originSqlContent" || key === "originFormulaContent") && onShowFormal()}
|
||||
onChange={v => this.handleChangeSalaryFiledItems(key, v)}/></WeaFormItem> :
|
||||
(type === "SWITCH" && display) ?
|
||||
<WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 12 }}>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export default class BaseForm extends React.Component {
|
|||
{ com: Input("岗位", position) },
|
||||
{ com: Input("手机号", telephone) },
|
||||
{ com: Input("入职日期", hiredate) },
|
||||
{ com: Input("合同到期日期", dimissionDate) }
|
||||
// { com: Input("合同到期日期", dimissionDate) }
|
||||
];
|
||||
const taxagentItems = [
|
||||
{ com: Input("个税扣缴义务人", paymentOrganizationName) }
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ export default class Archives extends React.Component {
|
|||
});
|
||||
return;
|
||||
}
|
||||
save("SOCIAL_SECURITY").then(() => {
|
||||
save("SOCIAL_SECURITY", this.record.paymentOrganization).then(() => {
|
||||
this.query();
|
||||
});
|
||||
} else if (selectedTab == 2) {
|
||||
|
|
@ -264,7 +264,7 @@ export default class Archives extends React.Component {
|
|||
});
|
||||
return;
|
||||
}
|
||||
save("ACCUMULATION_FUND").then(() => {
|
||||
save("ACCUMULATION_FUND", this.record.paymentOrganization).then(() => {
|
||||
this.query();
|
||||
});
|
||||
} else if (selectedTab == 3) {
|
||||
|
|
@ -277,7 +277,7 @@ export default class Archives extends React.Component {
|
|||
});
|
||||
return;
|
||||
}
|
||||
save("OTHER").then(() => {
|
||||
save("OTHER", this.record.paymentOrganization).then(() => {
|
||||
this.query();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@
|
|||
* Date: 2023/3/2
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaTable } from "ecCom";
|
||||
import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import { getCustomCategoryList, updateCustomCategoryStatus } from "../../../apis/welfareScheme";
|
||||
import { deleteCustomCategory, getCustomCategoryList, updateCustomCategoryStatus } from "../../../apis/welfareScheme";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
||||
class CustomBenefitsTable extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -77,7 +79,11 @@ class CustomBenefitsTable extends Component {
|
|||
return (
|
||||
<div className="linkWapper">
|
||||
{showOperateBtn &&
|
||||
<a href="javascript: void(0);" onClick={() => onCustomEdit(record)}>编辑</a>
|
||||
<React.Fragment>
|
||||
<a href="javascript: void(0);" onClick={() => onCustomEdit(record)} style={{ marginRight: 10 }}>编辑</a>
|
||||
<a href="javascript: void(0);"
|
||||
onClick={() => this.deleteCustomCategory(record.id)}>{getLabel(535052, "删除")}</a>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
|
|
@ -98,6 +104,38 @@ class CustomBenefitsTable extends Component {
|
|||
message.error(errormsg || "操作失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
this.setState({
|
||||
dataSource: _.map(this.state.dataSource, item => {
|
||||
if (item.id === id) {
|
||||
return {
|
||||
...item, isUse: item.isUse
|
||||
};
|
||||
}
|
||||
return { ...item };
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
deleteCustomCategory = (id) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(543231, "确认删除本条数据吗?"),
|
||||
onOk: () => {
|
||||
message.destroy();
|
||||
message.loading("正在删除中...", 0);
|
||||
const payload = { id };
|
||||
deleteCustomCategory(payload).then(({ status, errormsg }) => {
|
||||
message.destroy();
|
||||
if (status) {
|
||||
message.success(getLabel(502230, "删除成功"));
|
||||
this.getCustomCategoryList();
|
||||
} else {
|
||||
message.error(errormsg || getLabel(30651, "操作失败"));
|
||||
}
|
||||
}).catch(() => message.destroy());
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -244,11 +244,11 @@ export class ArchivesStore {
|
|||
|
||||
// 保存表单
|
||||
@action
|
||||
save = (welfareType) => {
|
||||
save = (welfareType, paymentOrganization) => {
|
||||
let baseForm = "";
|
||||
let paymentForm = "";
|
||||
if (welfareType === "SOCIAL_SECURITY") {
|
||||
baseForm = JSON.stringify(this.socialSecurityForm.data);
|
||||
baseForm = JSON.stringify({ ...this.socialSecurityForm.data, paymentOrganization });
|
||||
if (this.socialSecurityForm.data.socialSchemeId) {
|
||||
const socialSecurityPaymentData = toJS(this.socialSecurityPaymentForm).data;
|
||||
const socialSecurityPaymentItems = toJS(this.socialSecurityPaymentForm).items[0].items;
|
||||
|
|
@ -259,7 +259,7 @@ export class ArchivesStore {
|
|||
paymentForm = JSON.stringify(payload);
|
||||
}
|
||||
} else if (welfareType === "ACCUMULATION_FUND") {
|
||||
baseForm = JSON.stringify(this.accumulationFundForm.data);
|
||||
baseForm = JSON.stringify({ ...this.accumulationFundForm.data, paymentOrganization });
|
||||
if (this.accumulationFundForm.data.fundSchemeId) {
|
||||
const accumulationFundPaymentData = toJS(this.accumulationFundPaymentForm).data;
|
||||
const accumulationFundPaymentItems = toJS(this.accumulationFundPaymentForm).items[0].items;
|
||||
|
|
@ -270,7 +270,7 @@ export class ArchivesStore {
|
|||
paymentForm = JSON.stringify(payload);
|
||||
}
|
||||
} else if (welfareType === "OTHER") {
|
||||
baseForm = JSON.stringify(this.otherForm.data);
|
||||
baseForm = JSON.stringify({ ...this.otherForm.data, paymentOrganization });
|
||||
if (this.otherForm.data.otherSchemeId) {
|
||||
const otherPaymentData = toJS(this.otherPaymentForm).data;
|
||||
const otherPaymentItems = toJS(this.otherPaymentForm).items[0].items;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,19 @@ export class payrollStore {
|
|||
@observable salaryTemplateShowSet = {}; // 显示设置基础表单
|
||||
@observable replenishSalaryTemplateSalaryItemSet = []; // 补发工资单模版基础表单
|
||||
@observable salaryItemSet = []; // 显示设置薪资项
|
||||
@observable salaryBillItemNameSetting = [
|
||||
{
|
||||
salaryTemplateId: "",
|
||||
salaryBillType: 0,
|
||||
itemShowNameSetting: []
|
||||
},
|
||||
{
|
||||
salaryTemplateId: "",
|
||||
salaryBillType: 1,
|
||||
itemShowNameSetting: []
|
||||
}
|
||||
]; // 工资单模板薪资项目名称修改列表
|
||||
@observable salaryBillItemNameSet = {}; // 工资单模板薪资项目名称修改列表
|
||||
|
||||
// **** 工资单页面 ****
|
||||
@observable salarySendTableStore = new TableStore(); // 工资单列表
|
||||
|
|
@ -87,6 +100,10 @@ export class payrollStore {
|
|||
|
||||
@action
|
||||
setSalaryItemSet = salaryItemSet => (this.salaryItemSet = salaryItemSet);
|
||||
@action
|
||||
setSalaryBillItemNameSet = salaryBillItemNameSet => (this.salaryBillItemNameSet = salaryBillItemNameSet);
|
||||
@action
|
||||
setSalaryBillItemNameSetting = salaryBillItemNameSetting => (this.salaryBillItemNameSetting = salaryBillItemNameSetting);
|
||||
|
||||
@action("工资单模板分页信息修改")
|
||||
setTemplateTablePageInfo = (pageInfo, callback) => {
|
||||
|
|
@ -214,8 +231,9 @@ export class payrollStore {
|
|||
if (res.status) {
|
||||
if (id !== "") {
|
||||
this.salaryItemSet = res.data.salaryTemplateSalaryItemSet;
|
||||
this.replenishSalaryTemplateSalaryItemSet = res.data.salaryTemplateSalaryItemSet;
|
||||
this.replenishSalaryTemplateSalaryItemSet = res.data.replenishSalaryTemplateSalaryItemSet;
|
||||
}
|
||||
this.salaryBillItemNameSet = res.data.salaryBillItemNameSet;
|
||||
this.salaryTemplateShowSet = { ...res.data.salaryTemplateShowSet.data, ...JSON.parse(salaryTemplateShowSetStorage) };
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
|
|
@ -262,6 +280,7 @@ export class payrollStore {
|
|||
: false;
|
||||
params.salaryItemSetting = toJS(this.salaryItemSet);
|
||||
params.replenishSalaryItemSetting = toJS(this.replenishSalaryTemplateSalaryItemSet);
|
||||
params.salaryBillItemNameSetting = toJS(this.salaryBillItemNameSetting);
|
||||
return params;
|
||||
};
|
||||
|
||||
|
|
@ -274,6 +293,9 @@ export class payrollStore {
|
|||
if (res.status) {
|
||||
message.success("保存成功");
|
||||
this.getPayrollTemplateList();
|
||||
this.setSalaryBillItemNameSetting(_.map(this.salaryBillItemNameSetting, it => {
|
||||
return { ...it, salaryTemplateId: "", itemShowNameSetting: [] };
|
||||
}));
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败");
|
||||
|
|
|
|||
|
|
@ -325,7 +325,10 @@ export class ProgrammeStore {
|
|||
@action
|
||||
updateCustomCategory = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.updateCustomCategory(_.pick(params, ["id", "insuranceName"])).then(res => {
|
||||
API.updateCustomCategory({
|
||||
..._.pick(params, ["id", "insuranceName"]),
|
||||
paymentScope: _.pick(params, ["paymentScope"]).paymentScope.split(",")
|
||||
}).then(res => {
|
||||
if (res.status) {
|
||||
message.success("编辑成功");
|
||||
resolve();
|
||||
|
|
|
|||
|
|
@ -274,9 +274,34 @@ export class SalaryItemStore {
|
|||
@action
|
||||
saveItem = (params, continueFlag) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.validateForm(params)) {
|
||||
return;
|
||||
const { valueType, formulaId, originFormulaContent, originSqlContent, ...extra } = params;
|
||||
let payload = { ...extra, valueType };
|
||||
if (valueType === "1") {
|
||||
payload = {
|
||||
...payload,
|
||||
formulaContent: "",
|
||||
formulaId: "",
|
||||
originSqlContent: "",
|
||||
originFormulaContent: ""
|
||||
};
|
||||
} else if (valueType === "2") {
|
||||
payload = {
|
||||
...payload,
|
||||
formulaContent: originFormulaContent ? originFormulaContent : "",
|
||||
formulaId: originFormulaContent ? formulaId : "",
|
||||
originSqlContent: "",
|
||||
originFormulaContent
|
||||
};
|
||||
} else if (valueType === "3") {
|
||||
payload = {
|
||||
...payload,
|
||||
formulaContent: originSqlContent ? originSqlContent : "",
|
||||
formulaId: originSqlContent ? formulaId : "",
|
||||
originFormulaContent: "",
|
||||
originSqlContent
|
||||
};
|
||||
}
|
||||
if (!this.validateForm(payload)) return;
|
||||
API.saveItem(params).then(res => {
|
||||
if (res.status) {
|
||||
if (!continueFlag) {
|
||||
|
|
@ -336,9 +361,9 @@ export class SalaryItemStore {
|
|||
|
||||
// 根据id获取formual
|
||||
@action
|
||||
detailFormual = (formulaId) => {
|
||||
detailFormual = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.detailFormual({ formulaId }).then(res => {
|
||||
API.detailFormual(params).then(res => {
|
||||
if (res.status) {
|
||||
this.formulaDetail = res.data;
|
||||
resolve(res.data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue