Commit 9bed04d8 authored by 我在何方's avatar 我在何方
parents 493fb359 d157a3bd
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
<el-descriptions border :column="2"> <el-descriptions border :column="2">
<el-descriptions-item> <el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template> <template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<product-selector v-if="edit && !this.order.parentOrderId" v-model="form.prodId" @change="onProductChange0"/> <product-selector v-if="!order.parentOrderId" v-model="form.prodId" @change="onProductChange0"/>
<span v-else>{{ warehousing.prodTitleZh }}</span> <span v-else>{{ warehousing.prodTitleZh }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template> <template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template>
<product-selector v-if="edit && !this.order.parentOrderId" lang="En" v-model="form.prodId" @change="onProductChange0"/> <product-selector v-if="!order.parentOrderId" lang="En" v-model="form.prodId" @change="onProductChange0"/>
<span v-else>{{ warehousing.prodTitleEn }}</span> <span v-else>{{ warehousing.prodTitleEn }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('品牌')"> <el-descriptions-item :label="$t('品牌')">
...@@ -77,16 +77,10 @@ ...@@ -77,16 +77,10 @@
<span style="color: red">*</span>{{ $t('箱数') }}</template> <span style="color: red">*</span>{{ $t('箱数') }}</template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.cartonsNum" :prop="$index + '.cartonsNum'"> <el-form-item :rules="tableFormRules.cartonsNum" :prop="$index + '.cartonsNum'">
<span v-if="tableData[$index].id && !edit">
{{ tableData[$index].cartonsNum }}
{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, tableData[$index].specificationType) }}
</span>
<template v-else>
<el-input v-model="tableData[$index].cartonsNum" placeholder="" @blur="handleVolume($index)"> <el-input v-model="tableData[$index].cartonsNum" placeholder="" @blur="handleVolume($index)">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, tableData[$index].specificationType) }}</span> <span slot="append">{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, tableData[$index].specificationType) }}</span>
</el-input> </el-input>
<dict-selector :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="tableData[$index].specificationType" @change="handleVolume($index)"></dict-selector> <dict-selector :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="tableData[$index].specificationType" @change="handleVolume($index)"></dict-selector>
</template>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -95,8 +89,7 @@ ...@@ -95,8 +89,7 @@
<span style="color: red">*</span>{{ $t('包装类型') }}</template> <span style="color: red">*</span>{{ $t('包装类型') }}</template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item> <el-form-item>
<span v-if="tableData[$index].id && !edit">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGING_TYPE, tableData[$index].unit) }}</span> <dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="tableData[$index].unit"></dict-selector>
<dict-selector v-else :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="tableData[$index].unit"></dict-selector>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -106,8 +99,7 @@ ...@@ -106,8 +99,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge1" :prop="!tableData[$index].id && $index + '.boxGauge1'"> <el-form-item :rules="tableFormRules.boxGauge1" :prop="!tableData[$index].id && $index + '.boxGauge1'">
<span v-if="tableData[$index].id && !edit">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[0] : '' }}</span> <el-input type="number" v-model="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
<el-input v-else type="number" v-model="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -117,8 +109,7 @@ ...@@ -117,8 +109,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge2" :prop="!tableData[$index].id && $index + '.boxGauge2'"> <el-form-item :rules="tableFormRules.boxGauge2" :prop="!tableData[$index].id && $index + '.boxGauge2'">
<span v-if="tableData[$index].id && !edit">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[1] : '' }}</span> <el-input type="number" v-model="tableData[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
<el-input v-else type="number" v-model="tableData[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -128,8 +119,7 @@ ...@@ -128,8 +119,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge3" :prop="!tableData[$index].id && $index + '.boxGauge3'"> <el-form-item :rules="tableFormRules.boxGauge3" :prop="!tableData[$index].id && $index + '.boxGauge3'">
<span v-if="tableData[$index].id && !edit">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[2] : '' }}</span> <el-input type="number" v-model="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
<el-input v-else type="number" v-model="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -139,8 +129,7 @@ ...@@ -139,8 +129,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.volume" :prop="$index + '.volume'"> <el-form-item :rules="tableFormRules.volume" :prop="$index + '.volume'">
<span v-if="tableData[$index].id && !edit">{{ tableData[$index].volume }}</span> <el-input v-model="tableData[$index].volume" placeholder="" type="number"></el-input>
<el-input v-else v-model="tableData[$index].volume" placeholder="" type="number"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -150,16 +139,14 @@ ...@@ -150,16 +139,14 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.weight" :prop="$index + '.weight'"> <el-form-item :rules="tableFormRules.weight" :prop="$index + '.weight'">
<span v-if="tableData[$index].id && !edit">{{ tableData[$index].weight }}</span> <el-input v-model="tableData[$index].weight" placeholder="" type="number"></el-input>
<el-input v-else v-model="tableData[$index].weight" placeholder="" type="number"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('数量')" width="130px"> <el-table-column :label="$t('数量')" width="130px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.quantityAll" :prop="$index + '.quantityAll'"> <el-form-item :rules="tableFormRules.quantityAll" :prop="$index + '.quantityAll'">
<span v-if="tableData[$index].id && !edit">{{ tableData[$index].quantityAll }}</span> <el-input v-model.number="tableData[$index].quantityAll" placeholder="">
<el-input v-else v-model.number="tableData[$index].quantityAll" placeholder="">
<template slot="append">{{ $t('') }}</template> <template slot="append">{{ $t('') }}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -168,8 +155,7 @@ ...@@ -168,8 +155,7 @@
<el-table-column :label="$t('快递单号')"> <el-table-column :label="$t('快递单号')">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item> <el-form-item>
<span v-if="tableData[$index].id && !edit">{{ tableData[$index].expressNo }}</span> <el-input v-model="tableData[$index].expressNo" placeholder=""></el-input>
<el-input v-else v-model="tableData[$index].expressNo" placeholder=""></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -177,7 +163,6 @@ ...@@ -177,7 +163,6 @@
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<warehouse-area-select <warehouse-area-select
v-model="tableData[$index].orderLocationBackVOList" v-model="tableData[$index].orderLocationBackVOList"
:readonly="tableData[$index].id && !edit"
:order-id="orderId" :order-id="orderId"
:order-item-id="warehousing.orderItemId" :order-item-id="warehousing.orderItemId"
:warehouse-in-id="tableData[$index].id" :warehouse-in-id="tableData[$index].id"
...@@ -537,6 +522,32 @@ export default { ...@@ -537,6 +522,32 @@ export default {
}, },
opened(val) { opened(val) {
if (val) { if (val) {
this.form1 = {
"brand": undefined,
"brandType": 0,
"inTime": "",
"material": "",
"orderId": 0,
"orderItemId": 0,
"orderNo": "",
"orderWarehouseInItemDoList": [],
"prodAttrIds": "",
"prodId": '',
"prodTitleEn": "",
"prodTitleZh": "",
"prodType": 0,
"type": 1,
feeType: 0,
recordMode: undefined
}
this.form.orderWarehouseInItemDoList = []
this.form1.orderWarehouseInItemDoList = []
this.activeName = 'first'
if (!this.edit){
this.handleAdd()
this.handleAdd(1)
}
this.form.prodId = this.warehousing.prodId this.form.prodId = this.warehousing.prodId
this.form.material = this.warehousing.material this.form.material = this.warehousing.material
if (this.warehousing.brand && this.warehousing.brand !== 0){ if (this.warehousing.brand && this.warehousing.brand !== 0){
...@@ -560,13 +571,6 @@ export default { ...@@ -560,13 +571,6 @@ export default {
}, },
warehousing(newVal, oldVal){ warehousing(newVal, oldVal){
if(newVal.orderItemId !== oldVal.orderItemId){ if(newVal.orderItemId !== oldVal.orderItemId){
this.form.orderWarehouseInItemDoList = []
this.form1.orderWarehouseInItemDoList = []
this.activeName = 'first'
if (!this.edit){
this.handleAdd()
this.handleAdd(1)
}
} }
} }
}, },
...@@ -638,16 +642,16 @@ export default { ...@@ -638,16 +642,16 @@ export default {
}, 0) }, 0)
}, },
handleSubmit() { handleSubmit() {
const orderWarehouseInItemDoList = [ // const orderWarehouseInItemDoList = [
...this.warehousing.orderWarehouseInBackItemDoList, // ...this.warehousing.orderWarehouseInBackItemDoList,
...this.form.orderWarehouseInItemDoList.map(e => { // ...this.form.orderWarehouseInItemDoList.map(e => {
return { // return {
...e, // ...e,
boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3, // boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3,
orderLocationCreateReqVOList: e.orderLocationBackVOList // orderLocationCreateReqVOList: e.orderLocationBackVOList
} // }
}) // })
] // ]
if (this.activeName !== "first"){ if (this.activeName !== "first"){
// 添加非填单货物 // 添加非填单货物
this.$refs['form1'].validate(valid => { this.$refs['form1'].validate(valid => {
...@@ -713,14 +717,20 @@ export default { ...@@ -713,14 +717,20 @@ export default {
} }
}) })
} else { } else {
// 首次入仓 // 首次入仓、入仓补充
return orderWarehouseIn({ return orderWarehouseIn({
...this.form, ...this.form,
brandType: this.warehousing.brandType, brandType: this.warehousing.brandType,
orderId: this.warehousing.orderId, orderId: this.warehousing.orderId,
orderItemId: this.warehousing.orderItemId, orderItemId: this.warehousing.orderItemId,
orderNo: this.warehousing.orderNo, orderNo: this.warehousing.orderNo,
orderWarehouseInItemDoList orderWarehouseInItemDoList: this.tableData.map(e => {
return {
...e,
boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3,
orderLocationCreateReqVOList: e.orderLocationBackVOList
}
}),
}).then(r => { }).then(r => {
if (r.data) { if (r.data) {
this.$message.success('入仓成功') this.$message.success('入仓成功')
...@@ -752,13 +762,13 @@ export default { ...@@ -752,13 +762,13 @@ export default {
}) })
cartonsNum = this.warehousing.num - hasCartonsNum cartonsNum = this.warehousing.num - hasCartonsNum
orderLocationBackVOList = this.tableData.length // orderLocationBackVOList = this.tableData.length
? this.tableData[this.tableData.length - 1].orderLocationBackVOList // ? this.tableData[this.tableData.length - 1].orderLocationBackVOList
: [] // : []
} else { // 添加新品名 } else { // 添加新品名
orderLocationBackVOList = this.tableData1.length // orderLocationBackVOList = this.tableData1.length
? this.tableData1[this.tableData1.length - 1].orderLocationBackVOList // ? this.tableData1[this.tableData1.length - 1].orderLocationBackVOList
: [] // : []
} }
const form = val === 1 ? this.form1 : this.form const form = val === 1 ? this.form1 : this.form
...@@ -789,9 +799,9 @@ export default { ...@@ -789,9 +799,9 @@ export default {
return this.brandList.find(e => e.id === this.form1.brand) || '' return this.brandList.find(e => e.id === this.form1.brand) || ''
}, },
tableData() { tableData() {
if (!this.edit){ // if (!this.edit){
return [...this.warehousing.orderWarehouseInBackItemDoList, ...this.form.orderWarehouseInItemDoList] // return [...this.warehousing.orderWarehouseInBackItemDoList, ...this.form.orderWarehouseInItemDoList]
} // }
// 入仓修改的时候 // 入仓修改的时候
this.form.orderWarehouseInItemDoList = this.warehousing.orderWarehouseInBackItemDoList this.form.orderWarehouseInItemDoList = this.warehousing.orderWarehouseInBackItemDoList
......
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