Commit 5c1a3d9e authored by Marcus's avatar Marcus

入仓 自动计算箱数

parent 1f8620e1
...@@ -122,9 +122,8 @@ ...@@ -122,9 +122,8 @@
<product-selector lang="En" v-model="form1.prodId" @change="onProductChange"/> <product-selector lang="En" v-model="form1.prodId" @change="onProductChange"/>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="品牌"> <el-descriptions-item label="品牌">
<span v-if="warehousing.orderWarehouseInBackItemDoList && warehousing.orderWarehouseInBackItemDoList.length">{{ form1.brand ? brand1 : '无' }}</span>
<el-select <el-select
v-else v-model="form1.brand" v-model="form1.brand"
placeholder="可修改" placeholder="可修改"
filterable filterable
@change="handleBrandChange" @change="handleBrandChange"
...@@ -373,6 +372,13 @@ export default { ...@@ -373,6 +372,13 @@ export default {
} else { } else {
this.$emit('update:visible', false) this.$emit('update:visible', false)
} }
},
warehousing(newVal, oldVal){
if(newVal.orderItemId !== oldVal.orderItemId){
this.form.orderWarehouseInItemDoList = []
this.form1.orderWarehouseInItemDoList = []
this.activeName = 'first'
}
} }
}, },
...@@ -477,11 +483,19 @@ export default { ...@@ -477,11 +483,19 @@ export default {
(val === 1 ? this.form1 : this.form).orderWarehouseInItemDoList.pop() (val === 1 ? this.form1 : this.form).orderWarehouseInItemDoList.pop()
}, },
handleAdd(val) { handleAdd(val) {
let cartonsNum = '';
if (val !== 1) {
let hasCartonsNum = 0
this.tableData.forEach(e => {
hasCartonsNum += e.cartonsNum
})
cartonsNum = this.warehousing.num - hasCartonsNum
}
(val === 1 ? this.form1 : this.form).orderWarehouseInItemDoList.push({ (val === 1 ? this.form1 : this.form).orderWarehouseInItemDoList.push({
"boxGauge1": "", "boxGauge1": "",
"boxGauge2": "", "boxGauge2": "",
"boxGauge3": "", "boxGauge3": "",
"cartonsNum": "", "cartonsNum": cartonsNum > 0 ? cartonsNum : '',
"expressNo": "", "expressNo": "",
"quantityAll": "", "quantityAll": "",
"unit": "package", "unit": "package",
...@@ -550,15 +564,6 @@ export default { ...@@ -550,15 +564,6 @@ export default {
} }
} }
return '' return ''
},
brand1(){
if (!!this.form1.brand){
const brand = this.brandList.find(e => e.id === this.form1.brand)
if (brand) {
return brand.titleZh
}
}
return ''
} }
} }
} }
......
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