From fa60bfa07970c192c85a437e7db784eccdae2839 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期一, 16 六月 2025 20:04:15 +0800
Subject: [PATCH] 修改bug

---
 laboratory/src/views/dataManagement/schemeManagement/list.vue |   91 ++++++++++++++++++++-------------------------
 1 files changed, 40 insertions(+), 51 deletions(-)

diff --git a/laboratory/src/views/dataManagement/schemeManagement/list.vue b/laboratory/src/views/dataManagement/schemeManagement/list.vue
index 8f386ef..7ae84d9 100644
--- a/laboratory/src/views/dataManagement/schemeManagement/list.vue
+++ b/laboratory/src/views/dataManagement/schemeManagement/list.vue
@@ -1,6 +1,7 @@
 <template>
   <div class="list">
-    <TableCustom :queryForm="form" :tableData="tableData" :height="null" :total="total" @handlePageChange="handlePageChange" @handleSizeChange="handleSizeChange">
+    <TableCustom :queryForm="form" :tableData="tableData" :height="null" :total="total"
+      @handlePageChange="handlePageChange" @handleSizeChange="handleSizeChange">
       <template #search>
         <el-form :model="form" labelWidth="auto" inline>
           <el-form-item label="项目课题方案名称:">
@@ -10,15 +11,8 @@
             <el-input v-model="form.experimentCode" placeholder="请输入"></el-input>
           </el-form-item>
           <el-form-item label="创建时间:">
-            <el-date-picker
-              v-model="form.createTime"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              value-format="yyyy-MM-dd"
-              @change="handleDateChange"
-            ></el-date-picker>
+            <el-date-picker v-model="form.createTime" type="daterange" range-separator="至" start-placeholder="开始日期"
+              end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="handleDateChange"></el-date-picker>
           </el-form-item>
           <el-form-item label="状态:">
             <el-select v-model="form.status" placeholder="请选择">
@@ -40,35 +34,17 @@
       <template #setting>
         <div class="tableTitle">
           <div class="flex a-center flex-wrap">
-            <div 
-              class="title"
-              :class="{active:currentType === 'list'}"
-              @click="handleTypeChange('list')"
-            >项目课题方案列表</div>
-            <div 
-              v-if="userRole == '3'"
-              class="drafts"
-              :class="{active:currentType === 'draft'}"
-              @click="handleTypeChange('draft')"
-            >草稿箱</div>
+            <div class="title" :class="{ active: currentType === 'list' }" @click="handleTypeChange('list')">项目课题方案列表</div>
+            <div v-if="userRole == '3'" class="drafts" :class="{ active: currentType === 'draft' }"
+              @click="handleTypeChange('draft')">草稿箱</div>
           </div>
-          <el-button 
-            v-if="userRole == '3'"
-            @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>
-        <el-table-column
-          prop="projectName"
-          label="项目课题方案名称"
-        ></el-table-column>
-        <el-table-column
-          prop="experimentCode"
-          label="实验编号"
-        ></el-table-column>
+        <el-table-column prop="projectName" label="项目课题方案名称"></el-table-column>
+        <el-table-column prop="experimentCode" label="实验编号"></el-table-column>
         <el-table-column prop="experimentName" label="实验名称"></el-table-column>
         <el-table-column prop="experimentDate" label="实验日期"></el-table-column>
         <el-table-column prop="schemePersonName" label="实验员"></el-table-column>
@@ -96,7 +72,7 @@
 
             <!-- 实验员(5) -->
             <template v-if="userRole == '5'">
-              <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status == 1 ">编辑</el-button>
+              <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status == 1">编辑</el-button>
               <el-button type="text" @click="handleDetail(scope.row)" v-if="scope.row.status == 6">详情</el-button>
             </template>
           </template>
@@ -104,17 +80,13 @@
       </template>
     </TableCustom>
     <!-- 审批弹窗 -->
-    <approval-dialog
-      :visible.sync="approvalDialogVisible"
-      :type="approvalDialogType"
-      :data="currentApprovalData"
-    />
+    <approval-dialog :visible.sync="approvalDialogVisible" :type="approvalDialogType" :data="currentApprovalData" />
   </div>
 </template>
 
 <script>
 import ApprovalDialog from './components/approvalDialog.vue'
-import {getList} from './service'
+import { getList } from './service'
 
 export default {
   name: "ProjectList",
@@ -145,12 +117,12 @@
   created() {
     const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}');
     this.userRole = userInfo.roleType || '';
-    
-    if (this.userRole == '4') {
-      this.$router.push('/403');
-      return;
-    }
-    
+
+    // if (this.userRole == '4') {
+    //   this.$router.push('/403');
+    //   return;
+    // }
+
     this.getTableData();
   },
   methods: {
@@ -204,11 +176,23 @@
         '3': "success",
         '4': "danger",
         '5': "info",
-        '6':'success'
+        '6': 'success'
       };
       return statusMap[status] || "info";
     },
     getStatusText(status) {
+      if (this.userRole == 5) {
+        const statusMap = {
+          '-1': "草稿",
+          '1': "待提交",
+          '2': "申请中止待审核",
+          '3': "申请中止已通过",
+          '4': "申请中止已驳回",
+          '5': "已封存",
+          '6': '已提交'
+        };
+        return statusMap[status] || "未知";
+      }
       const statusMap = {
         '-1': "草稿",
         '1': "已发送",
@@ -216,7 +200,7 @@
         '3': "申请中止已通过",
         '4': "申请中止已驳回",
         '5': "已封存",
-        '6':'实验员已提交'
+        '6': '实验员已提交'
       };
       return statusMap[status] || "未知";
     },
@@ -285,15 +269,18 @@
 .list {
   height: 100%;
 }
+
 .flex {
   display: flex;
   align-items: center;
 }
+
 .tableTitle {
   display: flex;
   padding-bottom: 20px;
   justify-content: space-between;
   align-items: center;
+
   .title {
     background: #fafafc;
     border-radius: 8px 8px 0px 0px;
@@ -305,6 +292,7 @@
     width: unset;
     cursor: pointer;
   }
+
   .drafts {
     padding: 16px 65px;
     background: #fafafc;
@@ -316,7 +304,8 @@
     margin-left: 16px;
     cursor: pointer;
   }
-  .active{
+
+  .active {
     color: #049c9a;
     background: #ffffff;
     border-radius: 8px 8px 0px 0px;

--
Gitblit v1.7.1