diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 7813cde7..90cc4633 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -46,29 +46,20 @@ class Index extends Component { ...item, items: _.map(item.items, o => { if (getKey(o) === "taxAgentIds") { return { - ...o, - viewAttr: !_.isEmpty(detail) ? 1 : 3, - label: getLabel(o.lanId, o.label), + ...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 })) }; } return { - ...o, - viewAttr: !_.isEmpty(detail) ? 1 : 3, - label: getLabel(o.lanId, o.label), + ...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 + conditionType: "INPUT", domkey: [String(o.id)], fieldcol: 14, label: o.name, labelcol: 6, + value: detail[`${String(o.id)}_variableItem`] || "", viewAttr: 2, dataType: o.dataType })), title: "", col: 2, defaultshow: true }] }, () => { @@ -76,8 +67,7 @@ class Index extends Component { if (!_.isEmpty(detail)) { VSSalaryFileForm.updateFields({ employeeId: { - value: detail["employeeId"], - valueSpan: detail["username"], + value: detail["employeeId"], valueSpan: detail["username"], valueObj: [{ id: detail["employeeId"], name: detail["username"] }] } }); @@ -128,6 +118,19 @@ class Index extends Component { ; }; + handleChange = (formVal) => { + const key = _.keys(formVal)[0], value = formVal[key].value; + const [__, fields] = this.state.conditions, { items } = fields; + _.forEach(items, o => { + if (getKey(o) === key && o.dataType === "number") { + if (_.isNaN(Number(value))) { + const { baseTableStore: { VSSalaryFileForm } } = this.props; + message.warning(getLabel(111, "数值类型有误!")); + VSSalaryFileForm.updateFields({ [getKey(o)]: { value: "" } }); + } + } + }); + }; render() { const { conditions } = this.state; @@ -135,7 +138,8 @@ class Index extends Component { return ( onClose()} top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()} - content={
{getSearchs(VSSalaryFileForm, conditions, 2, false)}
} + content={
{getSearchs(VSSalaryFileForm, conditions, 2, false, this.handleChange)}
} />); } } diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index cf13077a..6cffca28 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -43,12 +43,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void tipPosition="bottom" // 错误提示的显示位置: top/bottom className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : classnames} > - + { fields.helpfulTitle &&