From 5eef21ed1f6e1c97e048dd07543f21bc868f9bba Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 10 三月 2026 14:38:16 +0800
Subject: [PATCH] fix: 入库前需加上仓库管理员审审批这一流程,审核通过后才能入库。另外在消息通知中需要展示这个审批信息

---
 src/views/inventoryManagement/receiptManagement/Record.vue |   80 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 73 insertions(+), 7 deletions(-)

diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index a477547..11ee21d 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -73,6 +73,25 @@
         <el-table-column label="鍏ュ簱鏁伴噺"
                          prop="stockInNum"
                          show-overflow-tooltip/>
+        <el-table-column label="瀹℃壒鐘舵��"
+                         prop="approveStatus"
+                         align="center"
+                         width="180">
+          <template #default="scope">
+            <el-tag :type="getApproveStatusType(scope.row.approveStatus)">
+              {{ getApproveStatusText(scope.row.approveStatus) }}
+            </el-tag>
+            <el-button
+              v-if="scope.row.approveStatus === 3"
+              type="primary"
+              link
+              style="margin-left: 8px"
+              @click="handleReApprove(scope.row)"
+            >
+              閲嶆柊鎻愯捣瀹℃壒
+            </el-button>
+          </template>
+        </el-table-column>
         <el-table-column label="鍏ュ簱浜�"
                          prop="createBy"
                          show-overflow-tooltip/>
@@ -107,10 +126,10 @@
 import {
   getStockInRecordListPage,
   batchDeleteStockInRecords,
+  updateStockInRecordForReApprove,
 } from "@/api/inventoryManagement/stockInRecord.js";
 import {
-  findAllQualifiedStockRecordTypeOptions,
-  findAllUnqualifiedStockRecordTypeOptions
+  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
 } from "@/api/basicData/enum.js";
 
 const {proxy} = getCurrentInstance();
@@ -130,7 +149,7 @@
 const stockRecordTypeOptions = ref([]);
 const page = reactive({
   current: 1,
-  size: 100,
+  size: 10,
 });
 const total = ref(0);
 
@@ -153,6 +172,24 @@
   return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
 }
 
+const getApproveStatusText = (status) => {
+  if (status === 0) return "寰呭鏍�";
+  if (status === 1) return "瀹℃牳涓�";
+  if (status === 2) return "瀹℃牳瀹屾垚";
+  if (status === 3) return "瀹℃牳鏈�氳繃";
+  if (status === 4) return "宸查噸鏂版彁浜�";
+  return "-";
+};
+
+const getApproveStatusType = (status) => {
+  if (status === 0) return "warning";
+  if (status === 1) return "primary";
+  if (status === 2) return "success";
+  if (status === 3) return "danger";
+  if (status === 4) return "info";
+  return "";
+};
+
 const pageProductChange = obj => {
   page.current = obj.page;
   page.size = obj.limit;
@@ -164,9 +201,11 @@
   const params = {...page, type: props.type};
   params.timeStr = searchForm.value.timeStr;
   params.productName = searchForm.value.productName;
+  params.recordType = searchForm.value.recordType;
   getStockInRecordListPage(params)
       .then(res => {
         tableData.value = res.data.records;
+        total.value = res.data.total || 0;
       }).finally(() => {
     tableLoading.value = false;
   })
@@ -175,13 +214,13 @@
 // 鑾峰彇鏉ユ簮绫诲瀷閫夐」
 const fetchStockRecordTypeOptions = () => {
   if (props.type === '0') {
-    findAllQualifiedStockRecordTypeOptions()
+    findAllQualifiedStockInRecordTypeOptions()
         .then(res => {
           stockRecordTypeOptions.value = res.data;
         })
     return
   }
-  findAllUnqualifiedStockRecordTypeOptions()
+  findAllUnQualifiedStockInRecordTypeOptions()
       .then(res => {
         stockRecordTypeOptions.value = res.data;
       })
@@ -194,6 +233,34 @@
 
 const expandedRowKeys = ref([]);
 
+const handleReApprove = (row) => {
+  if (!row || !row.id) {
+    return;
+  }
+  ElMessageBox.confirm(
+    "璇ヨ褰曞鏍告湭閫氳繃锛屾槸鍚﹂噸鏂版彁璧峰叆搴撳鎵癸紵",
+    "閲嶆柊鎻愯捣瀹℃壒",
+    {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    }
+  )
+    .then(() => {
+      updateStockInRecordForReApprove({ ...row })
+        .then(() => {
+          proxy.$modal.msgSuccess("宸查噸鏂板彂璧峰鎵�");
+          getList();
+        })
+        .catch(() => {
+          proxy.$modal.msgError("閲嶆柊鍙戣捣瀹℃壒澶辫触");
+        });
+    })
+    .catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
+};
+
 // 瀵煎嚭
 const handleOut = () => {
   ElMessageBox.confirm("鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -203,8 +270,7 @@
   })
       .then(() => {
         // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
-        let exportUrl = "/stockin/export";
-        proxy.download(exportUrl, {}, "鍏ュ簱鍙拌处.xlsx");
+        proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "鍚堟牸鍏ュ簱.xlsx" : "涓嶅悎鏍煎叆搴�.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");

--
Gitblit v1.9.3