From a32e60bf3366bf3b2d8d0d53b8257290acfb3d4e Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 12 六月 2026 10:26:58 +0800
Subject: [PATCH] 班次配置,夜班不限制时间顺序

---
 src/views/inventoryManagement/receiptManagement/Record.vue |  806 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 623 insertions(+), 183 deletions(-)

diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index cd103ea..b129651 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -1,42 +1,90 @@
 <template>
-  <div class="app-container">
-    <div class="search_form">
-      <div>
-        <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
-        <el-date-picker v-model="searchForm.timeStr"
-                        type="date"
-                        placeholder="璇烽�夋嫨鏃ユ湡"
-                        value-format="YYYY-MM-DD"
-                        format="YYYY-MM-DD"
-                        clearable
-                        @change="handleQuery"/>
-        <span class="search_title ml10">浜у搧澶х被锛�</span>
-        <el-input v-model="searchForm.productName"
-                  style="width: 240px"
-                  placeholder="璇疯緭鍏�"
-                  clearable/>
-        <span class="search_title ml10">鏉ユ簮锛�</span>
-        <el-select v-model="searchForm.recordType"
-                  style="width: 240px"
-                  placeholder="璇烽�夋嫨"
-                  clearable>
-          <el-option v-for="item in stockRecordTypeOptions"
-                     :key="item.value"
-                     :label="item.label"
-                     :value="item.value"/>
-        </el-select>
-        <el-button type="primary"
-                   @click="handleQuery"
-                   style="margin-left: 10px">鎼滅储
-        </el-button>
-      </div>
-      <div>
-        <el-button @click="handleOut">瀵煎嚭</el-button>
-        <el-button type="danger"
-                   plain
-                   @click="handleDelete">鍒犻櫎
-        </el-button>
-      </div>
+  <div>
+    <div class="search_form"
+         style="margin-bottom: 10px;">
+      <el-form ref="searchFormRef"
+               :model="searchForm"
+               class="demo-form-inline">
+        <el-row :gutter="20">
+          <el-col :span="4">
+            <el-form-item label="鍏ュ簱鏃ユ湡"
+                          prop="timeStr">
+              <el-date-picker v-model="searchForm.timeStr"
+                              type="date"
+                              placeholder="璇烽�夋嫨鏃ユ湡"
+                              value-format="YYYY-MM-DD"
+                              format="YYYY-MM-DD"
+                              clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="浜у搧澶х被"
+                          prop="productName">
+              <el-input v-model="searchForm.productName"
+                        style="width: 240px"
+                        placeholder="璇疯緭鍏�"
+                        clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="瑙勬牸鍨嬪彿"
+                          prop="model">
+              <el-input v-model="searchForm.model"
+                        style="width: 240px"
+                        placeholder="璇疯緭鍏�"
+                        clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="鎵瑰彿"
+                          prop="batchNo">
+              <el-input v-model="searchForm.batchNo"
+                        style="width: 240px"
+                        placeholder="璇疯緭鍏�"
+                        clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="鏉ユ簮"
+                          prop="recordType">
+              <el-select v-model="searchForm.recordType"
+                         style="width: 240px"
+                         placeholder="璇烽�夋嫨"
+                         clearable>
+                <el-option v-for="item in stockRecordTypeOptions"
+                           :key="item.value"
+                           :label="item.label"
+                           :value="item.value" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <!-- 鎸夐挳 -->
+          <el-col :span="4">
+            <el-form-item>
+              <el-button type="primary"
+                         @click="getList">
+                鎼滅储
+              </el-button>
+              <el-button @click="resetSearch">
+                閲嶇疆
+              </el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div class="actions">
+      <el-button type="primary"
+                 :disabled="!canBatchApprove"
+                 @click="handleBatchApprove">瀹℃壒</el-button>
+      <el-button :disabled="!canReverseApprove"
+                 @click="handleReverseApprove">鍙嶅</el-button>
+      <el-button @click="handleOut">瀵煎嚭</el-button>
+      <el-button type="danger"
+                 plain
+                 :disabled="!canDelete"
+                 @click="handleDelete">鍒犻櫎
+      </el-button>
     </div>
     <div class="table_list">
       <el-table :data="tableData"
