Commit 550e3dd8 by yangchen

单据默认值增加对实体类型的判断

parent b1964e21
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
this.init = true; this.init = true;
}); });
}, },
loadFinishFun(bill, err) { async loadFinishFun(bill, err) {
if (err) { if (err) {
this.$Message.error(err) this.$Message.error(err)
setTimeout(() => { setTimeout(() => {
...@@ -90,8 +90,24 @@ export default { ...@@ -90,8 +90,24 @@ export default {
return return
} }
// 给bill设置默认值 // 给bill设置默认值
let defaultValueList = this.defaultValueList || [] let defaultValueList = JSON.parse(JSON.stringify(this.defaultValueList || []))
for(let item of defaultValueList){ for(let item of defaultValueList){
if(item.tableName){
const postData = {
pagination: false,
tableName: item.tableName,
searchKey: "",
queryDataStructure: "ALL",
queryChildrenType: "ALL_CHILDREN_WITH_SELF",
code: item.defaultValue,
authType: "ACCESS",
versionDate: "",
expression: "",
}
const {data} = await GMS.$http.post(`/baseData/data/list`, postData)
const value = data.rows && data.rows[0] || ''
item.defaultValue = value
}
bill.getMasterData().setValue(item.field,item.defaultValue) bill.getMasterData().setValue(item.field,item.defaultValue)
} }
const workflowState = bill.getMasterData().getValue('billState') // setV const workflowState = bill.getMasterData().getValue('billState') // setV
......
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
}); });
} }
}, },
loadFinishFun(bill, err) { async loadFinishFun(bill, err) {
if (!GMS.oldBillDataMap) GMS.oldBillDataMap = {} if (!GMS.oldBillDataMap) GMS.oldBillDataMap = {}
if (err) { if (err) {
this.$Message.error(errMap[err]? errMap[err]: err) this.$Message.error(errMap[err]? errMap[err]: err)
...@@ -127,8 +127,24 @@ export default { ...@@ -127,8 +127,24 @@ export default {
return return
} }
// 给bill设置默认值 // 给bill设置默认值
let defaultValueList = this.defaultValueList || [] let defaultValueList = JSON.parse(JSON.stringify(this.defaultValueList || []))
for(let item of defaultValueList){ for(let item of defaultValueList){
if(item.tableName){
const postData = {
pagination: false,
tableName: item.tableName,
searchKey: "",
queryDataStructure: "ALL",
queryChildrenType: "ALL_CHILDREN_WITH_SELF",
code: item.defaultValue,
authType: "ACCESS",
versionDate: "",
expression: "",
}
const {data} = await GMS.$http.post(`/baseData/data/list`, postData)
const value = data.rows && data.rows[0] || ''
item.defaultValue = value
}
bill.getMasterData().setValue(item.field,item.defaultValue) bill.getMasterData().setValue(item.field,item.defaultValue)
} }
this.curBill = bill; this.curBill = bill;
......
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