diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index bf7b51d9..2d7b1782 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -12,6 +12,7 @@ export default class FormalFormModal extends React.Component { constructor(props) { super(props); this.state = { + formalua: false, //是否删除操作过公式数据 validateType: "", returnType: "", value: "", @@ -107,6 +108,7 @@ export default class FormalFormModal extends React.Component { const index = value.lastIndexOf("{", end - 1); const currentValue = value.substring(index, end); this.setState({ + formalua: true, value: value.replace(currentValue, "") }, () => { if (propsTextarea.setSelectionRange) { @@ -141,7 +143,7 @@ export default class FormalFormModal extends React.Component { this.parameters = []; } this.setState({ - value + value, formalua: true }); } @@ -209,6 +211,7 @@ export default class FormalFormModal extends React.Component { referenceType: this.referenceType == "" ? this.props.valueType == "2" ? "formula" : this.props.valueType == "3" ? "sql" : "" : this.referenceType }; saveFormual(params).then(data => { + this.setState({ formalua: false }); this.props.onSaveFormal(data); this.props.onCancel(); }); @@ -319,13 +322,13 @@ export default class FormalFormModal extends React.Component { render() { const { salaryItemStore } = this.props; const { searchGroup, searchFields } = salaryItemStore; - const { value, formulaDatasourceList, extendParam, testVisible, showTestVal } = this.state; + const { value, formulaDatasourceList, extendParam, testVisible, showTestVal, formalua } = this.state; const title =
{`${(this.props.valueType == 2 || this.props.valueType === "FORMULA") ? "函数" : "SQL"}公式`}
{ value &&