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/hollowequipment.vue |   53 +++++++++++++++++++++++++++++++----------------------
 1 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/UI-Project/src/views/hollow/hollowequipment.vue b/UI-Project/src/views/hollow/hollowequipment.vue
index 5b66a71..4a6d0cd 100644
--- a/UI-Project/src/views/hollow/hollowequipment.vue
+++ b/UI-Project/src/views/hollow/hollowequipment.vue
@@ -92,10 +92,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;"
@@ -114,8 +117,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>
@@ -992,6 +995,8 @@
 const topRemove = ref('')
 const filmsId = ref('')
 const thickness = ref('')
+const productName = ref('')
+const customerName = ref('')
 const flowCardId = ref('')
 const casFour = ref('')
 const casOne = ref('')
@@ -1026,6 +1031,7 @@
 const currentRow = reactive({});
 const formattedProcessType = ref([]);
 const selectedFormulaName = ref('');
+const pairTotal = ref();
 let selectedFormulaId = ref(null);
 const formulaNameid = ref({ id: null });
 const titleformulaName = ref({ formulaName: [] ,formulaId: []});
@@ -1377,11 +1383,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 }) {
@@ -1401,16 +1406,17 @@
     const response = await request.post('/hollowGlass/hollowGlassRelationInfo/queryHollowAllFlowCard',{
       filmsId: filmsId.value,
       flowCardId: flowCardId.value,
+      productName: productName.value,
+      customerName: customerName.value,
       thickness: thickness.value
     });
     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');
   }
 };
 // 涓┖閰嶆柟
@@ -1423,10 +1429,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) => {
@@ -1525,10 +1529,8 @@
       intervalFrameWidthFour.value = '';
       sealInsert.value = '';
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 
@@ -1583,10 +1585,8 @@
       adda.value = false
       fetchmulan()
     } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 // 涓┖閰嶆柟鍒犻櫎 
@@ -1608,7 +1608,6 @@
       ElMessage.success(response.message);
       fetchmulan()
     } else {
-      ElMessage.error(response.msg);
       }  
     }  
   } catch (error) {
@@ -1626,14 +1625,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="+ 930 + "&flowCardId=" + selectedProjectNo.value;
   window.localStorage.setItem('flowCardId', selectedProjectNo.value)
@@ -1645,10 +1646,8 @@
       selectedProjectNo.value = ''
       closeWebSocket(socket);
   } else {
-      ElMessage.error('Failed to fetch data');
     }
   } catch (error) {
-    ElMessage.error('Error fetching data');
   }
 };
 const parseData = (rawData) => {
@@ -1671,7 +1670,6 @@
       tableDatac.value = response.data[page];
       ElMessage.success(response.message);
     } else {
-      ElMessage.error(response.message);
     }
   } catch (error) {
   }
@@ -1687,7 +1685,6 @@
         ElMessage.success(response.message);
         blinda.value = false;
       } else {
-        ElMessage.error(response.message);
       }
     } else {
       ElMessage({
@@ -1709,7 +1706,6 @@
         ElMessage.success(response.message);
         blindc.value = false;
       } else {
-        ElMessage.error(response.message);
       }
     } else {
       ElMessage({
@@ -1731,7 +1727,6 @@
         ElMessage.success(response.message);
         blindd.value = false;
       } else {
-        ElMessage.error(response.message);
       }
     } else {
       ElMessage({
@@ -1744,6 +1739,14 @@
 }
 // 棰嗗彇浠诲姟
 const finisha = async () => {
+  if (!totalPairQuantity.value) {
+    ElMessage.error(t('hellow.cpairQuantity'))
+    return
+  }
+  if (!selectedFormulaName.value) {
+    ElMessage.error(t('hellow.phollowformula'))
+    return
+  }
   let flowCardId = window.localStorage.getItem('flowCardId')
   let id = window.localStorage.getItem('id')
     try {
@@ -1756,7 +1759,6 @@
       formulaName.value = '';
       totalPairQuantity.value = '';
     } else {
-          ElMessage.error(response.message);
         }
       } catch (error) {
       }
@@ -1765,6 +1767,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="+ 930 + "&flowCardId=" + flowCardId + "&totalPairQuantity=" + totalPairQuantitya.value+ "&formulaId=" + id;
       const response = await request.post(url)
@@ -1774,7 +1784,6 @@
       cella.value = '';
       totalPairQuantitya.value = '';
     } else {
-          ElMessage.error(response.message);
         }
       } catch (error) {
       }

--
Gitblit v1.8.0