From c7aebff7f6184b2d8da2669d2db5656e2bc09ec4 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 21 四月 2026 15:49:45 +0800
Subject: [PATCH] 湟水峡 1.反馈登记删减字段 2.售后服务字段匹配错误问题
---
src/views/inventoryManagement/receiptManagement/Record.vue | 69 +++++++++++++++++++++++++++-------
1 files changed, 54 insertions(+), 15 deletions(-)
diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index ec64f17..56d4981 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -15,6 +15,16 @@
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">鎼滅储
@@ -66,6 +76,13 @@
<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 +102,33 @@
toRefs,
onMounted,
getCurrentInstance,
- nextTick,
} 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,
- required: true,
- default: '0'
+ productId: {
+ type: [String, Number],
+ default: ''
}
})
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,6 +136,7 @@
searchForm: {
productName: "",
timeStr: "",
+ recordType: "",
},
});
const {searchForm} = toRefs(data);
@@ -128,6 +147,10 @@
getList();
};
+const getRecordType = (recordType) => {
+ return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
+}
+
const pageProductChange = obj => {
page.current = obj.page;
page.size = obj.limit;
@@ -136,16 +159,36 @@
const getList = () => {
tableLoading.value = true;
- const params = {...page, type: props.type};
+ const params = {...page, topParentProductId: props.productId};
params.timeStr = searchForm.value.timeStr;
params.productName = searchForm.value.productName;
+ params.recordType = searchForm.value.recordType;
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 qualified = qualifiedRes.data || [];
+ const unQualified = unQualifiedRes.data || [];
+ // 鍚堝苟骞跺幓閲�
+ const allOptions = [...qualified, ...unQualified];
+ const uniqueOptions = allOptions.filter((item, index, self) =>
+ index === self.findIndex((t) => t.value === item.value)
+ );
+ stockRecordTypeOptions.value = uniqueOptions;
+ });
+}
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = selection => {
@@ -162,12 +205,7 @@
type: "warning",
})
.then(() => {
- // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
- let exportUrl = "/stockin/export";
- if (activeTab.value === "production") {
- exportUrl = "/stockin/exportOne";
- }
- proxy.download(exportUrl, {}, "鍏ュ簱鍙拌处.xlsx");
+ proxy.download("/stockInRecord/exportStockInRecord", { topParentProductId: props.productId }, "鍏ュ簱鍙拌处.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
@@ -204,6 +242,7 @@
onMounted(() => {
getList();
+ fetchStockRecordTypeOptions();
});
</script>
--
Gitblit v1.9.3