Commit 7c46bc4d authored by Marcus's avatar Marcus

【2.0-空运订单】空运订单入仓修改页,入仓特性显示的是商品默认特性,而不是完成入仓时所勾选的特性

https://zentao.test.jdshangmen.com/bug-view-4275.html
parent 2595f2dc
......@@ -44,13 +44,20 @@ export default {
status: {
type: [String, Number],
default: null
},
// 为true时阻挡第一次$emit('change'),用于阻止入仓修改初始化时时覆盖了已修改的入仓属性
protectOnce: {
type: Boolean,
default: false
}
},
data(){
return {
index: null,
list:[],
loading: false
loading: false,
// 是否阻止过$emit('change')
hasProtectOnce: false
}
},
watch:{
......@@ -58,7 +65,12 @@ export default {
let productId = val !== '' && val !== null ? this.list[val].id : null
// console.log('index val', val, oldVal, productId)
this.$emit('input', productId)
this.$emit('change', val !== '' && val !== null ? this.list[val] : null)
if (this.protectOnce && !this.hasProtectOnce) {
this.hasProtectOnce = true
} else {
this.$emit('change', val !== '' && val !== null ? this.list[val] : null)
}
},
value(val){
// console.log('初始化内容', val)
......
......@@ -13,14 +13,14 @@
<el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<span style="min-width: 200px;margin-right: 15px;display: inline-block">
<product-selector v-if="!order.parentOrderId && !isAdd" v-model="form.prodId" @change="onProductChange" determined/>
<product-selector v-if="!order.parentOrderId && !isAdd" v-model="form.prodId" @change="onProductChange" determined protect-once/>
<span v-else>{{ warehousing.prodTitleZh }}</span>
</span>
<el-button v-if="!order.parentOrderId && !isAdd" type="text" @click="isShowProduct = true">添加新商品</el-button>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template>
<product-selector v-if="!order.parentOrderId && !isAdd" lang="En" v-model="form.prodId" @change="onProductChange" determined/>
<product-selector v-if="!order.parentOrderId && !isAdd" lang="En" v-model="form.prodId" @change="onProductChange" determined protect-once/>
<span v-else>{{ warehousing.prodTitleEn }}</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('品牌')">
......@@ -953,12 +953,18 @@ export default {
})
},
onProductChange(product){
if (!product) {
return
}
this.form.prodTitleZh = product.titleZh
this.form.prodTitleEn = product.titleEn
this.handleBrandChange(parseInt(this.form.brand))
this.form.warehouseInProdAttrIds = product.attrId ? product.attrId.split(',').map(e => +e) : []
},
onProductChange1(product){
if (!product) {
return
}
this.form1.prodTitleZh = product.titleZh
this.form1.prodTitleEn = product.titleEn
this.handleBrandChange(parseInt(this.form1.brand))
......
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