From 49fb95755090a1803b7435c0b67e5992e93931c3 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, 16 Mar 2023 09:05:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/calculateDetail/userSure.js | 25 +++ .../externalPersonManageEditSlide.js | 39 ++++- .../pages/externalPersonManage/conditions.js | 164 ++++++++++-------- .../components/ledgerAssociatedPersonnel.js | 4 +- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 2 +- pc4mobx/hrmSalary/util/index.js | 68 ++++---- 6 files changed, 185 insertions(+), 117 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index e74a8d8a..d0701591 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -497,6 +497,31 @@ export default class UserSure extends React.Component { title="提示:环比上期当前选择的账套归档的各个税扣缴义务人下增加的人员" placement="topLeft" /> + | + { + this.setState({ selectedKey: "3" }, () => { + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const payload = { + type: "PC", + listType: "MA", + url: "/api/bs/hrmsalary/salaryacct/addedemployee/list", + queryParams: { + salaryAcctRecordId, + employeeName: this.state.userListSearchValue + } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); + }); + }}> + 非系统人员 +
{ if (status) { const { - departmentName, departmentId, subcompanyName, subcompanyId, - jobtitleName, jobtitleId, ...extraFormfields + departmentOrgName, departmentId, subcompanyOrgName, subcompanyId, + jobtitleOrgName, jobtitleId, ...extraFormfields } = data; form.updateFields({ "departmentId": { value: departmentId, - valueSpan: departmentName, - valueObj: [{ id: departmentId, name: departmentName }] + valueSpan: departmentOrgName, + valueObj: [{ id: departmentId, name: departmentOrgName }] } }); form.updateFields({ "subcompanyId": { value: subcompanyId, - valueSpan: departmentName, - valueObj: [{ id: subcompanyId, name: subcompanyName }] + valueSpan: subcompanyOrgName, + valueObj: [{ id: subcompanyId, name: subcompanyOrgName }] } }); form.updateFields({ "jobtitleId": { value: jobtitleId, - valueSpan: jobtitleName, - valueObj: [{ id: jobtitleId, name: jobtitleName }] + valueSpan: jobtitleOrgName, + valueObj: [{ id: jobtitleId, name: jobtitleOrgName }] } }); _.map(_.keys(extraFormfields), item => { @@ -64,6 +64,20 @@ class ExternalPersonManageEditSlide extends Component { const { form, id, onCancel, title } = this.props; form.validateForm().then(f => { if (f.isValid) { + const tmpV = _.reduce(_.keys(form.getFormDatas()), (pre, cur) => { + if (cur === "departmentId") { + return _.assign(pre, { + [cur]: form.getFormDatas()[cur].value, + departmentName: form.getFormDatas()["departmentId"].valueSpan + }); + } else if (cur === "subcompanyId") { + return _.assign(pre, { + [cur]: form.getFormDatas()[cur].value, + subcompanyName: form.getFormDatas()["subcompanyId"].valueSpan + }); + } + return _.assign(pre, { [cur]: form.getFormDatas()[cur].value }); + }, {}); const payload = _.omitBy(form.getFormParams(), _.isEmpty); this.setState({ loading: true }); const APIFOX = !id ? save : update; @@ -82,6 +96,13 @@ class ExternalPersonManageEditSlide extends Component { } }); }; + handleFormChange = (res) => { + const { form, id } = this.props; + if (!id && (_.keys(res)[0] === "departmentId" || _.keys(res)[0] === "subcompanyId")) { + const key = _.replace(_.keys(res)[0], "Id", "Name"); + form.updateFields({ [key]: res[_.keys(res)[0]].valueSpan || "" }); + } + }; render() { const { loading } = this.state; @@ -106,7 +127,7 @@ class ExternalPersonManageEditSlide extends Component { onSave={this.handleSubmit} /> } - content={getSearchs(form, condition, 1)} + content={getSearchs(form, condition, 1, false, this.handleFormChange)} onClose={onCancel} /> ); diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js index 2afc57f0..f150bfdc 100644 --- a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js @@ -9,11 +9,11 @@ export const searchCondition = [ label: "姓名", labelcol: 8, value: "", - viewAttr: 2, + viewAttr: 2 } ], - defaultshow: true, - }, + defaultshow: true + } ]; export const condition = [ { @@ -27,68 +27,88 @@ export const condition = [ label: "姓名", labelcol: 6, value: "", - viewAttr: 3, + viewAttr: 3 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "部门", + type: "57", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["departmentId"], + fieldcol: 18, + label: "部门", + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentName"], + fieldcol: 18, + label: "部门名称", + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "分部", + type: "164", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyId"], + fieldcol: 18, + label: "分部", + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["subcompanyName"], + fieldcol: 18, + label: "分部名称", + labelcol: 6, + value: "", + viewAttr: 2 }, - // { - // browserConditionParam: { - // completeParams: {}, - // conditionDataParams: {}, - // dataParams: {}, - // destDataParams: {}, - // hasAddBtn: false, - // hasAdvanceSerach: false, - // idSeparator: ",", - // isAutoComplete: 1, - // isDetail: 0, - // isMultCheckbox: false, - // isSingle: true, - // icon: "icon-coms-hrm", - // linkUrl: "", - // pageSize: 10, - // quickSearchName: "", - // replaceDatas: [], - // title: "部门", - // type: "57", - // viewAttr: 2, - // }, - // colSpan: 1, - // conditionType: "BROWSER", - // domkey: ["departmentId"], - // fieldcol: 18, - // label: "部门", - // labelcol: 6, - // viewAttr: 2, - // }, - // { - // browserConditionParam: { - // completeParams: {}, - // conditionDataParams: {}, - // dataParams: {}, - // destDataParams: {}, - // hasAddBtn: false, - // hasAdvanceSerach: false, - // idSeparator: ",", - // isAutoComplete: 1, - // isDetail: 0, - // isMultCheckbox: false, - // isSingle: true, - // icon: "icon-coms-hrm", - // linkUrl: "", - // pageSize: 10, - // quickSearchName: "", - // replaceDatas: [], - // title: "分部", - // type: "164", - // viewAttr: 2, - // }, - // colSpan: 1, - // conditionType: "BROWSER", - // domkey: ["subcompanyId"], - // fieldcol: 18, - // label: "分部", - // labelcol: 6, - // viewAttr: 2, - // }, // { // browserConditionParam: { // completeParams: {}, @@ -127,7 +147,7 @@ export const condition = [ label: "入职日期", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -137,7 +157,7 @@ export const condition = [ label: "手机", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -147,7 +167,7 @@ export const condition = [ label: "工号", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -157,7 +177,7 @@ export const condition = [ label: "身份证号码", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -167,7 +187,7 @@ export const condition = [ label: "本人开户的银行卡卡号", labelcol: 6, value: "", - viewAttr: 2, + viewAttr: 2 }, { colSpan: 1, @@ -177,10 +197,10 @@ export const condition = [ label: "本人开户的银行卡开户支行全称", labelcol: 6, value: "", - viewAttr: 2, - }, + viewAttr: 2 + } ], defaultshow: true, title: "基本信息" - }, + } ]; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index ae587725..723b56b3 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -66,8 +66,8 @@ class LedgerAssociatedPersonnel extends Component { * Date: 2023/3/14 */ handleSaveExternalPerson = (val) => { - const { editId: salarySobId } = this.props; - saveLedgerPersonExtRange({ ...val, salarySobId }).then(({ status, errormsg }) => { + const { editId: salarySobId, saveSalarySobId } = this.props; + saveLedgerPersonExtRange({ ...val, salarySobId: salarySobId || saveSalarySobId }).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { message.success("保存成功"); diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 1c642e24..aa20841e 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -679,7 +679,7 @@ class Index extends Component { this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList"); break; case "stop": - this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList"); + this.queryList("/api/bs/hrmsalary/salaryArchive/stopList"); break; default: this.queryList("/api/bs/hrmsalary/salaryArchive/extList"); diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index ffaa1956..f49caf6e 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -1,6 +1,7 @@ -import { Spin } from 'antd'; -import { WeaSwitch } from 'comsMobx'; -import { WeaLocaleProvider, WeaAlertPage, WeaSearchGroup, WeaFormItem } from 'ecCom'; +import { Spin } from "antd"; +import { WeaSwitch } from "comsMobx"; +import { WeaAlertPage, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; + const getLabel = WeaLocaleProvider.getLabel; // 渲染form表单: 一般对form的渲染都统一使用该方法 @@ -10,14 +11,14 @@ export const getCustomSearchs = (form, condition, col, isCenter) => { let items = []; let group = []; isFormInit && condition && - condition.map(c =>{ + condition.map(c => { c.items.map(fields => { items.push({ - com:( + com: ( @@ -27,39 +28,39 @@ export const getCustomSearchs = (form, condition, col, isCenter) => { formParams={formParams} /> ), - colSpan:1, - }) + colSpan: 1 + }); }); }); - if(items.length > 0) { + if (items.length > 0) { group.push( ) + />); return group; } -} +}; // 渲染form表单: 一般对form的渲染都统一使用该方法 -export const getSearchs = (form, condition, col, isCenter) => { +export const getSearchs = (form, condition, col, isCenter, onChange = () => void (0)) => { const { isFormInit } = form; const formParams = form.getFormParams(); let group = []; - isFormInit && condition && condition.map(c =>{ + isFormInit && condition && condition.map(c => { let items = []; c.items.map(fields => { items.push({ - com:( + com: ( @@ -67,39 +68,40 @@ export const getSearchs = (form, condition, col, isCenter) => { fieldConfig={fields} form={form} formParams={formParams} + onChange={onChange} /> ), - colSpan:1, - }) + colSpan: 1 + }); }); group.push( ) + />); }); return group; -} +}; // 页面加载中效果处理 export const renderLoading = (loading) => (
- +
-) +); // 无权限处理 export const renderNoright = () => (
- {getLabel(2012,'对不起,您暂时没有权限!')} + {getLabel(2012, "对不起,您暂时没有权限!")}
-) +); // 暂无数据处理 export const renderNoData = () => ( @@ -108,13 +110,13 @@ export const renderNoData = () => ( 暂无数据
-) +); //分页计算 -export function calcPageNo (total, pageNo = 1, pageSize = 10, selectDelDataLen = 1) { - const totalPage = Math.ceil((total - selectDelDataLen) / pageSize) // 总页数 - pageNo = pageNo > totalPage ? totalPage : pageNo - pageNo = pageNo < 1 ? 1 : pageNo - return pageNo +export function calcPageNo(total, pageNo = 1, pageSize = 10, selectDelDataLen = 1) { + const totalPage = Math.ceil((total - selectDelDataLen) / pageSize); // 总页数 + pageNo = pageNo > totalPage ? totalPage : pageNo; + pageNo = pageNo < 1 ? 1 : pageNo; + return pageNo; }