Browse Source

发货申请主子表提交时明细不能为空

master
chenfang 10 months ago
parent
commit
0562fd02d0
  1. 12
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

12
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

@ -124,7 +124,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// getBomDisassemble // getBomDisassemble
DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id']) DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id'])
.then(res => { .then(res => {
console.log(120,res)
res.forEach(item => { res.forEach(item => {
item.qty = item.planQty item.qty = item.planQty
}) })
@ -298,8 +297,6 @@ const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: number) => {
if(type == "update"){ if(type == "update"){
DeliverRequestMain.allSchemas.formSchema.forEach((item) => { DeliverRequestMain.allSchemas.formSchema.forEach((item) => {
console.log(95132,item);
if (item.field == 'deliverPlanNumber') { if (item.field == 'deliverPlanNumber') {
item.componentProps.isSearchList = false, item.componentProps.isSearchList = false,
item.componentProps.disabled = true item.componentProps.disabled = true
@ -380,11 +377,18 @@ const flag = ref(false)
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
if(tableData.value.length <= 0){
message.warning(`子表明细不能为空!`)
flag.value = true
formRef.value.formLoading = false
return;
}
data.subList = tableData.value // data.subList = tableData.value //
data.subList.forEach(obj => { data.subList.forEach(obj => {
if(obj.qty == 0){ if(obj.qty == 0){
message.error(`数量不能为0!`) message.warning(`数量不能为0!`)
flag.value = true flag.value = true
formRef.value.formLoading = false
return; return;
} }
}) })

Loading…
Cancel
Save