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-form ref="tableForm" :model="form" :rules="tableFormRules" size="mini">
<el-table <el-table
:data="tableData" :data="tableData"
style="width: 100%"> style="width: 100%">
<el-table-column label="箱数"> <el-table-column label="箱数" width="150px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<span v-if="tableData[$index].id">{{ tableData[$index].cartonsNum }}</span> <el-form-item prop="cartonsNum">
<el-input v-else v-model="tableData[$index].cartonsNum" placeholder=""></el-input> <span v-if="tableData[$index].id">
<span>{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span> {{ tableData[$index].cartonsNum }}
{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}
</span>
<el-input v-else v-model="tableData[$index].cartonsNum" placeholder="">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span>
</el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="包装类型"> <el-table-column label="包装类型" width="100px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item>
<span v-if="tableData[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData[$index].unit) }}</span> <span v-if="tableData[$index].id">{{ 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> <dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData[$index].unit"></dict-selector>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="长(cm)"> <el-table-column label="长(cm)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="long">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[0] : '' }}</span> <span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[0] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input> <el-input v-else v-model.number="tableData[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="宽(cm)"> <el-table-column label="宽(cm)">
<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].boxGauge ? tableData[$index].boxGauge.split('*')[1] : '' }}</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].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input> <el-input v-else v-model.number="tableData[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="高(cm)"> <el-table-column label="高(cm)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="height">
<span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[2] : '' }}</span> <span v-if="tableData[$index].id">{{ tableData[$index].boxGauge ? tableData[$index].boxGauge.split('*')[2] : '' }}</span>
<el-input v-else v-model.number="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input> <el-input v-else v-model.number="tableData[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="体积(m³)"> <el-table-column label="体积(m³)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="volume">
<span v-if="tableData[$index].id">{{ tableData[$index].volume }}</span> <span v-if="tableData[$index].id">{{ tableData[$index].volume }}</span>
<el-input v-else v-model.number="tableData[$index].volume" placeholder=""></el-input> <el-input v-else v-model.number="tableData[$index].volume" placeholder=""></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="重量(Kg)"> <el-table-column label="重量(Kg)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="weight">
<span v-if="tableData[$index].id">{{ tableData[$index].weight }}</span> <span v-if="tableData[$index].id">{{ tableData[$index].weight }}</span>
<el-input v-else v-model.number="tableData[$index].weight" placeholder=""></el-input> <el-input v-else v-model.number="tableData[$index].weight" placeholder=""></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" width="130px"> <el-table-column label="数量" width="130px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="quantityAll">
<span v-if="tableData[$index].id">{{ tableData[$index].quantityAll }}</span> <span v-if="tableData[$index].id">{{ tableData[$index].quantityAll }}</span>
<el-input v-else v-model.number="tableData[$index].quantityAll" placeholder=""> <el-input v-else v-model.number="tableData[$index].quantityAll" placeholder="">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="快递单号"> <el-table-column label="快递单号">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item>
<span v-if="tableData[$index].id">{{ tableData[$index].expressNo }}</span> <span v-if="tableData[$index].id">{{ tableData[$index].expressNo }}</span>
<el-input v-else v-model="tableData[$index].expressNo" placeholder=""></el-input> <el-input v-else v-model="tableData[$index].expressNo" placeholder=""></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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-form ref="tableForm1" :model="form" :rules="tableFormRules" size="mini">
<el-table <el-table
:data="tableData1" :data="tableData1"
style="width: 100%"> style="width: 100%">
<el-table-column label="箱数"> <el-table-column label="箱数" width="150px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<span v-if="tableData1[$index].id">{{ tableData1[$index].cartonsNum }}</span> <el-form-item prop="cartonsNum">
<el-input v-else v-model="tableData1[$index].cartonsNum" placeholder=""></el-input> <span v-if="tableData1[$index].id">
<span>{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span> {{ tableData1[$index].cartonsNum }}
{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}
</span>
<el-input v-else v-model="tableData1[$index].cartonsNum" placeholder="">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span>
</el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="包装类型"> <el-table-column label="包装类型" width="100px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item>
<span v-if="tableData1[$index].id">{{ getDictDataLabel(DICT_TYPE.ECW_PACKAGE_TYPE, tableData1[$index].unit) }}</span> <span v-if="tableData1[$index].id">{{ 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> <dict-selector v-else :type="DICT_TYPE.ECW_PACKAGE_TYPE" v-model="tableData1[$index].unit"></dict-selector>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="长(cm)"> <el-table-column label="长(cm)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="long">
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[0] : '' }}</span> <span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[0] : '' }}</span>
<el-input v-else v-model.number="tableData1[$index].boxGauge1" placeholder="" @blur="handleVolume($index, 1)"></el-input> <el-input v-else v-model.number="tableData1[$index].boxGauge1" placeholder="" @blur="handleVolume($index, 1)"></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="宽(cm)"> <el-table-column label="宽(cm)">
<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].boxGauge ? tableData1[$index].boxGauge.split('*')[1] : '' }}</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].boxGauge2" placeholder="" @blur="handleVolume($index, 1)"></el-input> <el-input v-else v-model.number="tableData1[$index].boxGauge2" placeholder="" @blur="handleVolume($index, 1)"></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="高(cm)"> <el-table-column label="高(cm)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="height">
<span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[2] : '' }}</span> <span v-if="tableData1[$index].id">{{ tableData1[$index].boxGauge ? tableData1[$index].boxGauge.split('*')[2] : '' }}</span>
<el-input v-else v-model.number="tableData1[$index].boxGauge3" placeholder="" @blur="handleVolume($index, 1)"></el-input> <el-input v-else v-model.number="tableData1[$index].boxGauge3" placeholder="" @blur="handleVolume($index, 1)"></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="体积(m³)"> <el-table-column label="体积(m³)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="volume">
<span v-if="tableData1[$index].id">{{ tableData1[$index].volume }}</span> <span v-if="tableData1[$index].id">{{ tableData1[$index].volume }}</span>
<el-input v-else v-model.number="tableData1[$index].volume" placeholder=""></el-input> <el-input v-else v-model.number="tableData1[$index].volume" placeholder=""></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="重量(Kg)"> <el-table-column label="重量(Kg)">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="weight">
<span v-if="tableData1[$index].id">{{ tableData1[$index].weight }}</span> <span v-if="tableData1[$index].id">{{ tableData1[$index].weight }}</span>
<el-input v-else v-model.number="tableData1[$index].weight" placeholder=""></el-input> <el-input v-else v-model.number="tableData1[$index].weight" placeholder=""></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" width="130px"> <el-table-column label="数量" width="130px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item prop="quantityAll">
<span v-if="tableData1[$index].id">{{ tableData1[$index].quantityAll }}</span> <span v-if="tableData1[$index].id">{{ tableData1[$index].quantityAll }}</span>
<el-input v-else v-model.number="tableData1[$index].quantityAll" placeholder=""> <el-input v-else v-model.number="tableData1[$index].quantityAll" placeholder="">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="快递单号"> <el-table-column label="快递单号">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item>
<span v-if="tableData1[$index].id">{{ tableData1[$index].expressNo }}</span> <span v-if="tableData1[$index].id">{{ tableData1[$index].expressNo }}</span>
<el-input v-else v-model="tableData1[$index].expressNo" placeholder=""></el-input> <el-input v-else v-model="tableData1[$index].expressNo" placeholder=""></el-input>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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,6 +478,11 @@ export default { ...@@ -420,6 +478,11 @@ export default {
}) })
] ]
if (this.activeName !== "first"){ if (this.activeName !== "first"){
// 添加非填单货物
this.$refs['tableForm1'].validate(valid => {
if (!valid) {
return
}
return orderWarehouseIn({ return orderWarehouseIn({
...this.form1, ...this.form1,
brandType: this.form1.brand ? 1 : 0, brandType: this.form1.brand ? 1 : 0,
...@@ -433,15 +496,21 @@ export default { ...@@ -433,15 +496,21 @@ export default {
} }
}) })
}).then(r => { }).then(r => {
if (r.data){ if (r.data) {
this.$message.success('新增入仓成功') this.$message.success('新增入仓成功')
this.handleClose() this.handleClose()
}else { } else {
this.$message.success('新增入仓失败') this.$message.success('新增入仓失败')
} }
}) })
})
} else {
this.$refs['tableForm'].validate(valid => {
if (!valid) {
return
} }
else if (this.edit) if (this.edit) {
// 入仓编辑
return orderWarehouseInUpdateApply({ return orderWarehouseInUpdateApply({
...this.form, ...this.form,
brandType: this.form.brand ? 1 : 0, brandType: this.form.brand ? 1 : 0,
...@@ -451,14 +520,15 @@ export default { ...@@ -451,14 +520,15 @@ export default {
"orderWarehouseInUpdateItemDoList": orderWarehouseInItemDoList, "orderWarehouseInUpdateItemDoList": orderWarehouseInItemDoList,
copyUserId: this.selectedUsers copyUserId: this.selectedUsers
}).then(r => { }).then(r => {
if (r.data){ if (r.data) {
this.$message.success('入仓修改发起成功') this.$message.success('入仓修改发起成功')
this.handleClose() this.handleClose()
}else { } else {
this.$message.success('入仓修改发起失败') this.$message.success('入仓修改发起失败')
} }
}) })
else } else {
// 首次入仓
return orderWarehouseIn({ return orderWarehouseIn({
...this.form, ...this.form,
brandType: this.form.brand ? 1 : 0, brandType: this.form.brand ? 1 : 0,
...@@ -467,13 +537,16 @@ export default { ...@@ -467,13 +537,16 @@ export default {
orderNo: this.warehousing.orderNo, orderNo: this.warehousing.orderNo,
orderWarehouseInItemDoList orderWarehouseInItemDoList
}).then(r => { }).then(r => {
if (r.data){ if (r.data) {
this.$message.success('入仓成功') this.$message.success('入仓成功')
this.handleClose() this.handleClose()
}else { } else {
this.$message.success('入仓失败') 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