张诺
2026-04-17 b7acf69e89d4e5cc1b92304add88fd9277a616f7
src/views/productionManagement/productionReporting/index.vue
@@ -180,6 +180,9 @@
  import { productionProductMainListPage, productAudit } from "@/api/productionManagement/productionProductMain.js";
  import { userListNoPageByTenantId } from "@/api/system/user.js";
  import InputModal from "@/views/productionManagement/productionReporting/Input.vue";
  import useUserStore from "@/store/modules/user";
  const userStore = useUserStore();
  const data = reactive({
    searchForm: {
@@ -209,14 +212,33 @@
      width: 120,
    },
    {
      label: "工序",
      prop: "process",
      width: 120,
    },
    {
      label: "报工人员",
      prop: "nickName",
      width: 120,
    },
    {
      label: "工序",
      prop: "process",
     {
      label: "审核人",
      prop: "auditUserName",
      width: 120,
    },
     {
      label: "审核状态",
      prop: "auditStatus",
      width: 120,
      dataType: "tag",
      formatData: val => {
        const statusMap = { 0: "未审核", 1: "通过", 2: "不通过" };
        return statusMap[val] ?? "未知";
      },
      formatType: val => {
        const typeMap = { 0: "info", 1: "success", 2: "danger" };
        return typeMap[val] ?? "";
      },
    },
    {
      label: "工单编号",
@@ -254,23 +276,9 @@
      width: 120,
    },
    {
      label: "审核人",
      prop: "auditUserName",
      width: 120,
    },
    {
      label: "审核状态",
      prop: "auditStatus",
      width: 120,
      dataType: "tag",
      formatData: val => {
        const statusMap = { 0: "未审核", 1: "通过", 2: "不通过" };
        return statusMap[val] ?? "未知";
      },
      formatType: val => {
        const typeMap = { 0: "info", 1: "success", 2: "danger" };
        return typeMap[val] ?? "";
      },
      label: "备注信息",
      prop: "auditOpinion",
      minWidth: 120,
    },
    {
      label: "创建时间",
@@ -292,20 +300,18 @@
          },
        },
        {
          name:"审核",
          // 黄色
          color: "#E6A23C",
          clickFun: row => {
            handleAudit(row);
          },
          showHide: row => Number(row?.auditStatus) === 0, // 仅当未审核时显示审核按钮
        },
        {
          name: "删除",
          type: "danger",
          clickFun: row => {
            deleteReport(row);
          },
        },
        {
          name:"审核",
          clickFun: row => {
            handleAudit(row);
          },
          disabled: row => Number(row?.auditStatus) !== 0 || row.auditUserId !== userStore.id, // 已审核或不是指定审核人时禁用
        },
      ],
    },
@@ -499,8 +505,12 @@
   // 审核
  const handleAudit = (row) => {
    if (Number(row?.auditStatus) === 1) {
    if (Number(row?.auditStatus) !== 0) {
      ElMessage.warning("该工单已审核");
      return;
    }
    if (row.auditUserId !== userStore.id) {
      ElMessage.warning("您不是该工单的指定审核人");
      return;
    }
    // 重置表单,默认选择通过
@@ -544,7 +554,11 @@
      productAudit(auditData)
        .then(res => {
          if (res.code === 200) {
            proxy.$modal.msgSuccess(auditResult === 1 ? "审核通过" : "审核不通过");
            if(form.value.auditResult == 1){
              proxy.$modal.msgSuccess("审核通过");
            }else{
              proxy.$modal.msgError("审核不通过");
            }
            auditDialogVisible.value = false;
            getList();
          } else {