Commit 726eddf3 by fengjiansheng

fix(@gms/gms-plugin-billexpand): 修改币别校验公式

parent 8d232f13
...@@ -12,7 +12,11 @@ export default { ...@@ -12,7 +12,11 @@ export default {
customMessageList: [ customMessageList: [
{ {
preMessage: "More than one row with the given identifier was found", preMessage: "More than one row with the given identifier was found",
convertMessage: "保存失败,基础数据存在多条相同记录,基础数据标识:" convertMessage: "multiBaseDataError"
},
{
preMessage: "formulaError:",
convertMessage: "backFormulaError",
} }
], ],
getErrorBaseDataName(a) { getErrorBaseDataName(a) {
...@@ -34,10 +38,24 @@ export default { ...@@ -34,10 +38,24 @@ export default {
break; break;
} }
} }
return errorPreMessage === "" ? this.commonMessage : errorPreMessage + this.getErrorBaseDataName(a); return this.doDealWithErrorMessage(errorPreMessage, a);
}, },
getCommonMessage(){ getCommonMessage(){
return this.commonMessage; return this.commonMessage;
},
doDealWithErrorMessage(type,sourceMessage){
if (!type || !_.isString(type)) {
return this.commonMessage;
}
if (type === ""){
return this.commonMessage;
}
if (type === "backFormulaError") {
return sourceMessage.substring("formulaError:".length)
}
if (type === "multiBaseDataError") {
return "保存失败,基础数据存在多条相同记录,基础数据标识:" + this.getErrorBaseDataName(sourceMessage);
}
} }
}, },
tempSaveAction: { tempSaveAction: {
......
...@@ -10,39 +10,6 @@ import util from './FormulaConstants' ...@@ -10,39 +10,6 @@ import util from './FormulaConstants'
export default { export default {
formulaName: "EqualsMasterAndSubField", formulaName: "EqualsMasterAndSubField",
execute: function () { execute: function () {
if (arguments && arguments[0] && arguments[0].length === 3) {
let context = arguments[1]
let compType = util.getFormulaParamValue(arguments[0][0])
let masterField = arguments[0][1]
if (compType !== 1) {
return true
}
masterField = util.getFormulaParamValue(masterField).id
let tempSubTableObject = context.getTableType(arguments[0][2].FieldTableCode);
if (!_.isEqual(tempSubTableObject.type, "sub")) {
return false
}
let allSubData = context.getAllSubData();
if (!allSubData || _.isEmpty(allSubData)) {
return true
}
let tempAllSubData = context.getAllSubData()[tempSubTableObject.title];
if (!tempAllSubData || _.isEmpty(tempAllSubData)) {
return true
}
if (tempAllSubData instanceof Array) {
for (const tempSubData of tempAllSubData) {
let tempData = tempSubData.getValue(arguments[0][2].FieldCode).id
if (masterField !== tempData) {
return false
}
}
}
return true
} else {
console.error(this.formulaName + _.ERROR_MSG.PARAM_NUM)
return false
}
}, },
getResultType: function () { getResultType: function () {
return util.resultType.boolean return util.resultType.boolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment