|
|
|
@ -74,7 +74,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { getQualifiedReturnList } from "@/api/production/production-return2.js"; |
|
|
|
import { getQualifiedReturnListByProcedure } from "@/api/production/production-return2.js"; |
|
|
|
import { getCurrentWarehouse } from '@/utils' |
|
|
|
import moment from 'moment'; |
|
|
|
|
|
|
|
@ -94,6 +94,7 @@ export default { |
|
|
|
|
|
|
|
// 处理搜索 |
|
|
|
handleSearch() { |
|
|
|
if (this.loading) return; |
|
|
|
if (this.searchCode.trim()) { |
|
|
|
this.searchQualifiedList(this.searchCode.trim()); |
|
|
|
} else { |
|
|
|
@ -104,12 +105,14 @@ export default { |
|
|
|
|
|
|
|
// 搜索特定入库单 |
|
|
|
searchQualifiedList(searchCode) { |
|
|
|
if (this.loading) return; |
|
|
|
const currentWarehouse = getCurrentWarehouse(); |
|
|
|
if (!currentWarehouse) { |
|
|
|
this.$message.error('请先选择仓库'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.qualifiedList = []; |
|
|
|
this.loading = true; |
|
|
|
this.hasSearched = true; |
|
|
|
const params = { |
|
|
|
@ -119,20 +122,20 @@ export default { |
|
|
|
status: '待入库' |
|
|
|
}; |
|
|
|
|
|
|
|
getQualifiedReturnList(params).then(({ data }) => { |
|
|
|
getQualifiedReturnListByProcedure(params).then(({ data }) => { |
|
|
|
this.loading = false; |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.data.length === 0) { |
|
|
|
if (!data.data || data.data.length === 0) { |
|
|
|
this.$message.warning('未找到匹配的入库单'); |
|
|
|
} |
|
|
|
this.qualifiedList = data.data || []; |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '查询失败'); |
|
|
|
this.$message.error((data && data.msg) || '查询失败'); |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.loading = false; |
|
|
|
console.error('搜索失败:', error); |
|
|
|
this.$message.error('查询失败'); |
|
|
|
this.$message.error(error.response && error.response.status === 504 ? '查询超时,请稍后重试或联系管理员' : '查询失败'); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|