|
|
|
@ -788,9 +788,7 @@ |
|
|
|
overLoadSearchPartInfo, // 查询物料属性信息 |
|
|
|
getEamPropertiesItemByItemNo, |
|
|
|
getCollectorDataByItem, |
|
|
|
getResponsibleOperatorList, |
|
|
|
refreshInspectionResult, // 刷新验货结果 |
|
|
|
rollbackInspectionResult, // 回滚验货结果 |
|
|
|
getResponsibleOperatorList |
|
|
|
} from "@/api/qc/qc.js" |
|
|
|
import { buildQcBu } from './qcBuUtils' |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
@ -2752,7 +2750,8 @@ |
|
|
|
this.getDataList() |
|
|
|
this.detailInformationFlag = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
// 保存接口内已包含自动审核,后端同一事务完成 |
|
|
|
message: type === '2' ? '保存并审核成功' : '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
@ -3211,16 +3210,7 @@ |
|
|
|
this.submitData.submitList = this.IQCSelections |
|
|
|
saveIQCSubmitResult(this.submitData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
// 审核成功后,调用刷新验货结果接口 |
|
|
|
const refreshPromises = this.IQCSelections.map(selection => { |
|
|
|
return refreshInspectionResult({ |
|
|
|
poOrderNo: selection.poOrderNo, |
|
|
|
poItemNo: selection.poItemNo, |
|
|
|
site: selection.site |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
Promise.all(refreshPromises).then(() => { |
|
|
|
// 刷新验货结果已在后端审核事务中一并执行,前端无需再调用 |
|
|
|
this.getDataList() |
|
|
|
this.IQCSelections = [] |
|
|
|
this.$message({ |
|
|
|
@ -3229,17 +3219,6 @@ |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
}).catch(error => { |
|
|
|
console.error('刷新验货结果失败:', error) |
|
|
|
// 即使刷新失败,也更新列表 |
|
|
|
this.getDataList() |
|
|
|
this.IQCSelections = [] |
|
|
|
this.$message({ |
|
|
|
message: '审核成功,但刷新验货结果失败', |
|
|
|
type: 'warning', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
@ -3283,16 +3262,7 @@ |
|
|
|
this.submitData.submitList = this.IQCSelections |
|
|
|
cancelApproval(this.submitData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
// 取消审核成功后,调用回滚验货结果接口 |
|
|
|
const rollbackPromises = this.IQCSelections.map(selection => { |
|
|
|
return rollbackInspectionResult({ |
|
|
|
poOrderNo: selection.poOrderNo, |
|
|
|
poItemNo: selection.poItemNo, |
|
|
|
site: selection.site |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
Promise.all(rollbackPromises).then(() => { |
|
|
|
// 回滚验货结果已在后端取消审核事务中一并执行,前端无需再调用 |
|
|
|
this.getDataList() |
|
|
|
this.IQCSelections = [] |
|
|
|
this.$message({ |
|
|
|
@ -3301,17 +3271,6 @@ |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
}).catch(error => { |
|
|
|
console.error('回滚验货结果失败:', error) |
|
|
|
// 即使回滚失败,也更新列表 |
|
|
|
this.getDataList() |
|
|
|
this.IQCSelections = [] |
|
|
|
this.$message({ |
|
|
|
message: '取消审核成功,但回滚验货结果失败', |
|
|
|
type: 'warning', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
|