From a3c508233dd94b50c8005ec3a5d40b91341d6434 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 29 一月 2026 17:58:30 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New

---
 src/views/safeProduction/safeWorkApproval/index.vue |  371 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 371 insertions(+), 0 deletions(-)

diff --git a/src/views/safeProduction/safeWorkApproval/index.vue b/src/views/safeProduction/safeWorkApproval/index.vue
new file mode 100644
index 0000000..2d8362e
--- /dev/null
+++ b/src/views/safeProduction/safeWorkApproval/index.vue
@@ -0,0 +1,371 @@
+<template>
+  <div class="app-container">
+    <!-- 鏍囩椤靛垏鎹笉鍚岀殑瀹℃壒绫诲瀷 -->
+    <div class="search_form">
+      <div>
+        <span class="search_title">娴佺▼缂栧彿锛�</span>
+        <el-input v-model="searchForm.approveId"
+                  style="width: 240px"
+                  placeholder="璇疯緭鍏ユ祦绋嬬紪鍙锋悳绱�"
+                  @change="handleQuery"
+                  clearable
+                  :prefix-icon="Search" />
+        <span class="search_title ml10">瀹℃壒鐘舵�侊細</span>
+        <el-select v-model="searchForm.approveStatus"
+                   clearable
+                   @change="handleQuery"
+                   style="width: 240px">
+          <el-option label="寰呭鏍�"
+                     :value="0" />
+          <el-option label="瀹℃牳涓�"
+                     :value="1" />
+          <el-option label="瀹℃牳瀹屾垚"
+                     :value="2" />
+          <el-option label="瀹℃牳鏈�氳繃"
+                     :value="3" />
+          <el-option label="宸查噸鏂版彁浜�"
+                     :value="4" />
+        </el-select>
+        <el-button type="primary"
+                   @click="handleQuery"
+                   style="margin-left: 10px">鎼滅储</el-button>
+      </div>
+      <div>
+        <el-button type="primary"
+                   @click="openForm('add')">鏂板</el-button>
+        <el-button @click="handleOut">瀵煎嚭</el-button>
+        <el-button type="danger"
+                   plain
+                   @click="handleDelete">鍒犻櫎</el-button>
+      </div>
+    </div>
+    <div class="table_list">
+      <PIMTable rowKey="id"
+                :column="tableColumnCopy"
+                :tableData="tableData"
+                :page="page"
+                :isSelection="true"
+                @selection-change="handleSelectionChange"
+                :tableLoading="tableLoading"
+                @pagination="pagination"
+                :total="page.total"></PIMTable>
+    </div>
+    <info-form-dia ref="infoFormDia"
+                   @close="handleQuery"
+                   :approveType="currentApproveType"></info-form-dia>
+    <approval-dia ref="approvalDia"
+                  @close="handleQuery"
+                  :approveType="currentApproveType"></approval-dia>
+    <FileList ref="fileListRef" />
+  </div>
+</template>
+
+<script setup>
+  import FileList from "./fileList.vue";
+  import { Search } from "@element-plus/icons-vue";
+  import {
+    onMounted,
+    ref,
+    computed,
+    reactive,
+    toRefs,
+    nextTick,
+    getCurrentInstance,
+  } from "vue";
+  import { ElMessageBox } from "element-plus";
+  import { useRoute } from "vue-router";
+  import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue";
+  import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue";
+  import {
+    approveProcessDelete,
+    approveProcessListPage,
+  } from "@/api/collaborativeApproval/approvalProcess.js";
+  import useUserStore from "@/store/modules/user";
+
+  const userStore = useUserStore();
+  const route = useRoute();
+
+  // 褰撳墠瀹℃壒绫诲瀷锛屾牴鎹�変腑鐨勬爣绛鹃〉璁$畻
+  const currentApproveType = computed(() => {
+    return Number(8);
+  });
+
+  // 鏍囩椤靛垏鎹㈠鐞�
+  const handleTabChange = tabName => {
+    // 鍒囨崲鏍囩椤垫椂閲嶇疆鎼滅储鏉′欢鍜屽垎椤碉紝骞堕噸鏂板姞杞芥暟鎹�
+    searchForm.value.approveId = "";
+    searchForm.value.approveStatus = "";
+    page.current = 1;
+    getList();
+  };
+
+  const data = reactive({
+    searchForm: {
+      approveId: "",
+      approveStatus: "",
+    },
+  });
+  const { searchForm } = toRefs(data);
+
+  // 鍔ㄦ�佽〃鏍煎垪閰嶇疆锛屾牴鎹鎵圭被鍨嬬敓鎴愬垪
+  const tableColumnCopy = computed(() => {
+    // 鍩虹鍒楅厤缃�
+    const baseColumns = [
+      {
+        label: "瀹℃壒鐘舵��",
+        prop: "approveStatus",
+        dataType: "tag",
+        width: 100,
+        formatData: params => {
+          if (params == 0) {
+            return "寰呭鏍�";
+          } else if (params == 1) {
+            return "瀹℃牳涓�";
+          } else if (params == 2) {
+            return "瀹℃牳瀹屾垚";
+          } else if (params == 4) {
+            return "宸查噸鏂版彁浜�";
+          } else {
+            return "涓嶉�氳繃";
+          }
+        },
+        formatType: params => {
+          if (params == 0) {
+            return "warning";
+          } else if (params == 1) {
+            return "primary";
+          } else if (params == 2) {
+            return "success";
+          } else if (params == 4) {
+            return "info";
+          } else {
+            return "danger";
+          }
+        },
+      },
+      {
+        label: "娴佺▼缂栧彿",
+        prop: "approveId",
+        width: 170,
+      },
+      {
+        label: "鐢宠閮ㄩ棬",
+        prop: "approveDeptName",
+        width: 220,
+      },
+      {
+        label: "瀹℃壒浜嬬敱",
+        prop: "approveReason",
+        width: 200,
+      },
+      {
+        label: "鐢宠浜�",
+        prop: "approveUserName",
+        width: 120,
+      },
+    ];
+
+    // 鏃ユ湡鍒楋紙鏍规嵁绫诲瀷鍔ㄦ�侀厤缃級
+    baseColumns.push(
+      {
+        label: "鐢宠鏃ユ湡",
+        prop: "approveTime",
+        width: 200,
+      },
+      {
+        label: "缁撴潫鏃ユ湡",
+        prop: "approveOverTime",
+        width: 120,
+      }
+    );
+
+    // 褰撳墠瀹℃壒浜哄垪
+    baseColumns.push({
+      label: "褰撳墠瀹℃壒浜�",
+      prop: "approveUserCurrentName",
+      width: 120,
+    });
+
+    // 鎿嶄綔鍒�
+    baseColumns.push({
+      dataType: "action",
+      label: "鎿嶄綔",
+      align: "center",
+      fixed: "right",
+      width: 230,
+      operation: [
+        {
+          name: "缂栬緫",
+          type: "text",
+          clickFun: row => {
+            openForm("edit", row);
+          },
+          disabled: row =>
+            row.approveStatus == 2 ||
+            row.approveStatus == 1 ||
+            row.approveStatus == 4,
+        },
+        {
+          name: "瀹℃牳",
+          type: "text",
+          clickFun: row => {
+            openApprovalDia("approval", row);
+          },
+          disabled: row =>
+            row.approveUserCurrentId == null ||
+            row.approveStatus == 2 ||
+            row.approveStatus == 3 ||
+            row.approveStatus == 4 ||
+            row.approveUserCurrentId !== userStore.id,
+        },
+        {
+          name: "璇︽儏",
+          type: "text",
+          clickFun: row => {
+            openApprovalDia("view", row);
+          },
+        },
+        {
+          name: "闄勪欢",
+          type: "text",
+          clickFun: row => {
+            downLoadFile(row);
+          },
+        },
+      ],
+    });
+
+    return baseColumns;
+  });
+  const tableData = ref([]);
+  const selectedRows = ref([]);
+  const tableLoading = ref(false);
+  const page = reactive({
+    current: 1,
+    size: 100,
+    total: 0,
+  });
+  const infoFormDia = ref();
+  const approvalDia = ref();
+  const { proxy } = getCurrentInstance();
+
+  // 鏌ヨ鍒楄〃
+  /** 鎼滅储鎸夐挳鎿嶄綔 */
+  const handleQuery = () => {
+    page.current = 1;
+    getList();
+  };
+  const fileListRef = ref(null);
+  const downLoadFile = row => {
+    fileListRef.value.open(row.commonFileList);
+  };
+  const pagination = obj => {
+    page.current = obj.page;
+    page.size = obj.limit;
+    getList();
+  };
+  const getList = () => {
+    tableLoading.value = true;
+    approveProcessListPage({
+      ...page,
+      ...searchForm.value,
+      approveType: currentApproveType.value,
+    })
+      .then(res => {
+        tableLoading.value = false;
+        tableData.value = res.data.records;
+        page.total = res.data.total;
+      })
+      .catch(err => {
+        tableLoading.value = false;
+      });
+  };
+  // 瀵煎嚭
+  const handleOut = () => {
+    const type = currentApproveType.value;
+    const urlMap = {
+      0: "/approveProcess/exportZero",
+      1: "/approveProcess/exportOne",
+      2: "/approveProcess/exportTwo",
+      3: "/approveProcess/exportThree",
+      4: "/approveProcess/exportFour",
+      5: "/approveProcess/exportFive",
+      6: "/approveProcess/exportSix",
+      7: "/approveProcess/exportSeven",
+      8: "/approveProcess/exportEight",
+    };
+    const url = urlMap[type] || urlMap[0];
+    const nameMap = {
+      0: "鍗忓悓瀹℃壒绠$悊琛�",
+      1: "鍏嚭绠$悊瀹℃壒琛�",
+      2: "璇峰亣绠$悊瀹℃壒琛�",
+      3: "鍑哄樊绠$悊瀹℃壒琛�",
+      4: "鎶ラ攢绠$悊瀹℃壒琛�",
+      5: "閲囪喘鐢宠瀹℃壒琛�",
+      6: "鎶ヤ环瀹℃壒琛�",
+      7: "鍙戣揣瀹℃壒琛�",
+      8: "鍗遍櫓浣滀笟瀹℃壒琛�",
+    };
+    const fileName = nameMap[type] || nameMap[0];
+    proxy.download(url, {}, `${fileName}.xlsx`);
+  };
+  // 琛ㄦ牸閫夋嫨鏁版嵁
+  const handleSelectionChange = selection => {
+    selectedRows.value = selection;
+  };
+
+  // 鎵撳紑鏂板銆佺紪杈戝脊妗�
+  const openForm = (type, row) => {
+    nextTick(() => {
+      infoFormDia.value?.openDialog(type, row);
+    });
+  };
+  // 鎵撳紑鏂板妫�楠屽脊妗�
+  const openApprovalDia = (type, row) => {
+    nextTick(() => {
+      approvalDia.value?.openDialog(type, row);
+    });
+  };
+
+  // 鍒犻櫎
+  const handleDelete = () => {
+    let ids = [];
+    if (selectedRows.value.length > 0) {
+      ids = selectedRows.value.map(item => item.approveId);
+    } else {
+      proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+      return;
+    }
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        approveProcessDelete(ids).then(res => {
+          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+  onMounted(() => {
+    const approveId = route.query.approveId;
+
+    if (approveId) {
+      // 璁剧疆娴佺▼缂栧彿鏌ヨ鏉′欢
+      searchForm.value.approveId = String(approveId);
+    }
+
+    // 鏌ヨ鍒楄〃
+    getList();
+  });
+</script>
+
+<style scoped>
+  .approval-tabs {
+    margin-bottom: 10px;
+  }
+</style>

--
Gitblit v1.9.3