From df418a35e80167ae120e5840d6ff8d19676ee399 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期五, 15 五月 2026 13:37:09 +0800
Subject: [PATCH] 1.报告记录删除功能

---
 src/views/statistic/reportList.vue |   65 ++++++++++++++++++++++++--------
 src/layout/components/Navbar.vue   |   47 ++++++++++++++---------
 src/api/ReportManager.js           |    8 ++++
 3 files changed, 84 insertions(+), 36 deletions(-)

diff --git a/src/api/ReportManager.js b/src/api/ReportManager.js
index aa93227..7ab7a8b 100644
--- a/src/api/ReportManager.js
+++ b/src/api/ReportManager.js
@@ -18,6 +18,14 @@
   })
 }
 
+export function DeleteMesOrderStepReport(data) {
+  return request({
+    url: 'ReportManager/DeleteMesOrderStepReport',
+    method: 'post',
+    data
+  })
+}
+
 // 鍏ュ簱璁板綍瀵煎嚭
 export function StorageRecordExcelSearch(data) {
   return request({
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 139b2aa..e2209fd 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -268,7 +268,7 @@
     // Vue.prototype.$ButtonData = JSON.parse(localStorage.getItem('ButtonData'))
   },
   mounted() {
-    this.getHubConnectionBuilder()
+    // this.getHubConnectionBuilder()
   },
   computed: {
     ...mapGetters([
@@ -313,27 +313,36 @@
     // 寤虹珛hub杩炴帴
     async getHubConnectionBuilder() {
       const url = 'http://121.196.36.24:8048/chatHub'
+
+      // 鏈湴寮�鍙�
+      // if (process.env.NODE_ENV === 'development') {
+      //   url = 'http://121.196.36.24:8048/chatHub'
+      // } else { // 鐢熶骇鐜锛堝叧閿紒锛侊紒鐢ㄧ浉瀵硅矾寰勶紝閬垮厤璺ㄥ煙/鍗忚閿欒锛�
+      //   url = '/chatHub'
+      // }
+
       this.signalr = new signalR.HubConnectionBuilder().withUrl(url, {
-        // skipNegotiation: true,
-        // transport: signalR.HttpTransportType.WebSockets
+        withCredentials: false, // 璺ㄥ煙闇�瑕�
+        skipNegotiation: true,
+        transport: signalR.HttpTransportType.WebSockets
       }).configureLogging(signalR.LogLevel.Information).build()
 
       await this.signalr.start().then(() => {
-        if (window.Notification) {
-          if (Notification.permission === 'granted') {
-            console.log('鍏佽閫氱煡')
-          } else if (Notification.permission !== 'denied') {
-            console.log('闇�瑕侀�氱煡鏉冮檺')
-            Notification.requestPermission((permission) => {
-              console.log('鏉冮檺閫氱煡', permission)
-            })
-          } else if (Notification.permission === 'denied') {
-            // console.log('鎷掔粷閫氱煡')
-          }
-        } else {
-          console.error('娴忚鍣ㄤ笉鏀寔Notification')
-        }
-        // console.log('杩炴帴鎴愬姛')
+        // if (window.Notification) {
+        //   if (Notification.permission === 'granted') {
+        //     console.log('鍏佽閫氱煡')
+        //   } else if (Notification.permission !== 'denied') {
+        //     console.log('闇�瑕侀�氱煡鏉冮檺')
+        //     Notification.requestPermission((permission) => {
+        //       console.log('鏉冮檺閫氱煡', permission)
+        //     })
+        //   } else if (Notification.permission === 'denied') {
+        //     console.log('鎷掔粷閫氱煡')
+        //   }
+        // } else {
+        //   console.error('娴忚鍣ㄤ笉鏀寔Notification')
+        // }
+        console.log('杩炴帴鎴愬姛')
       })
 
       this.signalr.off('SendCustomUserMessage')
@@ -341,7 +350,7 @@
         this.$notify({ offset: 80, type: 'warning', title: '娑堟伅鎻愰啋', message: res })
         this.$store.state.settings.isDot = true
       })
-      await this.signalr.invoke('AddUser', localStorage.getItem('account'))
+      await this.signalr.invoke('AddUser', localStorage.getItem('usercode'))
     },
 
     systemSetting() {
diff --git a/src/views/statistic/reportList.vue b/src/views/statistic/reportList.vue
index 8df2db0..ace6022 100644
--- a/src/views/statistic/reportList.vue
+++ b/src/views/statistic/reportList.vue
@@ -275,6 +275,24 @@
             sortable="custom"
           />
 
+          <el-table-column
+            label="鎿嶄綔"
+            width="80"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-tooltip class="item" effect="dark" content="鍒犻櫎璁板綍" placement="top">
+                  <i
+                    class="el-icon-delete"
+                    :style="{color:$store.state.settings.theme}"
+                    @click="del(row)"
+                  />
+                </el-tooltip>
+              </div>
+            </template>
+          </el-table-column>
+
         </el-table>
       </div>
       <!--鍒嗛〉-->
@@ -337,6 +355,7 @@
 import ImportPicker from '@/components/ImportPicker'
 import { handleDatetime, validateCode } from '@/utils/global'
 import {
+  DeleteMesOrderStepReport,
   GroupSalaryReportSearchUser, MesOrderStepReportExcelSearch, MesOrderStepReportSearch
 } from '@/api/ReportManager'
 import elDragDialog from '@/directive/el-drag-dialog'
@@ -553,23 +572,35 @@
     },
     // 鍒犻櫎鎸夐挳
     async del(row) {
-      // this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
-      //   confirmButtonText: '纭畾',
-      //   cancelButtonText: '鍙栨秷',
-      //   type: 'warning'
-      // }).then(() => {
-      //   DeleteOrganization({ orgid: row.code }).then(res => {
-      //     if (res.code === '200') {
-      //       this.$message.success('鍒犻櫎鎴愬姛!')
-      //       if (this.form.page > 1 && this.tableData.length === 1) {
-      //         this.form.page--
-      //       }
-      //       this.getMesOrderStepReportSearch()
-      //     }
-      //   })
-      // }).catch(() => {
-      //   this.$message.info('宸插彇娑堝垹闄�')
-      // })
+      this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        const data = {
+          'id': row.id,
+          'sbid': row.sbid,
+          'wocode': row.wo_code,
+          'stepcode': row.step_code,
+          'stype': row.steptype,
+          'goodqty': row.report_qty,
+          'ngqty': row.ng_qty,
+          'laborbadqty': row.laborbad_qty,
+          'materielbadqty': row.materielbad_qty,
+          'verify': row.verify
+        }
+        DeleteMesOrderStepReport(data).then(res => {
+          if (res.code === '200') {
+            this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
+            this.getMesOrderStepReportSearch()
+          }
+        })
+      }).catch(() => {
+        this.$message.info('宸插彇娑堝垹闄�')
+      })
     },
     // 瀵硅瘽妗嗗叧闂簨浠�
     handleClose() {

--
Gitblit v1.9.3