Commit b67249de authored by dragondean@qq.com's avatar dragondean@qq.com

箱明细数量必填

parent ef609ce6
<template> <template>
<div style="display: inline-block"> <div style="display: inline-block">
<template v-if="text"> <template v-if="text">
<el-button size="mini" type="text" style="margin-right: 10px" @click="handleOpen">{{ num }}混箱</el-button> <el-button size="mini" type="text" style="margin-right: 10px" @click="handleOpen">{{ num }}{{$t('混箱')}}}</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button size="mini" type="primary" style="margin-right: 10px" @click="handleOpen">{{ title }}</el-button> <el-button size="mini" type="primary" style="margin-right: 10px" @click="handleOpen">{{ title }}</el-button>
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="1024px" width="1024px"
:before-close="handleClose"> :before-close="handleClose">
<template v-slot:title> <template v-slot:title>
<div class="flex flex-items-center"> <div class="flex flex-items-center">
<div class="title flex-1 flex flex-items-center">{{$t('选择订单商品')}}</div> <div class="title flex-1 flex flex-items-center">{{title}}</div>
<el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">选择订单商品</el-button> <el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">{{$t('选择订单商品')}}</el-button>
<div style="width: 100px"><!--占位,防止被关闭按钮挡住--></div> <div style="width: 100px"><!--占位,防止被关闭按钮挡住--></div>
</div> </div>
</template> </template>
<el-form v-if="dialogVisible"> <el-form v-if="dialogVisible">
<WarehouseRecordDetailItem <WarehouseRecordDetailItem
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
/> />
</el-form> </el-form>
<el-button v-show="!readonly" type="primary" size="mini" @click="handleAddItem">添加一条明细</el-button> <el-button v-show="!readonly" type="primary" size="mini" @click="handleAddItem">{{$t('添加一条明细')}}</el-button>
<span v-show="!readonly" slot="footer" class="dialog-footer"> <span v-show="!readonly" slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="handleSave">确 定</el-button> <el-button type="primary" @click="handleSave">{{$t('确定')}}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<choose-order-products <choose-order-products
...@@ -165,16 +165,22 @@ export default { ...@@ -165,16 +165,22 @@ export default {
for (let i = 0; i < this.dataList.length; i++) { for (let i = 0; i < this.dataList.length; i++) {
if (!this.dataList[i].prodId) { if (!this.dataList[i].prodId) {
return this.$notify({ return this.$notify({
title: '明细' + (i + 1) + ': ' + '请选择品名', title: this.$t("填写第{n}条明细的品名", {n: i=1}),
type: "warning" type: "warning"
}) })
} }
if (!this.dataList[i].brand) { if (!this.dataList[i].brand) {
return this.$notify({ return this.$notify({
title: '明细' + (i + 1) + ': ' + '请选择品牌', title: this.$t("填写第{n}条明细的品牌", {n: i=1}),
type: "warning" type: "warning"
}) })
} }
if(!this.dataList[i].quantityAll){
return this.$notify({
title: this.$t("填写第{n}条明细的数量", {n: i=1}),
type: "warning"
})
}
} }
this.$emit('input', this.dataList) this.$emit('input', this.dataList)
this.dialogVisible = false this.dialogVisible = false
...@@ -218,9 +224,9 @@ export default { ...@@ -218,9 +224,9 @@ export default {
computed: { computed: {
title() { title() {
if (this.readonly) { if (this.readonly) {
return '查看箱明细' return this.$t('查看箱明细')
} }
return !this.value || this.value.length === 0 ? '添加箱明细' : '编辑箱明细' return !this.value || this.value.length === 0 ? this.$t('添加箱明细') : this.$t('编辑箱明细')
} }
} }
} }
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</el-form-item> </el-form-item>
</el-col>--> </el-col>-->
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('数量')"> <el-form-item :label="$t('数量')" required>
<el-input v-model="value.quantityAll" type="number" :disabled="readonly" /> <el-input v-model="value.quantityAll" type="number" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
......
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