@@ -49,38 +97,75 @@
                 height="calc(100vh - 18.5em)">
         <el-table-column align="center"
                          type="selection"
-                         width="55"/>
+                         :selectable="isRowSelectable"
+                         width="55" />
         <el-table-column align="center"
                          label="搴忓彿"
                          type="index"
-                         width="60"/>
+                         width="60" />
         <el-table-column label="鍏ュ簱鎵规"
                          prop="inboundBatches"
-                         width="280"
-                         show-overflow-tooltip/>
+                         width="200"
+                         show-overflow-tooltip />
         <el-table-column label="鍏ュ簱鏃堕棿"
                          prop="createTime"
-                         show-overflow-tooltip/>
-        <el-table-column label="浜у搧澶х被"
-                         prop="productName"
-                         show-overflow-tooltip/>
-        <el-table-column label="瑙勬牸鍨嬪彿"
-                         prop="model"
-                         show-overflow-tooltip/>
-        <el-table-column label="鍗曚綅"
-                         prop="unit"
-                         show-overflow-tooltip/>
-        <el-table-column label="鍏ュ簱鏁伴噺"
-                         prop="stockInNum"
-                         show-overflow-tooltip/>
-        <el-table-column label="鍏ュ簱浜�"
-                         prop="createBy"
-                         show-overflow-tooltip/>
-        <el-table-column label="鏉ユ簮"
-                         prop="recordType"
+                         show-overflow-tooltip />
+        <el-table-column label="鍘傚"
+                         prop="manufacturerId"
                          show-overflow-tooltip>
           <template #default="scope">
