From 1a0f594753abb0d44f17905d84bead48d3303eab Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 16 Oct 2024 16:18:32 +0800 Subject: [PATCH] release/2.15.2.2409.01 --- .../components/salaryFileDialog/index.js | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 380f9228..7813cde7 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -18,8 +18,7 @@ import * as API from "../../../../apis/variableSalary"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; -@inject("baseTableStore") -@observer +@inject("baseTableStore") @observer class Index extends Component { constructor(props) { super(props); @@ -43,36 +42,35 @@ class Index extends Component { const { data: taxAgentOption } = await API.getAdminTaxAgentList(); API.getCreateForm().then(({ data }) => { this.setState({ - conditions: [ - ..._.map(salaryFileConditions, item => ({ - ...item, items: _.map(item.items, o => { - if (getKey(o) === "taxAgentIds") { - return { - ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - value: detail[getKey(o)] || "", - options: _.map(taxAgentOption, (o, i) => ({ key: o.id, showname: o.content })) - }; - } + conditions: [..._.map(salaryFileConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "taxAgentIds") { return { - ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - value: detail[getKey(o)] || "" + ...o, + viewAttr: !_.isEmpty(detail) ? 1 : 3, + label: getLabel(o.lanId, o.label), + value: detail[getKey(o)] || "", + options: _.map(taxAgentOption, (o, i) => ({ key: o.id, showname: o.content })) }; - }) - })), - { - items: _.map(data, o => ({ - conditionType: "INPUT", - domkey: [String(o.id)], - fieldcol: 14, - label: o.name, - labelcol: 6, - value: detail[`${String(o.id)}_variableItem`] || "", - viewAttr: 2 - })), - title: "", col: 2, - defaultshow: true - } - ] + } + return { + ...o, + viewAttr: !_.isEmpty(detail) ? 1 : 3, + label: getLabel(o.lanId, o.label), + value: detail[getKey(o)] || "" + }; + }) + })), { + items: _.map(data, o => ({ + conditionType: "INPUT", + domkey: [String(o.id)], + fieldcol: 14, + label: o.name, + labelcol: 6, + value: detail[`${String(o.id)}_variableItem`] || "", + viewAttr: 2 + })), title: "", col: 2, defaultshow: true + }] }, () => { VSSalaryFileForm.initFormFields(this.state.conditions); if (!_.isEmpty(detail)) { @@ -98,7 +96,7 @@ class Index extends Component { }, {}); }; save = () => { - const { baseTableStore: { VSSalaryFileForm }, onSearch, id } = this.props; + const { baseTableStore: { VSSalaryFileForm }, onSearch, detail: { id } } = this.props; VSSalaryFileForm.validateForm().then(f => { if (f.isValid) { const payload = VSSalaryFileForm.getFormParams(); @@ -119,7 +117,7 @@ class Index extends Component { }); }; renderTitle = () => { - const { loading } = this.state, { title, detail } = this.props; + const { loading } = this.state, { title } = this.props; return