|
|
|
@ -18,6 +18,7 @@ |
|
|
|
placeholder="请扫描入库单或标签条码" |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
@keyup.enter.native="handleSearch" |
|
|
|
@clear="handleSearch" |
|
|
|
ref="searchInput" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
@ -60,7 +61,7 @@ |
|
|
|
<!-- 空状态 --> |
|
|
|
<div v-if="qualifiedList.length === 0 && !loading" class="empty-state"> |
|
|
|
<i class="el-icon-box"></i> |
|
|
|
<p>暂无生产待退仓物料</p> |
|
|
|
<p>{{ hasSearched ? '未找到匹配的生产订单' : '请扫描入库单或标签条码查询' }}</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 加载状态 --> |
|
|
|
@ -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(); |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|