Commit beacbc6c authored by dragondean@qq.com's avatar dragondean@qq.com

修复有时候自定义付款人回显异常

parent 5bef42ff
......@@ -1060,8 +1060,8 @@ export default {
},
activated(){
if(this.$route.query.id != this.form.id){
console.log("activated 加载订单数据")
this.getOrder()
console.log("activated 加载订单数据")
this.getOrder()
}
let transportType = undefined
if(this.$route.query.transportType){
......@@ -1075,19 +1075,22 @@ export default {
this.updateChannel = this.$route.query.updateChannel == 1
},
async created() {
// 初始化自定义付款人需要在前面,否则先执行activated里的getOrder,会被覆盖
this.getDictDatas(this.DICT_TYPE.ECW_CUSTOM_DRAWEE).forEach(item => {
this.customDraweeList.push({
label: item.label, // 显示文字
name: item.value, // key值
value: 2 // 1 发货人,2收货人,默认收货人,可修改
})
})
this.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data
this.tradeCityList = (await getTradeCityList()).data
this.currencyList = (await getCurrencyList()).data
this.unitList = (await getUnitList()).data
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
this.getDictDatas(this.DICT_TYPE.ECW_CUSTOM_DRAWEE).forEach(item => {
this.customDraweeList.push({
label: item.label, // 显示文字
name: item.value, // key值
value: 2 // 1 发货人,2收货人,默认收货人,可修改
})
})
if(this.$route.query.transportType){
this.$set(this.form, 'transportId', +this.$route.query.transportType)
}
......@@ -1110,11 +1113,12 @@ export default {
onTableMounted(e){
// console.warn('onTableMounted', e)
},
getOrder(){
async getOrder(){
if(this.form.orderId == this.$route.query.id){
console.log('加载中或者已加载此订单数据,不重复加载', this.initing, this.form.orderId, this.$route.query.id)
return
}
this.$nextTick()
this.initing = true
getUpdateInfo(this.$route.query.id).then(res => {
this.form = Object.assign({}, {...res.data}, {orderItemVOList: []})
......@@ -1168,9 +1172,12 @@ export default {
// 如果是自定义付款人,则需要同步具体发货人信息
if(this.form.drawee == 3){
console.log('同步自定义付款人信息', JSON.stringify(this.customDraweeList))
this.customDraweeList.forEach(item => {
console.log(item.name, this.form.customDraweeVOList.find(it => it.name == item.name)?.value , item.value)
item.value = this.form.customDraweeVOList.find(it => it.name == item.name)?.value || item.value
})
console.log('同步自定义付款人信息', this.customDraweeList, this.form.customDraweeVOList)
}
// 如果已完成入仓,则需要监听必填内容,发生更改后需要填写审批表单
......
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