Commit dc8a25c2 authored by Marcus's avatar Marcus

后台-入仓-体积、重量、长宽高未填,但是也可以提交入仓

http://zentao.jdshangmen.com/bug-view-421.html
parent 46f48388
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-dialog <el-dialog
title="入仓-货物入仓" title="入仓-货物入仓"
:visible.sync="opened" :visible.sync="opened"
width="960px" width="1080px"
> >
<el-tabs v-model="activeName" type="card" @tab-click="handleTabs"> <el-tabs v-model="activeName" type="card" @tab-click="handleTabs">
<el-tab-pane label="货物入仓" name="first"> <el-tab-pane label="货物入仓" name="first">
...@@ -49,67 +49,92 @@ ...@@ -49,67 +49,92 @@
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete"></el-button> <el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd()"></el-button> <el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd()"></el-button>
</div> </div>
<el-table <el-form ref="tableForm" :model="form" :rules="tableFormRules" size="mini">
:data="tableData" <el-table
style="width: 100%"> :data="tableData"
<el-table-column label="箱数"> style="width: 100%">
<template v-slot="{r,c,$index}"> <el-table-column label="箱数" width="150px">
<span v-if="tableData[$index].id">{{ tableData[$index].cartonsNum }}</span> <template v-slot="{r,c,$index}">
<el-input v-else v-model="tableData[$index].cartonsNum" placeholder=""></el-input> <el-form-item prop="cartonsNum">
<span>{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span> <span v-if="tableData[$index].id">
</template> {{ tableData[$index].cartonsNum }}
</el-table-column> {{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}
<el-table-column label="包装类型"> </span>
<template v-slot="{r,c,$index}"> <el-input v-else v-model="tableData[$index].cartonsNum" placeholder="">
<span v-if="tableData[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span> <span slot="append">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span>
<dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData[$index].unit"></dict-selector> </el-input>
</template> </el-form-item>
</el-table-column> </template>
<el-table-column label="长(cm)"> </el-table-column>
<template v-slot="{r,c,$index}"> <el-table-column label="包装类型" width="100px">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[0] : '' }}</span> <template v-slot="{r,c,$index}">
<el-input v-else v-model.number="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input> <el-form-item>
</template> <span v-if="tableData[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span>
</el-table-column> <dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData[$index].unit"></dict-selector>
<el-table-column label="宽(cm)"> </el-form-item>
<template v-slot="{r,c,$index}"> </template>
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[1] : '' }}</span> </el-table-column>
<el-input v-else v-model.number="tableData[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input> <el-table-column label="长(cm)">
</template> <template v-slot="{r,c,$index}">
</el-table-column> <el-form-item prop="long">
<el-table-column label="高(cm)"> <span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[0] : '' }}</span>
<template v-slot="{r,c,$index}"> <el-input v-else v-model.number="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[2] : '' }}</span> </el-form-item>
<el-input v-else v-model.number="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="宽(cm)">
<el-table-column label="体积(m³)"> <template v-slot="{r,c,$index}">
<template v-slot="{r,c,$index}"> <el-form-item prop="width">
<span v-if="tableData[$index].id">{{ tableData[$index].volume }}</span> <span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[1] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].volume" placeholder=""></el-input> <el-input v-else v-model.number="tableData[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</template> </el-form-item>
</el-table-column> </template>
<el-table-column label="重量(Kg)"> </el-table-column>
<template v-slot="{r,c,$index}"> <el-table-column label="高(cm)">
<span v-if="tableData[$index].id">{{ tableData[$index].weight }}</span> <template v-slot="{r,c,$index}">
<el-input v-else v-model.number="tableData[$index].weight" placeholder=""></el-input> <el-form-item prop="height">
</template> <span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[2] : '' }}</span>
</el-table-column> <el-input v-else v-model.number="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
<el-table-column label="数量" width="130px"> </el-form-item>
<template v-slot="{r,c,$index}"> </template>
<span v-if="tableData[$index].id">{{ tableData[$index].quantityAll }}</span> </el-table-column>
<el-input v-else v-model.number="tableData[$index].quantityAll" placeholder=""> <el-table-column label="体积(m³)">
<template slot="append"></template> <template v-slot="{r,c,$index}">
</el-input> <el-form-item prop="volume">
</template> <span v-if="tableData[$index].id">{{ tableData[$index].volume }}</span>
</el-table-column> <el-input v-else v-model.number="tableData[$index].volume" placeholder=""></el-input>
<el-table-column label="快递单号"> </el-form-item>
<template v-slot="{r,c,$index}"> </template>
<span v-if="tableData[$index].id">{{ tableData[$index].expressNo }}</span> </el-table-column>
<el-input v-else v-model="tableData[$index].expressNo" placeholder=""></el-input> <el-table-column label="重量(Kg)">
</template> <template v-slot="{r,c,$index}">
</el-table-column> <el-form-item prop="weight">
</el-table> <span v-if="tableData[$index].id">{{ tableData[$index].weight }}</span>
<el-input v-else v-model.number="tableData[$index].weight" placeholder=""></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="数量" width="130px">
<template v-slot="{r,c,$index}">
<el-form-item prop="quantityAll">
<span v-if="tableData[$index].id">{{ tableData[$index].quantityAll }}</span>
<el-input v-else v-model.number="tableData[$index].quantityAll" placeholder="">
<template slot="append"></template>
</el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="快递单号">
<template v-slot="{r,c,$index}">
<el-form-item>
<span v-if="tableData[$index].id">{{ tableData[$index].expressNo }}</span>
<el-input v-else v-model="tableData[$index].expressNo" placeholder=""></el-input>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
...@@ -155,67 +180,91 @@ ...@@ -155,67 +180,91 @@
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete(1)"></el-button> <el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete(1)"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd(1)"></el-button> <el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd(1)"></el-button>
</div> </div>
<el-table <el-form ref="tableForm1" :model="form" :rules="tableFormRules" size="mini">
:data="tableData1" <el-table
style="width: 100%"> :data="tableData1"
<el-table-column label="箱数"> style="width: 100%">
<template v-slot="{r,c,$index}"> <el-table-column label="箱数" width="150px">
<span v-if="tableData1[$index].id">{{ tableData1[$index].cartonsNum }}</span> <template v-slot="{r,c,$index}">
<el-input v-else v-model="tableData1[$index].cartonsNum" placeholder=""></el-input> <el-form-item prop="cartonsNum">
<span>{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span> <span v-if="tableData1[$index].id">
</template> {{ tableData1[$index].cartonsNum }}
</el-table-column> {{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}
<el-table-column label="包装类型"> </span>
<template v-slot="{r,c,$index}"> <el-input v-else v-model="tableData1[$index].cartonsNum" placeholder="">
<span v-if="tableData1[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span> <span slot="append">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span>
<dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData1[$index].unit"></dict-selector> </el-input>
</template> </el-form-item>
</el-table-column> </template>
<el-table-column label="长(cm)"> </el-table-column>
<template v-slot="{r,c,$index}"> <el-table-column label="包装类型" width="100px">
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[0] : '' }}</span> <template v-slot="{r,c,$index}">
<el-input v-else v-model.number="tableData1[$index].boxGauge1" placeholder="" @blur="handleVolume($index, 1)"></el-input> <el-form-item>
</template> <span v-if="tableData1[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span>
</el-table-column> <dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData1[$index].unit"></dict-selector>
<el-table-column label="宽(cm)"> </el-form-item>
<template v-slot="{r,c,$index}"> </template>
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[1] : '' }}</span> </el-table-column>
<el-input v-else v-model.number="tableData1[$index].boxGauge2" placeholder="" @blur="handleVolume($index, 1)"></el-input> <el-table-column label="长(cm)">
</template> <template v-slot="{r,c,$index}">
</el-table-column> <el-form-item prop="long">
<el-table-column label="高(cm)"> <span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[0] : '' }}</span>
<template v-slot="{r,c,$index}"> <el-input v-else v-model.number="tableData1[$index].boxGauge1" placeholder="" @blur="handleVolume($index, 1)"></el-input>
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[2] : '' }}</span> </el-form-item>
<el-input v-else v-model.number="tableData1[$index].boxGauge3" placeholder="" @blur="handleVolume($index, 1)"></el-input> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="宽(cm)">
<el-table-column label="体积(m³)"> <template v-slot="{r,c,$index}">
<template v-slot="{r,c,$index}"> <el-form-item prop="width">
<span v-if="tableData1[$index].id">{{ tableData1[$index].volume }}</span> <span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[1] : '' }}</span>
<el-input v-else v-model.number="tableData1[$index].volume" placeholder=""></el-input> <el-input v-else v-model.number="tableData1[$index].boxGauge2" placeholder="" @blur="handleVolume($index, 1)"></el-input>
</template> </el-form-item>
</el-table-column> </template>
<el-table-column label="重量(Kg)"> </el-table-column>
<template v-slot="{r,c,$index}"> <el-table-column label="高(cm)">
<span v-if="tableData1[$index].id">{{ tableData1[$index].weight }}</span> <template v-slot="{r,c,$index}">
<el-input v-else v-model.number="tableData1[$index].weight" placeholder=""></el-input> <el-form-item prop="height">
</template> <span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[2] : '' }}</span>
</el-table-column> <el-input v-else v-model.number="tableData1[$index].boxGauge3" placeholder="" @blur="handleVolume($index, 1)"></el-input>
<el-table-column label="数量" width="130px"> </el-form-item>
<template v-slot="{r,c,$index}"> </template>
<span v-if="tableData1[$index].id">{{ tableData1[$index].quantityAll }}</span> </el-table-column>
<el-input v-else v-model.number="tableData1[$index].quantityAll" placeholder=""> <el-table-column label="体积(m³)">
<template slot="append"></template> <template v-slot="{r,c,$index}">
</el-input> <el-form-item prop="volume">
</template> <span v-if="tableData1[$index].id">{{ tableData1[$index].volume }}</span>
</el-table-column> <el-input v-else v-model.number="tableData1[$index].volume" placeholder=""></el-input>
<el-table-column label="快递单号"> </el-form-item>
<template v-slot="{r,c,$index}"> </template>
<span v-if="tableData1[$index].id">{{ tableData1[$index].expressNo }}</span> </el-table-column>
<el-input v-else v-model="tableData1[$index].expressNo" placeholder=""></el-input> <el-table-column label="重量(Kg)">
</template> <template v-slot="{r,c,$index}">
</el-table-column> <el-form-item prop="weight">
</el-table> <span v-if="tableData1[$index].id">{{ tableData1[$index].weight }}</span>
<el-input v-else v-model.number="tableData1[$index].weight" placeholder=""></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="数量" width="130px">
<template v-slot="{r,c,$index}">
<el-form-item prop="quantityAll">
<span v-if="tableData1[$index].id">{{ tableData1[$index].quantityAll }}</span>
<el-input v-else v-model.number="tableData1[$index].quantityAll" placeholder="">
<template slot="append"></template>
</el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="快递单号">
<template v-slot="{r,c,$index}">
<el-form-item>
<span v-if="tableData1[$index].id">{{ tableData1[$index].expressNo }}</span>
<el-input v-else v-model="tableData1[$index].expressNo" placeholder=""></el-input>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
...@@ -327,6 +376,15 @@ export default { ...@@ -327,6 +376,15 @@ export default {
feeType: 0, feeType: 0,
recordMode: undefined recordMode: undefined
}, },
tableFormRules: {
cartonsNum: [{required: true, message: "箱数不能为空", trigger: "blur"}],
long: [{required: true, message: "货物长不能为空", trigger: "blur"}],
width: [{required: true, message: "货物宽不能为空", trigger: "blur"}],
height: [{required: true, message: "货物高不能为空", trigger: "blur"}],
volume: [{required: true, message: "体积不能为空", trigger: "blur"}],
weight: [{required: true, message: "重量不能为空", trigger: "blur"}],
quantityAll: [{required: true, message: "数量不能为空", trigger: "blur"}]
},
form1: { form1: {
"brand": "", "brand": "",
"brandType": 0, "brandType": 0,
...@@ -420,60 +478,75 @@ export default { ...@@ -420,60 +478,75 @@ export default {
}) })
] ]
if (this.activeName !== "first"){ if (this.activeName !== "first"){
return orderWarehouseIn({ // 添加非填单货物
...this.form1, this.$refs['tableForm1'].validate(valid => {
brandType: this.form1.brand ? 1 : 0, if (!valid) {
orderId: this.warehousing.orderId, return
orderItemId: undefined, }
orderNo: this.warehousing.orderNo, return orderWarehouseIn({
orderWarehouseInItemDoList: this.form1.orderWarehouseInItemDoList.map(e => { ...this.form1,
return { brandType: this.form1.brand ? 1 : 0,
...e, orderId: this.warehousing.orderId,
boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3 orderItemId: undefined,
orderNo: this.warehousing.orderNo,
orderWarehouseInItemDoList: this.form1.orderWarehouseInItemDoList.map(e => {
return {
...e,
boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3
}
})
}).then(r => {
if (r.data) {
this.$message.success('新增入仓成功')
this.handleClose()
} else {
this.$message.success('新增入仓失败')
} }
}) })
}).then(r => {
if (r.data){
this.$message.success('新增入仓成功')
this.handleClose()
}else {
this.$message.success('新增入仓失败')
}
}) })
} } else {
else if (this.edit) this.$refs['tableForm'].validate(valid => {
return orderWarehouseInUpdateApply({ if (!valid) {
...this.form, return
brandType: this.form.brand ? 1 : 0,
orderId: this.warehousing.orderId,
orderItemId: this.warehousing.orderItemId,
orderNo: this.warehousing.orderNo,
"orderWarehouseInUpdateItemDoList": orderWarehouseInItemDoList,
copyUserId: this.selectedUsers
}).then(r => {
if (r.data){
this.$message.success('入仓修改发起成功')
this.handleClose()
}else {
this.$message.success('入仓修改发起失败')
} }
}) if (this.edit) {
else // 入仓编辑
return orderWarehouseIn({ return orderWarehouseInUpdateApply({
...this.form, ...this.form,
brandType: this.form.brand ? 1 : 0, brandType: this.form.brand ? 1 : 0,
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 "orderWarehouseInUpdateItemDoList": orderWarehouseInItemDoList,
}).then(r => { copyUserId: this.selectedUsers
if (r.data){ }).then(r => {
this.$message.success('入仓成功') if (r.data) {
this.handleClose() this.$message.success('入仓修改发起成功')
}else { this.handleClose()
this.$message.success('入仓失败') } else {
this.$message.success('入仓修改发起失败')
}
})
} else {
// 首次入仓
return orderWarehouseIn({
...this.form,
brandType: this.form.brand ? 1 : 0,
orderId: this.warehousing.orderId,
orderItemId: this.warehousing.orderItemId,
orderNo: this.warehousing.orderNo,
orderWarehouseInItemDoList
}).then(r => {
if (r.data) {
this.$message.success('入仓成功')
this.handleClose()
} else {
this.$message.success('入仓失败')
}
})
} }
}) })
}
}, },
handleClose() { handleClose() {
this.form.orderWarehouseInItemDoList = [] this.form.orderWarehouseInItemDoList = []
...@@ -569,6 +642,19 @@ export default { ...@@ -569,6 +642,19 @@ export default {
} }
</script> </script>
<style scoped> <style scoped lang="scss">
::v-deep .el-table__cell {
padding-bottom: 0;
.cell {
.el-form-item {
margin-bottom: 16px;
}
.el-form-item__error {
z-index: 1;
padding-top: 0;
top: 32px;
}
}
}
</style> </style>
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