From 236566b02c46f11f684e942b38ec43c310421fa3 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 17 三月 2026 13:06:27 +0800
Subject: [PATCH] 军泰伟业 1.仓储物流需要加上库位,库位暂时分为外购、自制、委外三种类型 2.生产订单加上库存数量,方便实时查看 3.产品发货后,若部分产品退回,可修改订单发货数量(减去退回的产品数量),若订单产品全部退回,可对发货的订单进行取消撤回操作

---
 src/views/inventoryManagement/receiptManagement/Record.vue |  111 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 98 insertions(+), 13 deletions(-)

diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index ec64f17..0b67f42 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -15,10 +15,29 @@
                   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>
+        <span class="search_title ml10">璐ㄦ鐘舵�侊細</span>
+        <el-select v-model="searchForm.type"
+                  style="width: 240px"
+                  placeholder="璇烽�夋嫨"
+                  clearable>
+          <el-option label="鍚堟牸" :value="0" />
+          <el-option label="涓嶅悎鏍�" :value="1" />
+        </el-select>
         <el-button type="primary"
                    @click="handleQuery"
                    style="margin-left: 10px">鎼滅储
         </el-button>
+        <el-button @click="handleReset">閲嶇疆</el-button>
       </div>
       <div>
         <el-button @click="handleOut">瀵煎嚭</el-button>
@@ -63,9 +82,29 @@
         <el-table-column label="鍏ュ簱鏁伴噺"
                          prop="stockInNum"
                          show-overflow-tooltip/>
+        <el-table-column label="璐ㄦ鐘舵��"
+                         prop="type"
+                         show-overflow-tooltip
+                         width="100">
+          <template #default="scope">
+            <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small">
+              {{ scope.row.type == 0 ? '鍚堟牸' : '涓嶅悎鏍�' }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="搴撲綅"
+                         prop="locationName"
+                         show-overflow-tooltip/>
         <el-table-column label="鍏ュ簱浜�"
                          prop="createBy"
                          show-overflow-tooltip/>
+        <el-table-column label="鏉ユ簮"
+                         prop="recordType"
+                         show-overflow-tooltip>
+          <template #default="scope">
+            {{ getRecordType(scope.row.recordType) }}
+          </template>
+        </el-table-column>
       </el-table>
       <pagination v-show="total > 0"
                   :total="total"
@@ -85,32 +124,35 @@
   toRefs,
   onMounted,
   getCurrentInstance,
-  nextTick,
+  watch,
 } from "vue";
 import {ElMessageBox} from "element-plus";
 import {
   getStockInRecordListPage,
   batchDeleteStockInRecords,
 } from "@/api/inventoryManagement/stockInRecord.js";
+import {
+  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
+} from "@/api/basicData/enum.js";
 
 const {proxy} = getCurrentInstance();
 
 const props = defineProps({
   type: {
-    type: String,
+    type: Number,
     required: true,
-    default: '0'
+    default: 1
   }
 })
 
 const tableData = ref([]);
 const selectedRows = ref([]);
 const tableLoading = ref(false);
-const activeTab = ref("production"); // 褰撳墠婵�娲荤殑 tab
-
+// 鏉ユ簮绫诲瀷閫夐」
+const stockRecordTypeOptions = ref([]);
 const page = reactive({
   current: 1,
-  size: 100,
+  size: 10,
 });
 const total = ref(0);
 
@@ -118,15 +160,31 @@
   searchForm: {
     productName: "",
     timeStr: "",
+    recordType: "",
+    type: "",
   },
 });
 const {searchForm} = toRefs(data);
+
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
   page.current = 1;
   getList();
 };
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+const handleReset = () => {
+  searchForm.value.productName = "";
+  searchForm.value.timeStr = "";
+  searchForm.value.recordType = "";
+  searchForm.value.type = "";
+  handleQuery();
+};
+
+const getRecordType = (recordType) => {
+  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
+}
 
 const pageProductChange = obj => {
   page.current = obj.page;
@@ -136,16 +194,36 @@
 
 const getList = () => {
   tableLoading.value = true;
-  const params = {...page, type: props.type};
+  const params = {...page, productType: props.type};
   params.timeStr = searchForm.value.timeStr;
   params.productName = searchForm.value.productName;
+  params.recordType = searchForm.value.recordType;
+  if (searchForm.value.type !== "") {
+    params.type = searchForm.value.type;
+  }
   getStockInRecordListPage(params)
       .then(res => {
         tableData.value = res.data.records;
+        total.value = res.data.total || 0;
       }).finally(() => {
     tableLoading.value = false;
   })
 };
+
+// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
+const fetchStockRecordTypeOptions = () => {
+  if (props.type === 1 || props.type === 2) {
+    findAllQualifiedStockInRecordTypeOptions()
+        .then(res => {
+          stockRecordTypeOptions.value = res.data;
+        })
+  } else {
+    findAllUnQualifiedStockInRecordTypeOptions()
+        .then(res => {
+          stockRecordTypeOptions.value = res.data;
+        })
+  }
+}
 
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = selection => {
@@ -162,12 +240,12 @@
     type: "warning",
   })
       .then(() => {
-        // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
-        let exportUrl = "/stockin/export";
-        if (activeTab.value === "production") {
-          exportUrl = "/stockin/exportOne";
-        }
-        proxy.download(exportUrl, {}, "鍏ュ簱鍙拌处.xlsx");
+        const fileNameMap = {
+          1: '鑷埗鍏ュ簱.xlsx',
+          2: '澶栬喘鍏ュ簱.xlsx',
+          3: '濮斿鍏ュ簱.xlsx'
+        };
+        proxy.download("/stockInRecord/exportStockInRecord", {productType: props.type}, fileNameMap[props.type] || '鍏ュ簱.xlsx');
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -204,6 +282,13 @@
 
 onMounted(() => {
   getList();
+  fetchStockRecordTypeOptions();
+});
+
+watch(() => props.type, () => {
+  page.current = 1;
+  getList();
+  fetchStockRecordTypeOptions();
 });
 </script>
 

--
Gitblit v1.9.3