|
|
|
@ -112,12 +112,14 @@ |
|
|
|
<el-form-item > |
|
|
|
<el-button v-if="!authSearch" type="primary" :loading="searchLoading" @click="getDataList">查询</el-button> |
|
|
|
<!-- 文案按窗口分化,原「验货任务」页沿用 审核/取消审核/删除 一字不改: |
|
|
|
采购单验货、打样单验货(orderScope)= 待审提交/删除报告/退出待检; |
|
|
|
验货审核窗口(auditMode)只隐藏 审核/删除/任务重载,并把 取消审核 改为「退回复核」--> |
|
|
|
<el-button v-if="!auditMode && !authCheck" type="primary" @click="submitResult">{{ orderScope ? '待审提交' : '审核' }}</el-button> |
|
|
|
<el-button v-if="!authCancelCheck" type="primary" @click="cancelApproval">{{ auditMode ? '退回复核' : (orderScope ? '删除报告' : '取消审核') }}</el-button> |
|
|
|
<el-button v-if="!auditMode && !authDelete" type="primary" @click="deleteModal">{{ orderScope ? '退出待检' : '删除' }}</el-button> |
|
|
|
<el-button v-if="!auditMode && !authOverLoad" type="primary" @click="overLoadModal">任务重载</el-button> |
|
|
|
采购单验货、打样单验货(orderScope)= 待审提交/删除报告/退出待检,原验货任务页 = 待审提交/取消审核/退出待检, |
|
|
|
两者均走旧取消审核(已完成→待检验,清空结论与快照); |
|
|
|
只有验货审核窗口(auditMode)的「退回复核」走新后端(已完成→待审核,保留结论与明细), |
|
|
|
文案与请求口径共用 cancelApprovalLabel / rollbackToReviewMode,不会出现名字与行为不一致 --> |
|
|
|
<el-button v-if="!auditMode && !authCheck" type="primary" @click="submitResult">{{ orderScope ? '待审提交' : '待审提交' }}</el-button> |
|
|
|
<el-button v-if="!authCancelCheck" type="primary" @click="cancelApproval">{{ cancelApprovalLabel }}</el-button> |
|
|
|
<el-button v-if="!auditMode && !authDelete" type="primary" @click="deleteModal">{{ orderScope ? '退出待检' : '退出待检' }}</el-button> |
|
|
|
<el-button v-if="!auditMode && !authOverLoad" type="primary" @click="overLoadModal">模板重载</el-button> |
|
|
|
<!-- <el-button type="primary" @click="printList">打印</el-button> --> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
@ -800,6 +802,7 @@ |
|
|
|
getIQCItemObjectList, // 查询项目设备 |
|
|
|
dataAcquisitionByItem, // 根据项目数据采集 |
|
|
|
cancelApproval, // 取消审核 |
|
|
|
rollbackToReview, // 退回复核:已完成退回待审核且保留明细 |
|
|
|
overLoadSearchPartInfo, // 查询物料属性信息 |
|
|
|
getEamPropertiesItemByItemNo, |
|
|
|
getCollectorDataByItem, |
|
|
|
@ -857,6 +860,19 @@ |
|
|
|
showPoSearch () { |
|
|
|
return this.auditMode || !!this.orderScope |
|
|
|
}, |
|
|
|
// 退回复核只在验货审核窗口(qc-IQCResultAudit 传的 audit-mode)生效:已完成退回待审核, |
|
|
|
// 只翻转审核标识,检验结论与检验项目明细全部保留,复核后用「审核」按钮重新审核即可; |
|
|
|
// 采购单/打样单验货的「删除报告」与原验货任务页的「取消审核」均保持旧逻辑(退回待检验并清空结论) |
|
|
|
rollbackToReviewMode () { |
|
|
|
return this.auditMode |
|
|
|
}, |
|
|
|
// 按钮文案唯一来源:验货审核=退回复核,采购单/打样单验货=删除报告,原验货任务页=取消审核 |
|
|
|
cancelApprovalLabel () { |
|
|
|
if (this.auditMode) { |
|
|
|
return '退回复核' |
|
|
|
} |
|
|
|
return this.orderScope ? '删除报告' : '取消审核' |
|
|
|
}, |
|
|
|
templateTableData () { |
|
|
|
let start = (this.pageIndex2 - 1) * this.pageSize2 |
|
|
|
let end = start + this.pageSize2 |
|
|
|
@ -2853,8 +2869,10 @@ |
|
|
|
return |
|
|
|
} |
|
|
|
if (type === '2') { |
|
|
|
if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) { |
|
|
|
this.$message.warning('请选择检验结论!') |
|
|
|
// 只判空不够:新建与取消审核(删除报告)会把主表结论初始化为“待检验”,非空但仍是脏值, |
|
|
|
// 不拦就会一路刷进验货申请明细与打样单PO的检验结论,后端同步做了兜底 - rqrq |
|
|
|
if (this.detailData.inspectionResult !== '合格' && this.detailData.inspectionResult !== '不合格') { |
|
|
|
this.$message.warning('请选择检验结论(合格/不合格)!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.detailData.inspectionResult === '不合格' && (this.detailData.disposalMeasures == null || this.detailData.disposalMeasures === '')) { |
|
|
|
@ -3011,7 +3029,8 @@ |
|
|
|
this.detailData.submitFlag = row.submitFlag |
|
|
|
this.detailData.disposalMeasures = row.disposalMeasures |
|
|
|
this.detailData.disposalRemark = row.disposalRemark |
|
|
|
this.detailData.inspectionResult = row.inspectionResult |
|
|
|
// 结论只有合格/不合格两个选项:主表为空的“待检验”脏值按业务约定默认合格(与首次开单默认全部通过一致),需不合格时人工改选 |
|
|
|
this.detailData.inspectionResult = (row.inspectionResult && row.inspectionResult !== '待检验') ? row.inspectionResult : '合格' |
|
|
|
this.detailData.inspectorNo = row.inspectorNo |
|
|
|
this.detailData.inspectorDate = row.inspectorDate |
|
|
|
this.detailData.submitDate = row.submitDate |
|
|
|
@ -3351,6 +3370,7 @@ |
|
|
|
submitResult () { |
|
|
|
let tempData1 = '' // 记录不是待审核状态的单号 |
|
|
|
let tempData2 = '' // 记录处置措施未填写的单号 |
|
|
|
let tempData3 = '' // 记录检验结论未选定(空/待检验)的单号 |
|
|
|
if (this.IQCSelections.length === 0) { |
|
|
|
this.$message.warning('请勾选要审核的检验单!') |
|
|
|
return |
|
|
|
@ -3362,12 +3382,22 @@ |
|
|
|
if (this.IQCSelections[i].inspectionResult === '不合格' && (this.IQCSelections[i].disposalMeasures === '' || this.IQCSelections[i].disposalMeasures == null)) { |
|
|
|
tempData2 = tempData2 + this.IQCSelections[i].inspectionNo + '、' |
|
|
|
} |
|
|
|
// 后端 saveIQCSubmitResult 已对未选定结论兜底(免检放行),此处提前拦住并报具体单号 |
|
|
|
const itemResult = this.IQCSelections[i].inspectionResult |
|
|
|
if (itemResult !== '合格' && itemResult !== '不合格' && itemResult !== '免检') { |
|
|
|
tempData3 = tempData3 + this.IQCSelections[i].inspectionNo + '、' |
|
|
|
} |
|
|
|
} |
|
|
|
if (tempData1 !== '') { |
|
|
|
tempData1 = tempData1.substring(0, tempData1.length - 1) |
|
|
|
this.$message.warning('检验单号 ' + tempData1 + ', 不是待审核状态!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (tempData3 !== '') { |
|
|
|
tempData3 = tempData3.substring(0, tempData3.length - 1) |
|
|
|
this.$message.warning('检验单号 ' + tempData3 + ', 检验结论未选定,请先打开弹窗选择合格/不合格!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (tempData2 !== '') { |
|
|
|
tempData2 = tempData2.substring(0, tempData2.length - 1) |
|
|
|
this.$message.warning('检验单号 ' + tempData2 + ', 的处置措施未选择!') |
|
|
|
@ -3408,12 +3438,15 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 取消审核 |
|
|
|
// 取消审核 / 删除报告 / 退回复核:两者勾选校验完全一致(必须已完成、免检不允许), |
|
|
|
// 仅后端不同:只有验货审核窗口的退回复核走 rollbackToReview(已完成→待审核,保留结论与明细), |
|
|
|
// 删除报告与取消审核走旧 cancelApproval(已完成→待检验,清空结论与快照) |
|
|
|
cancelApproval () { |
|
|
|
const actionName = this.cancelApprovalLabel |
|
|
|
let tempData1 = '' // 记录不是已完成状态的单号 |
|
|
|
let tempData2 = '' // 记录免检的单号 |
|
|
|
if (this.IQCSelections.length === 0) { |
|
|
|
this.$message.warning('请勾选要取消审核的检验单!') |
|
|
|
this.$message.warning('请勾选要' + actionName + '的检验单!') |
|
|
|
return |
|
|
|
} |
|
|
|
for (let i = 0; i < this.IQCSelections.length; i++) { |
|
|
|
@ -3431,18 +3464,20 @@ |
|
|
|
} |
|
|
|
if (tempData2 !== '') { |
|
|
|
tempData2 = tempData2.substring(0, tempData2.length - 1) |
|
|
|
this.$message.warning('检验单号 ' + tempData2 + ' , 免检的单据不允许取消审核!') |
|
|
|
this.$message.warning('检验单号 ' + tempData2 + ' , 免检的单据不允许' + actionName + '!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm(`确定取消审核该 ` + this.IQCSelections.length + ` 条记录`, '提示', { |
|
|
|
this.$confirm(`确定${actionName}该 ` + this.IQCSelections.length + ` 条记录`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.submitData.submitList = this.IQCSelections |
|
|
|
cancelApproval(this.submitData).then(({data}) => { |
|
|
|
// 文案与请求口径共用 rollbackToReviewMode,避免按钮名字与实际操作不一致 |
|
|
|
const submitRequest = this.rollbackToReviewMode ? rollbackToReview : cancelApproval |
|
|
|
submitRequest(this.submitData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
// 回滚验货结果已在后端取消审核事务中一并执行,前端无需再调用 |
|
|
|
// 退回复核保留验货申请结果(重新审核会覆盖写),取消审核则已在后端事务中一并回滚,前端无需再调用 |
|
|
|
this.getDataList() |
|
|
|
this.IQCSelections = [] |
|
|
|
this.$message({ |
|
|
|
|