From fbdbaf751acd114ef55a982fbad3fe8f9c956eb7 Mon Sep 17 00:00:00 2001 From: shenzhouyu Date: Mon, 2 Nov 2026 13:37:40 +0800 Subject: [PATCH] =?UTF-8?q?20261102.=E6=B5=B7=E6=B3=A2=EF=BC=9APDA?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E7=94=9F=E4=BA=A7=E9=80=80=E4=BB=93=E3=80=81?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E9=A2=86=E9=80=80=E6=96=99=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=9F=A5=E8=AF=A2=E4=BA=86=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=AA=E5=A4=9A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/productionIssueReturnList.vue | 41 ++++--------------- .../production/productionQualifiedReturn.vue | 41 ++++--------------- 2 files changed, 14 insertions(+), 68 deletions(-) diff --git a/src/views/modules/production/productionIssueReturnList.vue b/src/views/modules/production/productionIssueReturnList.vue index 7fe6983..b7a1770 100644 --- a/src/views/modules/production/productionIssueReturnList.vue +++ b/src/views/modules/production/productionIssueReturnList.vue @@ -18,6 +18,7 @@ placeholder="请扫描入库单或标签条码" prefix-icon="el-icon-search" @keyup.enter.native="handleSearch" + @clear="handleSearch" ref="searchInput" /> @@ -60,7 +61,7 @@
-

暂无生产待退仓物料

+

{{ hasSearched ? '未找到匹配的生产订单' : '请扫描入库单或标签条码查询' }}

@@ -82,7 +83,8 @@ export default { return { searchCode: '', qualifiedList: [], - loading: false + loading: false, + hasSearched: false }; }, methods: { @@ -95,39 +97,11 @@ export default { if (this.searchCode.trim()) { this.searchQualifiedList(this.searchCode.trim()); } else { - this.loadQualifiedList(); + this.hasSearched = false; + this.qualifiedList = []; } }, - // 加载生产待退仓列表 - loadQualifiedList() { - const currentWarehouse = getCurrentWarehouse(); - if (!currentWarehouse) { - this.$message.error('请先选择仓库'); - return; - } - - this.loading = true; - const params = { - warehouseId: currentWarehouse, - site: localStorage.getItem('site'), - status: '待入库', // 待入库状态 - }; - - getQualifiedReturnList(params).then(({ data }) => { - this.loading = false; - if (data && data.code === 0) { - this.qualifiedList = data.data || []; - } else { - this.$message.error(data.msg || '获取数据失败'); - } - }).catch(error => { - this.loading = false; - console.error('获取生产待退仓列表失败:', error); - this.$message.error('获取数据失败'); - }); - }, - // 搜索特定入库单 searchQualifiedList(searchCode) { const currentWarehouse = getCurrentWarehouse(); @@ -137,6 +111,7 @@ export default { } this.loading = true; + this.hasSearched = true; const params = { warehouseId: currentWarehouse, searchCode: searchCode, @@ -187,8 +162,6 @@ export default { this.$refs.searchInput.focus(); } }); - // 加载数据 - this.loadQualifiedList(); } }; diff --git a/src/views/modules/production/productionQualifiedReturn.vue b/src/views/modules/production/productionQualifiedReturn.vue index c6e8faf..68559d4 100644 --- a/src/views/modules/production/productionQualifiedReturn.vue +++ b/src/views/modules/production/productionQualifiedReturn.vue @@ -18,6 +18,7 @@ placeholder="请扫描入库单或标签条码" prefix-icon="el-icon-search" @keyup.enter.native="handleSearch" + @clear="handleSearch" ref="searchInput" /> @@ -60,7 +61,7 @@
-

暂无生产待入库物料

+

{{ hasSearched ? '未找到匹配的生产订单' : '请扫描入库单或标签条码查询' }}

@@ -82,7 +83,8 @@ export default { return { searchCode: '', qualifiedList: [], - loading: false + loading: false, + hasSearched: false }; }, methods: { @@ -95,39 +97,11 @@ export default { if (this.searchCode.trim()) { this.searchQualifiedList(this.searchCode.trim()); } else { - this.loadQualifiedList(); + this.hasSearched = false; + this.qualifiedList = []; } }, - // 加载生产待入库列表 - loadQualifiedList() { - const currentWarehouse = getCurrentWarehouse(); - if (!currentWarehouse) { - this.$message.error('请先选择仓库'); - return; - } - - this.loading = true; - const params = { - warehouseId: currentWarehouse, - site:localStorage.getItem('site'), - status: '待入库',// 待入库状态 - }; - - getQualifiedReturnList(params).then(({ data }) => { - this.loading = false; - if (data && data.code === 0) { - this.qualifiedList = data.data || []; - } else { - this.$message.error(data.msg || '获取数据失败'); - } - }).catch(error => { - this.loading = false; - console.error('获取生产待入库列表失败:', error); - this.$message.error('获取数据失败'); - }); - }, - // 搜索特定入库单 searchQualifiedList(searchCode) { const currentWarehouse = getCurrentWarehouse(); @@ -137,6 +111,7 @@ export default { } this.loading = true; + this.hasSearched = true; const params = { warehouseId: currentWarehouse, searchCode: searchCode, @@ -180,8 +155,6 @@ export default { this.$refs.searchInput.focus(); } }); - // 加载数据 - this.loadQualifiedList(); } };