From 993e5fd593398926af72af660cb5ed6aba8e4e2b Mon Sep 17 00:00:00 2001
From: 13404089107 <puwei@sinata.cn>
Date: 星期二, 20 五月 2025 16:43:04 +0800
Subject: [PATCH] 对接接口

---
 laboratory/src/views/dataManagement/dispatching/list.vue |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/laboratory/src/views/dataManagement/dispatching/list.vue b/laboratory/src/views/dataManagement/dispatching/list.vue
index ea67eba..34edc48 100644
--- a/laboratory/src/views/dataManagement/dispatching/list.vue
+++ b/laboratory/src/views/dataManagement/dispatching/list.vue
@@ -43,22 +43,28 @@
           <div class="flex a-center">
             <div
               class="title"
-              :class="{ active: currentType === 'list' }"
+              :class="{ active: currentType == 'list' }"
               @click="handleTypeChange('list')"
             >
               实验与调度列表
             </div>
             <div
+              v-if="userRole == '3'"
               class="drafts"
-              :class="{ active: currentType === 'draft' }"
+              :class="{ active: currentType == 'draft' }"
               @click="handleTypeChange('draft')"
             >
               草稿箱
             </div>
           </div>
-          <el-button @click="handleAddPlan" class="el-icon-plus" type="primary">
-            新增实验调度</el-button
+          <el-button 
+            v-if="userRole == '3'"
+            @click="handleAddPlan" 
+            class="el-icon-plus" 
+            type="primary"
           >
+            新增实验调度
+          </el-button>
         </div>
       </template>
       <template #table>
@@ -106,7 +112,7 @@
             <template v-if="userRole == '3'">
               <el-button type="text" @click="handleDetail(scope.row)">详情</el-button>
               <el-button 
-                v-if="scope.row.status === 1" 
+                v-if="scope.row.status == 1" 
                 type="text" 
                 @click="handleDelete(scope.row)"
               >删除</el-button>
@@ -116,7 +122,7 @@
             <template v-if="userRole == '4' || userRole == '5'">
               <el-button type="text" @click="handleDetail(scope.row)">详情</el-button>
               <el-button
-                v-if="scope.row.status === 1"
+                v-if="scope.row.status == 1"
                 type="text"
                 @click="handleConfirm(scope.row)"
               >确认</el-button>
@@ -136,6 +142,7 @@
       :type="approvalDialogType"
       :data="currentApprovalData"
       @close="approvalDialogVisible = false"
+      @update:data="handleUpdateData"
     />
     <ShowDelConfirm 
       :title="changeStatusTitle" 
@@ -252,19 +259,20 @@
     },
     handleTypeChange(type) {
       this.currentType = type;
-      this.form.status = type === 'draft' ? '-1' : '';
+      this.form.status = type == 'draft' ? '-1' : '';
       this.form.pageNum = 1;
       this.getTableData();
     },
     getTableData() {
       const params = {
         ...this.form,
-        status: this.currentType === 'draft' ? '-1' : this.form.status
+        status: this.currentType == 'draft' ? '-1' : this.form.status
       };
       getDispatchList(params).then(res => {
-        if (res) {
-          this.tableData = res.records || [];
-          this.total = res.total || 0;
+        console.log('111111111111',res)
+        if (res.code==200) {
+          this.tableData = res.data.records || [];
+          this.total = res.data.total || 0;
         }
       });
     },
@@ -291,6 +299,10 @@
         this.$message.error("删除失败");
       });
     },
+    handleUpdateData() {
+      this.currentApprovalData = null;
+      this.getTableData();
+    }
   },
 };
 </script>

--
Gitblit v1.7.1