董国庆
2025-05-15 b3f4499793fa7b21f6c5d1e099d6ed170ecbe47a
laboratory/src/views/dataManagement/schemeManagement/list.vue
@@ -23,6 +23,7 @@
          <el-form-item label="状态:">
            <el-select v-model="form.status" placeholder="请选择">
              <el-option label="全部" value=""></el-option>
              <el-option label="草稿" :value="-1"></el-option>
              <el-option label="已发送" :value="1"></el-option>
              <el-option label="申请中止待审核" :value="2"></el-option>
              <el-option label="申请中止已通过" :value="3"></el-option>
@@ -95,7 +96,7 @@
            <!-- 实验员(5) -->
            <template v-if="userRole == '5'">
              <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
              <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status == 1">编辑</el-button>
            </template>
          </template>
        </el-table-column>
@@ -156,11 +157,19 @@
  methods: {
    handlePageChange(page) {
      this.form.pageNum = page;
      // 当处于草稿箱模式时,强制将状态设置为-1
      if (this.currentType === 'draft') {
        this.form.status = -1;
      }
      this.getTableData();
    },
    handleSizeChange(size) {
      this.form.pageSize = size;
      this.form.pageNum = 1;
      // 当处于草稿箱模式时,强制将状态设置为-1
      if (this.currentType === 'draft') {
        this.form.status = -1;
      }
      this.getTableData();
    },
    resetForm() {
@@ -174,10 +183,18 @@
        pageNum: 1,
        pageSize: 10
      };
      // 当处于草稿箱模式时,强制将状态设置为-1
      if (this.currentType === 'draft') {
        this.form.status = -1;
      }
      this.getTableData();
    },
    handleSearch() {
      this.form.pageNum = 1;
      // 当处于草稿箱模式时,强制将状态设置为-1
      if (this.currentType === 'draft') {
        this.form.status = -1;
      }
      this.getTableData();
    },
    getStatusType(status) {
@@ -187,7 +204,8 @@
        '2': "warning",
        '3': "success",
        '4': "danger",
        '5': "info"
        '5': "info",
        '6':'success'
      };
      return statusMap[status] || "info";
    },
@@ -198,7 +216,8 @@
        '2': "申请中止待审核",
        '3': "申请中止已通过",
        '4': "申请中止已驳回",
        '5': "已封存"
        '5': "已封存",
        '6':'实验员已提交'
      };
      return statusMap[status] || "未知";
    },
@@ -219,6 +238,10 @@
    },
    async getTableData() {
      try {
        // 当处于草稿箱模式时,强制将状态设置为-1
        if (this.currentType === 'draft') {
          this.form.status = -1;
        }
        const { data } = await getList(this.form);
        this.tableData = data.records || [];
        this.total = data.total || 0;