Merge branch 'release/2.17.1.2411.01' into release/2.17.1.2411.01-个税
# Conflicts: # pc4mobx/hrmSalary/apis/ledger.js # pc4mobx/hrmSalary/pages/calculate/doCalc/index.js # pc4mobx/hrmSalary/pages/dataAcquisition/layout.js # pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
This commit is contained in:
commit
d5ecc6ae74
|
|
@ -277,6 +277,10 @@ export const deleteExportTemplate = (params) => {
|
|||
export const getExportTemplateForm = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params);
|
||||
};
|
||||
//薪资审批-薪资核算页面获取审批信息
|
||||
export const getApprovalInfoByRecordId = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/salaryApproval/getApprovalInfoByRecordId", "GET", params);
|
||||
};
|
||||
//薪资核算-薪资项目改变否
|
||||
export const getCompareSobConfig = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", params);
|
||||
|
|
|
|||
|
|
@ -191,6 +191,18 @@ export const saveTaxMapping = params => {
|
|||
export const getSalaryItemForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params);
|
||||
};
|
||||
//薪资核算规则配置-获取薪资审批规则表单
|
||||
export const getSalaryApprovalForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/getForm", params);
|
||||
};
|
||||
//薪资核算规则配置-保存薪资审批规则表单
|
||||
export const salaryApprovalSaveForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/saveForm", params);
|
||||
};
|
||||
//薪资核算规则配置-获取能够添加的项目
|
||||
export const getListSalaryItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/listSalaryItem", params);
|
||||
};
|
||||
//薪资账套-获取薪资账套中拓扑图数据
|
||||
export const getSalaryItemTopology = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/topology", params);
|
||||
|
|
|
|||
|
|
@ -75,9 +75,9 @@ class CustomBrowserMutiRight extends Component {
|
|||
const targetNode = obj.node.props.eventKey;
|
||||
const result = [];
|
||||
this.nodeIds.filter((item) => {
|
||||
return dragNodes.indexOf(item) === -1;
|
||||
return dragNodes.indexOf(String(item)) === -1;
|
||||
}).forEach((id) => {
|
||||
if (id === targetNode) {
|
||||
if (String(id) === targetNode) {
|
||||
dragNodes.forEach((drag) => {
|
||||
result.push(this.nodeObj[drag]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -177,8 +177,9 @@ class SalaryDetails extends Component {
|
|||
}
|
||||
});
|
||||
converCheckedCol = (data) => {
|
||||
const { salaryDetailShowType } = this.props;
|
||||
return _.reduce(data.checked || [], (pre, cur) => {
|
||||
const item = _.find(data.setting, k => (k.id === cur) || (k.column === cur.column));
|
||||
const item = _.find(data.setting, k => (salaryDetailShowType !== "1" && k.id === cur) || (salaryDetailShowType === "1" && k.column === cur.column));
|
||||
if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }];
|
||||
return pre;
|
||||
}, []);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ class Index extends Component {
|
|||
|
||||
renderTabBtns = () => {
|
||||
const { selectedKey, selectedRowKeys } = this.state;
|
||||
const { calcDetail } = this.props;
|
||||
let tabBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "range":
|
||||
|
|
@ -95,6 +96,7 @@ class Index extends Component {
|
|||
className="icon-coms-Refresh"/></span>,
|
||||
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
|
||||
];
|
||||
calcDetail && tabBtns.splice(0, 2);
|
||||
break;
|
||||
case "add":
|
||||
case "sub":
|
||||
|
|
@ -202,7 +204,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { calculateStore: { PCSearchForm } } = this.props;
|
||||
const { calculateStore: { PCSearchForm }, calcDetail } = this.props;
|
||||
const {
|
||||
selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys,
|
||||
columns, dataSource
|
||||
|
|
@ -280,8 +282,8 @@ class Index extends Component {
|
|||
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
|
||||
/>
|
||||
<WeaTable
|
||||
dataSource={dataSource} loading={loading} rowSelection={rowSelection} pagination={pagination}
|
||||
scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
|
||||
dataSource={dataSource} loading={loading} rowSelection={calcDetail ? null : rowSelection}
|
||||
pagination={pagination} scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
|
||||
columns={[..._.map(columns, item => {
|
||||
let width = "";
|
||||
const { dataIndex } = item;
|
||||
|
|
@ -300,9 +302,10 @@ class Index extends Component {
|
|||
dataIndex: "operate",
|
||||
title: getLabel(30585, "操作"),
|
||||
width: 120,
|
||||
render: (_, record) => (
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>
|
||||
render: (_, record) => (<React.Fragment>
|
||||
{calcDetail ? null : <a href="javascript:void(0);"
|
||||
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>}
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
]}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class Index extends Component {
|
|||
selectedKey: "person", progressVisible: false, progress: 0, loading: { calcTax: false, feedback: false },
|
||||
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
|
||||
salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" },
|
||||
approvalInfo: {},//审批信息,
|
||||
accountExceptInfo: "" //核算报错信息,
|
||||
|
||||
};
|
||||
|
|
@ -37,6 +38,12 @@ class Index extends Component {
|
|||
this.timer = null;
|
||||
}
|
||||
|
||||
init = () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
API.getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => {
|
||||
if (status) this.setState({ approvalInfo });
|
||||
});
|
||||
};
|
||||
handleMenuClick = ({ key }) => {
|
||||
switch (key) {
|
||||
case "calc_selected":
|
||||
|
|
@ -202,7 +209,9 @@ class Index extends Component {
|
|||
});
|
||||
};
|
||||
renderReqBtns = () => {
|
||||
const { selectedKey, accountExceptInfo, loading } = this.state;
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { selectedKey, accountExceptInfo, approvalInfo, loading } = this.state;
|
||||
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
|
||||
let reqBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "calc":
|
||||
|
|
@ -213,7 +222,7 @@ class Index extends Component {
|
|||
);
|
||||
const moreMenu = (
|
||||
<Menu onClick={this.handleMoreMenuClick}>
|
||||
<Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>
|
||||
{canEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
|
||||
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
||||
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
|
||||
|
|
@ -233,6 +242,10 @@ class Index extends Component {
|
|||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
|
||||
onAdvanceSearch={() => this.calc.onAdSearch(false)}/>
|
||||
];
|
||||
!canEdit && reqBtns.splice(0, 1);
|
||||
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
|
||||
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
|
||||
}}>{getLabel(111, "发起审批")}</Button>);
|
||||
accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao"
|
||||
title={getLabel(111, "存在异常信息,点击下载!")}
|
||||
onClick={() => this.downloadTxtfile(accountExceptInfo)}/>);
|
||||
|
|
@ -251,14 +264,15 @@ class Index extends Component {
|
|||
element.click();
|
||||
};
|
||||
renderContent = () => {
|
||||
const { selectedKey } = this.state;
|
||||
const { selectedKey, approvalInfo } = this.state;
|
||||
const { canEdit } = approvalInfo;
|
||||
let dom = null;
|
||||
switch (selectedKey) {
|
||||
case "person":
|
||||
dom = <SalaryCalcPersonConfirm {...this.props}/>;
|
||||
dom = <SalaryCalcPersonConfirm calcDetail={!canEdit} {...this.props}/>;
|
||||
break;
|
||||
case "calc":
|
||||
dom = <SalaryEditCalc {...this.props} ref={dom => this.calc = dom}/>;
|
||||
dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} ref={dom => this.calc = dom}/>;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -274,7 +288,7 @@ class Index extends Component {
|
|||
const { calculateStore: { setOtherConditions } } = this.props;
|
||||
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
|
||||
return (
|
||||
<Layout {...this.props}>
|
||||
<Layout {...this.props} init={this.init}>
|
||||
<div className="salary-calculate-do-calc">
|
||||
<WeaReqTop
|
||||
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ class AddItems extends Component {
|
|||
render() {
|
||||
const { form, condition = [] } = this.props;
|
||||
return (
|
||||
<div className="addItemsWrapper">
|
||||
{getSearchs(form, condition)}
|
||||
<div className="addItemsWrapper form-dialog-layout">
|
||||
{getSearchs(form, condition, 2, false)}
|
||||
<Tips><span>若此员工数据已存在在同期列表中,则当前数据保存后会覆盖列表数据</span></Tips>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,15 @@
|
|||
flex-direction: column;
|
||||
|
||||
.wea-form-item {
|
||||
padding: 8px 16px 0 16px;
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
background: #FFF;
|
||||
margin: 8px 16px 0 16px;
|
||||
|
||||
.wea-form-item-label {
|
||||
line-height: 46px !important;
|
||||
padding-left: 8px !important;
|
||||
}
|
||||
|
||||
.to {
|
||||
padding: 0 10px
|
||||
|
|
@ -15,7 +23,7 @@
|
|||
flex: 1;
|
||||
overflow: hidden;
|
||||
background: #FFF;
|
||||
margin: 16px;
|
||||
margin: 8px 16px;
|
||||
}
|
||||
|
||||
.linkWapper {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,21 @@
|
|||
.tableRecordWrapper {
|
||||
.accumulated {
|
||||
.wea-form-cell-wrapper {
|
||||
& > div:first-child {
|
||||
height: 46px !important;
|
||||
line-height: 46px;
|
||||
padding: 0 16px;
|
||||
|
||||
.form-dialog-layout {
|
||||
padding: 0 !important;
|
||||
|
||||
.wea-search-group {
|
||||
padding: 16px 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
& > div:nth-child(2) {
|
||||
//width: 40% !important;
|
||||
.wea-form-cell-wrapper {
|
||||
& > div:first-child {
|
||||
height: 47px !important;
|
||||
line-height: 47px;
|
||||
}
|
||||
|
||||
& > div:last-child {
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: flex !important;
|
||||
|
|
@ -18,9 +26,25 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > div:last-child {
|
||||
//width: 40% !important;
|
||||
.accumulated {
|
||||
.wea-form-cell-wrapper {
|
||||
& > div:first-child {
|
||||
height: 47px !important;
|
||||
line-height: 47px;
|
||||
}
|
||||
|
||||
& > div:nth-child(2) {
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
|
||||
.to {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaSearchGroup } from "ecCom";
|
||||
import UnifiedTable from "../../../components/UnifiedTable";
|
||||
import { WeaSearchGroup, WeaTable } from "ecCom";
|
||||
import { getTableRecordDate } from "../../../apis/cumDeduct";
|
||||
import { DataCollectionDateRangePick, DataCollectionSelect, Input } from "../cumDeduct";
|
||||
import "./index.less";
|
||||
|
|
@ -87,9 +86,22 @@ class TableRecord extends Component {
|
|||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource,
|
||||
columns
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
columns: _.map(columns, (o, i) => {
|
||||
let col = {
|
||||
...o, width: 110,
|
||||
render: text => (<span className="dataAc-ellipsis" title={text}>{text}</span>)
|
||||
};
|
||||
switch (o.dataIndex) {
|
||||
case "taxAgentName":
|
||||
col = { ...col, width: 180 };
|
||||
break;
|
||||
default:
|
||||
col = { ...col };
|
||||
break;
|
||||
}
|
||||
return i === 0 ? { ...col, fixed: "left" } : col;
|
||||
})
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
|
|
@ -161,14 +173,6 @@ class TableRecord extends Component {
|
|||
{
|
||||
com: Input({ value: record.username })
|
||||
},
|
||||
{
|
||||
com: DataCollectionDateRangePick({
|
||||
label: "税款所属期",
|
||||
range: recordPayload[screenParams[screenParams.length - 1]] || [],
|
||||
onChange: this.handleTablerecordScreen,
|
||||
key: screenParams[screenParams.length - 1]
|
||||
})
|
||||
},
|
||||
{
|
||||
com: DataCollectionSelect({
|
||||
label: "个税扣缴义务人",
|
||||
|
|
@ -177,28 +181,26 @@ class TableRecord extends Component {
|
|||
onChange: this.handleTablerecordScreen,
|
||||
key: "taxAgentId"
|
||||
})
|
||||
},
|
||||
{
|
||||
com: DataCollectionDateRangePick({
|
||||
label: "税款所属期",
|
||||
range: recordPayload[screenParams[screenParams.length - 1]] || [],
|
||||
onChange: this.handleTablerecordScreen,
|
||||
key: screenParams[screenParams.length - 1]
|
||||
})
|
||||
}
|
||||
];
|
||||
return (
|
||||
<div className="tableRecordWrapper">
|
||||
{
|
||||
!_.isEmpty(screenParams) &&
|
||||
<WeaSearchGroup className={className} showGroup needTigger={false} items={items} col={width > 1280 ? 3 : 2}/>
|
||||
<div className="form-dialog-layout">
|
||||
<WeaSearchGroup className={className} showGroup needTigger={false} items={items} col={2}/>
|
||||
</div>
|
||||
}
|
||||
<UnifiedTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={_.map(columns, item => ({
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}> {text} </span>;
|
||||
}
|
||||
}))}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
xWidth={columns.length * 180}
|
||||
/>
|
||||
<WeaTable rowKey="id" rowSelection={rowSelection} bordered dataSource={dataSource} pagination={pagination}
|
||||
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 310px)` }} columns={columns}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,400 +1,3 @@
|
|||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
export const modalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "addUpChildEducation",
|
||||
key: "addUpChildEducation"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "addUpContinuingEducation",
|
||||
key: "addUpContinuingEducation"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "addUpHousingLoanInterest",
|
||||
key: "addUpHousingLoanInterest"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "addUpHousingRent",
|
||||
key: "addUpHousingRent"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "addUpSupportElderly",
|
||||
key: "addUpSupportElderly"
|
||||
},
|
||||
{
|
||||
title: "累计婴幼儿照护",
|
||||
dataIndex: "addUpInfantCare",
|
||||
key: "addUpInfantCare"
|
||||
},
|
||||
{
|
||||
title: "累计大病医疗",
|
||||
dataIndex: "addUpIllnessMedical",
|
||||
key: "addUpIllnessMedical"
|
||||
}
|
||||
];
|
||||
export const specialModalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "子女教育",
|
||||
dataIndex: "childrenEducation",
|
||||
key: "childrenEducation"
|
||||
},
|
||||
{
|
||||
title: "继续教育",
|
||||
dataIndex: "continuingEducation",
|
||||
key: "continuingEducation"
|
||||
},
|
||||
{
|
||||
title: "住房贷款利息",
|
||||
dataIndex: "housingLoanInterest",
|
||||
key: "housingLoanInterest"
|
||||
},
|
||||
{
|
||||
title: "住房租金",
|
||||
dataIndex: "housingRent",
|
||||
key: "housingRent"
|
||||
},
|
||||
{
|
||||
title: "赡养老人",
|
||||
dataIndex: "supportingElder",
|
||||
key: "supportingElder"
|
||||
},
|
||||
{
|
||||
title: "婴幼儿照护",
|
||||
dataIndex: "infantCare",
|
||||
key: "infantCare"
|
||||
},
|
||||
{
|
||||
title: "大病医疗",
|
||||
dataIndex: "seriousIllnessTreatment",
|
||||
key: "seriousIllnessTreatment"
|
||||
}
|
||||
];
|
||||
export const otherModalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "商业健康保险",
|
||||
dataIndex: "businessHealthyInsurance",
|
||||
key: "businessHealthyInsurance"
|
||||
},
|
||||
{
|
||||
title: "税延养老保险",
|
||||
dataIndex: "taxDelayEndowmentInsurance",
|
||||
key: "taxDelayEndowmentInsurance"
|
||||
},
|
||||
{
|
||||
title: "其他",
|
||||
dataIndex: "otherDeduction",
|
||||
key: "otherDeduction"
|
||||
},
|
||||
{
|
||||
title: "准予扣除的捐赠额",
|
||||
dataIndex: "deductionAllowedDonation",
|
||||
key: "deductionAllowedDonation"
|
||||
}
|
||||
];
|
||||
export const situationModalColumns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "username",
|
||||
key: "username"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "taxAgentName",
|
||||
key: "taxAgentName"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
key: "departmentName"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "mobile",
|
||||
key: "mobile"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobNum",
|
||||
key: "jobNum"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "idNo",
|
||||
key: "idNo"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "hiredate",
|
||||
key: "hiredate"
|
||||
},
|
||||
{
|
||||
title: "累计收入额",
|
||||
dataIndex: "addUpIncome",
|
||||
key: "addUpIncome"
|
||||
},
|
||||
{
|
||||
title: "累计减除费用",
|
||||
dataIndex: "addUpSubtraction",
|
||||
key: "addUpSubtraction"
|
||||
},
|
||||
{
|
||||
title: "累计社保个人合计",
|
||||
dataIndex: "addUpSocialSecurityTotal",
|
||||
key: "addUpSocialSecurityTotal"
|
||||
},
|
||||
{
|
||||
title: "累计公积金个人合计",
|
||||
dataIndex: "addUpAccumulationFundTotal",
|
||||
key: "addUpAccumulationFundTotal"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "addUpChildEducation",
|
||||
key: "addUpChildEducation"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "addUpContinuingEducation",
|
||||
key: "addUpContinuingEducation"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "addUpHousingLoanInterest",
|
||||
key: "addUpHousingLoanInterest"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "addUpHousingRent",
|
||||
key: "addUpHousingRent"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "addUpSupportElderly",
|
||||
key: "addUpSupportElderly"
|
||||
},
|
||||
{
|
||||
title: "累计企业(职业)年金及其他福利",
|
||||
dataIndex: "addUpEnterpriseAndOther",
|
||||
key: "addUpEnterpriseAndOther"
|
||||
},
|
||||
{
|
||||
title: "累计其他免税扣除",
|
||||
dataIndex: "addUpOtherDeduction",
|
||||
key: "addUpOtherDeduction"
|
||||
},
|
||||
{
|
||||
title: "累计免税收入",
|
||||
dataIndex: "addUpTaxExemptIncome",
|
||||
key: "addUpTaxExemptIncome"
|
||||
},
|
||||
{
|
||||
title: "累计准予扣除的捐赠额",
|
||||
dataIndex: "addUpAllowedDonation",
|
||||
key: "addUpAllowedDonation"
|
||||
},
|
||||
{
|
||||
title: "累计减免税额",
|
||||
dataIndex: "addUpTaxSavings",
|
||||
key: "addUpTaxSavings"
|
||||
},
|
||||
{
|
||||
title: "累计已预扣预缴税额",
|
||||
dataIndex: "addUpAdvanceTax",
|
||||
key: "addUpAdvanceTax"
|
||||
},
|
||||
{
|
||||
title: "累计婴幼儿照护",
|
||||
dataIndex: "addUpInfantCare",
|
||||
key: "addUpInfantCare"
|
||||
},
|
||||
{
|
||||
title: "累计大病医疗",
|
||||
dataIndex: "addUpIllnessMedical",
|
||||
key: "addUpIllnessMedical"
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
|
||||
export const dataSource = [];
|
||||
|
||||
export const dataCollectCondition = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -404,7 +7,7 @@ export const dataCollectCondition = [
|
|||
fieldcol: 12,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
|
|
@ -414,7 +17,7 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAgentId"],
|
||||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
lanId: 537996,
|
||||
value: "",
|
||||
options: [],
|
||||
|
|
@ -448,7 +51,7 @@ export const dataCollectCondition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,70 +1,3 @@
|
|||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
}
|
||||
];
|
||||
export const dataCollectCondition = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -74,7 +7,7 @@ export const dataCollectCondition = [
|
|||
fieldcol: 12,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
|
|
@ -84,7 +17,7 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAgentId"],
|
||||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
lanId: 537996,
|
||||
value: "",
|
||||
options: [],
|
||||
|
|
@ -133,7 +66,7 @@ export const dataCollectCondition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -416,7 +416,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
* Date: 2023/2/17
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import { getTableDate } from "../../apis/cumDeduct";
|
||||
import { Menu, Popover } from "antd";
|
||||
import { Spin } from "antd";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -16,25 +15,53 @@ class DataTables extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: {
|
||||
query: false
|
||||
},
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
loading: { query: false }, dataSource: [], columns: [], selectedRowKeys: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getTableDate();
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getTableDate();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
case "PAGEINFO":
|
||||
this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.getTableDate());
|
||||
break;
|
||||
case "CHECKBOX":
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
break;
|
||||
case "DEL":
|
||||
this.props.onTableOperate({ key: "deleteSelectAddUpDeduction" }, params);
|
||||
break;
|
||||
case "EDIT":
|
||||
this.props.onTableOperate({ key: "handleAddData" }, params);
|
||||
break;
|
||||
case "VIEW":
|
||||
this.props.onViewDetails(params);
|
||||
break;
|
||||
case "log":
|
||||
this.props.onTableOperate({ key: "log" }, params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
getTableDate = (extraPayload = {}) => {
|
||||
const { loading, pageInfo } = this.state;
|
||||
const { url, payload } = this.props;
|
||||
const { loading, pageInfo, selectedRowKeys } = this.state;
|
||||
const { url, payload, isSpecial } = this.props;
|
||||
const module = {
|
||||
...pageInfo, url, ...payload, ...extraPayload,
|
||||
departmentIds: extraPayload.departmentIds ? extraPayload.departmentIds.split(",") : []
|
||||
|
|
@ -45,10 +72,12 @@ class DataTables extends Component {
|
|||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource,
|
||||
columns
|
||||
});
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns
|
||||
}, () => this.postMessageToChild({
|
||||
dataSource: this.state.dataSource, scrollHeight: 103, selectedRowKeys, isSpecial,
|
||||
pageInfo: this.state.pageInfo, unitTableType: "dataAcquisition",
|
||||
columns: this.state.columns
|
||||
}));
|
||||
}
|
||||
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
|
||||
};
|
||||
|
|
@ -59,124 +88,34 @@ class DataTables extends Component {
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
handleClearRows = () => this.setState({ selectedRowKeys: [] });
|
||||
postMessageToChild = (payload = {}) => {
|
||||
const i18n = {
|
||||
"操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"),
|
||||
"条": getLabel(18256, "条"), "删除": getLabel(111, "删除"), "查看明细": getLabel(111, "查看明细"),
|
||||
"操作日志": getLabel(545781, "操作日志")
|
||||
};
|
||||
const childFrameObj = document.getElementById("unitTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
|
||||
render() {
|
||||
const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state;
|
||||
const { showOperateBtn, onTableOperate, onViewDetails, isSpecial = false, form } = this.props;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.getTableDate({ ...form.getFormParams() });
|
||||
});
|
||||
},
|
||||
onChange: (current) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => {
|
||||
this.getTableDate({ ...form.getFormParams() });
|
||||
});
|
||||
const { dataSource, loading } = this.state;
|
||||
const dom = document.querySelector(".dataContent");
|
||||
let height = 280;
|
||||
if (dataSource.length > 0 && dom) {
|
||||
const tableHeight = dataSource.length * 46 + 124;
|
||||
height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight;
|
||||
}
|
||||
};
|
||||
const getColumns = _.map(columns, item => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <a
|
||||
className="ellipsis"
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
};
|
||||
} else if (dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
width: 150,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
{
|
||||
!isSpecial &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onViewDetails(record)}>查看明细</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">删除</Menu.Item>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
isSpecial &&
|
||||
<React.Fragment>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
<a href="javaScript:void(0);" style={{ marginRight: 12 }}
|
||||
onClick={() => onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}> {text} </span>;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
return <UnifiedTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={getColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
xWidth={getColumns.length * 160}
|
||||
/>;
|
||||
return (<div style={{ height: height + "px" }}>
|
||||
<Spin spinning={loading.query}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/unitTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
|
||||
id="unitTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,33 +23,17 @@
|
|||
}
|
||||
|
||||
.addItemsWrapper {
|
||||
padding-bottom: 8px;
|
||||
|
||||
.baseForm {
|
||||
.wea-form-cell {
|
||||
padding-right: 20% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
.wea-form-cell-wrapper {
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
& > div:last-child {
|
||||
border-bottom: none
|
||||
}
|
||||
|
||||
.wea-form-cell {
|
||||
padding: 4px 16px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.wea-form-item {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tipWrapper {
|
||||
background: #FFF;
|
||||
margin: 0 16px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,6 +41,15 @@
|
|||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #F6F6F6;
|
||||
|
||||
.wea-new-top-wapper, .wea-tab {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.wea-tab {
|
||||
margin: 8px 16px;
|
||||
}
|
||||
|
||||
.wea-tab-left {
|
||||
min-width: 600px !important;
|
||||
|
|
@ -114,6 +107,68 @@
|
|||
.dataContent {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
padding: 0 16px;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
|
||||
.dataAc-ellipsis {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-slide-modal .wea-slide-modal-content {
|
||||
background: #f6f6f6;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 46px 8px 16px;
|
||||
background: #fff;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.titleLeftBox {
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.titleRightBox {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import ImportModal from "./importDialog";
|
||||
import LogDialog from "../../components/logViewModal";
|
||||
import SlideModalTitle from "../../components/slideModalTitle";
|
||||
import { getSearchs } from "../../util";
|
||||
import "./index.less";
|
||||
|
||||
|
|
@ -73,15 +73,29 @@ class Layout extends Component {
|
|||
break;
|
||||
}
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { slidePayload, slideLoading, detailOptBtns, onSave } = this.props;
|
||||
const { title } = slidePayload;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
{(slidePayload.children && slidePayload.children.props.className) ? [...detailOptBtns] :
|
||||
<Button type="primary" loading={slideLoading} onClick={onSave}>{getLabel(537558, "保存")}</Button>}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { showSearchAd, logDialogVisible, filterConditions } = this.state;
|
||||
const {
|
||||
title, btns, leftComp, children, taxAgentStore: { showOperateBtn },
|
||||
slidePayload, onClose, onSave, slideLoading, form, condition, onImportFile,
|
||||
onAdSearch, onCancel, importPayload, detailOptBtns, tabBtns = [], logFunction, onClearTargrtid
|
||||
slidePayload, onClose, form, condition, onImportFile,
|
||||
onAdSearch, onCancel, importPayload, logFunction, onClearTargrtid
|
||||
} = this.props;
|
||||
const { visible, title: subtitle, children: slideChildren } = slidePayload;
|
||||
const { visible, children: slideChildren } = slidePayload;
|
||||
const {
|
||||
visible: importVisiable, importFormComponent, importOpts,
|
||||
importResult, templateLink, previewUrl
|
||||
|
|
@ -99,6 +113,7 @@ class Layout extends Component {
|
|||
]}
|
||||
/>
|
||||
<WeaTab
|
||||
advanceHeight={162}
|
||||
searchType={["base", "advanced"]}
|
||||
replaceLeft={leftComp}
|
||||
searchsAd={getSearchs(form, toJS(condition), 2)}
|
||||
|
|
@ -112,7 +127,7 @@ class Layout extends Component {
|
|||
buttons={showOperateBtn ? tabBtns : []}
|
||||
/>
|
||||
<div className="dataContent">
|
||||
<WeaNewScroll height="100%">{children}</WeaNewScroll>
|
||||
{children}
|
||||
{/*导入弹框*/}
|
||||
<ImportModal
|
||||
visible={importVisiable} onCancel={onCancel} importParams={importFormComponent}
|
||||
|
|
@ -125,21 +140,12 @@ class Layout extends Component {
|
|||
visible={visible}
|
||||
top={0}
|
||||
measureT="%"
|
||||
width={80}
|
||||
measureX="%"
|
||||
width={850}
|
||||
measureX="px"
|
||||
height={100}
|
||||
measureY="%"
|
||||
direction="right"
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={subtitle}
|
||||
loading={slideLoading}
|
||||
onSave={onSave}
|
||||
editable={subtitle.length <= 2}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={subtitle.length <= 2 ? [] : detailOptBtns}
|
||||
/>
|
||||
}
|
||||
title={this.renderTitle()}
|
||||
content={slideChildren}
|
||||
onClose={onClose}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,70 +1,3 @@
|
|||
export const columns = [
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "个税扣缴义务人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "证件号码",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "入职日期",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计子女教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计继续教育",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房贷款利息",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计住房租金",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "累计赡养老人",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
}
|
||||
];
|
||||
export const dataCollectCondition = [
|
||||
{
|
||||
items: [
|
||||
|
|
@ -74,7 +7,7 @@ export const dataCollectCondition = [
|
|||
fieldcol: 12,
|
||||
label: "税款所属期",
|
||||
lanId: 542240,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
|
|
@ -84,7 +17,7 @@ export const dataCollectCondition = [
|
|||
domkey: ["taxAgentId"],
|
||||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
lanId: 537996,
|
||||
value: "",
|
||||
options: [],
|
||||
|
|
@ -118,7 +51,7 @@ export const dataCollectCondition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export const condition = [
|
|||
fieldcol: 12,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 537996,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
|
|
@ -40,7 +40,7 @@ export const condition = [
|
|||
isQuickSearch: false,
|
||||
label: "人员",
|
||||
lanId: 30042,
|
||||
labelcol: 4,
|
||||
labelcol: 8,
|
||||
rules: "required",
|
||||
viewAttr: 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ class Index extends Component {
|
|||
...slidePayload,
|
||||
visible: false,
|
||||
title: "",
|
||||
chidren: null,
|
||||
children: null,
|
||||
data: {}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资核算规则配置
|
||||
* Description:
|
||||
* Date: 2024/4/24
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
import LedgerAccountSalaryItemsSet from "./ledgerAccountSalaryItemsSet";
|
||||
import * as API from "../../../apis/ledger";
|
||||
import { acctApprRulesConditions } from "../config";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
class LedgerAccountApprRule extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
conditions: [], approvalId: "", approvalItemGroup: []
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
init = () => {
|
||||
const { saveSalarySobId, editId } = this.props;
|
||||
API.getSalaryApprovalForm({ salarySobId: editId || saveSalarySobId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({
|
||||
approvalId: data.id,
|
||||
approvalItemGroup: _.map(data.approvalItemGroup, item => ({
|
||||
...item, id: String(item.sorted),
|
||||
approvalItems: _.map(item.approvalItems, o => ({ ...o, id: `${String(item.sorted)}-${String(o.sorted)}` }))
|
||||
})),
|
||||
conditions: _.map(acctApprRulesConditions, item => ({
|
||||
...item, items: _.map(item.items, o => ({
|
||||
...o, value: getKey(o) === "isOpenApproval" ? (data[getKey(o)] ? "1" : "0") : data[getKey(o)],
|
||||
viewAttr: getKey(o) === "approvalWorkflowUrl" ? (data["isOpenApproval"] ? 3 : 2) : o.viewAttr,
|
||||
hide: getKey(o) !== "isOpenApproval" ? !data["isOpenApproval"] : false,
|
||||
label: getLabel(o.lanId, o.label)
|
||||
}))
|
||||
}))
|
||||
}, () => {
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
AARForm.initFormFields(this.state.conditions);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
const { ledgerStore: { initAARForm } } = this.props;
|
||||
initAARForm();
|
||||
}
|
||||
|
||||
renderForm = (form, conditions) => {
|
||||
const { saveSalarySobId, editId } = this.props;
|
||||
const { approvalItemGroup } = this.state;
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && conditions && conditions.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
if (getKey(fields) !== "approvalItemGroup") {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
|
||||
onChange={this.handleFormItemChange}/>
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<LedgerAccountSalaryItemsSet datas={approvalItemGroup} salarySobId={editId || saveSalarySobId}
|
||||
onAddItems={(groupId, items) => this.setState({
|
||||
approvalItemGroup: _.map(approvalItemGroup, o => ({
|
||||
...o,
|
||||
approvalItems: (groupId === o.id && !_.isEmpty(items)) ? [...o.approvalItems, ..._.map(items, (k, ki) => ({
|
||||
salaryItemId: k.id, salaryItemName: k.name,
|
||||
id: `${String(o.sorted)}-${String(o.approvalItems.length + ki)}`
|
||||
}))] : o.approvalItems
|
||||
}))
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
|
||||
onEdit={(groupName, groupId) => this.setState({
|
||||
approvalItemGroup: groupId ? _.map(approvalItemGroup, o => ({
|
||||
...o, groupName: groupId === o.id ? groupName : o.groupName
|
||||
})) : [{
|
||||
approvalItems: [], groupName, id: String(approvalItemGroup.length)
|
||||
}, ...approvalItemGroup]
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
|
||||
onDelete={(group, item) => this.setState({
|
||||
approvalItemGroup: _.isEmpty(item) ? _.filter(approvalItemGroup, o => o.id !== group.id) :
|
||||
_.map(approvalItemGroup, o => ({
|
||||
...o,
|
||||
approvalItems: _.filter(o.approvalItems, oo => oo.id !== item.id)
|
||||
}))
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
|
||||
onChange={datas => this.setState({
|
||||
approvalItemGroup: datas
|
||||
}, () => form.updateFields({ approvalItemGroup: { value: datas } }))}/>
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
}
|
||||
});
|
||||
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
convertFormItemViewAttr = (viewAttr) => {
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
const { isOpenApproval } = AARForm.getFormParams();
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "approvalWorkflowUrl") {
|
||||
return { ...o, viewAttr, hide: isOpenApproval === "0" };
|
||||
} else if (getKey(o) === "approvalItemGroup") {
|
||||
return { ...o, viewAttr, hide: isOpenApproval === "0" };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
});
|
||||
};
|
||||
handleFormItemChange = (value) => {
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
const { isOpenApproval } = AARForm.getFormParams();
|
||||
if (_.keys(value)[0] === "isOpenApproval") {
|
||||
this.convertFormItemViewAttr(isOpenApproval === "1" ? 3 : 2);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions } = this.state;
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
return (
|
||||
<div className="form-dialog-layout" style={{ background: "#FFF" }}>
|
||||
{this.renderForm(AARForm, conditions)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountApprRule;
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name:审批规则分类编辑
|
||||
* Description:
|
||||
* Date: 2024/4/25
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import { getSearchs } from "../../../util";
|
||||
import { classifyConditions } from "../config";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
class LedgerAccountApprRuleClassifyNameEditDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { conditions: [] };
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.init(nextProps);
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.ledgerStore.initAARClassifyForm();
|
||||
}
|
||||
|
||||
init = (props) => {
|
||||
const { ledgerStore: { AARClassifyForm }, groupName, groupId } = props;
|
||||
this.setState({
|
||||
conditions: _.map(classifyConditions, item => ({
|
||||
...item,
|
||||
items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
|
||||
}))
|
||||
}, () => {
|
||||
AARClassifyForm.initFormFields(this.state.conditions);
|
||||
groupId && AARClassifyForm.updateFields({ groupName });
|
||||
});
|
||||
};
|
||||
save = () => {
|
||||
const { ledgerStore: { AARClassifyForm }, groupId } = this.props;
|
||||
AARClassifyForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.props.onCancel();
|
||||
this.props.onEdit(AARClassifyForm.getFormParams().groupName, groupId);
|
||||
} else {
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions } = this.state;
|
||||
const { ledgerStore: { AARClassifyForm } } = this.props;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 80 }} initLoadCss
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save}>{getLabel(537558, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(AARClassifyForm, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountApprRuleClassifyNameEditDialog;
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资核算规则配置-审批薪资项目
|
||||
* Description:
|
||||
* Date: 2024/4/24
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaButtonIcon, WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom";
|
||||
import LedgerAccountApprRuleClassifyNameEditDialog from "./ledgerAccountApprRuleClassifyNameEditDialog";
|
||||
import * as API from "../../../apis/ledger";
|
||||
import { Icon, Modal } from "antd";
|
||||
import cs from "classnames";
|
||||
import SalaryItemModal from "../../payroll/stepForm/salaryItemModal";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class LedgerAccountSalaryItemsSet extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
editDialog: { visible: false, groupName: "", groupId: "", title: "" },
|
||||
salaryItemDialog: { visible: false, title: getLabel(111, "薪资项目项"), options: [], groupId: "" }
|
||||
};
|
||||
}
|
||||
|
||||
handleDeleteClick = (group, item = {}) => {
|
||||
Modal.confirm({
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(543231, "确认删除本条数据吗?"),
|
||||
onOk: () => this.props.onDelete(group, item)
|
||||
});
|
||||
};
|
||||
handleAddSalaryItems = (group) => {
|
||||
const { salaryItemDialog } = this.state;
|
||||
const { salarySobId, datas } = this.props;
|
||||
const payload = {
|
||||
salarySobId, excludeIds: _.reduce(datas, (pre, cur) => {
|
||||
return pre.concat(_.map(cur.approvalItems, o => o.salaryItemId));
|
||||
}, [])
|
||||
};
|
||||
API.getListSalaryItem(payload).then(({ status, data }) => {
|
||||
if (status) this.setState({
|
||||
salaryItemDialog: {
|
||||
...salaryItemDialog, visible: true, options: data, groupId: group.id
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
handleConfirm = () => {
|
||||
const { salaryItemDialog } = this.state;
|
||||
this.setState({
|
||||
salaryItemDialog: { ...salaryItemDialog, visible: false }
|
||||
}, () => this.props.onAddItems(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem)));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { editDialog, salaryItemDialog } = this.state;
|
||||
const { datas } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<div style={{ textAlign: "right", padding: "10px 0" }}>
|
||||
<WeaButtonIcon buttonType="add" type="primary"
|
||||
onClick={() => this.setState({
|
||||
editDialog: { visible: true, title: getLabel(111, "添加分类") }
|
||||
})}/>
|
||||
|
||||
</div>
|
||||
<div className={cs("salaryItemSettingWrapper", { required: _.isEmpty(datas) })}>
|
||||
<WeaSortable
|
||||
datas={datas}
|
||||
onChange={list => this.props.onChange(list)}
|
||||
renderNodeItem={(item) => {
|
||||
return <div className="salaryItemWrapper">
|
||||
<div className="salaryItemHeader">
|
||||
<span className="titleWrapper">
|
||||
<span className="salaryClassTitle">{item.groupName}</span>
|
||||
<span className="iconWrapper">
|
||||
<i className="icon-coms-edit" onClick={() => this.setState({
|
||||
editDialog: {
|
||||
visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑")
|
||||
}
|
||||
})}/>
|
||||
<i className="icon-coms-Delete" onClick={() => this.handleDeleteClick(item)}/>
|
||||
</span>
|
||||
</span>
|
||||
<i className="icon-coms-Add-to" onClick={() => this.handleAddSalaryItems(item)}/>
|
||||
</div>
|
||||
<div className="salaryItemContent">
|
||||
{
|
||||
!_.isEmpty(item.approvalItems) ?
|
||||
<WeaSortable
|
||||
datas={item.approvalItems}
|
||||
onChange={(items) => this.props.onChange(
|
||||
_.map(datas, child => {
|
||||
if (child.id === item.id) {
|
||||
return { ...child, approvalItems: items };
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
)}
|
||||
renderNodeItem={(filed) => {
|
||||
return <div className="salaryItemList">
|
||||
<div className="salaryItem" title={filed.salaryItemName}>
|
||||
<div className="salaryItemName">{filed.salaryItemName}</div>
|
||||
<Icon type="cross" onClick={() => this.handleDeleteClick(item, filed)}/>
|
||||
</div>
|
||||
</div>;
|
||||
}}
|
||||
className="wea-sortable-salary-item"
|
||||
/> :
|
||||
<div className="empty">暂无数据</div>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
}}
|
||||
className="wea-sortable-salary-item"
|
||||
/>
|
||||
<LedgerAccountApprRuleClassifyNameEditDialog {...editDialog} {...this.props}
|
||||
onCancel={() => this.setState({
|
||||
editDialog: { ...editDialog, visible: false }
|
||||
})}/>
|
||||
<SalaryItemModal {...salaryItemDialog}
|
||||
onCancel={() => this.setState({
|
||||
salaryItemDialog: { ...salaryItemDialog, visible: false }
|
||||
})} onConfirm={this.handleConfirm}>
|
||||
<div className="modalContent">
|
||||
<WeaTransfer
|
||||
data={salaryItemDialog.options}
|
||||
selectedKeys={_.map(_.filter(salaryItemDialog.options, g => g.checkedSalaryItem), o => o.id)}
|
||||
onChange={v => {
|
||||
this.setState({
|
||||
salaryItemDialog: {
|
||||
...salaryItemDialog,
|
||||
options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) }))
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</SalaryItemModal>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountSalaryItemsSet;
|
||||
|
|
@ -13,12 +13,14 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
|
|||
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
|
||||
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
|
||||
import LedgerSalaryItem from "./ledgerSalaryItem";
|
||||
import LedgerAccountApprRule from "./ledgerAccountApprRule";
|
||||
import IncomeTaxFields from "./incomeTaxFields";
|
||||
import IncomeTaxFieldsCorresponding from "./incomeTaxFieldsCorresponding";
|
||||
import CumulativeFields from "./cumulativeFields";
|
||||
import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
|
||||
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
|
||||
import {
|
||||
salaryApprovalSaveForm,
|
||||
addupruleSave,
|
||||
saveAdjustmentRule,
|
||||
saveLedgerBasic,
|
||||
|
|
@ -26,6 +28,7 @@ import {
|
|||
taxreportruleSave,
|
||||
taxruleSave
|
||||
} from "../../../apis/ledger";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -37,19 +40,23 @@ class LedgerSlide extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
current: 0,
|
||||
loading: false,
|
||||
baseSettingInfo: {},
|
||||
adjustRules: [],
|
||||
empFields: [], itemGroups: [],
|
||||
current: 0, loading: false, baseSettingInfo: {}, adjustRules: [],
|
||||
empFields: [], itemGroups: [], saveSalarySobId: "",
|
||||
salaryApprovalStatus: false,
|
||||
taxruleFields: [], taxruleKeys: "", //个税字段对应
|
||||
incomeTaxFields: [], incomeTaxKeys: "", //个税申报字段对应
|
||||
addupruleFields: [], addupruleKeys: "", //累计字段对应
|
||||
saveSalarySobId: "",
|
||||
taxableItems: "" //薪资类型 1||489 对应显示个税设置-累计字段对应
|
||||
};
|
||||
}
|
||||
|
||||
async componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
const { data } = await sysConfCodeRule({ code: "SALARY_APPROVAL_STATUS" });
|
||||
this.setState({ salaryApprovalStatus: data === "1" });
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.setState({
|
||||
saveSalarySobId: ""
|
||||
|
|
@ -319,9 +326,45 @@ class LedgerSlide extends Component {
|
|||
this.setState({ empFields, itemGroups });
|
||||
};
|
||||
|
||||
handleDefaultSave = () => {
|
||||
const { saveSalarySobId } = this.state;
|
||||
const { state: { approvalId } } = this.approRef.wrappedInstance;
|
||||
const { ledgerStore: { AARForm } } = this.props;
|
||||
const { approvalItemGroup, isOpenApproval, ...extra } = AARForm.getFormParams();
|
||||
const group = _.map(approvalItemGroup, (item, index) => ({
|
||||
groupName: item.groupName, sorted: index,
|
||||
approvalItems: _.map(item.approvalItems, (o, oi) => ({
|
||||
salaryItemId: o.salaryItemId, sorted: oi,
|
||||
salaryItemName: o.salaryItemName
|
||||
}))
|
||||
}));
|
||||
if (isOpenApproval === "1" && _.isEmpty(extra.approvalWorkflowUrl)) {
|
||||
AARForm.showError("approvalWorkflowUrl", getLabel(111, "\"审批流程地址\"未填写"));
|
||||
return;
|
||||
} else if (isOpenApproval === "1" && _.isEmpty(group)) {
|
||||
AARForm.showError("approvalItemGroup", getLabel(111, "\"审批薪资项目\"未填写"));
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
...extra, isOpenApproval: isOpenApproval === "1", id: approvalId,
|
||||
salarySobId: this.props.editId || saveSalarySobId,
|
||||
approvalItemGroup: group
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
salaryApprovalSaveForm(payload).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "保存成功!"));
|
||||
saveSalarySobId && this.handleClose();
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { current, taxableItems, saveSalarySobId, loading } = this.state;
|
||||
const { current, taxableItems, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
|
||||
let tabs = [
|
||||
{
|
||||
key: 0, title: getLabel(82751, "基础设置"),
|
||||
|
|
@ -443,10 +486,25 @@ class LedgerSlide extends Component {
|
|||
onSetAdduprule={(addupruleFields, selectedKey) => this.setState({
|
||||
addupruleFields, addupruleKeys: selectedKey
|
||||
})}/>
|
||||
},
|
||||
{
|
||||
key: 8, title: getLabel(111, "核算审批规则"),
|
||||
createBtns: [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.handleDefaultSave}>{getLabel(111, "完成")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={this.handleDefaultSave}>{getLabel(111, "保存")}</Button>
|
||||
],
|
||||
children: <LedgerAccountApprRule {...this.props} ref={dom => this.approRef = dom}
|
||||
saveSalarySobId={saveSalarySobId}/>
|
||||
}
|
||||
];
|
||||
(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") &&
|
||||
(tabs = _.map(_.filter(tabs, o => o.key !== 7), (k, j) => ({ ...k, key: j })));
|
||||
!salaryApprovalStatus && tabs.pop();
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="ledgerSlideLayout slideOuterWrapper"
|
||||
|
|
|
|||
|
|
@ -803,3 +803,57 @@ export const keepDecimalPlaces = [
|
|||
showname: "5"
|
||||
}
|
||||
];
|
||||
export const acctApprRulesConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["isOpenApproval"],
|
||||
fieldcol: 20,
|
||||
label: "是否开启审批",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["approvalWorkflowUrl"],
|
||||
fieldcol: 20,
|
||||
label: "审批流程地址",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "CUSTOM",
|
||||
domkey: ["approvalItemGroup"],
|
||||
fieldcol: 20,
|
||||
label: "审批薪资项目",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const classifyConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["groupName"],
|
||||
fieldcol: 18,
|
||||
label: "分类名称",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export default class MobilePayroll extends React.Component {
|
|||
} else {
|
||||
const params = this.getUrlkey();
|
||||
const { data } = await salaryBillGetToken({
|
||||
id: _.pick(params, ["id"]).id,
|
||||
recipient: _.pick(params, ["recipient"]).recipient,
|
||||
salaryCode: _.pick(params, ["salaryCode"]).salaryCode
|
||||
});
|
||||
|
|
|
|||
|
|
@ -59,6 +59,24 @@ export const conditions = [
|
|||
lanId: 543358,
|
||||
defaultshow: true
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["openSecondaryAccount"],
|
||||
fieldcol: 10,
|
||||
label: "启用主次账号",
|
||||
tip: "启用后,若有次账号相关档案,则此功能不能关闭。",
|
||||
tipLanId: 111,
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: "主次身份",
|
||||
lanId: 111,
|
||||
defaultshow: true
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
|
|
@ -229,6 +247,51 @@ export const conditions = [
|
|||
// defaultshow: true
|
||||
// },
|
||||
];
|
||||
export const salaryApprovalConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["SALARY_APPROVAL_STATUS"],
|
||||
fieldcol: 10,
|
||||
label: "薪资审批",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["APPROVAL_CAN_MANUAL_FILE_STATUS"],
|
||||
fieldcol: 10,
|
||||
label: "开启审批的核算记录允许手动归档",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["APPROVAL_CAN_RE_CALC_STATUS"],
|
||||
fieldcol: 10,
|
||||
label: "开启审批的核算记录允许重新核算",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["APPROVAL_CAN_EDIT_RESULT_STATUS"],
|
||||
fieldcol: 10,
|
||||
label: "审批流程发起后允许修改核算数据",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: "薪资审批设置",
|
||||
lanId: 111,
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const payloadList = [
|
||||
{ enumClass: "com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum" },
|
||||
{ enumClass: "com.engine.salary.sys.enums.OrderRuleEnum" },
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import React from "react";
|
||||
import { WeaFormItem, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export const renderRuleForm = (form, condition, onChange) => {
|
||||
const { isFormInit } = form;
|
||||
|
|
@ -14,7 +15,12 @@ export const renderRuleForm = (form, condition, onChange) => {
|
|||
items.push({
|
||||
com: (
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
label={<div className="customFormLabel">
|
||||
<span>{fields.label}</span>
|
||||
{fields.tip && <WeaHelpfulTip width={200} title={getLabel(fields.tipLanId, fields.tip)}
|
||||
placement="topLeft"/>}
|
||||
</div>}
|
||||
labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom">
|
||||
<WeaSwitch
|
||||
|
|
|
|||
|
|
@ -8,6 +8,19 @@
|
|||
height: 100%;
|
||||
overflow: hidden auto;
|
||||
|
||||
.wea-form-item .wea-form-item-label.colon:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customFormLabel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
& > span {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
background: #fff;
|
||||
margin-bottom: 16px;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
|
|||
import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import * as API from "../../apis/ruleconfig";
|
||||
import { conditions, payloadList } from "./conditions";
|
||||
import { conditions, payloadList, salaryApprovalConditions } from "./conditions";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
import { renderRuleForm } from "./form";
|
||||
import { getConditionDomkeys } from "../../util";
|
||||
|
|
@ -33,12 +33,13 @@ class RuleConfig extends Component {
|
|||
}
|
||||
|
||||
init = async () => {
|
||||
const { data: sysinfo } = await API.sysinfo();
|
||||
const [{ data: sysinfo }, { data: confCode }] = await Promise.all([API.sysinfo(), API.sysConfCodeRule({ code: "SHOW_SALARY_ACCT_APPROVAL" })]);
|
||||
const [{ data: matchRule }, { data: orderRule }, { data: ascOrDesc }, { data: rule }] =
|
||||
await Promise.all(_.map(payloadList, it => API.commonEnumList(it)));
|
||||
const optionsList = { matchRule, orderRule, ascOrDesc, rule };
|
||||
const conditonsSlice = confCode === "1" ? [...conditions, ...salaryApprovalConditions] : conditions;
|
||||
this.setState({
|
||||
sysinfo, conditions: _.map(conditions, item => ({
|
||||
sysinfo, conditions: _.map(conditonsSlice, item => ({
|
||||
...item, title: getLabel(item.lanId, item.title),
|
||||
items: _.map(item.items, o => {
|
||||
o = { ...o, label: getLabel(o.lanId, o.label) };
|
||||
|
|
@ -65,6 +66,13 @@ class RuleConfig extends Component {
|
|||
...o,
|
||||
viewAttr: (_.isNil(sysinfo.taxDeclarationFunction) || sysinfo.taxDeclarationFunction !== "0") ? 2 : 1
|
||||
};
|
||||
} else if (
|
||||
getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS"
|
||||
) {
|
||||
return {
|
||||
...o,
|
||||
hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"])
|
||||
};
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
|
|
@ -91,6 +99,10 @@ class RuleConfig extends Component {
|
|||
form.updateFields({ [item]: { value: sysinfo[item] || "1" } });
|
||||
} else if (item === "OPEN_APPLICATION_ENCRYPT") {
|
||||
form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "") } });
|
||||
} else if (
|
||||
item === "APPROVAL_CAN_MANUAL_FILE_STATUS" || item === "APPROVAL_CAN_RE_CALC_STATUS" || item === "APPROVAL_CAN_EDIT_RESULT_STATUS"
|
||||
) {
|
||||
form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "0") } });
|
||||
} else {
|
||||
form.updateFields({ [item]: { value: sysinfo[item] || "" } });
|
||||
}
|
||||
|
|
@ -136,6 +148,11 @@ class RuleConfig extends Component {
|
|||
case "adjustShowStatus":
|
||||
case "REPORT_ORGANIZATIN_TYPE":
|
||||
case "SALARY_DETAILS_REPORT_SHOW_TYPE":
|
||||
case "openSecondaryAccount":
|
||||
case "SALARY_APPROVAL_STATUS":
|
||||
case "APPROVAL_CAN_MANUAL_FILE_STATUS":
|
||||
case "APPROVAL_CAN_RE_CALC_STATUS":
|
||||
case "APPROVAL_CAN_EDIT_RESULT_STATUS":
|
||||
if (!this.handleDebounce) {
|
||||
this.handleDebounce = _.debounce(() => {
|
||||
const confTitle = {
|
||||
|
|
@ -147,7 +164,12 @@ class RuleConfig extends Component {
|
|||
salaryShowStatus: getLabel(111, "显示工资单页签"),
|
||||
adjustShowStatus: getLabel(111, "显示调薪记录页签"),
|
||||
REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息"),
|
||||
SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式")
|
||||
SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式"),
|
||||
openSecondaryAccount: getLabel(111, "启用主次身份"),
|
||||
SALARY_APPROVAL_STATUS: getLabel(111, "是否开启薪资审批"),
|
||||
APPROVAL_CAN_MANUAL_FILE_STATUS: getLabel(111, "开启审批的核算记录允许手动归档"),
|
||||
APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"),
|
||||
APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据")
|
||||
};
|
||||
this.unifiedSettings(key, confTitle[key]);
|
||||
this.handleDebounce = null;
|
||||
|
|
@ -320,6 +342,20 @@ class RuleConfig extends Component {
|
|||
API.saveSysOperate(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(22619, "保存成功!"));
|
||||
if (confKey === "SALARY_APPROVAL_STATUS") {
|
||||
this.setState({
|
||||
conditions: _.map(this.state.conditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (
|
||||
getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS"
|
||||
) {
|
||||
return { ...o, hide: form.getFormParams()[confKey] === "0" };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
}))
|
||||
});
|
||||
}
|
||||
} else {
|
||||
message.error(errormsg || getLabel(22620, "保存失败!"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,56 +2,240 @@ import { WeaLocaleProvider } from "ecCom";
|
|||
import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
export const columns = [
|
||||
|
||||
|
||||
export const salaryItemConditions = [
|
||||
{
|
||||
title: "名称",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 14,
|
||||
label: "名称",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "属性",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["useDefault"],
|
||||
fieldcol: 14,
|
||||
label: "默认使用",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
rules: "required|string",
|
||||
tipLanId: 111,
|
||||
tip: "提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["hideDefault"],
|
||||
fieldcol: 14,
|
||||
label: "核算时隐藏",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
rules: "required|string",
|
||||
tipLanId: 111,
|
||||
tip: "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "薪资档案引用",
|
||||
dataIndex: "refere",
|
||||
key: "refere"
|
||||
conditionType: "SELECT",
|
||||
domkey: ["sharedType"],
|
||||
fieldcol: 14,
|
||||
label: "可见性",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "默认使用",
|
||||
dataIndex: "refere",
|
||||
key: "refere"
|
||||
conditionType: "SELECT",
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 14,
|
||||
label: "可见性范围",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [],
|
||||
multiple: true,
|
||||
rules: "",
|
||||
viewAttr: 2,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
title: "进位规则",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
conditionType: "SELECT",
|
||||
domkey: ["dataType"],
|
||||
fieldcol: 14,
|
||||
label: "字段类型",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [
|
||||
{ key: "number", showname: "数值", lanId: 111, selected: true },
|
||||
{ key: "string", showname: "字符", lanId: 111, selected: false }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "保留小数位",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
conditionType: "SELECT",
|
||||
domkey: ["roundingMode"],
|
||||
fieldcol: 14,
|
||||
label: "舍入规则",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
options: [
|
||||
{ key: "1", selected: true, showname: "原始数据", lanId: 111 },
|
||||
{ key: "2", selected: false, showname: "四舍五入", lanId: 111 },
|
||||
{ key: "3", selected: false, showname: "向上舍入", lanId: 111 },
|
||||
{ key: "4", selected: false, showname: "向下舍入", lanId: 111 },
|
||||
{ key: "5", selected: false, showname: "见分进角", lanId: 111 }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "取值方式",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
conditionType: "SELECT",
|
||||
domkey: ["pattern"],
|
||||
fieldcol: 14,
|
||||
label: "保留小数位",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "2",
|
||||
options: [
|
||||
{ key: "0", selected: false, showname: "0" },
|
||||
{ key: "1", selected: false, showname: "1" },
|
||||
{ key: "2", selected: true, showname: "2" },
|
||||
{ key: "3", selected: false, showname: "3" },
|
||||
{ key: "4", selected: false, showname: "4" },
|
||||
{ key: "5", selected: false, showname: "5" },
|
||||
{ key: "6", selected: false, showname: "6" },
|
||||
{ key: "7", selected: false, showname: "7" },
|
||||
{ key: "8", selected: false, showname: "8" },
|
||||
{ key: "9", selected: false, showname: "9" },
|
||||
{ key: "10", selected: false, showname: "10" }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
conditionType: "SELECT",
|
||||
domkey: ["valueType"],
|
||||
fieldcol: 14,
|
||||
label: "取值方式",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
otherParams: { detailtype: 3 },
|
||||
options: [
|
||||
{ key: "1", showname: "输入", selected: true, lanId: 111 },
|
||||
{ key: "2", showname: "公式", selected: false, lanId: 111 },
|
||||
{ key: "3", showname: "SQL", selected: false, lanId: 111 }
|
||||
],
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "cz",
|
||||
key: "cz"
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["defaultValue"],
|
||||
fieldcol: 14,
|
||||
label: "默认值",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
otherParams: { precision: 2 },
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["formulaContent"],
|
||||
fieldcol: 14,
|
||||
label: "公式",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 3,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["formulaId"],
|
||||
fieldcol: 14,
|
||||
label: "公式",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 3,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["sortedIndex"],
|
||||
fieldcol: 14,
|
||||
label: "显示顺序",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["width"],
|
||||
fieldcol: 14,
|
||||
label: "显示宽度",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "TEXTAREA",
|
||||
domkey: ["description"],
|
||||
fieldcol: 14,
|
||||
label: "备注",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2,
|
||||
otherParams: { minRows: 3 }
|
||||
},
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["useInEmployeeSalary"],
|
||||
fieldcol: 14,
|
||||
label: "薪资档案引用",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
viewAttr: 2,
|
||||
tipLanId: 111,
|
||||
tip: "提示:开启后,该薪资项目不可删除或设为无效,取值方式会默认置为输入",
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["systemType"],
|
||||
fieldcol: 14,
|
||||
label: "是否系统默认",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "0",
|
||||
viewAttr: 2,
|
||||
hide: true
|
||||
}
|
||||
],
|
||||
title: "",
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const salaryItemFields = [
|
||||
|
|
|
|||
|
|
@ -1,62 +1,211 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import FormalFormModal from "./formalFormModal";
|
||||
import SalaryItemForm from "./salaryItemForm";
|
||||
import "./index.less";
|
||||
import { salaryItemConditions } from "./columns";
|
||||
import { commonEnumList } from "../../apis/archive";
|
||||
import { getItemForm } from "../../apis/item";
|
||||
import { getTaxAgentSelectList } from "../../apis/taxAgent";
|
||||
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const getKey = WeaTools.getKey;
|
||||
|
||||
@inject("salaryItemStore")
|
||||
@observer
|
||||
export default class CustomSalaryItemSlide extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showForm: false,
|
||||
formalModalVisible: false,
|
||||
salaryItemName: ""
|
||||
conditions: [], visible: false
|
||||
};
|
||||
}
|
||||
|
||||
handleChange = (params) => {
|
||||
this.props.onChange({ ...this.props.request, ...params });
|
||||
};
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
document.querySelector(".custom_salaryItemSlide").classList.add("zIndex0-weaslide-title");
|
||||
this.initForm(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
document.querySelector(".custom_salaryItemSlide").classList.remove("zIndex0-weaslide-title");
|
||||
this.props.salaryItemStore.initItemsForm();
|
||||
}
|
||||
}
|
||||
|
||||
handleShowFormal = (salaryItemName) => {
|
||||
handleChange = (data) => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
form.updateFields({ formulaContent: { value: data["formula"] }, formulaId: { value: data["id"] } });
|
||||
};
|
||||
initForm = async (props) => {
|
||||
const { data: salaryItemForm } = props.id ?
|
||||
await getItemForm({ id: props.id }) :
|
||||
{
|
||||
data: { sharedType: "0", useDefault: "0", hideDefault: "0", pattern: 2, dataType: "number", valueType: "1" }
|
||||
};
|
||||
const [{ data: sharedTypeList }, { data: taxAgentList }] = await Promise.all([
|
||||
commonEnumList({ enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }),
|
||||
getTaxAgentSelectList()
|
||||
]);
|
||||
this.setState({
|
||||
formalModalVisible: true,
|
||||
salaryItemName
|
||||
conditions: _.map(salaryItemConditions, c => {
|
||||
return {
|
||||
...c, items: _.map(c.items, fields => {
|
||||
fields = {
|
||||
...fields, viewAttr: props.showOperateBtn ? fields.viewAttr : 1,
|
||||
label: getLabel(fields.lanId, fields.label),
|
||||
value: !_.isNil(salaryItemForm[getKey(fields)]) ? String(salaryItemForm[getKey(fields)]) : fields.value
|
||||
};
|
||||
switch (getKey(fields)) {
|
||||
case "sharedType":
|
||||
fields = {
|
||||
...fields, options: _.map(sharedTypeList, o => ({ key: o.value, showname: o.defaultLabel }))
|
||||
};
|
||||
break;
|
||||
case "taxAgentIds":
|
||||
fields = {
|
||||
...fields, options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })),
|
||||
hide: String(salaryItemForm["sharedType"]) === "0" || !_.isNil(salaryItemForm["sharedType"])
|
||||
};
|
||||
break;
|
||||
case "dataType":
|
||||
case "valueType":
|
||||
fields = {
|
||||
...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) }))
|
||||
};
|
||||
break;
|
||||
case "roundingMode":
|
||||
fields = {
|
||||
...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) })),
|
||||
hide: String(salaryItemForm["dataType"]) === "string"
|
||||
};
|
||||
break;
|
||||
case "pattern":
|
||||
fields = {
|
||||
...fields, hide: String(salaryItemForm["dataType"]) === "string"
|
||||
};
|
||||
break;
|
||||
case "defaultValue":
|
||||
const otherParams = String(salaryItemForm["dataType"]) === "number" ? { precision: Number(salaryItemForm["pattern"]) } : {};
|
||||
fields = {
|
||||
...fields, otherParams,
|
||||
conditionType: String(salaryItemForm["dataType"]) === "string" ? "INPUT" : "INPUTNUMBER",
|
||||
hide: String(salaryItemForm["valueType"]) !== "1"
|
||||
};
|
||||
break;
|
||||
case "formulaContent":
|
||||
fields = {
|
||||
...fields, hide: String(salaryItemForm["valueType"]) === "1",
|
||||
label: String(salaryItemForm["valueType"]) === "2" ? getLabel(111, "公式") : getLabel(111, "SQL")
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return fields;
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
props.salaryItemStore.itemsForm.initFormFields(this.state.conditions);
|
||||
});
|
||||
};
|
||||
|
||||
// 保存公式成功回调
|
||||
handleSaveFormal = (data) => {
|
||||
this.handleChange({
|
||||
formulaId: data.id, formulaContent: data.formula,
|
||||
originFormulaContent: data.referenceType === "formula" ? data.formula : "",
|
||||
originSqlContent: data.referenceType === "sql" ? data.formula : ""
|
||||
handleChangeFormItem = (res) => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { conditions } = this.state, [key] = _.keys(res), value = res[key].value;
|
||||
this.setState({
|
||||
conditions: _.map(conditions, c => {
|
||||
return {
|
||||
...c, items: _.map(c.items, fields => {
|
||||
if (key === "sharedType" && getKey(fields) === "taxAgentIds") {
|
||||
fields = { ...fields, viewAttr: value === "0" ? 2 : 3, hide: value === "0" };
|
||||
} else if (key === "dataType" && (getKey(fields) === "roundingMode" || getKey(fields) === "pattern")) {
|
||||
fields = { ...fields, hide: value === "string" };
|
||||
} else if ((key === "dataType" || key === "pattern") && getKey(fields) === "defaultValue") {
|
||||
const otherParams = form.getFormParams().dataType === "number" ? { precision: Number(form.getFormParams().pattern) } : {};
|
||||
fields = {
|
||||
...fields, otherParams, conditionType: value === "string" ? "INPUT" : "INPUTNUMBER",
|
||||
hide: form.getFormParams().valueType !== "1"
|
||||
};
|
||||
} else if (key === "valueType" && (getKey(fields) === "formulaContent" || getKey(fields) === "defaultValue")) {
|
||||
fields = {
|
||||
...fields,
|
||||
label: getKey(fields) === "defaultValue" ? fields.label : form.getFormDatas().valueType.valueSpan,
|
||||
hide: (getKey(fields) === "formulaContent" && value === "1") || (getKey(fields) === "defaultValue" && value !== "1")
|
||||
};
|
||||
}
|
||||
return fields;
|
||||
})
|
||||
};
|
||||
})
|
||||
}, () => {
|
||||
form.getFormParams().valueType === "1" &&
|
||||
form.updateFields({ formulaContent: { value: "" }, formulaId: { value: "" } });
|
||||
(form.getFormParams().valueType === "2" || form.getFormParams().valueType === "3") &&
|
||||
form.updateFields({ defaultValue: { value: "" } });
|
||||
});
|
||||
};
|
||||
renderForm = () => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && conditions.map(c => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom">
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={this.handleChangeFormItem}/>
|
||||
{
|
||||
getKey(fields) === "formulaContent" && form.getFormParams().valueType !== "1" &&
|
||||
this.props.showOperateBtn &&
|
||||
<div className="formula_input_div" onClick={() => this.setState({ visible: true })}/>
|
||||
}
|
||||
{
|
||||
fields.tip && <WeaHelpfulTip
|
||||
style={{ marginLeft: 16 }} width={350} title={getLabel(fields.tipLanId, fields.tip)}
|
||||
placement="topLeft"/>
|
||||
}
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
});
|
||||
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { title, buttons } = this.props;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">{buttons}</div>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { request } = this.props;
|
||||
const { valueType, dataType, formulaId } = request;
|
||||
const { formalModalVisible, salaryItemName } = this.state;
|
||||
return (
|
||||
<div className="customSalaryItemSlide">
|
||||
<SalaryItemForm {...this.props} onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}/>
|
||||
{formalModalVisible &&
|
||||
const { onClose, salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { visible } = this.state;
|
||||
return (<WeaSlideModal
|
||||
className="custom_salaryItemSlide"{...this.props}
|
||||
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
|
||||
direction="right" title={this.renderTitle()} onClose={() => onClose()}
|
||||
content={<div className="form-dialog-layout">
|
||||
{this.renderForm()}
|
||||
{visible &&
|
||||
<FormalFormModal
|
||||
name={salaryItemName}
|
||||
formulaId={formulaId}
|
||||
visible={formalModalVisible}
|
||||
valueType={valueType}
|
||||
dataType={dataType}
|
||||
onSaveFormal={data => {
|
||||
this.handleSaveFormal(data);
|
||||
}}
|
||||
onCancel={() =>
|
||||
this.setState({
|
||||
formalModalVisible: false,
|
||||
salaryItemName: ""
|
||||
})}
|
||||
/>}
|
||||
</div>
|
||||
formulaId={form.getFormParams().formulaId}
|
||||
visible={visible}
|
||||
name={form.getFormParams().name}
|
||||
valueType={form.getFormParams().valueType}
|
||||
dataType={form.getFormParams().dataType}
|
||||
onSaveFormal={this.handleChange}
|
||||
onCancel={() => this.setState({ visible: false })}
|
||||
/>
|
||||
}
|
||||
</div>}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
|
||||
import { WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
|
||||
import { renderLoading, toDecimal_n } from "../../util";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import * as API from "../../apis/item";
|
||||
import SalaryItemsTable from "./salaryItemsTable";
|
||||
import { toDecimal_n } from "../../util";
|
||||
import SystemSalaryItemModal from "./systemSalaryItemModal";
|
||||
import { columns } from "./columns";
|
||||
import SlideModalTitle from "../../components/slideModalTitle";
|
||||
import CustomSalaryItemSlide from "./customSalaryItemSlide";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog";
|
||||
import "../socialSecurityBenefits/programme/index.less";
|
||||
import LogDialog from "../../components/logViewModal";
|
||||
import SalaryItemImportDialog from "./salaryItemImport";
|
||||
import * as API from "../../apis/item";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
@inject("salaryItemStore", "taxAgentStore", "salaryFileStore")
|
||||
|
|
@ -21,192 +19,83 @@ export default class SalaryItem extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
editable: false,
|
||||
isAdd: false,
|
||||
searchValue: "",
|
||||
formalModalVisible: false,
|
||||
searchParams: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [],
|
||||
syncSalarySetDialog: { visible: false, title: "", id: "" },
|
||||
logDialogVisible: false, filterConditions: "[]",
|
||||
name: "", isQuery: false, loading: false, sysVisible: false,
|
||||
customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗
|
||||
syncSalarySetDialog: { visible: false, id: "" }, // 同步到薪资账套弹窗
|
||||
logDialogVisible: false, filterConditions: "[]", selectedRowKeys: [],
|
||||
salaryItemImpDialog: { visible: false, title: getLabel(24023, "数据导入") }
|
||||
};
|
||||
columns.map(item => {
|
||||
if (item.dataIndex == "refere") {
|
||||
item.render = () => {
|
||||
return (
|
||||
<Switch/>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "cz") {
|
||||
item.render = () => {
|
||||
return (<div>
|
||||
<a style={{ marginRight: "10px" }}>编辑</a>
|
||||
<a style={{ marginRight: "10px" }}>删除</a>
|
||||
{/* <a>操作日志</a> */}
|
||||
</div>);
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
this.record = {};
|
||||
}
|
||||
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { salaryItemStore: { getTableDatas }, salaryFileStore, taxAgentStore } = this.props;
|
||||
const { commonEnumList } = salaryFileStore;
|
||||
const { fetchTaxAgentOption } = taxAgentStore;
|
||||
fetchTaxAgentOption();
|
||||
commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" });
|
||||
getTableDatas({}).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current: res.pageNum,
|
||||
total: res.total
|
||||
handleDeleteItem = (recordId) => {
|
||||
const { selectedRowKeys, isQuery } = this.state;
|
||||
const params = recordId ? [recordId] : selectedRowKeys;
|
||||
if (_.isEmpty(params)) {
|
||||
message.warning(getLabel(111, "请勾选数据!"));
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onEditItem = (record, isedit) => {
|
||||
this.record = record;
|
||||
const { salaryItemStore: { getItemForm, setEditSlideVisible } } = this.props;
|
||||
this.setState({
|
||||
editable: isedit, isAdd: false,
|
||||
syncSalarySetDialog: { ...this.state.syncSalarySetDialog, id: record.id }
|
||||
});
|
||||
getItemForm(record.id).then(() => {
|
||||
setEditSlideVisible(true);
|
||||
}).catch(({ errormsg }) => {
|
||||
message.error(errormsg || "");
|
||||
});
|
||||
};
|
||||
|
||||
// 删除列表项
|
||||
handleDeleteItem(record) {
|
||||
const { salaryItemStore: { deleteItemRequest, getTableDatas } } = this.props;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除该条数据吗?",
|
||||
title: getLabel(131329, "信息确认"),
|
||||
content: getLabel(111, "确认删除吗?"),
|
||||
onOk: () => {
|
||||
deleteItemRequest([record.id]).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
API.deleteItem(params).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(getLabel(111, "操作成功!"));
|
||||
this.setState({ isQuery: !isQuery });
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getColumns = () => {
|
||||
const { salaryItemStore, taxAgentStore: { showSalaryItemBtn, showOperateBtn } } = this.props;
|
||||
const { tableColumns } = salaryItemStore;
|
||||
let columns = tableColumns.map(column => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch (newColumn.dataIndex) {
|
||||
case "name":
|
||||
return <a onClick={() => {
|
||||
this.onEditItem(record, false);
|
||||
}}>{text}</a>;
|
||||
case "useDefault":
|
||||
case "hideDefault":
|
||||
case "useInEmployeeSalary":
|
||||
return <Switch checked={text === 1} disabled/>;
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
});
|
||||
};
|
||||
return newColumn;
|
||||
handleValidateForm = () => {
|
||||
return new Promise((resolve) => {
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { formulaId, valueType, sharedType, taxAgentIds } = form.getFormParams();
|
||||
let taxAgentValidate = true, formulaValidate = true;
|
||||
if (sharedType === "1" && !taxAgentIds) taxAgentValidate = false;
|
||||
if (valueType !== "1" && !formulaId) formulaValidate = false;
|
||||
resolve({ taxAgentValidate, formulaValidate });
|
||||
});
|
||||
columns.push({
|
||||
key: "operate",
|
||||
title: "操作",
|
||||
width: 185,
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<a
|
||||
onClick={() => this.onEditItem(record, true)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a>
|
||||
{
|
||||
(record.canDelete && (showSalaryItemBtn || showOperateBtn)) &&
|
||||
<a href="javascript:void(0)" style={{ marginLeft: 10 }}
|
||||
onClick={() => this.handleDeleteItem(record)}
|
||||
>{getLabel(535052, "删除")}</a>
|
||||
}
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)" style={{ marginLeft: 10 }}><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
});
|
||||
return [
|
||||
// {
|
||||
// title: "序号",
|
||||
// dataIndex: "index",
|
||||
// align: "left",
|
||||
// width: 60,
|
||||
// render: (text, record, index) => {
|
||||
// const { current, pageSize } = this.state.searchParams;
|
||||
// return (current - 1) * pageSize + index + 1;
|
||||
// }
|
||||
// },
|
||||
...columns];
|
||||
};
|
||||
|
||||
handleSearch(value) {
|
||||
const { salaryItemStore: { getTableDatas } } = this.props;
|
||||
getTableDatas({ ...this.state.searchParams, current: 1, name: value }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current: 1,
|
||||
total: res.total
|
||||
}
|
||||
handleSalaryItem = (type) => {
|
||||
const { customItemDialog: { id }, isQuery } = this.state;
|
||||
const { salaryItemStore: { itemsForm: form } } = this.props;
|
||||
Promise.all([form.validateForm(), this.handleValidateForm()])
|
||||
.then(([f1, f2]) => {
|
||||
if (f1.isValid && f2.taxAgentValidate && f2.formulaValidate) {
|
||||
const { formulaContent, valueType, dataType, defaultValue, pattern, ...formData } = form.getFormParams();
|
||||
const key = valueType === "2" ? "originFormulaContent" : valueType === "3" ? "originSqlContent" : "formulaContent";
|
||||
this.setState({ loading: true });
|
||||
API.saveItem({
|
||||
...formData, valueType, dataType, pattern, [key]: formulaContent, id,
|
||||
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue
|
||||
}).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
this.setState({ isQuery: !isQuery }, () => {
|
||||
message.success(getLabel(111, "操作成功"));
|
||||
type === "SAVECREATE" && form.updateFields({
|
||||
name: { value: "" }, formulaContent: { value: "" }, formulaId: { value: "" }
|
||||
});
|
||||
type !== "SAVECREATE" && this.setState({
|
||||
customItemDialog: { ...this.state.customItemDialog, visible: false, id: "" }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
handlePageChange(value) {
|
||||
const { salaryItemStore: { getTableDatas } } = this.props;
|
||||
getTableDatas({ ...this.state.searchParams, name: this.state.searchValue, current: value }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current: value,
|
||||
total: res.total
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
!f1.isValid && f1.showErrors();
|
||||
!f2.taxAgentValidate && f1.showError("taxAgentIds", getLabel(111, "\"可见性范围\"未填写"));
|
||||
!f2.formulaValidate && f1.showError("formulaContent", getLabel(111, `\"${form.getFormDatas().valueType.valueSpan}\"未填写`));
|
||||
this.forceUpdate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
handleShowSizeChange(searchParams) {
|
||||
const { salaryItemStore: { getTableDatas } } = this.props;
|
||||
getTableDatas({ ...searchParams });
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
onDropMenuClick = (key, targetid = "") => {
|
||||
switch (key) {
|
||||
case "log":
|
||||
|
|
@ -228,206 +117,84 @@ export default class SalaryItem extends React.Component {
|
|||
}
|
||||
});
|
||||
break;
|
||||
case "customAdd":
|
||||
case "edit":
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { loading } = this.state;
|
||||
const editTitle = !showOperateBtn ? getLabel(111, "查看自定义薪资项目") : getLabel(111, "修改自定义薪资项目");
|
||||
const title = key === "edit" ? editTitle : getLabel(111, "新建自定义薪资项目");
|
||||
const buttons = key === "edit" ? [
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
syncSalarySetDialog: { visible: true, id: targetid }
|
||||
})}>{getLabel(111, "同步到薪资账套")}</Button>,
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVE")}>{getLabel(111, "保存")}</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVE")}>{getLabel(111, "保存")}</Button>,
|
||||
<Button type="ghost" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVECREATE")}>{getLabel(111, "保存并继续创建")}</Button>
|
||||
];
|
||||
this.setState({
|
||||
customItemDialog: {
|
||||
visible: true, title, buttons: showOperateBtn ? buttons : [], id: targetid
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "delete":
|
||||
this.handleDeleteItem(targetid);
|
||||
break;
|
||||
case "sysAdd":
|
||||
this.setState({ sysVisible: true });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const {
|
||||
salaryItemStore, salaryFileStore, taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption }
|
||||
} = this.props;
|
||||
const { userStatusList } = salaryFileStore;
|
||||
const { selectedRowKeys, logDialogVisible, filterConditions, salaryItemImpDialog } = this.state;
|
||||
const { loading, deleteItemRequest, getTableDatas } = salaryItemStore;
|
||||
const {
|
||||
tableDataSource,
|
||||
tableColumns,
|
||||
systemItemVisible,
|
||||
setSystemItemVisible,
|
||||
editSlideVisible,
|
||||
setEditSlideVisible,
|
||||
request
|
||||
} = salaryItemStore;
|
||||
if (this.getColumns().length === 2) { // 无权限处理
|
||||
return renderLoading();
|
||||
}
|
||||
|
||||
const handleMenuClick = (e) => {
|
||||
const { salaryItemStore: { setEditSlideVisible, initRequest } } = this.props;
|
||||
if (e.key === "1") {
|
||||
this.setState({ editable: true, isAdd: true });
|
||||
initRequest();
|
||||
setEditSlideVisible(true);
|
||||
} else if (e.key === "2") {
|
||||
setSystemItemVisible(true);
|
||||
}
|
||||
};
|
||||
|
||||
selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog, sysVisible,
|
||||
salaryItemImpDialog
|
||||
} = this.state;
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="2">{getLabel(111, "新增系统薪资项")}</Menu.Item>
|
||||
<Menu onClick={({ key }) => this.onDropMenuClick(key)}>
|
||||
<Menu.Item key="sysAdd">{getLabel(111, "新增系统薪资项")}</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const buttons = [
|
||||
let buttons = [
|
||||
<Dropdown.Button overlay={menu} type="primary"
|
||||
onClick={() => handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
|
||||
<Button type="primary" onClick={() => {
|
||||
if (!selectedRowKeys.length) {
|
||||
message.info("未选中任何数据!");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确定要将所选的薪资项(共${selectedRowKeys.length}条数据)删除吗?`,
|
||||
onOk: () => {
|
||||
deleteItemRequest(selectedRowKeys).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
selectedRowKeys: [],
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}}>{getLabel(32136, "批量删除")}</Button>,
|
||||
<WeaInputSearch value={this.state.searchValue} placeholder={getLabel(111, "请输入名称")}
|
||||
onChange={value => this.setState({ searchValue: value })}
|
||||
onSearch={value => this.handleSearch(value)}/>
|
||||
onClick={() => this.onDropMenuClick("customAdd")}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
|
||||
<Button type="ghost" onClick={() => this.handleDeleteItem()}>{getLabel(32136, "批量删除")}</Button>,
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })}
|
||||
placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/>
|
||||
];
|
||||
// 新建和修改保存的回调
|
||||
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({
|
||||
title: "信息确认",
|
||||
content: "必要信息不完整,红色*为必填项!"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { pattern, defaultValue, dataType, ...extra } = payload;
|
||||
saveItem({
|
||||
...extra, pattern, dataType,
|
||||
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue
|
||||
}, continueFlag)
|
||||
.then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const renderCustomOperate = () => {
|
||||
let arrList = [];
|
||||
if (this.state.isAdd) {
|
||||
arrList = [
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(false);
|
||||
}}>保存</Button>,
|
||||
<Button type="default" onClick={() => {
|
||||
handleSlideSave(true);
|
||||
}}>保存并继续创建</Button>
|
||||
let dropMenuDatas = [
|
||||
{ key: "import", icon: <i className="icon-coms02-Template-import1"/>, content: getLabel(111, "导入") },
|
||||
{ key: "export", icon: <i className="iconfont icon-daochu"/>, content: getLabel(111, "导出") },
|
||||
{ key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>, content: getLabel(545781, "操作日志") }
|
||||
];
|
||||
} else if (this.state.editable) {
|
||||
arrList = [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({
|
||||
syncSalarySetDialog: {
|
||||
...this.state.syncSalarySetDialog,
|
||||
visible: true,
|
||||
title: getLabel(111, "请选择薪资账套")
|
||||
}
|
||||
})}
|
||||
>{getLabel(111, "同步到薪资账套")}</Button>,
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(true);
|
||||
}}>保存</Button>
|
||||
];
|
||||
}
|
||||
return arrList;
|
||||
};
|
||||
|
||||
const handleSaveSlideChange = (value) => {
|
||||
const { salaryItemStore: { setRequest } } = this.props;
|
||||
setRequest(value);
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
// getCheckboxProps: record => ({
|
||||
// disabled: !record.canDelete // Column configuration not to be checked
|
||||
// })
|
||||
};
|
||||
!showOperateBtn && (buttons = buttons.slice(-1));
|
||||
!showOperateBtn && (dropMenuDatas = dropMenuDatas.slice(-1));
|
||||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaTop title="薪资项目管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
{
|
||||
key: "import",
|
||||
icon: <i className="icon-coms02-Template-import1"/>,
|
||||
content: getLabel(111, "导入")
|
||||
},
|
||||
{
|
||||
key: "export",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(111, "导出")
|
||||
},
|
||||
{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}
|
||||
]} buttons={(showOperateBtn || showSalaryItemBtn) ? buttons : buttons.slice(-1)}>
|
||||
<div className="tableWrapper">
|
||||
<WeaNewScroll height="100%">
|
||||
<CustomPaginationTable
|
||||
rowKey={record => record.id}
|
||||
loading={loading}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={tableDataSource}
|
||||
columns={this.getColumns(tableColumns)}
|
||||
total={this.state.searchParams.total}
|
||||
current={this.state.searchParams.current}
|
||||
pageSize={this.state.searchParams.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.handlePageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current,
|
||||
pageSize
|
||||
}
|
||||
}, () => {
|
||||
this.handleShowSizeChange({ name: this.state.searchValue, ...this.state.searchParams });
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
<React.Fragment>
|
||||
<WeaTop title={getLabel(111, "薪资项目管理")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}
|
||||
className="salaryProjectManagement">
|
||||
<div className="salaryItems_content">
|
||||
<SalaryItemsTable {...this.props} name={name} isQuery={isQuery} showOperateBtn={showOperateBtn}
|
||||
selectedRowKeys={selectedRowKeys} onDropMenuClick={this.onDropMenuClick}
|
||||
onChange={val => this.setState({ selectedRowKeys: val })}/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
{/*添加系统薪资项目*/}
|
||||
<SystemSalaryItemModal visible={sysVisible} onSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
onCancel={(callback) => this.setState({ sysVisible: false }, () => callback && callback())}/>
|
||||
{/*同步薪资账套*/}
|
||||
<SyncToSalaryAccountSetDialog
|
||||
{...this.state.syncSalarySetDialog}
|
||||
onCancel={() => this.setState({
|
||||
syncSalarySetDialog: {
|
||||
...this.state.syncSalarySetDialog,
|
||||
visible: false, title: ""
|
||||
}
|
||||
})}
|
||||
/>
|
||||
onCancel={() => this.setState({ syncSalarySetDialog: { visible: false, id: "" } })}/>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="salaryitem" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
|
|
@ -436,61 +203,15 @@ export default class SalaryItem extends React.Component {
|
|||
onCancel={callback => {
|
||||
this.setState({
|
||||
salaryItemImpDialog: { ...salaryItemImpDialog, visible: false }
|
||||
}, () => callback && this.handleSearch(this.state.searchValue));
|
||||
}, () => callback && this.setState({ isQuery: !isQuery }));
|
||||
}}/>
|
||||
{
|
||||
systemItemVisible &&
|
||||
<SystemSalaryItemModal
|
||||
visible={systemItemVisible}
|
||||
onCancel={() => {
|
||||
setSystemItemVisible(false);
|
||||
}}
|
||||
onInitTableList={() => {
|
||||
getTableDatas({ ...this.state.searchParams, name: this.state.searchValue }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
editSlideVisible &&
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
visible={editSlideVisible}
|
||||
top={0}
|
||||
measureT="%"
|
||||
width={800}
|
||||
measureX="px"
|
||||
height={100}
|
||||
measureY="%"
|
||||
direction={"right"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
|
||||
editable={false}
|
||||
showOperateBtn={(showSalaryItemBtn || showOperateBtn)}
|
||||
customOperate={(showSalaryItemBtn || showOperateBtn) ? renderCustomOperate() : []}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<CustomSalaryItemSlide
|
||||
record={this.record} editable={this.state.editable}
|
||||
isAdd={this.state.isAdd} request={request}
|
||||
userStatusList={userStatusList}
|
||||
taxAgentAdminOption={taxAgentOption}
|
||||
onChange={(value) => {
|
||||
handleSaveSlideChange(value);
|
||||
}}/>
|
||||
}
|
||||
onClose={() => setEditSlideVisible(false)}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
{/*新增编辑自定义薪资项目*/}
|
||||
<CustomSalaryItemSlide {...customItemDialog} onSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onClose={callback => this.setState({
|
||||
customItemDialog: { ...customItemDialog, visible: false, id: "" }
|
||||
}, () => callback && callback())}/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,91 @@
|
|||
//薪资项目重构项
|
||||
.salaryProjectManagement {
|
||||
.wea-input-focus {
|
||||
height: 31.36px;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.salaryItems_content {
|
||||
height: 100%;
|
||||
padding: 8px 16px;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.custom_salaryItemSlide {
|
||||
.wea-slide-modal-title {
|
||||
border-bottom: 1px solid #e5e5e5 !important;
|
||||
}
|
||||
|
||||
.wea-slide-modal-content {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
//display: block !important;
|
||||
|
||||
.formula_input_div {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 46px 0 16px;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.titleLeftBox {
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.titleRightBox {
|
||||
justify-content: flex-end;
|
||||
|
||||
button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.customSalaryItemSlide {
|
||||
padding: 16px;
|
||||
|
||||
|
|
@ -62,20 +150,20 @@
|
|||
|
||||
//系统薪资项添加modal
|
||||
.sys-salary-wrapper {
|
||||
.wea-dialog-body {
|
||||
height: 50vh;
|
||||
overflow: hidden auto;
|
||||
|
||||
.headerSearchWrapper {
|
||||
.sys-item-title {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding: 16px 20px;
|
||||
|
||||
.wea-tab {
|
||||
width: 100%;
|
||||
border-bottom: none;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.sys-item-table-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #F6F6F6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ export const roundingModeOptions = [
|
|||
showname: "见分进角"
|
||||
}
|
||||
];
|
||||
|
||||
export const patternOptions = [
|
||||
{
|
||||
key: "0",
|
||||
|
|
@ -83,7 +82,6 @@ export const patternOptions = [
|
|||
selected: false
|
||||
}
|
||||
];
|
||||
|
||||
export const dataTypeOptions = [
|
||||
{
|
||||
key: "number",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* 薪资项目管理
|
||||
* 表格
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/16
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Dropdown, Menu, Spin } from "antd";
|
||||
import * as API from "../../apis/item";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryItemsTable extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, columns: [], dataSource: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getItemList(this.props);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1 }
|
||||
}, () => this.getItemList(nextProps));
|
||||
}
|
||||
|
||||
getItemList = (props) => {
|
||||
const { name } = props;
|
||||
const { pageInfo } = this.state;
|
||||
const payload = { name, ...pageInfo };
|
||||
this.setState({ loading: true });
|
||||
API.getItemList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: _.map(columns, o => {
|
||||
if (o.dataIndex === "useDefault" || o.dataIndex === "hideDefault" || o.dataIndex === "useInEmployeeSalary") {
|
||||
return { ...o, width: 80, render: text => <WeaCheckbox value={String(text)} disabled display="switch"/> };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, columns, pageInfo, loading } = this.state;
|
||||
const { selectedRowKeys, onChange, onDropMenuClick, showOperateBtn } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getItemList(this.props));
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getItemList(this.props));
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange,
|
||||
getCheckboxProps: record => ({ disabled: !record.canDelete })
|
||||
};
|
||||
return (<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<WeaTable rowKey="id" dataSource={dataSource} rowSelection={rowSelection} pagination={pagination}
|
||||
loading={loading} scroll={{ y: `calc(100vh - 180px)` }}
|
||||
columns={[
|
||||
...columns, {
|
||||
dataIndex: "opt", title: getLabel(111, "操作"), width: 140,
|
||||
render: (__, record) => (<React.Fragment>
|
||||
<a style={{ marginRight: 8 }} onClick={() => onDropMenuClick("edit", record.id)}
|
||||
href="javascript:void(0);">{showOperateBtn ? getLabel(111, "编辑") : getLabel(111, "查看")}</a>
|
||||
{
|
||||
showOperateBtn && record.canDelete &&
|
||||
<a style={{ marginRight: 8 }} href="javascript:void(0);"
|
||||
onClick={() => onDropMenuClick("delete", record.id)}>{getLabel(111, "删除")}</a>
|
||||
}
|
||||
<Dropdown overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>)
|
||||
}
|
||||
]}/>
|
||||
</Spin>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryItemsTable;
|
||||
|
|
@ -51,7 +51,6 @@ class SyncToSalaryAccountSetDialog extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
save = () => {
|
||||
const { salaryItemStore: { salarySetform }, id: salaryItemId } = this.props;
|
||||
salarySetform.validateForm().then(f => {
|
||||
|
|
@ -80,7 +79,7 @@ class SyncToSalaryAccountSetDialog extends Component {
|
|||
return (
|
||||
<WeaDialog
|
||||
{...this.props} className="salarySetDialog" initLoadCss
|
||||
style={{ width: 480 }}
|
||||
style={{ width: 480 }} title={getLabel(111, "请选择薪资账套")}
|
||||
buttons={[<Button type="primary" onClick={this.save}
|
||||
loading={this.state.loading}>{getLabel(537558, "确定")}</Button>]}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import React from "react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTab } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Button, message, Spin } from "antd";
|
||||
import { getSysItemList, saveSysItem } from "../../apis/item";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -10,20 +9,16 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
name: "",
|
||||
loading: false,
|
||||
saveLoading: false,
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
dataSource: [], columns: [], name: "", loading: false, saveLoading: false,
|
||||
selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSysItemList();
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getSysItemList();
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
|
||||
selectedRowKeys: [], name: ""
|
||||
});
|
||||
}
|
||||
|
||||
getSysItemList = () => {
|
||||
|
|
@ -33,41 +28,33 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
columns: _.map(columns, item => {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}>{text}</span>;
|
||||
}
|
||||
};
|
||||
}),
|
||||
dataSource,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
this.setState({ columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } });
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleAdd = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.info(getLabel(111, "未选择任何条目"));
|
||||
return;
|
||||
}
|
||||
this.setState({ saveLoading: true });
|
||||
saveSysItem(selectedRowKeys).then(({ status, errormsg }) => {
|
||||
this.setState({ saveLoading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "添加成功"));
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.props.onInitTableList();
|
||||
this.props.onCancel();
|
||||
});
|
||||
this.setState({ selectedRowKeys: [] }, () => this.props.onCancel(this.props.onSearch()));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ saveLoading: false }));
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { name, pageInfo } = this.state;
|
||||
return <div className="sys-item-title">
|
||||
<span>{getLabel(111, "添加系统薪资项目")}</span>
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })} style={{ width: 200 }}
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")} a onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getSysItemList())}/>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedRowKeys, pageInfo, loading, columns, dataSource, saveLoading } = this.state;
|
||||
|
|
@ -95,33 +82,20 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
title="添加系统薪资项目"
|
||||
initLoadCss className="sys-salary-wrapper"
|
||||
visible={this.props.visible} onCancel={() => {
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.props.onCancel();
|
||||
});
|
||||
}} style={{ width: "60vw" }} scalable
|
||||
buttons={[
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleAdd}>添加</Button>
|
||||
]}
|
||||
>
|
||||
<div className="headerSearchWrapper">
|
||||
<WeaTab datas={[]} keyParam="viewcondition" //主键
|
||||
searchType={["base"]} onSearchChange={name => this.setState({ name })}
|
||||
onSearch={this.getSysItemList}
|
||||
/>
|
||||
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.sysItemRef = dom}
|
||||
style={{
|
||||
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} title={this.renderTitle()}
|
||||
buttons={[<Button type="primary" loading={saveLoading} disabled={_.isEmpty(selectedRowKeys)}
|
||||
onClick={this.handleAdd}>{getLabel(111, "添加")}</Button>]}>
|
||||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} rowSelection={rowSelection}
|
||||
loading={loading} scroll={{ y: this.importRef ? this.sysItemRef.state.height - 16 : 600 }}
|
||||
rowKey="id"/>
|
||||
</Spin>
|
||||
</div>
|
||||
<UnifiedTable
|
||||
loading={loading}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
rowSelection={rowSelection}
|
||||
xWidth={columns.length * 120}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { observable, action, toJS } from "mobx";
|
||||
import { action, observable } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
|
||||
import * as API from "../apis/ledger"; // 引入API接口文件
|
||||
import { notNull } from "../util/validate";
|
||||
import { categoryConditions } from "../pages/ledgerPage/config";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -13,6 +12,11 @@ export class LedgerStore {
|
|||
@observable copyForm = new WeaForm(); // 复制form
|
||||
@observable categoryForm = new WeaForm(); // 新增分类form
|
||||
@observable searchForm = new WeaForm(); // 查询form
|
||||
@observable AARForm = new WeaForm(); // 核算审批规则form
|
||||
@observable AARClassifyForm = new WeaForm(); // 核算审批规则分类编辑form
|
||||
|
||||
@action initAARForm = (v) => this.AARForm = new WeaForm();//重置核算审批规则form
|
||||
@action initAARClassifyForm = (v) => this.AARClassifyForm = new WeaForm();//重置审批规则分类编辑form
|
||||
|
||||
|
||||
/*******************************************************/
|
||||
|
|
@ -562,7 +566,7 @@ export class LedgerStore {
|
|||
salaryItemId: i.salaryItemId,
|
||||
sortedIndex: index + 1,
|
||||
formulaId: i.formulaId,
|
||||
itemHide: i.itemHide || "0",
|
||||
itemHide: i.itemHide || "0"
|
||||
}));
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ const { TableStore } = WeaTableNew;
|
|||
|
||||
export class SalaryItemStore {
|
||||
@observable salarySetform = new WeaForm(); //同步薪资账套form
|
||||
@observable itemsForm = new WeaForm(); //自定义薪资项目form
|
||||
@action initItemsForm = () => this.itemsForm = new WeaForm();
|
||||
|
||||
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable sysListTableStore = new TableStore();
|
||||
|
|
|
|||
Loading…
Reference in New Issue