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 | 99 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 78 insertions(+), 21 deletions(-)
diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index a477547..b85e79b 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -25,10 +25,19 @@
: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>
@@ -64,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="鍗曚綅"
@@ -72,6 +81,19 @@
show-overflow-tooltip/>
<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"
@@ -102,6 +124,7 @@
toRefs,
onMounted,
getCurrentInstance,
+ watch,
} from "vue";
import {ElMessageBox} from "element-plus";
import {
@@ -109,17 +132,16 @@
batchDeleteStockInRecords,
} from "@/api/inventoryManagement/stockInRecord.js";
import {
- findAllQualifiedStockRecordTypeOptions,
- findAllUnqualifiedStockRecordTypeOptions
+ findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
} from "@/api/basicData/enum.js";
const {proxy} = getCurrentInstance();
const props = defineProps({
type: {
- type: String,
+ type: Number,
required: true,
- default: '0'
+ default: 1
}
})
@@ -130,7 +152,7 @@
const stockRecordTypeOptions = ref([]);
const page = reactive({
current: 1,
- size: 100,
+ size: 10,
});
const total = ref(0);
@@ -139,14 +161,25 @@
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) => {
@@ -161,12 +194,17 @@
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;
})
@@ -174,17 +212,27 @@
// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
const fetchStockRecordTypeOptions = () => {
- if (props.type === '0') {
- findAllQualifiedStockRecordTypeOptions()
- .then(res => {
- stockRecordTypeOptions.value = res.data;
- })
- return
- }
- findAllUnqualifiedStockRecordTypeOptions()
- .then(res => {
- stockRecordTypeOptions.value = res.data;
- })
+ 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 = [];
+ });
}
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -202,9 +250,12 @@
type: "warning",
})
.then(() => {
- // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
- let exportUrl = "/stockin/export";
- 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("宸插彇娑�");
@@ -243,6 +294,12 @@
getList();
fetchStockRecordTypeOptions();
});
+
+watch(() => props.type, () => {
+ page.current = 1;
+ getList();
+ fetchStockRecordTypeOptions();
+});
</script>
<style scoped lang="scss"></style>
--
Gitblit v1.9.3