diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js index f3734cbc..50df1c24 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js @@ -1,3 +1,4 @@ +import React, { Component } from "react"; import { WeaSwitch } from "comsMobx"; import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index d0b0d7f4..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
@@ -137,7 +135,7 @@ class Index extends Component { return ( onClose()} top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()} - content={
{getSearchs(VSSalaryFileForm, conditions)}
} + content={
{getSearchs(VSSalaryFileForm, conditions, 2, false)}
} />); } } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index 01969697..9f583eee 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -24,14 +24,18 @@ const WeaTableComx = WeaTableNew.WeaTable; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; -@inject("baseTableStore") -@observer +@inject("baseTableStore") @observer class Index extends Component { constructor(props) { super(props); this.state = { - pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], - selectedRowKeys: [], condtions: [], showSearchAd: false + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, + dataSource: [], + columns: [], + selectedRowKeys: [], + condtions: [], + showSearchAd: false }; } @@ -43,7 +47,8 @@ class Index extends Component { ...item, items: _.map(item.items, child => { if (getKey(child) === "taxAgentIds") { return { - ...child, label: getLabel(child.lanId, child.label), + ...child, + label: getLabel(child.lanId, child.label), options: _.map(taxAgentOption, o => ({ key: o.id, showname: o.content })) }; } @@ -112,9 +117,8 @@ class Index extends Component { const { pageInfo: result } = data; const { list: dataSource, pageNum: current, pageSize, total } = result; this.setState({ - pageInfo: { ...pageInfo, current, pageSize, total }, dataSource - } - ); + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource + }); } }); }; @@ -125,9 +129,7 @@ class Index extends Component { }; handleDelete = (ids) => { Modal.confirm({ - title: getLabel(111, "信息确认"), - content: getLabel(111, "确认删除吗?"), - onOk: () => { + title: getLabel(111, "信息确认"), content: getLabel(111, "确认删除吗?"), onOk: () => { API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => { if (status) { message.success(getLabel(111, "删除成功")); @@ -142,21 +144,27 @@ class Index extends Component { getColumns = () => { const { baseTableStore: { SFTableStore }, showOperateBtn } = this.props; const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), (it, idx) => ({ - dataIndex: it.dataIndex, title: it.title, align: "left", - width: 150, ellipsis: true + dataIndex: it.dataIndex, title: it.title, align: "left", width: 150, ellipsis: true })); if (!_.isEmpty(columns)) { this.postMessageToChild({ - columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 95, - pageInfo: this.state.pageInfo, unitTableType: "variableSalary", selectedRowKeys: this.state.selectedRowKeys + columns, + showOperateBtn, + dataSource: this.state.dataSource, + scrollHeight: 95, + pageInfo: this.state.pageInfo, + unitTableType: "variableSalary", + selectedRowKeys: this.state.selectedRowKeys }); } return columns; }; postMessageToChild = (payload = {}) => { const i18n = { - "操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), - "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), + "操作": getLabel(30585, "操作"), + "编辑": getLabel(111, "编辑"), + "共": getLabel(18609, "共"), + "条": getLabel(18256, "条"), "删除": getLabel(111, "删除") }; const childFrameObj = document.getElementById("unitTable"); @@ -172,30 +180,32 @@ class Index extends Component { if (dom && dataSource.length > 0) { height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 62; } - return ( - -
- {getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())} - this.openAdvanceSearch()} - onAdvanceSearch={() => this.getVariableSalaryList()}/> -
-
- this.setState({ showSearchAd: false })} onAdSearch={this.handleAdvanceSearch}/> -
-
- -