From 870b2e410af104ce9a551cd7f3f462b77800266a Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期四, 26 六月 2025 09:47:15 +0800
Subject: [PATCH] 解决中空一线、二线、三线前端返回空数据时报错问题

---
 UI-Project/src/views/hollow/hollowequipmenttwo.vue |  101 +++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 78 insertions(+), 23 deletions(-)

diff --git a/UI-Project/src/views/hollow/hollowequipmenttwo.vue b/UI-Project/src/views/hollow/hollowequipmenttwo.vue
index 80972b3..0d1a301 100644
--- a/UI-Project/src/views/hollow/hollowequipmenttwo.vue
+++ b/UI-Project/src/views/hollow/hollowequipmenttwo.vue
@@ -65,10 +65,13 @@
     <div style="display: flex;">
     <el-input v-model="flowCardId" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('searchOrder.incardnumber')" />
     <el-input v-model="filmsId" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('film.infilms')"/>
+    <el-input v-model="productName" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('large.inproductname')"/>
+    <el-input v-model="customerName" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('large.incustomerName')"/>
     <el-input v-model="thickness" style="margin-left: 10px;margin-bottom: 10px;width: 240px;" :placeholder="$t('searchOrder.inthickness')"/>
     <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="fetchFlowCardsearch">
       {{$t('reportmanage.inquire')}}</el-button>
   </div>
+  <div style="margin-left: 87%;">{{$t('hellow.pairsnumbertotal')}}{{ pairTotal }}</div>
   <el-table
     ref="table"
     style="margin-top: 20px; height: 700px;"
@@ -88,8 +91,8 @@
       <el-table-column prop="filmsId" align="center" :label="$t('hellow.coatingtypes')" min-width="80"/>
       <el-table-column prop="sumCount" align="center" :label="$t('hellow.totalnumber')" min-width="80"/>
       <el-table-column prop="realCount" align="center" :label="$t('hellow.realpieces')" min-width="80"/>
-      <el-table-column prop="pairCount" align="center" :label="$t('hellow.pairsnumber')" min-width="80"/>
       <el-table-column prop="damageCount" align="center" :label="$t('hellow.damagenumber')" min-width="80"/>
+      <el-table-column prop="pairCount" align="center" :label="$t('hellow.pairsnumber')" min-width="80"/>
       </el-table>
       </template>
     </el-table-column>
@@ -513,7 +516,7 @@
 const tableDatax = ref([])
 const cell = ref('')
 const cella = ref('')
-const selectedProjectNo = ref('');
+const selectedProjectNo = ref('')
 const totalPairQuantity = ref('')
 const totalPairQuantitya = ref('')
 const bottomRemove = ref('')
@@ -524,6 +527,9 @@
 const rightRemove = ref('')
 const topRemove = ref('')
 const filmsId = ref('')
+const pairTotal = ref()
+const productName = ref('')
+const customerName = ref('')
 const flowCardId = ref('')
 const freetwo = ref('#911005');
 const dialogFormVisiblea = ref(false)
