Commit 894cb298 by Joey

fix(@gms/gms-plugin-billexpand): 字符串拼接赋值公式修改

- 首先判断选定基础数据是否完整,避免查字段时查错

- 调批量查基础数据的接口,减少接口调用次数
parent 226b2509
...@@ -38,15 +38,29 @@ export default { ...@@ -38,15 +38,29 @@ export default {
} }
const getBaseDataList = (originFieldValue) => { const getBaseDataList = (originFieldValue) => {
const promistList = [] const getList = (originFieldValue) => {
const paramList = []
for (let i = 0; i < argList.length; i += 2) { for (let i = 0; i < argList.length; i += 2) {
promistList.push(this.getMDObject({ paramList.push({
...requestParam, ...requestParam,
tableName: argList[i + 1], tableName: argList[i + 1],
objectcode: originFieldValue[argList[i]], objectcode: originFieldValue[argList[i]],
})) })
}
return this.getCombBaseDataList(paramList)
}
if (originFieldValue._type) {
return this.getMDObject({
...requestParam,
tableName: originFieldValue._type.split('.')[1],
code: originFieldValue.code,
}).then((res) => {
return getList(res)
})
}
else {
return getList(originFieldValue)
} }
return Promise.all(promistList)
} }
const getFormattedString = (originFieldValue, basedataObjectList, templateString) => { const getFormattedString = (originFieldValue, basedataObjectList, templateString) => {
const matchList = templateString.match(/`.+?`/g) const matchList = templateString.match(/`.+?`/g)
...@@ -114,6 +128,12 @@ export default { ...@@ -114,6 +128,12 @@ export default {
}).catch((resp) => { }).catch((resp) => {
}); });
}, },
getCombBaseDataList(param) {
return GMS.$http.post("/rbcfunc/getCombBaseDataList", param).then(res => {
return (res && res.data && res.data.data || []).map((o) => o && o[0] || {})
}).catch((res) => {
});
},
getResultType: function () { getResultType: function () {
return FMR.ConstDataTypes.General; return FMR.ConstDataTypes.General;
} }
......
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