|
|
@ -113,10 +113,51 @@ const urls = ref([]) |
|
|
|
const viewKey = ref(0) |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
|
const searchTableSuccess = async (formField, searchField, val, formRef) => { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if (formField == 'itemNumber') { |
|
|
|
const params = { |
|
|
|
'itemNumber': val[0]['number'] |
|
|
|
}; |
|
|
|
await ItemAccountsApi.getItemAccountsNoPage(params).then((res) => { |
|
|
|
let oldData = ['TRUE', 'FALSE']; |
|
|
|
// 遍历 res 中的每一项 item |
|
|
|
res.forEach(item => { |
|
|
|
// 从 oldData 中排除 item.isInAccount |
|
|
|
oldData = oldData.filter(data => data !== item.isInAccount); |
|
|
|
}); |
|
|
|
// 根据 oldData 剩余项设置 setV['isInAccountWill'] |
|
|
|
if (oldData.length === 2) { |
|
|
|
setV['isInAccountWill'] = 'ALL'; |
|
|
|
} else if (oldData.length === 1) { |
|
|
|
setV['isInAccountWill'] = oldData[0]; |
|
|
|
} else { |
|
|
|
setV['isInAccountWill'] = 'BOTH'; |
|
|
|
} |
|
|
|
console.log(setV); |
|
|
|
}); |
|
|
|
setV['name'] = val[0]['name'], |
|
|
|
setV['specifications'] = val[0]['specifications'], |
|
|
|
setV['singlePrice'] = val[0]['singlePrice'], |
|
|
|
setV['category'] = val[0]['category'], |
|
|
|
setV['classification'] = val[0]['classification'], |
|
|
|
setV['cost'] = val[0]['cost'], |
|
|
|
setV['financer'] = val[0]['financer'], |
|
|
|
setV['isConstant'] = val[0]['isConstant'], |
|
|
|
setV['isFramework'] = val[0]['isFramework'], |
|
|
|
setV['isRadeIn'] = val[0]['isRadeIn'], |
|
|
|
setV['purchaser'] = val[0]['purchaser'], |
|
|
|
setV['region'] = val[0]['region'], |
|
|
|
setV['reprocurement'] = val[0]['reprocurement'], |
|
|
|
setV['subject'] = val[0]['subject'], |
|
|
|
setV['subjectCode'] = val[0]['subjectCode'], |
|
|
|
setV['uom'] = val[0]['uom'] |
|
|
|
setV['safetyStock'] = val[0]['safetyStock'] |
|
|
|
} else if (formField == 'locationNumber') { |
|
|
|
setV['isInAccount'] = val[0]['isInAccount'] |
|
|
|
} |
|
|
|
nextTick(() => { |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
} |
|
|
|