董国庆
2025-05-09 4614d2ec1bc32eab5f0332176a3ecac7598e3f5c
laboratory/src/views/dataManagement/approvalPlan/list.vue
@@ -89,7 +89,7 @@
<script>
import ShowDelConfirm from "@/components/showDelConfirm/index.vue";
import ApprovalDialog from "./components/approvalDialog.vue";
import { getProposalList } from "./service";
import { getProposalList, upAndDown, deleteById } from "./service";
export default {
  name: "ProjectList",
@@ -106,7 +106,7 @@
        createBy: "",
        createTime: [],
        auditPersonName: "",
        auditStatus: 1,
        auditStatus: '',
        pageNum: 1,
        pageSize: 10,
        startTime: "",
@@ -182,9 +182,8 @@
  },
  computed: {
    isProcessEngineer() {
      return false;
      // 这里需要根据实际的用户角色判断逻辑来修改
      return this.$store.state.user.role === 'processEngineer';
      const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}');
      return userInfo.roleType === 3; // 3是工艺工程师
    }
  },
  created() {
@@ -198,12 +197,13 @@
        createBy: "",
        createTime: [],
        auditPersonName: "",
        auditStatus: this.currentType === "draft" ? -1 : 1,
        auditStatus: this.currentType === "draft" ? -1 : '',
        pageNum: 1,
        pageSize: 10,
        startTime: "",
        endTime: "",
      };
      this.getTableData();
    },
    handleSearch() {
      if (this.form.createTime && this.form.createTime.length === 2) {
@@ -277,8 +277,12 @@
      this.changeStatus = true;
    },
    handleEdit(row) {
      // 实现编辑逻辑
      console.log("编辑数据:", row);
      this.$router.push({
        path: "/dataManagement/addPlan",
        query: {
          id: row.id
        }
      });
    },
    handleDelete(row) {
      this.currentOperationType = "delete";
@@ -318,17 +322,28 @@
    handleChangeStatusConfirm() {
      if (this.currentOperationType === "revoke") {
        // 处理撤销审批逻辑
        console.log("撤销审批数据:", this.currentOperationRow);
        // TODO: 调用撤销审批接口
        upAndDown({
          id: this.currentOperationRow.id,
          status: 4 // 已撤销状态
        }).then(() => {
        this.$message.success("撤销审批成功");
      } else if (this.currentOperationType === "delete") {
        // 处理删除逻辑
        console.log("删除数据:", this.currentOperationRow);
        // TODO: 调用删除接口
        this.$message.success("删除成功");
      }
      this.changeStatus = false;
      this.getTableData();
        }).catch(error => {
          this.$message.error("撤销审批失败");
        });
      } else if (this.currentOperationType === "delete") {
        // 处理删除逻辑
        deleteById({
          id: this.currentOperationRow.id
        }).then(() => {
          this.$message.success("删除成功");
          this.changeStatus = false;
          this.getTableData();
        }).catch(error => {
          this.$message.error("删除失败");
        });
      }
    },
  },
};