From 04a368c731917b17afb0d093c87d2228e054cba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 21 Nov 2022 17:50:06 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E7=A6=85=E9=81=93bug132=E3=80=81133?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cumDeduct/components/editSlideContent.js | 34 ++++++++--------- .../cumSituation/editSlideContent.js | 38 +++++++++---------- .../otherDeduct/editSlideContent.js | 19 ++++++++-- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 5 ++- pc4mobx/hrmSalary/stores/cumDeduct.js | 2 +- 5 files changed, 51 insertions(+), 47 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js index 37ea5920..dee64cb5 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/editSlideContent.js @@ -86,27 +86,32 @@ export default class EditSlideContent extends React.Component { }; render() { - const { - taxAgentStore: { taxAgentOption } - } = this.props; const { cumDeductStore } = this.props; const { - slideTableStore, currentRecord, slideColumns, slidePageObj, slideTableDataSource, setSlidePageObj, - slideLoading + slideLoading, + getCumDeductDetailList } = cumDeductStore; const { startDate, endDate, taxAgentId } = this.state; - + const declareMonth = [startDate, endDate]; const pagination = { + current: slidePageObj.current, + pageSize: slidePageObj.pageSize, total: slidePageObj.total, showTotal: (total) => `共 ${total} 条`, showSizeChanger: true, onShowSizeChange(current, pageSize) { setSlidePageObj({ ...slidePageObj, current, pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); }, onChange(current) { setSlidePageObj({ @@ -114,6 +119,10 @@ export default class EditSlideContent extends React.Component { current, pageSize: slidePageObj.pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, current, + declareMonth: _.filter(declareMonth, item => item) + }); } }; const newColumns = _.map([...slideColumns], (item) => ({ ...item })); @@ -169,19 +178,6 @@ export default class EditSlideContent extends React.Component { - {/**/} - {/* 个税扣缴义务人*/} - {/* {*/} - {/* this.setState({ taxAgentId: v });*/} - {/* this.handleFetchCumDeductDetailList(startDate, endDate, v);*/} - {/* }}*/} - {/* />*/} - {/**/}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js index 0c374c99..fc9b430a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js @@ -86,12 +86,10 @@ export default class EditSlideContent extends React.Component { }; render() { - const { - taxAgentStore: { taxAgentOption } - } = this.props; const { cumSituationStore } = this.props; + const { startDate, endDate, taxAgentId } = this.state; const { - slideTableStore, + getCumDeductDetailList, currentRecord, slideColumns, slidePageObj, @@ -99,14 +97,22 @@ export default class EditSlideContent extends React.Component { setSlidePageObj, slideLoading } = cumSituationStore; - const { startDate, endDate, taxAgentId } = this.state; + const declareMonth = [startDate, endDate]; const pagination = { + current: slidePageObj.current, + pageSize: slidePageObj.pageSize, total: slidePageObj.total, showTotal: (total) => `共 ${total} 条`, showSizeChanger: true, onShowSizeChange(current, pageSize) { setSlidePageObj({ ...slidePageObj, current, pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); }, onChange(current) { setSlidePageObj({ @@ -114,6 +120,12 @@ export default class EditSlideContent extends React.Component { current, pageSize: slidePageObj.pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); } }; const newColumns = _.map([...slideColumns], (item) => ({ ...item })); @@ -170,22 +182,6 @@ export default class EditSlideContent extends React.Component {
- {/**/} - {/* 个税扣缴义务人*/} - {/* {*/} - {/* this.setState({ taxAgentId: v });*/} - {/* this.fetchCumDeductDetailList({*/} - {/* declareMonth: [startDate, endDate],*/} - {/* taxAgentId: v,*/} - {/* });*/} - {/* }}*/} - {/* />*/} - {/**/}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js index 3079fa7b..6f464d9e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js @@ -92,12 +92,9 @@ export default class EditSlideContent extends React.Component { }; render() { - const { - taxAgentStore: { taxAgentOption }, - } = this.props; const { otherDeductStore } = this.props; const { - slideTableStore, + getOtherDeductDetailList, currentRecord, slideColumns, slidePageObj, @@ -106,13 +103,22 @@ export default class EditSlideContent extends React.Component { slideLoading, } = otherDeductStore; const { startDate, endDate, taxAgentId } = this.state; + const declareMonth = [startDate, endDate]; const pagination = { + current: slidePageObj.current, + pageSize: slidePageObj.pageSize, total: slidePageObj.total, showTotal: (total) => `共 ${total} 条`, showSizeChanger: true, onShowSizeChange(current, pageSize) { setSlidePageObj({ ...slidePageObj, current, pageSize }); + getOtherDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); }, onChange(current) { setSlidePageObj({ @@ -120,6 +126,11 @@ export default class EditSlideContent extends React.Component { current, pageSize: slidePageObj.pageSize, }); + getOtherDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + declareMonth: _.filter(declareMonth, item => item) + }); }, }; const newColumns = _.map([...slideColumns], (item) => ({ ...item })); diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 4e552d4e..ba3322ff 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -472,7 +472,7 @@ class Index extends Component { ...item, width: item.oldWidth, render: (text) => { - return {text} + return {text}; } }; }); @@ -526,7 +526,8 @@ class Index extends Component { let arrList = []; if (showOperateBtn && isShow === "true" && selectedKey === "fixed") { arrList.push(); } if (showOperateBtn && selectedKey === "fixed") { diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index b276dd0b..44b46552 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -191,7 +191,7 @@ export class CumDeductStore { pageSize }); } else { - this.setSlideTableDataSource(list); + this.setSlideTableDataSource([]); this.setSlidePageObj({ ...this.slidePageObj, total: 0 From 25e76718d244c38124cdb29a5a542cb9215bbabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 23 Nov 2022 15:12:19 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E9=80=80=E5=B7=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 106 +++++--- .../pages/dataAcquisition/addItems.js | 25 +- pc4mobx/hrmSalary/pages/ruleConfig/index.js | 19 +- .../standingBook/index.js | 167 ++++++------- .../standingBookDetail/components/index.less | 56 ++++- .../components/regAddEmployee.js | 227 ++++++++++++++++++ .../components/regEditDetial.js | 53 ++++ .../standingBookDetail/components/regList.js | 153 ++++++++++++ .../standingBookDetail/components/regTop.js | 72 ++++++ .../components/regression.js | 145 +++++++++++ .../standingBookDetail/index.js | 6 +- 11 files changed, 884 insertions(+), 145 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 4c9e41a7..e9a77f3b 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //社会福利台账-获取正常缴纳列表 export const getCommonList = (params) => { @@ -7,9 +8,9 @@ export const getCommonList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -25,9 +26,9 @@ export const getNormalList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-获取补缴列表 @@ -36,9 +37,9 @@ export const getSupplementaryList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -48,9 +49,9 @@ export const getOverViewList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -60,9 +61,9 @@ export const getChangeList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-保存并进入核算 @@ -71,9 +72,9 @@ export const save = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-归档 @@ -82,9 +83,9 @@ export const siaccountFile = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-核算异常列表 @@ -93,9 +94,9 @@ export const inspectList = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-删除正常缴纳人员 @@ -104,9 +105,9 @@ export const siaccountCommonDelete = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-添加正常缴纳人员 @@ -115,9 +116,9 @@ export const siaccountCommonSave = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-添加补缴人员 @@ -126,9 +127,9 @@ export const siaccountSupplementarySave = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-删除月份表单 @@ -137,9 +138,9 @@ export const siaccountDelete = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //社会福利台账-正常缴纳添加缴纳人员表单 @@ -165,9 +166,9 @@ export const commonAccount = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -177,9 +178,9 @@ export const socialSecurityBenefitsRecalculate = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -191,7 +192,7 @@ export const getAdminTaxAgentList = () => { "get", {} ); -} +}; // 表单字段对应的接口 export const getWelfareList = () => { @@ -200,7 +201,7 @@ export const getWelfareList = () => { "get", {} ); -} +}; // 社保福利台账-导入预览 export const welfarePreview = (params) => { @@ -208,11 +209,11 @@ export const welfarePreview = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); -} +}; // 社保福利台账-核算数据导入 export const importInsuranceAcctDetail = (params) => { @@ -220,11 +221,11 @@ export const importInsuranceAcctDetail = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); -} +}; // 社保福利台账-线下对比数据导入 export const importExcelInsuranceDetail = (params) => { @@ -232,8 +233,35 @@ export const importExcelInsuranceDetail = (params) => { method: "post", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); -} +}; + +//获取当前登录人所控制的人员范围 +export const getEmployeeListByTaxAgent = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/getEmployeeListByTaxAgent", params); +}; +//新增退差数据 +export const saveRecession = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/saveRecession", params); +}; +//查询退差列表 +export const recessionList = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params); +}; +//删除退差数据 +export const delRecession = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); +}; +//获取核算项个人和公司社保福利缴纳详情 +export const getPaymentById = ({ id }) => { + return fetch(`/api/bs/hrmsalary/siaccount/getPaymentById?id=${id}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + }).then(res => res.json()); +}; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index b57b8860..f241aca8 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -36,17 +36,17 @@ class AddItems extends Component { taxAgentId: nextProps.editId.taxAgentId, taxAgentName: nextProps.editId.taxAgentName, employeeId: nextProps.editId.employeeId, - employeeName: nextProps.editId.username, + employeeName: nextProps.editId.username } }); - const fields= _.map(nextProps.condition[0].items, it =>{ - return it.domkey[0] - }) + const fields = _.map(nextProps.condition[0].items, it => { + return it.domkey[0]; + }); fields.map(item => { nextProps.form.updateFields({ - [item]: nextProps.editId[item] || '' - }) - }) + [item]: nextProps.editId[item] || "" + }); + }); } } @@ -84,7 +84,7 @@ class AddItems extends Component { viewAttr: _.isEmpty(editId) ? 3 : 1, value: baseInfo.employeeId, valueSpan: baseInfo.employeeName, - onChange: ({ids, names}) => { + onChange: ({ ids, names }) => { this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); } }) @@ -136,7 +136,7 @@ class AddItems extends Component { viewAttr: _.isEmpty(editId) ? 3 : 1, value: baseInfo.employeeId, valueSpan: baseInfo.employeeName, - onChange: ({ids, names}) => { + onChange: ({ ids, names }) => { this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); } }) @@ -180,15 +180,16 @@ class AddItems extends Component { export default AddItems; export const Browser = payload => { - const { label, onChange, viewAttr = 3, value, valueSpan } = payload; + const { label, onChange, viewAttr = 3, value, valueSpan, type = 1, isSingle = true } = payload; return ( onChange({ids, names})}/> + onChange={(ids, names) => onChange({ ids, names })}/> ); }; diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 485dd1dd..38acfb8b 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -339,10 +339,25 @@ class Index extends Component { export default Index; export const Select = payload => { - const { label, onChange, value, options = [], viewAttr = 3 } = payload; + const { + label, + onChange, + value, + options = [], + viewAttr = 3, + detailtype = 1, + multiple = false, + showSearch = false + } = payload; return ( - onChange({ type: label, selected, showName })}/> ); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index 78aefbbb..6dd3e2cc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -45,7 +45,12 @@ export default class StandingBook extends React.Component { list: [], total: 0 }, - adminData: {}, + adminData: { + isDefaultOpen: false, + isAdminEnable: false, + isChief: false, + isOpenDevolution: false + }, progressVisible: false, progress: 0 }; @@ -113,12 +118,12 @@ export default class StandingBook extends React.Component { it = { ...it, render: (text, r) => { - const { billMonth } = r; + const { billMonth, creator } = r; return ( this.handleGoDetail(billMonth, "detail", r.paymentOrganizationId)}> + onClick={() => this.handleGoDetail(billMonth, "detail", r.paymentOrganizationId, creator)}> {text} ); @@ -127,71 +132,73 @@ export default class StandingBook extends React.Component { } return { ...it }; }); + if (!this.state.adminData.isDefaultOpen || (this.state.adminData.isDefaultOpen && this.state.adminData.isAdminEnable)) { + columns = [ + ...columns, + { + title: "操作", + dataIndex: "action", + key: "action", + fixed: "right", + render: (text, r) => { + const { billStatus, billMonth, creator } = r; + return ( + + {billStatus === "未归档" && ( + this.handleGoDetail(billMonth, "", r.paymentOrganizationId, creator)}> + 核算 + + )} + {billStatus === "已归档" && ( + this.socialSecurityBenefitsRecalculate({ id: r.id })}> + 重新核算 + + )} + {billStatus === "未归档" && ( + + this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId, creator }) + }> + 归档 + {/* 异常详情 */} + 删除 + {/* 操作日志 */} + + }> + + + )} + {billStatus === "已归档" && ( + + this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId, creator }) + }> + 查看 + + }> + + + )} + + ); + } + } + ]; + } this.setState({ tableData: { list, - columns: [ - ...columns, - (!this.state.adminData.isDefaultOpen || (this.state.adminData.isDefaultOpen && this.state.adminData.isAdminEnable)) ? { - title: "操作", - dataIndex: "action", - key: "action", - fixed: "right", - render: (text, r) => { - const { billStatus, billMonth } = r; - return ( - - {billStatus === "未归档" && ( - this.handleGoDetail(billMonth, "", r.paymentOrganizationId)}> - 核算 - - )} - {billStatus === "已归档" && ( - this.socialSecurityBenefitsRecalculate({ id: r.id })}> - 重新核算 - - )} - {billStatus === "未归档" && ( - - this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId }) - }> - 归档 - {/* 异常详情 */} - 删除 - {/* 操作日志 */} - - }> - - - )} - {billStatus === "已归档" && ( - - this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId }) - }> - 查看 - {/* 操作日志 */} - - }> - - - )} - - ); - } - } : {} - ], + columns, total }, current: pageNum @@ -236,21 +243,21 @@ export default class StandingBook extends React.Component { }); } - handleGoDetail = (billMonth, detail, paymentOrganization) => { + handleGoDetail = (billMonth, detail, paymentOrganization, creator) => { if (detail) { window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&creator=${creator}` ); } else { window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&creator=${creator}` ); } }; handleOperate = (payload) => { const { siaccountFile, siaccountDelete, deleteLoading } = this.props.standingBookStore; - const { key, billMonth, paymentOrganizationId } = payload; + const { key, billMonth, paymentOrganizationId, creator } = payload; switch (key) { case "archive": Modal.confirm({ @@ -295,7 +302,7 @@ export default class StandingBook extends React.Component { }); break; case "view": - this.handleGoDetail(billMonth, "detail", paymentOrganizationId); + this.handleGoDetail(billMonth, "detail", paymentOrganizationId, creator); break; default: break; @@ -361,15 +368,6 @@ export default class StandingBook extends React.Component { }); }; - handlePageChange(value) { - this.setState({ current: value }); - this.pageInfo.current = value; - this.getCommonList({ - ...this.state.tableParams, - ...this.pageInfo - }); - } - handleShowSizeChange(pageInfo) { this.getCommonList({ ...this.state.tableParams, @@ -383,13 +381,7 @@ export default class StandingBook extends React.Component { inspectLoading, loading, hasRight, - form, - condition, tableStore, - showSearchAd, - getTableDatas, - doSearch, - setShowSearchAd } = standingBookStore; const { list, columns, total } = this.state.tableData; const { startTime, endTime } = this.state.tableParams; @@ -448,9 +440,6 @@ export default class StandingBook extends React.Component { icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 buttons={showOperateBtn ? rightBtns : []} - // showDropIcon={true} // 是否显示下拉按钮 - // dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) - // dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 >
账单月份:
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 0cf8e6be..4170ae45 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -24,7 +24,7 @@ padding: 8px 20px; justify-content: flex-end; - i,button { + i, button { cursor: pointer; margin-right: 10px; } @@ -37,4 +37,56 @@ margin-right: 0px; } } -} \ No newline at end of file +} + +//退差 +.regressionWrapper { + .tdEllipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .optWrapper { + display: flex; + align-items: center; + + i { + cursor: pointer; + } + } + + .wea-new-top-wapper .wea-new-top { + background: #FFF; + + .wea-new-top-title { + font-size: 12px; + + & > span:first-child { + display: none; + } + } + } + + .wea-new-top { + .ant-btn { + border-radius: 0; + padding: 0; + background: transparent; + border: none; + font-size: 18px; + line-height: 18px; + } + + .ant-btn.ant-btn-primary[disabled] { + color: #d8d8d8; + background: transparent; + } + + .ant-btn.ant-btn-primary { + color: #2db7f5; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js new file mode 100644 index 00000000..81e19839 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -0,0 +1,227 @@ +/* + * Author: 黎永顺 + * name: 添加退差人员弹框 + * Description: + * Date: 2022/11/22 + */ +import React, { Component } from "react"; +import { WeaDatePicker, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { Button, Modal } from "antd"; +import { Select } from "../../../ruleConfig"; +import * as API from "../../../../apis/standingBook"; + +class RegAddEmployee extends Component { + constructor(props) { + super(props); + this.state = { + baseInfo: { + billMonth: "", + items: "", + itemsAll: "" + }, + returnPersonInfo: { + employee: "", + employeeOptions: [] + }, + selectPersonInfo: { + employee: "", + employeeOptions: [] + } + }; + } + + componentDidMount() { + this.getEmployeeListByTaxAgent(); + } + + getEmployeeListByTaxAgent = () => { + const { returnPersonInfo, selectPersonInfo } = this.state; + const payload = { + pageNum: 1, + pageSize: 10000, + name: null + }; + API.getEmployeeListByTaxAgent(payload).then(({ status, data }) => { + if (status) { + const { list } = data; + this.setState({ + returnPersonInfo: { + ...returnPersonInfo, + employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username })) + }, + selectPersonInfo: { + ...selectPersonInfo, + employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username })) + } + }); + } + }); + }; + handleReset = () => { + this.setState({ + baseInfo: { + billMonth: "", + items: "", + itemsAll: "" + }, + returnPersonInfo: { + ...this.state.returnPersonInfo, + employee: "" + }, + selectPersonInfo: { + ...this.state.selectPersonInfo, + employee: "" + } + }); + }; + handleSave = () => { + const { baseInfo, returnPersonInfo, selectPersonInfo } = this.state; + const { onSave } = this.props; + const payload = { + recessionMonthList: baseInfo.billMonth.split(","), + projects: baseInfo.itemsAll ? ["0"] : baseInfo.items.split(","), + includes: returnPersonInfo.employee.split(","), + excludes: selectPersonInfo.employee.split(",") + }; + if (_.isEmpty(baseInfo.billMonth) || _.isEmpty(baseInfo.items) || _.isEmpty(returnPersonInfo.employee)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + onSave(payload); + }; + + render() { + const { baseInfo, returnPersonInfo, selectPersonInfo } = this.state; + const buttons = [ + , + + ]; + const baseItems = [ + { + com: Picker({ + label: "退差月份", + value: baseInfo.billMonth, + onChange: (billMonth) => { + this.setState({ baseInfo: { ...baseInfo, billMonth } }); + } + }) + }, + { + com: SelectWithAll({ + label: "退差项目", + options: [ + { key: "1", showname: "社保" }, + { key: "2", showname: "公积金" }, + { key: "3", showname: "企业年金及其他福利" } + ], + detailtype: 2, + valueAll: baseInfo.itemsAll, + value: baseInfo.items, + onChangeAll: ({ selected }) => { + if (selected) { + this.setState({ baseInfo: { ...baseInfo, itemsAll: selected, items: "1,2,3" } }); + } else { + this.setState({ baseInfo: { ...baseInfo, itemsAll: selected, items: "" } }); + } + }, + onChange: ({ selected }) => { + const bool1 = selected.split(",").includes("1"); + const bool2 = selected.split(",").includes("2"); + const bool3 = selected.split(",").includes("3"); + if (bool1 && bool2 && bool3) { + this.setState({ baseInfo: { ...baseInfo, itemsAll: "0", items: selected } }); + } else { + this.setState({ baseInfo: { ...baseInfo, itemsAll: "", items: selected } }); + } + } + }) + } + ]; + const returnPersonItems = [ + { + com: Select({ + multiple: true, + label: "对象", + viewAttr: 3, + showSearch: true, + options: returnPersonInfo.employeeOptions, + value: returnPersonInfo.employee, + onChange: ({ selected }) => { + this.setState({ returnPersonInfo: { ...returnPersonInfo, employee: selected } }); + } + }) + } + ]; + const selectPersonItems = [ + { + com: Select({ + multiple: true, + label: "选择人员", + viewAttr: 2, + showSearch: true, + options: selectPersonInfo.employeeOptions, + value: selectPersonInfo.employee, + onChange: ({ selected }) => { + this.setState({ selectPersonInfo: { ...selectPersonInfo, employee: selected } }); + } + }) + } + ]; + return ( + + + + + + ); + } +} + +export default RegAddEmployee; + + +export const Picker = payload => { + const { label, onChange, value, viewAttr = 3, format = "YYYY-MM" } = payload; + return ( + + + + ); +}; +export const SelectWithAll = payload => { + const { label, onChange, value, valueAll, onChangeAll, options = [], viewAttr = 3, detailtype = 1 } = payload; + return ( + +
+ onChangeAll({ selected, showName })} + style={{ width: "inherit" }} + /> + onChange({ type: label, selected, showName })} + style={{ width: "inherit" }} + /> +
+
+ ); +}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js new file mode 100644 index 00000000..0e8dcb21 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js @@ -0,0 +1,53 @@ +/* + * Author: 黎永顺 + * name:退差编辑页面 + * Description: + * Date: 2022/11/23 + */ +import React, { Component } from "react"; +import { WeaSlideModal } from "ecCom"; +import * as API from "../../../../apis/standingBook"; +import SlideModalTitle from "../../../../components/slideModalTitle"; + +class RegEditDetial extends Component { + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.editId !== this.props.editId && nextProps.editId) { + this.getPaymentById(nextProps.editId); + } + } + + getPaymentById = (id) => { + const payload = { id }; + API.getPaymentById(payload).then(res => { + console.log(res); + }); + }; + + render() { + const { visible, title, onCancel } = this.props; + return ( + + } + content={
123
} + onClose={onCancel} + showMask={true} + /> + ); + } +} + +export default RegEditDetial; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js new file mode 100644 index 00000000..99486ef8 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -0,0 +1,153 @@ +/* + * Author: 黎永顺 + * name: 退差列表 + * Description: + * Date: 2022/11/23 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { getQueryString } from "../../../../util/url"; +import * as API from "../../../../apis/standingBook"; +import "./index.less"; + +class RegList extends Component { + constructor(props) { + super(props); + this.state = { + columns: [], + dataSource: [], + selectedRowKeys: [], + loading: { + query: false + }, + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.recessionList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible) { + this.recessionList(); + } + } + + recessionList = (userName = "") => { + const { loading, pageInfo } = this.state; + const billMonth = getQueryString("billMonth"); + const creator = Number(getQueryString("creator")); + const paymentStatus = getQueryString("paymentOrganization"); + const payload = { + billMonth, paymentStatus, + creator, userName, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + API.recessionList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageInfo: list } = data; + const { columns, list: dataSource, pageNum: current, pageSize, total } = list; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(_.filter(columns, it => it.dataIndex !== "id"), items => { + if (items.dataIndex === "employeeId") { + return { + ...items, + width: 110, + title: "姓名", + fixed: "left", + render: (text, r) => { + const { userName } = r; + return ( + {userName} + ); + } + }; + } + return { + ...items, + title: , + width: 120, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + handleChangeRow = (selectedRowKeys) => { + const { onChangeRowkey } = this.props; + this.setState({ selectedRowKeys }); + onChangeRowkey(selectedRowKeys); + }; + + render() { + const { loading, pageInfo, selectedRowKeys, dataSource, columns } = this.state; + const { onEdit } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => { + this.recessionList(); + }); + }, + onChange: (current) => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => { + this.recessionList(); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: this.handleChangeRow + }; + return ( + { + return ( + + ); + } + } + ]} + dataSource={dataSource} + loading={loading.query} + pagination={pagination} + rowSelection={rowSelection} + scroll={{ x: 900 }} + /> + ); + } +} + +export default RegList; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js new file mode 100644 index 00000000..96107ed0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js @@ -0,0 +1,72 @@ +import React, { Component } from "react"; +import { Button } from "antd"; +import { WeaHelpfulTip, WeaInputSearch, WeaTop } from "ecCom"; +import { getQueryString } from "../../../../util/url"; + +class RegTop extends Component { + constructor(props) { + super(props); + this.state = { + name: "" + }; + } + + renderTopBtns = () => { + const { name } = this.state; + const { onChange, selectKey } = this.props; + const type = getQueryString("type"); + let dom = [ + +
提示:
+
个人合计=社保个人合计+公积金个人合计+其他福利个人合计
+
单位合计=社保单位合计+公积金单位合计+其他福利单位合计
+
社保合计=社保个人合计+社保单位合计
+
公积金合计=公积金个人合计+公积金单位合计
+
其他福利合计=其他福利个人合计+其他福利单位合计
+
合计=社保合计+公积金合计+其他福利合计
+
+ } + placement="bottomRight" + width={250} + />, + , + this.setState({ name })} + onSearch={() => onChange("search")} + /> + ]; + if (!type) { + const [dom1, ...extra] = dom; + dom = [ + dom1, + , + , + ...extra + ]; + } + return dom; + }; + + render() { + const { billMonth } = this.props; + return ( + 账单月份{billMonth}} + buttons={this.renderTopBtns()} + /> + ); + } +} + +export default RegTop; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js new file mode 100644 index 00000000..a38ce115 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js @@ -0,0 +1,145 @@ +/* + * Author: 黎永顺 + * name: 退差组件 + * Description: + * Date: 2022/11/22 + */ +import React, { Component } from "react"; +import { message, Modal } from "antd"; +import RegTop from "./regTop"; +import RegList from "./regList"; +import RegAddEmployee from "./regAddEmployee"; +import RegEditDetial from "./regEditDetial"; +import { getQueryString } from "../../../../util/url"; +import * as API from "../../../../apis/standingBook"; +import "./index.less"; + +class Regression extends Component { + constructor(props) { + super(props); + this.state = { + selectKey: [], + returnPersonModal: { + title: "添加退差人员", + visible: false + }, + returnEditPersonSlide: { + title: "", + editId: "", + visible: false + } + }; + this.regEmmployeeRef = null; + this.regListRef = null; + this.regTopRef = null; + } + + delRecession = () => { + const { selectKey } = this.state; + API.delRecession(selectKey).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.regListRef.recessionList(); + this.setState({ selectKey: [] }); + } else { + message.error(errormsg || "删除失败"); + } + }); + }; + handleSave = (params) => { + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + const payload = { + ...params, + billMonth, + paymentOrganization + }; + API.saveRecession(payload).then(({ status, errormsg }) => { + if (status) { + message.success("操作成功。若退差月无核算明细,账单月则无法获取退差数据。"); + this.handleCloseModal(); + } else { + message.error(errormsg || "操作失败"); + } + }); + }; + handleChangeOpt = (key) => { + const { returnPersonModal } = this.state; + const name = this.regTopRef.state.name; + const billMonth = getQueryString("billMonth"); + const creator = Number(getQueryString("creator")); + switch (key) { + case "add": + this.setState({ returnPersonModal: { ...returnPersonModal, visible: true } }); + break; + case "delete": + Modal.confirm({ + title: "信息确认", + content: "删除人员本账单月将不包含该人员的退差数据!", + onOk: () => { + this.delRecession(); + }, + onCancel: () => { + } + }); + break; + case "export": + const url = `${window.location.origin}/api/bs/hrmsalary/welfare/recession/export?creator=${creator}&billMonth=${billMonth}`; + window.open(url, "_self"); + break; + case "search": + this.regListRef.recessionList(name); + break; + default: + break; + } + }; + handleCloseModal = () => { + const { returnPersonModal, returnEditPersonSlide } = this.state; + this.setState({ + returnPersonModal: { ...returnPersonModal, visible: false, title: "添加退差人员" }, + returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" } + }, () => { + this.regEmmployeeRef.handleReset(); + }); + }; + handleEdit = (record) => { + const { userName, id: editId } = record; + const { returnEditPersonSlide } = this.state; + this.setState({ + returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId } + }); + }; + + render() { + const billMonth = getQueryString("billMonth"); + const { returnPersonModal, returnEditPersonSlide, selectKey } = this.state; + return ( +
+ this.regTopRef = dom} + billMonth={billMonth} + onChange={this.handleChangeOpt} + selectKey={selectKey} + /> + this.regListRef = dom} + visible={returnPersonModal.visible} + onChangeRowkey={(selectKey) => this.setState({ selectKey })} + onEdit={this.handleEdit} + /> + {/*编辑弹框*/} + + {/* 弹框 */} + this.regEmmployeeRef = dom} + {...returnPersonModal} + onCancel={this.handleCloseModal} + onSave={this.handleSave} + /> +
+ ); + } +} + +export default Regression; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js index 9fa45933..75b41a1b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js @@ -10,6 +10,7 @@ import { WeaTab } from "ecCom"; import NormalIndex from "./components/normal"; import OverViewIndex from "./components/overView"; import AbnormalListIndex from "./components/abnormalList"; +import Regression from "./components/regression"; @inject("standingBookStore") @observer @@ -27,7 +28,6 @@ class StandingBookDetail extends Component { } componentDidMount() { - this.getTabList(); } @@ -39,6 +39,7 @@ class StandingBookDetail extends Component { getTabList({ billMonth, paymentOrganization: this.paymentOrganization }).then(({ data }) => { const { tabList, remarks, billMonth } = data; let newTabList = tabList.filter(item => item.id != "2"); + newTabList[newTabList.length - 2] = newTabList.splice(newTabList.length - 1, 1, newTabList[newTabList.length - 2])[0] this.setState({ selectedKey: newTabList[0].id, tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })), @@ -72,6 +73,9 @@ class StandingBookDetail extends Component { selectedKey === "4" && } + { + selectedKey === "5" && + }
); } From c468ff35ffa211396b58b9d28dfb004f993fa71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 23 Nov 2022 15:42:51 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E6=89=A3=E7=BC=B4?= =?UTF-8?q?=E4=B9=89=E5=8A=A1=E4=BA=BA=E6=B7=BB=E5=8A=A0=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=8C=83=E5=9B=B4=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 11 +++++++++ pc4mobx/hrmSalary/pages/taxAgent/index.js | 27 +++++++++++++++++++---- pc4mobx/hrmSalary/stores/taxAgent.js | 6 ++++- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index e5177c4d..d68e965d 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -12,6 +12,17 @@ export const getTaxAgentList = (params) => { body: JSON.stringify(params), }).then((res) => res.json()); }; +//同步人员范围 +export const taxAgentRangeSync = (params) => { + return fetch("/api/bs/hrmsalary/taxAgent/range/sync", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(params), + }).then((res) => res.json()); +}; // 系统管理员权限 export const getPermission = (params) => { diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index d599b779..26356da9 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -1,6 +1,6 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Col, message, Modal, Row, Switch } from "antd"; +import { Button, Col, message, Modal, Row, Switch } from "antd"; import { WeaFormItem, WeaRightMenu, WeaSearchGroup, WeaTable, WeaTop } from "ecCom"; import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import EditModal from "./editModal"; @@ -28,7 +28,8 @@ export default class TaxAgent extends React.Component { devolutionStatus: 0, conditions: editConditions, decentralizationConditions: decentralizationConditions, - permission: {} + permission: {}, + syncLoading: false }; } @@ -120,7 +121,7 @@ export default class TaxAgent extends React.Component { this.setState( { conditions: [{ defaultshow: true, items: conditionMap }], - decentralizationConditions: [{ defaultshow: true, items: conditionMap }], + decentralizationConditions: [{ defaultshow: true, items: conditionMap }] }, () => { devolutionStatus === 1 ? getCondition(this.state.conditions) : getFormDecentralizationCondition(this.state.decentralizationConditions); @@ -268,6 +269,19 @@ export default class TaxAgent extends React.Component { } }); }; + taxAgentRangeSync = () => { + const { taxAgentStore } = this.props; + const { taxAgentRangeSync, getTaxAgentList } = taxAgentStore; + this.setState({ syncLoading: true }); + taxAgentRangeSync({}).then(({ status, data }) => { + this.setState({ syncLoading: false }); + if (status) { + message.success(data || "操作成功"); + getTaxAgentList(); + } + }); + }; + render() { const { taxAgentStore } = this.props; @@ -277,7 +291,8 @@ export default class TaxAgent extends React.Component { devolutionStatus, conditions, decentralizationConditions, - permission + permission, + syncLoading } = this.state; const { loading, @@ -293,6 +308,9 @@ export default class TaxAgent extends React.Component { return renderNoright(); } + const btns = [ + + ]; const renderTipsLabel = () => { const tipList = [ "1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;", @@ -376,6 +394,7 @@ export default class TaxAgent extends React.Component { title="个税扣缴义务人" // 文字 icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 + buttons={btns} showDropIcon={true}> (this.showSearchAd = bool); + @action("同步人员范围") + taxAgentRangeSync = params => { + return API.taxAgentRangeSync(params); + }; + // 高级搜索 - 搜索 @action doSearch = name => { From f8169a9080e90af2dad7bcb79fb275b94a054a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 23 Nov 2022 16:50:43 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E6=89=A3=E7=BC=B4?= =?UTF-8?q?=E4=B9=89=E5=8A=A1=E4=BA=BA=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/taxAgent/index.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index 26356da9..66e84489 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { Button, Col, message, Modal, Row, Switch } from "antd"; -import { WeaFormItem, WeaRightMenu, WeaSearchGroup, WeaTable, WeaTop } from "ecCom"; +import { WeaFormItem, WeaRightMenu, WeaSearchGroup, WeaTable, WeaTop, WeaInputSearch } from "ecCom"; import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import EditModal from "./editModal"; import TipLabel from "../../components/TipLabel"; @@ -14,6 +14,7 @@ export default class TaxAgent extends React.Component { constructor(props) { super(props); this.state = { + name: '', editModalProps: { title: "新增个税扣缴义务人", visible: false, @@ -292,7 +293,8 @@ export default class TaxAgent extends React.Component { conditions, decentralizationConditions, permission, - syncLoading + syncLoading, + name } = this.state; const { loading, @@ -300,7 +302,8 @@ export default class TaxAgent extends React.Component { dataSource, columns, doInit, - hasRight + hasRight, + getTaxAgentList } = taxAgentStore; if (!hasRight && !loading) { @@ -309,7 +312,14 @@ export default class TaxAgent extends React.Component { } const btns = [ - + , + this.setState({ name })} + onSearch={() => getTaxAgentList({name})} + /> ]; const renderTipsLabel = () => { const tipList = [ From 510f13009d1463b335aaab129001a3219a055905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 24 Nov 2022 15:56:10 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=8F=B0=E8=B4=A6=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E9=80=80?= =?UTF-8?q?=E5=B7=AE=E5=8A=9F=E8=83=BD=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 4 + .../standingBook/index.js | 20 +- .../components/regAddEmployee.js | 3 +- .../components/regEditDetial.js | 217 +++++++++++++++++- .../components/regression.js | 9 +- .../standingBookDetail/constant.js | 18 ++ 6 files changed, 259 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index e9a77f3b..24da62d4 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -255,6 +255,10 @@ export const recessionList = (params) => { export const delRecession = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); }; +//编辑社保福利缴纳数据 +export const editAccount = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/editAccount", params); +}; //获取核算项个人和公司社保福利缴纳详情 export const getPaymentById = ({ id }) => { return fetch(`/api/bs/hrmsalary/siaccount/getPaymentById?id=${id}`, { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index 6dd3e2cc..d8cb4cf3 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -165,7 +165,12 @@ export default class StandingBook extends React.Component { overlay={ - this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId, creator }) + this.handleOperate({ + key, + billMonth, + paymentOrganizationId: r.paymentOrganizationId, + creator + }) }> 归档 {/* 异常详情 */} @@ -181,7 +186,12 @@ export default class StandingBook extends React.Component { overlay={ - this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId, creator }) + this.handleOperate({ + key, + billMonth, + paymentOrganizationId: r.paymentOrganizationId, + creator + }) }> 查看 @@ -315,7 +325,7 @@ export default class StandingBook extends React.Component { billMonth: moment(billMonth).format("YYYY-MM"), ...extra }; - save(payload).then(() => { + save(payload).then(({ data }) => { this.setState({ progressVisible: true }, () => { @@ -336,7 +346,7 @@ export default class StandingBook extends React.Component { ...this.state.tableParams, current: this.state.current }); - this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : ""); + this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", data); }); } }, 1000); @@ -381,7 +391,7 @@ export default class StandingBook extends React.Component { inspectLoading, loading, hasRight, - tableStore, + tableStore } = standingBookStore; const { list, columns, total } = this.state.tableData; const { startTime, endTime } = this.state.tableParams; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js index 81e19839..82cad6e9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -95,8 +95,9 @@ class RegAddEmployee extends Component { render() { const { baseInfo, returnPersonInfo, selectPersonInfo } = this.state; + const { loading } = this.props; const buttons = [ - , + , ]; const baseItems = [ diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js index 0e8dcb21..8eb47e38 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js @@ -5,11 +5,84 @@ * Date: 2022/11/23 */ import React, { Component } from "react"; -import { WeaSlideModal } from "ecCom"; +import { WeaInput, WeaSearchGroup, WeaSlideModal, WeaTable } from "ecCom"; +import { message } from "antd"; import * as API from "../../../../apis/standingBook"; import SlideModalTitle from "../../../../components/slideModalTitle"; +import { regColumns } from "../constant"; class RegEditDetial extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + listMap: [ + { + key: "social", + label: "社保", + dataSource: [], + columns: _.map(regColumns, item => { + if (item.dataIndex === "personalPaymentAmount" || item.dataIndex === "companyPaymentAmount") { + return { + ...item, + render: (text, record) => { + return ( + this.handleChange("social", item.dataIndex, v, record)} + /> + ); + } + }; + } + return { ...item }; + }) + }, + { + key: "fund", + label: "公积金", + dataSource: [], + columns: _.map(regColumns, item => { + if (item.dataIndex === "personalPaymentAmount" || item.dataIndex === "companyPaymentAmount") { + return { + ...item, + render: (text, record) => { + return ( + this.handleChange("fund", item.dataIndex, v, record)} + /> + ); + } + }; + } + return { ...item }; + }) + }, + { + key: "other", + label: "企业年金及其他福利", + dataSource: [], + columns: _.map(regColumns, item => { + if (item.dataIndex === "personalPaymentAmount" || item.dataIndex === "companyPaymentAmount") { + return { + ...item, + render: (text, record) => { + return ( + this.handleChange("other", item.dataIndex, v, record)} + /> + ); + } + }; + } + return { ...item }; + }) + } + ] + }; + } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.editId !== this.props.editId && nextProps.editId) { @@ -17,15 +90,138 @@ class RegEditDetial extends Component { } } + handleSave = () => { + const { editId, onCancel } = this.props; + const { listMap } = this.state; + const [socialData, foundData, otherData] = listMap; + let payload = { + editId, + socialPerJson: {}, + socialComJson: {}, + fundPerJson: {}, + fundComJson: {}, + otherPerJson: {}, + otherComJson: {} + }; + _.forEach(socialData.dataSource, item => { + payload["socialPerJson"][item["insuranceId"]] = item.personalPaymentAmount; + payload["socialComJson"][item["insuranceId"]] = item.companyPaymentAmount; + }); + _.forEach(foundData.dataSource, item => { + payload["fundPerJson"][item["insuranceId"]] = item.personalPaymentAmount; + payload["fundComJson"][item["insuranceId"]] = item.companyPaymentAmount; + }); + _.forEach(otherData.dataSource, item => { + payload["otherPerJson"][item["insuranceId"]] = item.personalPaymentAmount; + payload["otherComJson"][item["insuranceId"]] = item.companyPaymentAmount; + }); + _.forEach(Object.keys(payload), item => { + payload[item] = JSON.stringify(payload[item]); + }); + this.setState({ loading: true }); + API.editAccount(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + onCancel(); + } else { + message.error(errormsg || "保存成功"); + } + }); + }; + handleChange = (type, dataIndex, value, record) => { + const { listMap } = this.state; + const [socialData, foundData, otherData] = listMap; + switch (type) { + case "social": + const sociallist = _.map(socialData.dataSource, item => { + if (item.insuranceId === record.insuranceId) { + return { ...item, [dataIndex]: value }; + } + return { ...item }; + }); + this.setState({ + listMap: [{ ...socialData, dataSource: sociallist }, { ...foundData }, { ...otherData }] + }); + break; + case "fund": + const fundlist = _.map(socialData.dataSource, item => { + if (item.insuranceId === record.insuranceId) { + return { ...item, [dataIndex]: value }; + } + return { ...item }; + }); + this.setState({ + listMap: [{ ...socialData }, { ...foundData, dataSource: fundlist }, { ...otherData }] + }); + break; + case "other": + const otherlist = _.map(socialData.dataSource, item => { + if (item.insuranceId === record.insuranceId) { + return { ...item, [dataIndex]: value }; + } + return { ...item }; + }); + this.setState({ + listMap: [{ ...socialData }, { ...foundData }, { ...otherData, dataSource: otherlist }] + }); + break; + default: + break; + } + + }; getPaymentById = (id) => { const payload = { id }; - API.getPaymentById(payload).then(res => { - console.log(res); + const { listMap } = this.state; + const [socialData, foundData, otherData] = listMap; + API.getPaymentById(payload).then(({ status, data }) => { + if (status) { + let socialSecurity = [], accumulationFund = [], otherBenefits = []; + const { data: result } = data; + _.map(result, it => { + if (it.title.indexOf("社保") !== -1) { + socialSecurity.push(it); + } + if (it.title.indexOf("公积金") !== -1) { + accumulationFund.push(it); + } + if (it.title.indexOf("其他") !== -1) { + otherBenefits.push(it); + } + }); + const social = this.combinedData(socialSecurity, result); + const fund = this.combinedData(accumulationFund, result); + const other = this.combinedData(otherBenefits, result); + this.setState({ + listMap: [{ ...socialData, dataSource: social }, { ...foundData, dataSource: fund }, { + ...otherData, + dataSource: other + }] + }); + } }); }; + combinedData = (data = []) => { + const fieldItems = _.map(data, item => item.insuranceName); + let result = []; + result = _.map(_.uniqWith(fieldItems, _.isEqual), item => { + let obj = { benefits: item }; + _.forEach(data, it => { + if (item === it.insuranceName && it.paymentScope === "个人") { + obj = _.assign(obj, { ...it, personalPaymentAmount: it.insuranceValue }); + } else if (item === it.insuranceName && it.paymentScope === "公司") { + obj = _.assign(obj, { ...it, companyPaymentAmount: it.insuranceValue }); + } + }); + return obj; + }); + return result; + }; render() { const { visible, title, onCancel } = this.props; + const { listMap, loading } = this.state; return ( } - content={
123
} + content={ +
+ { + _.map(listMap, item => { + const { key, label, dataSource, columns } = item; + return + + ; + }) + } +
+ } onClose={onCancel} showMask={true} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js index a38ce115..4ff35c15 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js @@ -27,7 +27,8 @@ class Regression extends Component { title: "", editId: "", visible: false - } + }, + loading: { save: false } }; this.regEmmployeeRef = null; this.regListRef = null; @@ -47,6 +48,7 @@ class Regression extends Component { }); }; handleSave = (params) => { + const { loading } = this.state; const billMonth = getQueryString("billMonth"); const paymentOrganization = getQueryString("paymentOrganization"); const payload = { @@ -54,7 +56,9 @@ class Regression extends Component { billMonth, paymentOrganization }; + this.setState({ loading: { ...loading, save: true } }); API.saveRecession(payload).then(({ status, errormsg }) => { + this.setState({ loading: { ...loading, save: false } }); if (status) { message.success("操作成功。若退差月无核算明细,账单月则无法获取退差数据。"); this.handleCloseModal(); @@ -113,7 +117,7 @@ class Regression extends Component { render() { const billMonth = getQueryString("billMonth"); - const { returnPersonModal, returnEditPersonSlide, selectKey } = this.state; + const { returnPersonModal, returnEditPersonSlide, selectKey, loading } = this.state; return (
this.regEmmployeeRef = dom} {...returnPersonModal} + loading={loading} onCancel={this.handleCloseModal} onSave={this.handleSave} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js index 98b0539a..6b2634c3 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js @@ -30,3 +30,21 @@ export const archiveTabs = [ viewcondition: "OVERVIEW", }, ]; + +export const regColumns = [ + { + title: '福利项', + dataIndex: 'benefits', + key: 'benefits', + }, + { + title: '个人缴纳金额', + dataIndex: 'personalPaymentAmount', + key: 'personalPaymentAmount', + }, + { + title: '单位缴纳金额', + dataIndex: 'companyPaymentAmount', + key: 'companyPaymentAmount', + }, +]; From 32072512a9213076fd63a192cdb5948b7c40d198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 24 Nov 2022 17:36:00 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=B8=E7=AE=97=E4=BA=BA=E5=91=98=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculateDetail/index.js | 64 ++++++++++++------- .../pages/calculateDetail/salaryDetail.js | 6 +- pc4mobx/hrmSalary/stores/calculate.js | 11 ++-- 3 files changed, 50 insertions(+), 31 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index d59b9429..53550cee 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -3,11 +3,13 @@ import UserSure from "./userSure"; import { inject, observer } from "mobx-react"; import SalaryDetail from "./salaryDetail"; import { Button, Dropdown, Menu, message, Modal } from "antd"; -import { WeaBrowser, WeaCheckbox, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; +import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; import { getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; +const { ButtonSelect } = WeaDropdown; + @inject("calculateStore", "salaryFileStore") @observer export default class CalculateDetail extends React.Component { @@ -27,7 +29,8 @@ export default class CalculateDetail extends React.Component { fieldData: {}, acctResultImportVisiable: false, progressVisible: false, - progress: 0 + progress: 0, + accountIds: [] }; this.id = ""; this.timer; @@ -100,8 +103,8 @@ export default class CalculateDetail extends React.Component { this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -126,19 +129,23 @@ export default class CalculateDetail extends React.Component { }; // 核算点击事件 - handleAccount() { + handleAccount = (key) => { const { calculateStore } = this.props; - const { - acctresultAccounting, - acctResultList, - getCalculateProgress - } = calculateStore; + const { acctresultAccounting, getCalculateProgress } = calculateStore; + if (key === "SELECT" && _.isEmpty(this.state.accountIds)) { + message.warning("请先选择表格数据"); + return; + } Modal.confirm({ title: "信息确认", content: "点击核算,公式项将按照公式逻辑核算,核算结果将覆盖原数据", onOk: () => { this.setState({ progress: 0 }); - acctresultAccounting(this.id).then(() => { + let payload = { salaryAcctRecordId: this.id }; + if (key === "SELECT") { + payload = _.assign(payload, { employeeIds: this.state.accountIds }); + } + acctresultAccounting(payload).then(() => { this.setState({ progressVisible: true }); @@ -152,7 +159,8 @@ export default class CalculateDetail extends React.Component { clearInterval(this.timer); this.timer = null; this.setState({ - progressVisible: false + progressVisible: false, + accountIds: [] }); message.success("核算完成"); // acctResultList({ salaryAcctRecordId: this.id }); @@ -163,7 +171,7 @@ export default class CalculateDetail extends React.Component { listType: "", url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { - salaryAcctRecordId, + salaryAcctRecordId } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -171,7 +179,8 @@ export default class CalculateDetail extends React.Component { clearInterval(this.timer); this.timer = null; this.setState({ - progressVisible: false + progressVisible: false, + accountIds: [] }); message.error(data.message); } @@ -183,7 +192,7 @@ export default class CalculateDetail extends React.Component { onCancel() { } }); - } + }; // 更多选项点击 handleMenuClick = e => { @@ -199,7 +208,7 @@ export default class CalculateDetail extends React.Component { ); } else if (e.key == "3") { window.open( - '/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=' + this.id +"&ids=" + "/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + this.id + "&ids=" ); } }; @@ -223,7 +232,7 @@ export default class CalculateDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - ...params, + ...params } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -248,11 +257,19 @@ export default class CalculateDetail extends React.Component { const renderRightOperation = () => { return [ - , + this.handleAccount(key)} + />, + // , 更多 @@ -333,7 +350,8 @@ export default class CalculateDetail extends React.Component { searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username /> {selectedKey == 0 && } - {selectedKey == 1 && } + {selectedKey == 1 && this.setState({ accountIds: ids })} + employeeName={this.state.searchValue}/>} {acctResultImportVisiable &&