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();
}
};