Commit 5c1a3d9e authored by Marcus's avatar Marcus

入仓 自动计算箱数

parent 1f8620e1
......@@ -122,9 +122,8 @@
<product-selector lang="En" v-model="form1.prodId" @change="onProductChange"/>
</el-descriptions-item>
<el-descriptions-item label="品牌">
<span v-if="warehousing.orderWarehouseInBackItemDoList && warehousing.orderWarehouseInBackItemDoList.length">{{ form1.brand ? brand1 : '无' }}</span>
<el-select
v-else v-model="form1.brand"
v-model="form1.brand"
placeholder="可修改"
filterable
@change="handleBrandChange"
......@@ -373,6 +372,13 @@ export default {
} else {
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 {
(val === 1 ? this.form1 : this.form).orderWarehouseInItemDoList.pop()
},
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({
"boxGauge1": "",
"boxGauge2": "",
"boxGauge3": "",
"cartonsNum": "",
"cartonsNum": cartonsNum > 0 ? cartonsNum : '',
"expressNo": "",
"quantityAll": "",
"unit": "package",
......@@ -550,15 +564,6 @@ export default {
}
}
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