From 5b238a4f037c1fe2e2af8769e62f75b8ff2d389a Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期三, 11 十二月 2024 16:12:17 +0800
Subject: [PATCH] 上片模块新增删除工程

---
 UI-Project/src/views/Returns/returns.vue |   50 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/UI-Project/src/views/Returns/returns.vue b/UI-Project/src/views/Returns/returns.vue
index f7a9744..8326877 100644
--- a/UI-Project/src/views/Returns/returns.vue
+++ b/UI-Project/src/views/Returns/returns.vue
@@ -6,7 +6,6 @@
 import {host, WebSocketHost} from '@/utils/constants'
 import request from "@/utils/request"
 import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
-
 const router = useRouter()
 const {t} = useI18n()
 const dialogFormVisible = ref(false)
@@ -60,7 +59,6 @@
       const uniqueHeights = new Set(response.data.map(item => item.height));
       const uniqueFilmsIds = new Set(response.data.map(item => item.filmsId));
       const uniqueThicknesses = new Set(response.data.map(item => item.thickness));  
-  
       selectOptions.value = Array.from(uniqueWidths).map(width => ({
         value: width,
         label: width,
@@ -93,6 +91,10 @@
   dialogFormVisible.value = true;
   selectgong();
 };
+// 鍒犻櫎
+const handledelete = (row) => {
+  blindb.value = true;
+};
 // 鍊肩彮淇℃伅
 const fetchFlowCardId = async () => {
   try  {
@@ -105,6 +107,33 @@
       tableDatax.value = response.data;
     } else {
       ElMessage.error(response.message);
+    }
+}
+catch (error) {
+    console.error(error);
+  }
+}
+// 鍒犻櫎
+const deleteTask = async () => {
+  try {
+    let engineeringId = window.localStorage.getItem('engineeringId')
+    console.log(engineeringId);
+    if (engineeringId !== '') {
+      const response = await request.post('/loadGlass/engineering/engineering/deleteTask', {
+        engineerId: engineeringId,
+      })
+      if (response.code == 200) {
+        ElMessage.success(response.message);
+        blindb.value = false;
+      } else {
+        ElMessage.error(response.message);
+    }
+  }
+    else  {
+      ElMessage({
+        type: 'info',
+        message: t('basicData.infonull'),
+      })
     }
 }
 catch (error) {
@@ -523,10 +552,6 @@
 const handleBinda = (row) => {
   blinda.value = true;
 };
-// 鍋滄浠诲姟
-const handleBindb = (row) => {
-  blindb.value = true; 
-};
 // 鍒犻櫎
 const handleBindRacka = (row) => {
   workstationId.value = row.workstationId;
@@ -604,13 +629,12 @@
             $t('basicData.change')
           }}
         </el-button>
-  
   </div>
     <el-button :disabled="!canSelectProject" style="margin-top: 5px;margin-left: 15px;"  type="primary" @click="selectproject">{{ $t('basicData.selectproject') }}</el-button>
     <el-button :disabled="!canSelectProject" :style="{ backgroundColor: canStartLoading ? 'green' : 'initial',color: canStartLoading ? 'white' : 'black', }" style="margin-top: 5px;margin-left: 20px;"  @click="handleBind">{{ $t('basicData.startloading') }}</el-button>
     <el-button style="margin-top: 5px;margin-left: 20px;"  id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button>
+    <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handledelete">{{ $t('searchOrder.deleteTask') }}</el-button>
     <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button>
-    <!-- <el-button style="margin-top: 5px;margin-left: 20px;"  id="searchButton" type="danger" @click="handleBindb">鍋滄浠诲姟</el-button> -->
     <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading">
       <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
     <el-table
@@ -705,6 +729,16 @@
       </div>
     </template>
   </el-dialog>
+  <el-dialog v-model="blindb" top="30vh" width="25%" :title="$t('searchOrder.pdeleteTask')">
+    <template #footer>
+      <div id="dialog-footer">
+        <el-button type="primary" @click="deleteTask">
+          {{ $t('basicData.confirm') }}
+        </el-button>
+        <el-button @click="blindb = false">{{ $t('basicData.cancel') }}</el-button>
+      </div>
+    </template>
+  </el-dialog>
   <!-- <el-dialog v-model="blindb" top="30vh" width="25%" title="鏄惁鍋滄浠诲姟?" >
     <template #footer>
       <div id="dialog-footer">

--
Gitblit v1.8.0