diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index 2095272..df203cb 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -1828,6 +1828,13 @@ export function getCharConfig(name, charType, dataID, order, width, height) { export function validatePramsNotEmpty(props) { let result = true; + const fieldNotNull = commonFunc.showLocalMessage(this.props, 'fieldNotNull', '字段不能为空'); + + const fieldNotZero = commonFunc.showLocalMessage(this.props, 'fieldNotZero', '字段不能为0'); + + const errorMessage = commonFunc.showLocalMessage(this.props, 'errorMessage', '错误提示'); + + const allTableConfig = commonFunc.getAllTableConfig(props); const bParamsMustConfigList = []; Object.keys(allTableConfig).forEach(tableName => { @@ -1900,15 +1907,15 @@ export function validatePramsNotEmpty(props) { if (mustValue === undefined || mustValue === '') { if (paramConfig[bMustList[iIndex]] === "色序") { if (commonUtils.isEmpty(rowData.sColorSerialMemo)) { - sTip = `${sTip}【${paramConfig[bMustList[iIndex]]}】字段不能为空!xpm`; + sTip = `${sTip}【${paramConfig[bMustList[iIndex]]}】${fieldNotNull}xpm`; } } else if (paramConfig[bMustList[iIndex]] === "电化铝版本") { if (commonUtils.isEmpty(rowData.sAlumiteBomBillNo)) { - sTip = `${sTip}【${paramConfig[bMustList[iIndex]]}】字段不能为空!xpm`; + sTip = `${sTip}【${paramConfig[bMustList[iIndex]]}】${fieldNotNull}xpm`; } } else { - sTip = `${sTip}【${paramConfig[bMustList[iIndex]]}】字段不能为空!xpm`; + sTip = `${sTip}【${paramConfig[bMustList[iIndex]]}】${fieldNotNull}xpm`; } } @@ -1918,7 +1925,7 @@ export function validatePramsNotEmpty(props) { iIndex = 0; for(const zeroValue of bNotZeroValueList) { if (zeroValue === undefined || zeroValue === '0' || zeroValue === 0) { - sTip = `${sTip}【${paramConfig[bNotZeroList[iIndex]]}】字段不能0!xpm`; + sTip = `${sTip}【${paramConfig[bNotZeroList[iIndex]]}】${fieldNotZero}!xpm`; } iIndex = iIndex + 1; } @@ -1952,9 +1959,8 @@ export function validatePramsNotEmpty(props) { if (commonUtils.isNotEmptyStr(sTipAll)) { Modal.error({ - title: "错误提示:", + title: errorMessage, content:
{handleGetMsg(sTipAll)}
, - okText: "确认", onOk() {} }); throw new Error();