add:c出入库单参数非空校验
This commit is contained in:
@@ -283,8 +283,6 @@ export default {
|
||||
measureunit.getSelect().then(res => {
|
||||
this.unitDict = res.content
|
||||
})
|
||||
console.log(this.id)
|
||||
console.log(2222222)
|
||||
if (this.id !== '' && this.id !== null && this.id !== undefined) {
|
||||
crudProductIn.getIosInvDtl(this.id).then(res => {
|
||||
this.tableData = res
|
||||
@@ -319,6 +317,25 @@ export default {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
let itemDtl = this.tableData[i];
|
||||
if (!itemDtl.unit_id) {
|
||||
this.crud.notify('单位不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.stor_code) {
|
||||
this.crud.notify('仓库不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.pcsn) {
|
||||
this.crud.notify('物料批次不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.qty) {
|
||||
this.crud.notify('物料出库数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.form.item = this.tableData
|
||||
},
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
placeholder="车间"
|
||||
class="filter-item"
|
||||
style="width: 120px"
|
||||
@change="areaChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusEnum.PRODUCT_AREA"
|
||||
@@ -330,6 +331,15 @@ export default {
|
||||
this.nowrow = row
|
||||
this.materShow = true
|
||||
},
|
||||
|
||||
areaChange(val){
|
||||
if (this.tableData.length>0) {
|
||||
this.tableData.forEach(a=>{
|
||||
this.$set(a.form_data, 'product_area', val)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 提交前校验
|
||||
if (this.tableData.length === 0) {
|
||||
@@ -344,6 +354,25 @@ export default {
|
||||
this.crud.notify('车间不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
let itemDtl = this.tableData[i];
|
||||
if (!itemDtl.unit_id) {
|
||||
this.crud.notify('单位不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.stor_code) {
|
||||
this.crud.notify('仓库不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.pcsn) {
|
||||
this.crud.notify('物料批次不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.qty) {
|
||||
this.crud.notify('物料出库数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.form.item = this.tableData
|
||||
},
|
||||
|
||||
@@ -370,6 +399,7 @@ export default {
|
||||
}
|
||||
this.$set(data.form_data,a.value,item)
|
||||
})
|
||||
this.$set(data.form_data,'product_area',this.form.form_data.product_area)
|
||||
this.tableData.splice(-1, 0, data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
sort: 'id,desc',
|
||||
crudMethod: {...crudFormData},
|
||||
optShow: {
|
||||
add: true,
|
||||
add: false,
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
@@ -291,14 +291,22 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length === 1) {
|
||||
this.task_flag = false
|
||||
this.dis_flag = false
|
||||
this.currentRow = row
|
||||
} else {
|
||||
if (val.length > 1) {
|
||||
this.task_flag = true
|
||||
this.dis_flag = true
|
||||
this.currentRow = null
|
||||
} else {
|
||||
this.currentRow = val[0]
|
||||
if (this.currentRow.status == '10' || this.currentRow.status == '13'){
|
||||
this.dis_flag = false
|
||||
}else {
|
||||
this.dis_flag = true
|
||||
}
|
||||
if (this.currentRow.status == '13'){
|
||||
this.task_flag = false
|
||||
}else {
|
||||
this.task_flag = true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user