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/receiptManagement/Record.vue | 123 ++++++++++++++++++++++++++++++++++++----
1 files changed, 109 insertions(+), 14 deletions(-)
diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index ec64f17..b85e79b 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>
@@ -54,7 +73,7 @@
<el-table-column label="浜у搧澶х被"
prop="productName"
show-overflow-tooltip/>
- <el-table-column label="瑙勬牸鍨嬪彿"
+ <el-table-column label="鍥剧焊缂栧彿"
prop="model"
show-overflow-tooltip/>
<el-table-column label="鍗曚綅"
@@ -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,46 @@
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 = () => {
+ Promise.all([
+ findAllQualifiedStockInRecordTypeOptions(),
+ findAllUnQualifiedStockInRecordTypeOptions()
+ ])
+ .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 = [];
+ });
+}
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = selection => {
@@ -162,12 +250,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 +292,13 @@
onMounted(() => {
getList();
+ fetchStockRecordTypeOptions();
+});
+
+watch(() => props.type, () => {
+ page.current = 1;
+ getList();
+ fetchStockRecordTypeOptions();
});
</script>
--
Gitblit v1.9.3