From 7d09c5b55b1e083c2d2a01bcbe83cea923f6ffad 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, 25 Oct 2023 15:45:38 +0800 Subject: [PATCH] =?UTF-8?q?hotfix/2.9.42310.02=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=87=E9=9B=86=E6=97=A5=E6=9C=9F=E7=BB=84=E4=BB=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=A4=B1=E8=B4=A5=E7=9A=84bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/excelEditor/index.less | 7 +- .../pages/dataAcquisition/addItems.js | 224 ++++-------------- .../dataAcquisition/cumDeduct/columns.js | 66 +++++- .../pages/dataAcquisition/cumDeduct/index.js | 74 ++++-- .../dataAcquisition/cumSituation/columns.js | 79 +++++- .../dataAcquisition/cumSituation/index.js | 66 ++++-- .../dataAcquisition/otherDeduct/columns.js | 64 ++++- .../dataAcquisition/otherDeduct/index.js | 65 +++-- .../components/condition.js | 55 ++++- .../specialAddDeduction/index.js | 65 +++-- .../socialSecurityBenefits/programme/index.js | 4 +- pc4mobx/hrmSalary/stores/cumDeduct.js | 3 +- pc4mobx/hrmSalary/stores/cumSituation.js | 1 + pc4mobx/hrmSalary/stores/otherDeduct.js | 15 +- pc4mobx/hrmSalary/stores/specialAdd.js | 5 +- pc4mobx/hrmSalary/util/index.js | 4 +- 16 files changed, 520 insertions(+), 277 deletions(-) diff --git a/pc4mobx/hrmSalary/components/excelEditor/index.less b/pc4mobx/hrmSalary/components/excelEditor/index.less index 35de776f..31b28e01 100644 --- a/pc4mobx/hrmSalary/components/excelEditor/index.less +++ b/pc4mobx/hrmSalary/components/excelEditor/index.less @@ -155,6 +155,7 @@ .ant-tree-title { display: inline-block; width: 100%; + max-width: 208px; .funcListTitle { width: 100%; @@ -216,9 +217,9 @@ } .danger { - color: rgb(255, 102, 106)!important; - border: 1px solid rgb(255, 193, 195)!important; - background-color: rgb(255, 223, 224)!important; + color: rgb(255, 102, 106) !important; + border: 1px solid rgb(255, 193, 195) !important; + background-color: rgb(255, 223, 224) !important; } .weapp-excel-code-action-list-variable-tip { diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index 07dcad4d..5b05c2d6 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -4,195 +4,65 @@ * Description: */ import React, { Component } from "react"; -import { WeaBrowser, WeaFormItem, WeaInput, WeaSearchGroup } from "ecCom"; -import { getSearchs } from "../../util"; -import { Select } from "../ruleConfig"; -import { PickDate } from "../appConfig"; +import { WeaBrowser, WeaFormItem } from "ecCom"; +import { getDomkes, getSearchs } from "../../util"; import "./index.less"; class AddItems extends Component { - constructor(props) { - super(props); - this.state = { - baseInfo: { - declareMonth: "", - taxAgentId: "", - taxAgentName: "", - employeeId: "", - employeeName: "", - personArea: "ORGANIZATION", - username: "", - idcard: "" - } - }; - } - componentDidMount() { - this.setState({ - baseInfo: { - ...this.state.baseInfo, - declareMonth: this.props.editId.declareMonth || this.props.editId.taxYearMonth, - taxAgentId: this.props.editId.taxAgentId, - taxAgentName: this.props.editId.taxAgentName, - employeeId: this.props.editId.employeeId, - employeeName: this.props.editId.username - } - }); - const fields = _.map(this.props.condition[0].items, it => { - return it.domkey[0]; - }); - fields.map(item => { - this.props.form.updateFields({ - [item]: this.props.editId[item] || "" + const { editId, condition, form } = this.props; + if (!_.isEmpty(editId)) { + getDomkes(condition).map(item => { + if (item === "employeeId") { + form.updateFields({ + [item]: { + value: editId[item], + valueSpan: editId["username"], + valueObj: [{ id: editId[item], name: editId["username"] }] + } + }); + } else if (item === "taxAgentId") { + form.updateFields({ + [item]: editId[item].toString() + }); + } else { + form.updateFields({ + [item]: editId[item] || "" + }); + } }); - }); + } } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.editId !== this.props.editId) { - this.setState({ - baseInfo: { - ...this.state.baseInfo, - declareMonth: nextProps.editId.declareMonth || nextProps.editId.taxYearMonth, - taxAgentId: nextProps.editId.taxAgentId, - taxAgentName: nextProps.editId.taxAgentName, - employeeId: nextProps.editId.employeeId, - employeeName: nextProps.editId.username + if (nextProps.editId !== this.props.editId && !_.isEmpty(nextProps.editId)) { + getDomkes(nextProps.condition).map(item => { + if (item === "employeeId") { + nextProps.form.updateFields({ + [item]: { + value: nextProps.editId[item], + valueSpan: nextProps.editId["username"], + valueObj: [{ id: nextProps.editId[item], name: nextProps.editId["username"] }] + } + }); + } else if (item === "taxAgentId") { + nextProps.form.updateFields({ + [item]: nextProps.editId[item].toString() + }); + } else { + nextProps.form.updateFields({ + [item]: nextProps.editId[item] || "" + }); } }); - const fields = _.map(nextProps.condition[0].items, it => { - return it.domkey[0]; - }); - fields.map(item => { - nextProps.form.updateFields({ - [item]: nextProps.editId[item] || "" - }); - }); } } render() { - const { taxAgentOption = [], form, condition = [], isCum, isSpecial, editId } = this.props; - const { baseInfo } = this.state; - let items = [ - { - com: PickDate({ - label: "税款所属期", - viewAttr: _.isEmpty(editId) ? 3 : 1, - labelCol: { span: 6 }, - wrapperCol: { span: 18 }, - format: "YYYY-MM", - value: baseInfo.declareMonth, - onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } }); - } - }) - }, - { - com: Select({ - label: "个税扣缴义务人", - viewAttr: _.isEmpty(editId) ? 3 : 1, - options: taxAgentOption, - value: baseInfo.taxAgentId, - onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } }); - } - }) - }, - { - com: Browser({ - label: "人员", - viewAttr: _.isEmpty(editId) ? 3 : 1, - value: baseInfo.employeeId, - valueSpan: baseInfo.employeeName, - onChange: ({ ids, names }) => { - this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); - } - }) - } - ]; - const cumSituationitems = [ - { - com: PickDate({ - label: "税款所属期", - viewAttr: _.isEmpty(editId) ? 3 : 1, - labelCol: { span: 6 }, - wrapperCol: { span: 18 }, - format: "YYYY-MM", - value: baseInfo.declareMonth, - onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } }); - } - }) - }, - { - com: Select({ - label: "个税扣缴义务人", - viewAttr: _.isEmpty(editId) ? 3 : 1, - options: taxAgentOption, - value: baseInfo.taxAgentId, - onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } }); - } - }) - }, - { - com: Select({ - label: "人员范围", - viewAttr: _.isEmpty(editId) ? 3 : 1, - options: [ - { key: "ORGANIZATION", showname: "内部人员" } - // { key: "EXT_EMPLOYEE", showname: "非系统人员" } - ], - value: baseInfo.personArea, - onChange: (data) => { - this.setState({ baseInfo: { ...baseInfo, personArea: data.selected } }); - } - }) - } - ]; - const insider = [{ - com: Browser({ - label: "人员", - viewAttr: _.isEmpty(editId) ? 3 : 1, - value: baseInfo.employeeId, - valueSpan: baseInfo.employeeName, - onChange: ({ ids, names }) => { - this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } }); - } - }) - }]; - const noSysPerson = [ - { - com: InputCus({ - label: "姓名", - viewAttr: 2, - onChange: (username) => { - this.setState({ baseInfo: { ...baseInfo, username } }); - } - }) - }, - { - com: InputCus({ - label: "身份证号码", - viewAttr: 3, - onChange: (idcard) => { - this.setState({ baseInfo: { ...baseInfo, idcard } }); - } - }) - } - ]; - isSpecial && items.shift(); + const { form, condition = [] } = this.props; return (
- - { - getSearchs(form, condition, 2) - } + {getSearchs(form, condition)} 若此员工数据已存在在同期列表中,则当前数据保存后会覆盖列表数据
); @@ -215,14 +85,6 @@ export const Browser = payload => { ); }; -export const InputCus = payload => { - const { label, onChange, value, viewAttr = 3 } = payload; - return ( - - - - ); -}; export const Tips = payload => { const { children } = payload; return ( diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index 9956585a..742d1573 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -396,6 +396,67 @@ export const situationModalColumns = [ export const dataSource = []; export const dataCollectCondition = [ + { + items: [ + { + conditionType: "MONTHPICKER", + domkey: ["declareMonth"], + fieldcol: 12, + label: "税款所属期", + lanId: 542240, + labelcol: 4, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentId"], + fieldcol: 12, + label: "个税扣缴义务人", + labelcol: 4, + lanId: 537996, + value: "", + options: [], + rules: "required|string", + viewAttr: 3 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "1", + viewAttr: 3 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["employeeId"], + fieldcol: 12, + isQuickSearch: false, + label: "人员", + lanId: 30042, + labelcol: 4, + rules: "required", + viewAttr: 3 + } + ], + title: "基础信息", + defaultshow: true, + col: 1 + }, { items: [ { @@ -469,8 +530,9 @@ export const dataCollectCondition = [ viewAttr: 2 } ], - title: '数据采集', - defaultshow: true + title: "数据采集", + defaultshow: true, + col: 2 } ]; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 0e106ae3..085f5756 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -1,6 +1,15 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaDatePicker, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSearchGroup, WeaSelect } from "ecCom"; +import { + WeaDatePicker, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaLocaleProvider, + WeaSearchGroup, + WeaSelect, + WeaTools +} from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { autoAddAll, @@ -23,6 +32,9 @@ import { convertToUrlString } from "../../../util/url"; import Layout from "../layout"; import moment from "moment"; +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + @inject("taxAgentStore", "cumDeductStore") @observer class Index extends Component { @@ -258,21 +270,21 @@ class Index extends Component { } }; handleSaveData = () => { - const { cumDeductStore: { addForm } } = this.props; - const { baseInfo } = this.addItemRef.state; - const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !!v); - if (!bool) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - const payload = { - ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), - ...addForm.getFormParams() - }; - this.handleSaveDeduction(payload); + const { cumDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props; + addForm.validateForm().then(f => { + if (f.isValid) { + const payload = { + ...addForm.getFormParams(), + taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname + }; + this.handleSaveDeduction(payload); + } else { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + } + }); }; handleResize = (innerWidth) => this.setState({ innerWidth }); /* @@ -285,7 +297,32 @@ class Index extends Component { const { taxAgentStore, cumDeductStore: { addForm } } = this.props; const { slidePayload } = this.state; const { taxAgentOption } = taxAgentStore; - addForm.initFormFields(dataCollectCondition); + const conditions = _.map(dataCollectCondition, (it, idx) => { + if (idx === 0) { + return { + ...it, title: getLabel(82743, "基础信息"), + items: _.map(it.items, o => { + if (getKey(o) === "taxAgentId") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + } + return { + ...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + }) + }; + } else if (idx === 1) { + return { + ...it, title: getLabel(83871, "数据采集"), + items: _.map(it.items, o => ({ + ...o, label: getLabel(o.lanId, o.label) + })) + }; + } + }); + addForm.initFormFields(conditions); this.setState({ slidePayload: { ...slidePayload, @@ -298,7 +335,7 @@ class Index extends Component { taxAgentOption={taxAgentOption} form={addForm} editId={editId} - condition={dataCollectCondition} + condition={conditions} /> : this.tableRecordRef = dom} @@ -336,6 +373,7 @@ class Index extends Component { }); this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys(); this.handleDebounce = null; + this.props.cumDeductStore.initAddForm(); }; /* * Author: 黎永顺 diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index ae006af6..197463bb 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -66,6 +66,82 @@ export const columns = [ } ]; export const dataCollectCondition = [ + { + items: [ + { + conditionType: "MONTHPICKER", + domkey: ["taxYearMonth"], + fieldcol: 12, + label: "税款所属期", + lanId: 542240, + labelcol: 4, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentId"], + fieldcol: 12, + label: "个税扣缴义务人", + labelcol: 4, + lanId: 537996, + value: "", + options: [], + rules: "required|string", + viewAttr: 3 + }, + // { + // conditionType: "SELECT", + // domkey: ["employeeScope"], + // fieldcol: 14, + // label: "人员范围", + // labelcol: 8, + // lanId: 124810, + // value: "ORGANIZATION", + // options: [ + // { key: "ORGANIZATION", showname: "内部人员" } + // // { key: "EXT_EMPLOYEE", showname: "非系统人员" } + // ], + // rules: "required|string", + // viewAttr: 3 + // }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "1", + viewAttr: 3 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["employeeId"], + fieldcol: 12, + isQuickSearch: false, + label: "人员", + lanId: 30042, + labelcol: 4, + rules: "required", + viewAttr: 3 + } + ], + title: "基础信息", + defaultshow: true, + col: 1 + }, { items: [ { @@ -240,7 +316,8 @@ export const dataCollectCondition = [ } ], title: "数据采集", - defaultshow: true + defaultshow: true, + col: 2 } ]; export const taxOptions = [ diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 8ac0a3cd..6a781d4b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaSearchGroup } from "ecCom"; +import { WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { createAddUpSituation, @@ -30,6 +30,9 @@ import TableRecord from "../components/tableRecord"; import { situationModalColumns } from "../cumDeduct/columns"; import { convertToUrlString } from "../../../util/url"; +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + @inject("taxAgentStore", "cumSituationStore") @observer class Index extends Component { @@ -184,7 +187,32 @@ class Index extends Component { const { taxAgentStore, cumSituationStore: { addForm } } = this.props; const { slidePayload } = this.state; const { taxAgentOption } = taxAgentStore; - addForm.initFormFields(dataCollectCondition); + const conditions = _.map(dataCollectCondition, (it, idx) => { + if (idx === 0) { + return { + ...it, title: getLabel(82743, "基础信息"), + items: _.map(it.items, o => { + if (getKey(o) === "taxAgentId") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + } + return { + ...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + }) + }; + } else if (idx === 1) { + return { + ...it, title: getLabel(83871, "数据采集"), + items: _.map(it.items, o => ({ + ...o, label: getLabel(o.lanId, o.label) + })) + }; + } + }); + addForm.initFormFields(conditions); this.setState({ slidePayload: { ...slidePayload, @@ -198,7 +226,7 @@ class Index extends Component { form={addForm} isCum editId={editId} - condition={dataCollectCondition} + condition={conditions} /> : this.tableRecordRef = dom} @@ -399,24 +427,24 @@ class Index extends Component { }); this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys(); this.handleDebounce = null; + this.props.cumSituationStore.initAddForm(); }; handleSaveData = () => { - const { cumSituationStore: { addForm } } = this.props; - const { baseInfo } = this.addItemRef.state; - const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !!v); - if (!bool) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - const payload = { - taxYearMonth: baseInfo.declareMonth, - ..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]), - ...addForm.getFormParams() - }; - this.handleSaveDeduction(payload); + const { cumSituationStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props; + addForm.validateForm().then(f => { + if (f.isValid) { + const payload = { + ...addForm.getFormParams(), + taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname + }; + this.handleSaveDeduction(payload); + } else { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + } + }); }; handleResize = (innerWidth) => this.setState({ innerWidth }); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index a4b80c9c..e693c017 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -66,6 +66,67 @@ export const columns = [ } ]; export const dataCollectCondition = [ + { + items: [ + { + conditionType: "MONTHPICKER", + domkey: ["declareMonth"], + fieldcol: 12, + label: "税款所属期", + lanId: 542240, + labelcol: 4, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentId"], + fieldcol: 12, + label: "个税扣缴义务人", + labelcol: 4, + lanId: 537996, + value: "", + options: [], + rules: "required|string", + viewAttr: 3 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "1", + viewAttr: 3 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["employeeId"], + fieldcol: 12, + isQuickSearch: false, + label: "人员", + lanId: 30042, + labelcol: 4, + rules: "required", + viewAttr: 3 + } + ], + title: "基础信息", + defaultshow: true, + col: 1 + }, { items: [ { @@ -120,7 +181,8 @@ export const dataCollectCondition = [ } ], title: "数据采集", - defaultshow: true + defaultshow: true, + col: 2 } ]; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 5e5aec09..7f843623 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaSearchGroup } from "ecCom"; +import { WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { createData, @@ -31,6 +31,9 @@ import TableRecord from "../components/tableRecord"; import { otherModalColumns } from "../cumDeduct/columns"; import { convertToUrlString } from "../../../util/url"; +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + @inject("taxAgentStore", "otherDeductStore") @observer class Index extends Component { @@ -287,7 +290,32 @@ class Index extends Component { const { taxAgentStore, otherDeductStore: { addForm } } = this.props; const { slidePayload } = this.state; const { taxAgentOption } = taxAgentStore; - addForm.initFormFields(dataCollectCondition); + const conditions = _.map(dataCollectCondition, (it, idx) => { + if (idx === 0) { + return { + ...it, title: getLabel(82743, "基础信息"), + items: _.map(it.items, o => { + if (getKey(o) === "taxAgentId") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + } + return { + ...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + }) + }; + } else if (idx === 1) { + return { + ...it, title: getLabel(83871, "数据采集"), + items: _.map(it.items, o => ({ + ...o, label: getLabel(o.lanId, o.label) + })) + }; + } + }); + addForm.initFormFields(conditions); this.setState({ slidePayload: { ...slidePayload, @@ -300,7 +328,7 @@ class Index extends Component { taxAgentOption={taxAgentOption} form={addForm} editId={editId} - condition={dataCollectCondition} + condition={conditions} /> : this.tableRecordRef = dom} @@ -389,23 +417,24 @@ class Index extends Component { }); this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys(); this.handleDebounce = null; + this.props.otherDeductStore.initAddForm(); }; handleSaveData = () => { - const { otherDeductStore: { addForm } } = this.props; - const { baseInfo } = this.addItemRef.state; - const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !!v); - if (!bool) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - const payload = { - ..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]), - ...addForm.getFormParams() - }; - this.handleSaveDeduction(payload); + const { otherDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props; + addForm.validateForm().then(f => { + if (f.isValid) { + const payload = { + ...addForm.getFormParams(), + taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname + }; + this.handleSaveDeduction(payload); + } else { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + } + }); }; handleAdSearch = () => { const { otherDeductStore: { form } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js index 68495cc9..241efd93 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js @@ -1,4 +1,54 @@ export const condition = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["taxAgentId"], + fieldcol: 12, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 4, + value: "", + options: [], + rules: "required|string", + viewAttr: 3 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "1", + viewAttr: 3 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["employeeId"], + fieldcol: 12, + isQuickSearch: false, + label: "人员", + lanId: 30042, + labelcol: 4, + rules: "required", + viewAttr: 3 + } + ], + title: "基础信息", + defaultshow: true, + col: 1 + }, { items: [ { @@ -73,7 +123,8 @@ export const condition = [ } ], title: "数据采集", - defaultshow: true + defaultshow: true, + col: 2 } ]; @@ -114,7 +165,7 @@ export const searchCondition = [ showOrder: 0 } ], - title: '部门', + title: "部门", type: "4", viewAttr: 2, pageSize: 10, diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 5ea6f81c..5b4cd8f7 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaSearchGroup } from "ecCom"; +import { WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import DataTables from "../dataTables"; import Layout from "../layout"; @@ -23,6 +23,9 @@ import TableRecord from "../components/tableRecord"; import { specialModalColumns } from "../cumDeduct/columns"; import { convertToUrlString } from "../../../util/url"; +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + @inject("taxAgentStore", "specialAddStore") @observer class Index extends Component { @@ -295,7 +298,32 @@ class Index extends Component { const { taxAgentStore, specialAddStore: { addForm } } = this.props; const { slidePayload } = this.state; const { taxAgentOption } = taxAgentStore; - addForm.initFormFields(condition); + const conditions = _.map(condition, (it, idx) => { + if (idx === 0) { + return { + ...it, title: getLabel(82743, "基础信息"), + items: _.map(it.items, o => { + if (getKey(o) === "taxAgentId") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + } + return { + ...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1 + }; + }) + }; + } else if (idx === 1) { + return { + ...it, title: getLabel(83871, "数据采集"), + items: _.map(it.items, o => ({ + ...o, label: getLabel(o.lanId, o.label) + })) + }; + } + }); + addForm.initFormFields(conditions); this.setState({ slidePayload: { ...slidePayload, @@ -309,7 +337,7 @@ class Index extends Component { form={addForm} isSpecial editId={editId} - condition={condition} + condition={conditions} /> : this.tableRecordRef = dom} @@ -347,23 +375,24 @@ class Index extends Component { }); this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys(); this.handleDebounce = null; + this.props.specialAddStore.initAddForm(); }; handleSaveData = () => { - const { specialAddStore: { addForm } } = this.props; - const { baseInfo } = this.addItemRef.state; - const bool = _.every(_.pick(baseInfo, ["taxAgentId", "employeeId"]), v => !!v); - if (!bool) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - const payload = { - ..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]), - ...addForm.getFormParams() - }; - this.handleSaveDeduction(payload); + const { specialAddStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props; + addForm.validateForm().then(f => { + if (f.isValid) { + const payload = { + ...addForm.getFormParams(), + taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname + }; + this.handleSaveDeduction(payload); + } else { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + } + }); }; handleAdSearch = () => { const { specialAddStore: { advanceForm } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index c3673fae..6359eee7 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -434,8 +434,8 @@ export default class Programme extends React.Component { visible={this.state.slideVisiable} top={0} measureT="%" - width={800} - measureX="px" + width={100} + measureX="%" height={100} measureY="%" direction={"right"} diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index 55d2cf60..676b841a 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -12,6 +12,7 @@ export class CumDeductStore { @observable slideTableStore = new TableStore(); @observable form = new WeaForm(); // new 一个form @observable addForm = new WeaForm(); // 新增form + @action initAddForm = () => this.addForm = new WeaForm(); // 初始化新增form @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 @@ -108,7 +109,7 @@ export class CumDeductStore { ...requestParams, current: this.pageObj.current, pageSize: this.pageObj.pageSize, - ...params, + ...params }; API.getCumDeductList(requestParams).then( action(({ status, data, errormsg }) => { diff --git a/pc4mobx/hrmSalary/stores/cumSituation.js b/pc4mobx/hrmSalary/stores/cumSituation.js index 082c6d3b..6936613c 100644 --- a/pc4mobx/hrmSalary/stores/cumSituation.js +++ b/pc4mobx/hrmSalary/stores/cumSituation.js @@ -12,6 +12,7 @@ export class CumSituationStore { @observable slideTableStore = new TableStore(); @observable form = new WeaForm(); // new 一个form @observable addForm = new WeaForm(); // 新增form + @action initAddForm = () => this.addForm = new WeaForm(); @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 diff --git a/pc4mobx/hrmSalary/stores/otherDeduct.js b/pc4mobx/hrmSalary/stores/otherDeduct.js index 2f413560..18ce76d6 100644 --- a/pc4mobx/hrmSalary/stores/otherDeduct.js +++ b/pc4mobx/hrmSalary/stores/otherDeduct.js @@ -1,4 +1,4 @@ -import { observable, action, toJS } from "mobx"; +import { action, observable } from "mobx"; import { message } from "antd"; import { WeaForm, WeaTableNew } from "comsMobx"; import { removePropertyCondition } from "../util/response"; @@ -12,6 +12,7 @@ export class OtherDeductStore { @observable slideTableStore = new TableStore(); @observable form = new WeaForm(); // new 一个form @observable addForm = new WeaForm(); // 新增form + @action initAddForm = () => this.addForm = new WeaForm(); @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 @@ -115,13 +116,13 @@ export class OtherDeductStore { this.setPageObj({ total, current, - pageSize, + pageSize }); } else { this.setDataSource([]); this.setPageObj({ ...this.pageObj, - total: 0, + total: 0 }); message.error(errormsg || "接口调用失败!"); } @@ -184,23 +185,23 @@ export class OtherDeductStore { this.setSlidePageObj({ total, current, - pageSize, + pageSize }); } else { this.setSlideTableDataSource([]); this.setSlidePageObj({ ...this.slidePageObj, - total: 0, + total: 0 }); message.error(errormsg || "接口调用失败!"); } - this.slideLoading = false + this.slideLoading = false; } ); }; // 导出明细 - @action exportOtherDeductDetailList = (id, ids = "", taxAgentId="") => { + @action exportOtherDeductDetailList = (id, ids = "", taxAgentId = "") => { API.exportOtherDeductDetailList(id, ids, taxAgentId); }; } diff --git a/pc4mobx/hrmSalary/stores/specialAdd.js b/pc4mobx/hrmSalary/stores/specialAdd.js index 6167156d..bcd298ab 100644 --- a/pc4mobx/hrmSalary/stores/specialAdd.js +++ b/pc4mobx/hrmSalary/stores/specialAdd.js @@ -1,7 +1,8 @@ -import { observable, action, toJS } from 'mobx'; -import { WeaForm } from 'comsMobx'; +import { action, observable } from "mobx"; +import { WeaForm } from "comsMobx"; export class SpecialAddStore { @observable advanceForm = new WeaForm(); @observable addForm = new WeaForm(); + @action initAddForm = () => this.addForm = new WeaForm(); } diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index a3cc81bf..9a918faf 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -50,7 +50,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void }); group.push( { }; export const getDomkes = (conditions) => { - return _.map(conditions[0].items, it => it.domkey[0]); + return _.reduce(conditions, (pre, cur) => ([...pre, ..._.map(cur.items, o => o.domkey[0])]), []); }; export const padding0 = (num, length) => {