Commit 0dbc6623 authored by dragondean@qq.com's avatar dragondean@qq.com

打包空值拦截

parent fd455f98
......@@ -84,7 +84,7 @@
<template v-slot:header>
<span style="color: red">*</span>{{ $t('箱数') }}</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.cartonsNum">
<el-form-item :rules="tableFormRules.cartonsNum" :prop="`table.${$index}.cartonsNum`">
<el-input v-model="form.table[$index].cartonsNum" placeholder="" @blur="handleVolume($index)" :disabled="$index < protectRowCount">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, form.table[$index].specificationType) }}</span>
</el-input>
......@@ -106,7 +106,7 @@
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge1">
<el-form-item :rules="tableFormRules.boxGauge1" :prop="`table.${$index}.boxGauge1`">
<el-input :disabled="$index < protectRowCount" type="number" v-model="form.table[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template>
......@@ -116,7 +116,7 @@
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge2">
<el-form-item :rules="tableFormRules.boxGauge2" :prop="`table.${$index}.boxGauge2`">
<el-input :disabled="$index < protectRowCount" type="number" v-model="form.table[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template>
......@@ -126,7 +126,7 @@
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge3">
<el-form-item :rules="tableFormRules.boxGauge3" :prop="`table.${$index}.boxGauge3`">
<el-input :disabled="$index < protectRowCount" type="number" v-model="form.table[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template>
......@@ -136,7 +136,7 @@
<span style="color: red">*</span> <span>{{ $t('体积') }}</span>(m³)
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.volume">
<el-form-item :rules="tableFormRules.volume" :prop="`table.${$index}.volume`">
<el-input :disabled="$index < protectRowCount" v-model="form.table[$index].volume" placeholder="" type="number"></el-input>
</el-form-item>
</template>
......@@ -146,7 +146,7 @@
<span style="color: red">*</span> <span>{{ $t('重量') }}</span>(Kg)
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.weight">
<el-form-item :rules="tableFormRules.weight" :prop="`table.${$index}.weight`">
<el-input :disabled="$index < protectRowCount" v-model="form.table[$index].weight" placeholder="" type="number"></el-input>
</el-form-item>
</template>
......@@ -376,13 +376,13 @@ export default {
brand: [{required: true, message: this.$t("请选择品牌"), trigger: "change"}],
},
tableFormRules: {
// cartonsNum: [{required: true, message: this.$t("箱数不能为空"), trigger: "change"}],
// boxGauge1: [{required: true, message: this.$t("货物长不能为空"), trigger: "change"}],
// boxGauge2: [{required: true, message: this.$t("货物宽不能为空"), trigger: "change"}],
// boxGauge3: [{required: true, message: this.$t("货物高不能为空"), trigger: "change"}],
// volume: [{required: true, message: this.$t("体积不能为空"), trigger: "change"}],
// weight: [{required: true, message: this.$t("重量不能为空"), trigger: "change"}],
// // quantityAll: [{required: true, message: this.$t("数量不能为空"), trigger: "change"}]
cartonsNum: [{required: true, message: this.$t("箱数不能为空"), trigger: "change"}],
boxGauge1: [{required: true, message: this.$t("货物长不能为空"), trigger: "change"}],
boxGauge2: [{required: true, message: this.$t("货物宽不能为空"), trigger: "change"}],
boxGauge3: [{required: true, message: this.$t("货物高不能为空"), trigger: "change"}],
volume: [{required: true, message: this.$t("体积不能为空"), trigger: "change"}],
weight: [{required: true, message: this.$t("重量不能为空"), trigger: "change"}],
// quantityAll: [{required: true, message: this.$t("数量不能为空"), trigger: "change"}]
},
......@@ -492,31 +492,30 @@ export default {
type: 'warning'
})
}
this.$refs['form'].validate(valid => {
this.$refs['tableForm'].validate(valid1 => {
if (!valid || !valid1) {
return
}
// 首次入仓、入仓补充
return finishPacked({
brand: this.form.brand,
orderId: this.warehousing.orderId,
orderItemId: this.warehousing.orderItemId,
orderWarehouseInItemDtoList: this.form.table.map(e => {
return {
...e,
boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3,
orderLocationCreateReqVOList: e.orderLocationBackVOList
}
}),
}).then(r => {
if (r.data) {
this.$message.success('打包成功')
this.handleClose()
} else {
this.$message.success('打包失败')
this.$refs['tableForm'].validate(valid1 => {
console.log("表单校验", valid1)
if (!valid1) {
return
}
// 首次入仓、入仓补充
return finishPacked({
brand: this.form.brand,
orderId: this.warehousing.orderId,
orderItemId: this.warehousing.orderItemId,
orderWarehouseInItemDtoList: this.form.table.map(e => {
return {
...e,
boxGauge: e.boxGauge1 + '*' + e.boxGauge2 + '*' + e.boxGauge3,
orderLocationCreateReqVOList: e.orderLocationBackVOList
}
})
}),
}).then(r => {
if (r.data) {
this.$message.success('打包成功')
this.handleClose()
} else {
this.$message.success('打包失败')
}
})
})
},
......
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