-            {{ getRecordType(scope.row.recordType) }}
+            {{ getManufacturerName(scope.row.manufacturerId) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="浜у搧澶х被"
+                         prop="productName"
+                         show-overflow-tooltip />
+        <el-table-column label="瑙勬牸鍨嬪彿"
+                         prop="model"
+                         show-overflow-tooltip />
+        <el-table-column label="鎵瑰彿"
+                         prop="batchNo"
+                         show-overflow-tooltip />
+        <el-table-column label="鍗曚綅"
+                         prop="unit"
+                         show-overflow-tooltip />
+        <el-table-column label="瀹為檯鍏ュ簱鏁伴噺"
+                         prop="stockInNum"
+                         width="120"
+                         show-overflow-tooltip />
+        <el-table-column label="鍚按宸"
+                         prop="differenceNum"
+                         show-overflow-tooltip>
+          <template #default="scope">
+            {{ scope.row.isContainsWater?scope.row.differenceNum || "--": "--" }}
+          </template>
+        </el-table-column>
+        <el-table-column label="鍏ュ簱浜�"
+                         prop="createBy"
+                         show-overflow-tooltip />
+        <el-table-column label="鏉ユ簮"
+                         show-overflow-tooltip>
+          <template #default="scope">
+            {{ scope.row.qualifiedSourceText || scope.row.unQualifiedSourceText || getRecordType(scope.row.recordType) || "--" }}
+          </template>
+        </el-table-column>
+        <el-table-column v-if="showSourceOrderNoColumn"
+                         label="婧愬崟鍙�"
+                         width="150"
+                         prop="sourceOrderNo"
+                         show-overflow-tooltip>
+          <template #default="scope">
+            {{ formatSourceOrderNo(scope.row?.sourceOrderNo) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="瀹℃壒鐘舵��"
+                         prop="approvalStatus"
+                         show-overflow-tooltip>
+          <template #default="scope">
+            <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)"
+                    size="small">
+              {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+            </el-tag>
           </template>
         </el-table-column>
       </el-table>
@@ -89,162 +174,517 @@
                   layout="total, sizes, prev, pager, next, jumper"
                   :page="page.current"
                   :limit="page.size"
-                  @pagination="pageProductChange"/>
+                  @pagination="pageProductChange" />
     </div>
+    <!-- 瀹℃壒寮圭獥 -->
+    <el-dialog v-model="approveDialogVisible"
+               title="瀹℃壒"
+               width="800px"
+               append-to-body>
+      <el-form :model="approveForm"
+               label-width="80px">
+        <el-form-item label="瀹℃壒缁撴灉">
+          <el-radio-group v-model="approveForm.approvalStatus">
+            <el-radio :label="1">閫氳繃</el-radio>
+            <el-radio :label="2">椹冲洖</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="鏄庣粏纭"
+                      v-if="approveForm.approvalStatus === 1">
+          <div class="approve-items-list">
+            <div class="list-header">
+              <span class="header-product">浜у搧淇℃伅</span>
+              <span class="header-num">鍏ュ簱鏁伴噺</span>
+            </div>
+            <div v-for="item in approveForm.items"
+                 :key="item.id"
+                 class="approve-item">
+              <div class="item-info">
+                <div class="product-name"
+                     :title="item.productName">{{ item.productName }}</div>
+                <div class="product-info-sub">
+                  <span class="product-model"
+                        :title="item.model">{{ item.model }}</span>
+                  <span class="product-batch"
+                        v-if="item.batchNo"
+                        :title="'鎵瑰彿: ' + item.batchNo"> | 鎵瑰彿: {{ item.batchNo }}</span>
+                </div>
+              </div>
+              <div class="item-input">
+                <el-input-number v-model="item.stockInNum"
+                                 :min="0"
+                                 :precision="2"
+                                 controls-position="right"
+                                 style="width: 130px" />
+              </div>
+            </div>
+          </div>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="approveDialogVisible = false">鍙栨秷</el-button>
+          <el-button type="primary"
+                     @click="submitApprove"
+                     :loading="approveLoading">纭畾</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import pagination from "@/components/PIMTable/Pagination.vue";
-import {
-  ref,
-  reactive,
-  toRefs,
-  onMounted,
-  getCurrentInstance,
-} from "vue";
-import {ElMessageBox} from "element-plus";
-import {
-  getStockInRecordListPage,
-  batchDeleteStockInRecords,
-} from "@/api/inventoryManagement/stockInRecord.js";
-import {
-  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
-} from "@/api/basicData/enum.js";
+  import pagination from "@/components/PIMTable/Pagination.vue";
+  import {
+    ref,
+    reactive,
+    toRefs,
+    computed,
+    onMounted,
+    getCurrentInstance,
+  } from "vue";
+  import { ElMessageBox } from "element-plus";
+  import {
+    getStockInRecordListPage,
+    batchDeletePendingStockInRecords,
+    batchApproveStockInRecords,
+    batchUnapproveStockInRecords,
+  } from "@/api/inventoryManagement/stockInRecord.js";
+  import {
+    findAllQualifiedStockInRecordTypeOptions,
+    // findAllUnQualifiedStockInRecordTypeOptions,
+  } from "@/api/basicData/enum.js";
+  import { getManufacturerOptions } from "@/api/inspectionManagement/manufacturerManageFile.js";
 
-const {proxy} = getCurrentInstance();
+  const { proxy } = getCurrentInstance();
 
-const props = defineProps({
-  type: {
-    type: String,
-    required: true,
-    default: '0'
-  }
-})
+  const props = defineProps({
+    type: {
+      type: String,
+      required: true,
+      default: "0",
+    },
+    topParentProductId: {
+      type: [String, Number],
+      default: undefined,
+    },
+  });
 
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-// 鏉ユ簮绫诲瀷閫夐」
-const stockRecordTypeOptions = ref([]);
-const page = reactive({
-  current: 1,
-  size: 100,
-});
-const total = ref(0);
+  const tableData = ref([]);
+  const selectedRows = ref([]);
+  const tableLoading = ref(false);
+  // 鏉ユ簮绫诲瀷閫夐」
+  const stockRecordTypeOptions = ref([]);
+  const manufacturerOptions = ref([]);
+  const page = reactive({
+    current: 1,
+    size: 10,
+  });
+  const total = ref(0);
 
-const data = reactive({
-  searchForm: {
-    productName: "",
-    timeStr: "",
-    recordType: "",
-  },
-});
-const {searchForm} = toRefs(data);
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
-  page.current = 1;
-  getList();
-};
+  // 瀹℃壒鐩稿叧
+  const approveDialogVisible = ref(false);
+  const approveLoading = ref(false);
+  const approveForm = reactive({
+    approvalStatus: 1,
+    items: [], // 瀛樺偍姣忎釜閫変腑鐨勬潯鐩強鍏跺叆搴撴暟閲�
+  });
 
-const getRecordType = (recordType) => {
-  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
-}
+  const data = reactive({
+    searchForm: {
+      productName: "",
+      batchNo: "",
+      model: "",
+      timeStr: "",
+      recordType: "",
+    },
+  });
+  const { searchForm } = toRefs(data);
+  const searchFormRef = ref(null);
 
-const pageProductChange = obj => {
-  page.current = obj.page;
-  page.size = obj.limit;
-  getList();
-};
+  const resetSearch = () => {
+    searchFormRef.value?.resetFields();
+    page.current = 1;
+    getList();
+  };
 
-const getList = () => {
-  tableLoading.value = true;
-  const params = {...page, type: props.type};
-  params.timeStr = searchForm.value.timeStr;
-  params.productName = searchForm.value.productName;
-  params.recordType = searchForm.value.recordType;
-  getStockInRecordListPage(params)
+  const getRecordType = recordType => {
+    return (
+      stockRecordTypeOptions.value.find(item => item.value === recordType)
+        ?.label || ""
+    );
+  };
+
+  const getManufacturerName = manufacturerId => {
+    return (
+      manufacturerOptions.value.find(item => item.id === manufacturerId)?.name ||
+      "--"
+    );
+  };
+
+  const approvalStatusLabelMap = {
+    0: "寰呭鎵�",
+    1: "閫氳繃",
+    2: "椹冲洖",
+    pending: "寰呭鎵�",
+    approved: "閫氳繃",
+    rejected: "椹冲洖",
+    PENDING: "寰呭鎵�",
+    APPROVED: "閫氳繃",
+    REJECTED: "椹冲洖",
+  };
+  approvalStatusLabelMap[3] = "寰呯‘璁�";
+
+  const getApprovalStatusLabel = status => {
+    if (status === null || status === undefined || status === "") {
+      return "寰呭鎵�";
+    }
+    return approvalStatusLabelMap[status] || "寰呭鎵�";
+  };
+
+  // 閫氳繃/椹冲洖鍥哄畾鑹诧紱鍏朵綑锛堝惈寰呭鎵广�佺┖鍊笺�佹湭鏄犲皠浣嗘枃妗堜负寰呭鎵癸級缁熶竴鐢� warning 棰勮鑹�
+  const getApprovalStatusTagType = status => {
+    if (
+      status === 1 ||
+      status === "1" ||
+      status === "approved" ||
+      status === "APPROVED"
+    )
+      return "success";
+    if (
+      status === 2 ||
+      status === "2" ||
+      status === "rejected" ||
+      status === "REJECTED"
+    )
+      return "danger";
+    return "warning";
+  };
+
+  const isPendingApproval = status => {
+    return (
+      status === 0 ||
+      status === "0" ||
+      status === "pending" ||
+      status === "PENDING" ||
+      status === null ||
+      status === undefined ||
+      status === ""
+    );
+  };
+
+  const isRejectedApproval = status => {
+    return (
+      status === 2 ||
+      status === "2" ||
+      status === "rejected" ||
+      status === "REJECTED"
+    );
+  };
+
+  const isRowSelectable = row => {
+    return (
+      isPendingApproval(row?.approvalStatus) ||
+      isRejectedApproval(row?.approvalStatus)
+    );
+  };
+
+  const canBatchApprove = computed(() => {
+    return (
+      selectedRows.value.length > 0 &&
+      selectedRows.value.every(row => isPendingApproval(row.approvalStatus))
+    );
+  });
+
+  const canReverseApprove = computed(() => {
+    return (
+      selectedRows.value.length > 0 &&
+      selectedRows.value.every(row => isRejectedApproval(row.approvalStatus))
+    );
+  });
+
+  const canDelete = computed(() => canBatchApprove.value);
+  const showSourceOrderNoColumn = computed(() => {
+    const topParentProductId = Number(props.topParentProductId);
+    return topParentProductId === 276 || topParentProductId === 278;
+  });
+
+  const formatSourceOrderNo = value => {
+    const text = String(value ?? "").trim();
+    return text || "--";
+  };
+
+  const pageProductChange = obj => {
+    page.current = obj.page;
+    page.size = obj.limit;
+    getList();
+  };
+
+  const getList = () => {
+    tableLoading.value = true;
+    getStockInRecordListPage(
+      Object.assign(
+        {},
+        {
+          ...searchForm.value,
+          ...page,
+          topParentProductId: props.topParentProductId,
+        }
+      )
+    )
       .then(res => {
         tableData.value = res.data.records;
-      }).finally(() => {
-    tableLoading.value = false;
-  })
-};
-
-// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
-const fetchStockRecordTypeOptions = () => {
-  if (props.type === '0') {
-    findAllQualifiedStockInRecordTypeOptions()
-        .then(res => {
-          stockRecordTypeOptions.value = res.data;
-        })
-    return
-  }
-  findAllUnQualifiedStockInRecordTypeOptions()
-      .then(res => {
-        stockRecordTypeOptions.value = res.data;
+        total.value = res.data.total || 0;
       })
-}
+      .finally(() => {
+        tableLoading.value = false;
+      });
+  };
 
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = selection => {
-  selectedRows.value = selection.filter(item => item.id);
-};
+  // 鑾峰彇鏉ユ簮绫诲瀷閫夐」
+  const fetchStockRecordTypeOptions = () => {
+    if (props.type === "0") {
+      findAllQualifiedStockInRecordTypeOptions().then(res => {
+        stockRecordTypeOptions.value = res.data;
+      });
+      return;
+    }
+    // findAllUnQualifiedStockInRecordTypeOptions()
+    //     .then(res => {
+    //       stockRecordTypeOptions.value = res.data;
+    //     })
+  };
 
-const expandedRowKeys = ref([]);
+  const fetchManufacturerOptions = () => {
+    getManufacturerOptions().then(res => {
+      manufacturerOptions.value = res.data || [];
+    });
+  };
 
-// 瀵煎嚭
-const handleOut = () => {
-  ElMessageBox.confirm("鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
-    confirmButtonText: "纭",
-    cancelButtonText: "鍙栨秷",
-    type: "warning",
-  })
+  // 琛ㄦ牸閫夋嫨鏁版嵁
+  const handleSelectionChange = selection => {
+    selectedRows.value = selection.filter(
+      item => item.id && isRowSelectable(item)
+    );
+  };
+
+  const expandedRowKeys = ref([]);
+
+  const handleReverseApprove = () => {
+    if (!canReverseApprove.value) {
+      proxy.$modal.msgWarning("璇烽�夋嫨宸查┏鍥炵殑鏁版嵁");
+      return;
+    }
+    const ids = selectedRows.value.map(item => item.id);
+    ElMessageBox.confirm("鍙嶅鍚庤褰曞皢鎭㈠涓哄緟瀹℃壒鐘舵�侊紝鏄惁纭鍙嶅锛�", "鍙嶅", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        batchUnapproveStockInRecords({ ids })
+          .then(() => {
+            proxy.$modal.msgSuccess("鍙嶅鎴愬姛");
+            getList();
+          })
+          .catch(() => {
+            proxy.$modal.msgError("鍙嶅澶辫触");
+          });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+
+  const handleBatchApprove = () => {
+    if (!canBatchApprove.value) {
+      proxy.$modal.msgWarning("璇烽�夋嫨寰呭鎵圭殑鏁版嵁");
+      return;
+    }
+    // 鍒濆鍖栧鎵硅〃鍗�
+    approveForm.approvalStatus = 1;
+    approveForm.items = selectedRows.value.map(row => ({
+      id: row.id,
+      productName: row.productName,
+      model: row.model,
+      batchNo: row.batchNo,
+      stockInNum: row.stockInNum || 0,
+    }));
+    approveDialogVisible.value = true;
+  };
+
+  const submitApprove = () => {
+    const params = {
+      approvalStatus: approveForm.approvalStatus,
+      items: approveForm.items.map(item => ({
+        id: item.id,
+        ...(approveForm.approvalStatus === 1 && { stockInNum: item.stockInNum }),
+      })),
+    };
+
+    approveLoading.value = true;
+    batchApproveStockInRecords(params)
+      .then(() => {
+        proxy.$modal.msgSuccess(
+          approveForm.approvalStatus === 1 ? "瀹℃壒閫氳繃鎴愬姛" : "瀹℃壒椹冲洖鎴愬姛"
+        );
+        approveDialogVisible.value = false;
+        getList();
+      })
+      .catch(() => {
+        proxy.$modal.msgError(
+          approveForm.approvalStatus === 1 ? "瀹℃壒閫氳繃澶辫触" : "瀹℃壒椹冲洖澶辫触"
+        );
+      })
+      .finally(() => {
+        approveLoading.value = false;
+      });
+  };
+
+  // 瀵煎嚭
+  const handleOut = () => {
+    ElMessageBox.confirm("鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
       .then(() => {
         // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
-        proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "鍚堟牸鍏ュ簱.xlsx" : "涓嶅悎鏍煎叆搴�.xlsx");
+        proxy.download(
+          "/stockInRecord/exportStockInRecord",
+          { type: props.type },
+          props.type === "0" ? "鍚堟牸鍏ュ簱.xlsx" : "涓嶅悎鏍煎叆搴�.xlsx"
+        );
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
       });
-};
+  };
 
-// 鍒犻櫎
-const handleDelete = () => {
-  if (selectedRows.value.length === 0) {
-    proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
-    return;
-  }
-  const ids = selectedRows.value.map(item => item.id);
+  // 鍒犻櫎
+  const handleDelete = () => {
+    if (!canDelete.value) {
+      proxy.$modal.msgWarning("璇烽�夋嫨寰呭鎵圭殑鏁版嵁");
+      return;
+    }
+    const ids = selectedRows.value.map(item => item.id);
 
-  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎", {
-    confirmButtonText: "纭",
-    cancelButtonText: "鍙栨秷",
-    type: "warning",
-  })
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
       .then(() => {
-        batchDeleteStockInRecords(ids)
-            .then(() => {
-              proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-              getList();
-            })
-            .catch(() => {
-              proxy.$modal.msgError("鍒犻櫎澶辫触");
-            });
+        batchDeletePendingStockInRecords(ids)
+          .then(() => {
+            proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+            getList();
+          })
+          .catch(() => {
+            proxy.$modal.msgError("鍒犻櫎澶辫触");
+          });
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
       });
-};
+  };
 
-onMounted(() => {
-  getList();
-  fetchStockRecordTypeOptions();
-});
+  onMounted(() => {
+    getList();
+    fetchStockRecordTypeOptions();
+    fetchManufacturerOptions();
+  });
+
+  watch(
+    () => props.topParentProductId,
+    () => {
+      page.current = 1;
+      getList();
+    }
+  );
 </script>
 
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+  .actions {
+    display: flex;
+    justify-content: flex-end;
+    margin-bottom: 10px;
+  }
 
+  .approve-items-list {
+    max-height: 400px;
+    overflow-y: auto;
+    width: 100%;
+    border: 1px solid #ebeef5;
+    border-radius: 4px;
 
+    .list-header {
+      display: flex;
+      background-color: #f5f7fa;
+      padding: 8px 12px;
+      font-weight: bold;
+      border-bottom: 1px solid #ebeef5;
+      font-size: 13px;
 
+      .header-product {
+        flex: 1;
+      }
+
+      .header-num {
+        width: 130px;
+        text-align: center;
+      }
+    }
+
+    .approve-item {
+      display: flex;
+      align-items: center;
+      padding: 10px 12px;
+      border-bottom: 1px solid #ebeef5;
+
+      &:last-child {
+        border-bottom: none;
+      }
+
+      .item-info {
+        flex: 1;
+        min-width: 0;
+        margin-right: 15px;
+
+        .product-name {
+          font-weight: bold;
+          font-size: 13px;
+          color: #303133;
+          white-space: nowrap;
+          overflow: hidden;
+          text-overflow: ellipsis;
+        }
+
+        .product-info-sub {
+          display: flex;
+          align-items: center;
+          font-size: 12px;
+          color: #909399;
+          margin-top: 2px;
+          white-space: nowrap;
+          overflow: hidden;
+
+          .product-model,
+          .product-batch {
+            overflow: hidden;
+            text-overflow: ellipsis;
+          }
+
+          .product-batch {
+            margin-left: 4px;
+            color: #409eff;
+          }
+        }
+      }
+
+      .item-input {
+        width: 130px;
+      }
+    }
+  }
+</style>
\ No newline at end of file

--
Gitblit v1.9.3