Browse Source

change: cargo集货页面.-- 箱数.唛头.货物名称.体积 改为必填.

peter 3 weeks ago
parent
commit
f8a36e2359
1 changed files with 49 additions and 0 deletions
  1. 49 0
      src/pages/cargo-consolidation-request/index.vue

+ 49 - 0
src/pages/cargo-consolidation-request/index.vue

@@ -1061,10 +1061,27 @@ const commit = async () => {
   let formData = customMapData(temp.filter((i) => !i.deleteFlag))
 
   const emptyUserNotesList: number[] = []
+  const emptyCartonList: number[] = [] // 箱数
+  const emptyMarksNosList: number[] = [] // 唛头
+  const emptyNameList: number[] = [] // 货物名称 Description_of_Goods
+  const emptyCubeList: number[] = [] // 体积
+
   formData.forEach((i, index) => {
     if (!i.User_Notes) {
       emptyUserNotesList.push(index)
     }
+    if (!i.Carton) {
+      emptyCartonList.push(index)
+    }
+    if (!i.Marks_Nos) {
+      emptyMarksNosList.push(index)
+    }
+    if (!i.Description_of_Goods) {
+      emptyNameList.push(index)
+    }
+    if (!i.Cube) {
+      emptyCubeList.push(index)
+    }
   })
 
   if (emptyUserNotesList.length) {
@@ -1075,6 +1092,38 @@ const commit = async () => {
     })
     return
   }
+  if (emptyCartonList.length) {
+    ElNotification({
+      title: '请检查表单, 箱数是必填的',
+      message: `第 ${emptyCartonList.map((i) => i + 1).join(', ')} 行的箱数数据, 不能为空`,
+      duration: 5000,
+    })
+    return
+  }
+  if (emptyMarksNosList.length) {
+    ElNotification({
+      title: '请检查表单, 唛头是必填的',
+      message: `第 ${emptyMarksNosList.map((i) => i + 1).join(', ')} 行的唛头数据, 不能为空`,
+      duration: 5000,
+    })
+    return
+  }
+  if (emptyNameList.length) {
+    ElNotification({
+      title: '请检查表单, 货物名称是必填的',
+      message: `第 ${emptyNameList.map((i) => i + 1).join(', ')} 行的货物名称数据, 不能为空`,
+      duration: 5000,
+    })
+    return
+  }
+  if (emptyCubeList.length) {
+    ElNotification({
+      title: '请检查表单, 体积是必填的',
+      message: `第 ${emptyCubeList.map((i) => i + 1).join(', ')} 行的体积数据, 不能为空`,
+      duration: 5000,
+    })
+    return
+  }
 
   formData = formData.concat(
     temp