From 6d30bc636d931c5aa53d0336cf67db99649d41a7 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 21 三月 2026 13:31:18 +0800
Subject: [PATCH] 军泰伟业 1.订单分批发货后,对应仓库出库数据有误 2.新增退货单并处理成功后,已退货数量、未退货数量显示有误 3.自制、外购、委外来源需拆分为合格来源、不合格来源 4.规格型号改为图纸编号

---
 src/views/inventoryManagement/dispatchLog/Record.vue |   96 +++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 74 insertions(+), 22 deletions(-)

diff --git a/src/views/inventoryManagement/dispatchLog/Record.vue b/src/views/inventoryManagement/dispatchLog/Record.vue
index 6fa29c8..1acc0a3 100644
--- a/src/views/inventoryManagement/dispatchLog/Record.vue
+++ b/src/views/inventoryManagement/dispatchLog/Record.vue
@@ -22,9 +22,18 @@
                      :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>
@@ -62,7 +71,7 @@
 					show-overflow-tooltip
 				/>
 				<el-table-column
-					label="瑙勬牸鍨嬪彿"
+					label="鍥剧焊缂栧彿"
 					prop="model"
 					show-overflow-tooltip
 				/>
@@ -76,6 +85,16 @@
 					prop="stockOutNum"
 					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="createBy"
@@ -103,7 +122,7 @@
 
 <script setup>
 import pagination from "@/components/PIMTable/Pagination.vue";
-import { ref } from "vue";
+import { ref, watch } from "vue";
 import { ElMessageBox } from "element-plus";
 import useUserStore from "@/store/modules/user";
 import { getCurrentDate } from "@/utils/index.js";
@@ -112,9 +131,7 @@
 	delStockOut,
 } from "@/api/inventoryManagement/stockOut.js";
 import {
-  findAllQualifiedStockRecordTypeOptions,
-  findAllStockRecordTypeOptions,
-  findAllUnqualifiedStockRecordTypeOptions
+  findAllQualifiedStockOutRecordTypeOptions, findAllUnQualifiedStockOutRecordTypeOptions,
 } from "@/api/basicData/enum.js";
 
 const userStore = useUserStore();
@@ -132,9 +149,9 @@
 
 const props = defineProps({
   type: {
-    type: String,
+    type: Number,
     required: true,
-    default: '0'
+    default: 1
   }
 })
 
@@ -148,6 +165,7 @@
 		supplierName: "",
 		timeStr: "",
     recordType: "",
+    type: "",
 	}
 });
 const { searchForm } = toRefs(data);
@@ -158,6 +176,15 @@
 	page.current = 1;
 	getList();
 };
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+const handleReset = () => {
+  searchForm.value.supplierName = "";
+  searchForm.value.timeStr = "";
+  searchForm.value.recordType = "";
+  searchForm.value.type = "";
+  handleQuery();
+};
 const paginationChange = (obj) => {
 	page.current = obj.page;
 	page.size = obj.limit;
@@ -165,7 +192,11 @@
 };
 const getList = () => {
 	tableLoading.value = true;
-	getStockOutPage({ ...searchForm.value, ...page, type: props.type })
+	const params = { ...searchForm.value, ...page, productType: props.type };
+  if (searchForm.value.type !== "") {
+    params.type = searchForm.value.type;
+  }
+	getStockOutPage(params)
 		.then((res) => {
 			tableLoading.value = false;
 			tableData.value = res.data.records;
@@ -185,17 +216,27 @@
 
 // 鑾峰彇鏉ユ簮绫诲瀷閫夐」
 const fetchStockRecordTypeOptions = () => {
-  if (props.type === '0') {
-    findAllQualifiedStockRecordTypeOptions()
-        .then(res => {
-          stockRecordTypeOptions.value = res.data;
-        })
-    return
-  }
-  findAllUnqualifiedStockRecordTypeOptions()
-      .then(res => {
-        stockRecordTypeOptions.value = res.data;
-      })
+  Promise.all([
+    findAllQualifiedStockOutRecordTypeOptions(),
+    findAllUnQualifiedStockOutRecordTypeOptions()
+  ])
+    .then(([qualifiedRes, unQualifiedRes]) => {
+      const qualifiedData = qualifiedRes.data || [];
+      const unQualifiedData = unQualifiedRes.data || [];
+      const allData = [...qualifiedData, ...unQualifiedData];
+      const uniqueData = [];
+      const valueSet = new Set();
+      allData.forEach(item => {
+        if (!valueSet.has(item.value)) {
+          valueSet.add(item.value);
+          uniqueData.push(item);
+        }
+      });
+      stockRecordTypeOptions.value = uniqueData;
+    })
+    .catch(() => {
+      stockRecordTypeOptions.value = [];
+    });
 }
 
 // 琛ㄦ牸閫夋嫨鏁版嵁
@@ -214,7 +255,12 @@
 		type: "warning",
 	})
 		.then(() => {
-			proxy.download("/stockOutRecord/exportStockOutRecord", {type: props.type}, props.type === '0' ? "鍚堟牸鍑哄簱鍙拌处.xlsx" : "涓嶅悎鏍煎嚭搴撳彴璐�.xlsx");
+			const fileNameMap = {
+        1: '鑷埗鍑哄簱鍙拌处.xlsx',
+        2: '澶栬喘鍑哄簱鍙拌处.xlsx',
+        3: '濮斿鍑哄簱鍙拌处.xlsx'
+      };
+			proxy.download("/stockOutRecord/exportStockOutRecord", {productType: props.type}, fileNameMap[props.type] || '鍑哄簱鍙拌处.xlsx');
 		})
 		.catch(() => {
 			proxy.$modal.msg("宸插彇娑�");
@@ -407,7 +453,7 @@
       <div class="print-page">
         <div class="delivery-note">
           <div class="header">
-            <div class="company-name">榧庤瘹鐟炲疄涓氭湁闄愯矗浠诲叕鍙�</div>
+            <div class="company-name">鍐涙嘲浼熶笟鏈烘鏈夐檺鍏徃</div>
             <div class="document-title">闆跺敭鍙戣揣鍗�</div>
           </div>
           
@@ -433,7 +479,7 @@
               <thead>
                 <tr>
                   <th>浜у搧鍚嶇О</th>
-                  <th>瑙勬牸鍨嬪彿</th>
+                  <th>鍥剧焊缂栧彿</th>
                   <th>鍗曚綅</th>
                   <th>鍗曚环</th>
                   <th>闆跺敭鏁伴噺</th>
@@ -539,6 +585,12 @@
 	getList();
   fetchStockRecordTypeOptions();
 });
+
+watch(() => props.type, () => {
+  page.current = 1;
+  getList();
+  fetchStockRecordTypeOptions();
+});
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3