@@ -696,11 +702,10 @@
     if (response.code == 200) {
       ElMessage.success(response.message);
       tableDatab.value = response.data;
+      pairTotal.value = response.data[0].pairTotalCount;
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 function tableRowClassName({ row }) {
@@ -725,11 +730,10 @@
     if (response.code == 200) {
       ElMessage.success(response.message);
       tableDatab.value = response.data;
+      pairTotal.value = response.data[0].pairTotalCount;
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 // 涓┖閰嶆柟
@@ -742,10 +746,8 @@
       tableDatax.value = response.data;
       titleformulaName.value = response.data.map(item => ({ formulaId: item.id, formulaName: item.formulaName }));
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 const handleFormulaChange = (value) => {
@@ -759,6 +761,30 @@
 };
 // 涓┖閰嶆柟娣诲姞
 const handleConfirm = async () => {
+  if (!formulaName.value) {
+    ElMessage.error(t('hellow.formulaNamea'))
+    return
+  }
+  if (!filmRemove.value) {
+    ElMessage.error(t('Mounting.removalmethod'))
+    return
+  }
+  if (!bottomRemove.value) {
+    ElMessage.error(t('hellow.bottomRemovea'))
+    return
+  }
+  if (!topRemove.value) {
+    ElMessage.error(t('hellow.topRemovea'))
+    return
+  }
+  if (!leftRemove.value) {
+    ElMessage.error(t('hellow.leftRemovea'))
+    return
+  }
+  if (!rightRemove.value) {
+    ElMessage.error(t('hellow.rightRemovea'))
+    return
+  }
   try {
     const response = await request.post('/hollowGlass/hollowFormulaDetails/saveFormulaDetails',{
       formulaName: formulaName.value,
@@ -780,10 +806,8 @@
       topRemove.value = '';
       fetchmulan()
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 const removalMethodMapa = {
@@ -792,6 +816,30 @@
 };
 // 涓┖閰嶆柟淇敼
 const handledit = async () => {
+  if (!formulaName.value) {
+    ElMessage.error(t('hellow.formulaNamea'))
+    return
+  }
+  if (!filmRemove.value) {
+    ElMessage.error(t('Mounting.removalmethod'))
+    return
+  }
+  if (!bottomRemove.value) {
+    ElMessage.error(t('hellow.bottomRemovea'))
+    return
+  }
+  if (!topRemove.value) {
+    ElMessage.error(t('hellow.topRemovea'))
+    return
+  }
+  if (!leftRemove.value) {
+    ElMessage.error(t('hellow.leftRemovea'))
+    return
+  }
+  if (!rightRemove.value) {
+    ElMessage.error(t('hellow.rightRemovea'))
+    return
+  }
   try {
     const response = await request.post('/hollowGlass/hollowFormulaDetails/updateFormulaDetails',{
       formulaName: formulaName.value,
@@ -806,10 +854,8 @@
       adda.value = false
       fetchmulan()
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 // 涓┖閰嶆柟鍒犻櫎 
@@ -831,7 +877,6 @@
       ElMessage.success(response.message);
       fetchmulan()
     } else {
-      ElMessage.error(response.msg);
       }  
     }  
   } catch (error) {
@@ -849,14 +894,16 @@
       }));
       titleSelectJson.value.processType = processTypes;
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 // 棰勮
 const handleup = async () => {
+  if (!selectedProjectNo.value) {
+    ElMessage.error(t('basicData.plselectproject'))
+    return
+  }
   try {
     var url="/hollowGlass/hollowGlassOutRelationInfo/appointHollowTaskDetails?cell="+ 931 + "&flowCardId=" + selectedProjectNo.value;
   window.localStorage.setItem('flowCardId', selectedProjectNo.value)
@@ -868,10 +915,8 @@
       selectedProjectNo.value = ''
       closeWebSocket(socket);
   } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 const parseData = (rawData) => {
@@ -894,7 +939,6 @@
       tableDatac.value = response.data[page];
       ElMessage.success(response.message);
     } else {
-      ElMessage.error(response.message);
     }
   } catch (error) {
   }
@@ -910,7 +954,6 @@
         ElMessage.success(response.message);
         blinda.value = false;
       } else {
-        ElMessage.error(response.message);
       }
     } else {
       ElMessage({
@@ -932,7 +975,6 @@
         ElMessage.success(response.message);
         blindc.value = false;
       } else {
-        ElMessage.error(response.message);
       }
     } else {
       ElMessage({
@@ -954,7 +996,6 @@
         ElMessage.success(response.message);
         blindd.value = false;
       } else {
-        ElMessage.error(response.message);
       }
     } else {
       ElMessage({
@@ -969,6 +1010,14 @@
 const finisha = async () => {
   let flowCardId = window.localStorage.getItem('flowCardId')
   let id = window.localStorage.getItem('id')
+  if (!totalPairQuantity.value) {
+    ElMessage.error(t('hellow.cpairQuantity'))
+    return
+  }
+  if (!selectedFormulaName.value) {
+    ElMessage.error(t('hellow.phollowformula'))
+    return
+  }
     try {
       var url="/hollowGlass/hollowGlassOutRelationInfo/receiveTask?cell="+ 931 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantity.value+ "&formulaId=" + id;
       const response = await request.post(url)
@@ -979,7 +1028,6 @@
       formulaName.value = '';
       totalPairQuantity.value = '';
     } else {
-          ElMessage.error(response.message);
         }
       } catch (error) {
       }
@@ -988,6 +1036,14 @@
 const finishb = async () => {
   let flowCardId = window.localStorage.getItem('flowCardId')
   let id = window.localStorage.getItem('id')
+  if (!totalPairQuantity.value) {
+    ElMessage.error(t('hellow.cpairQuantity'))
+    return
+  }
+  if (!selectedFormulaName.value) {
+    ElMessage.error(t('hellow.phollowformula'))
+    return
+  }
   try {
       var url="/hollowGlass/hollowGlassOutRelationInfo/forceOutGlass?cell="+ 931 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantitya.value+ "&formulaId=" + id;
       const response = await request.post(url)
@@ -997,7 +1053,6 @@
       cella.value = '';
       totalPairQuantitya.value = '';
     } else {
-          ElMessage.error(response.message);
         }
       } catch (error) {
       }

--
Gitblit v1.8.0