diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 49fc279..7041bed 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -319,7 +319,7 @@ @@ -888,6 +888,10 @@ needTriggerMachineInspectOption () { const types = this.appearanceInspectTypes || [] return (this.IQCSelections || []).some(r => types.indexOf(r.submissionType) !== -1 && this.treatsAsQualified(r)) + }, + disposalMeasuresForDetail () { + const options = this.disposalMeasuresOptions || [] + return options.filter(i => this.isDisposalAllowed(this.detailData.inspectCode, this.detailData.inspectionResult, i.disposalMeasures)) } }, watch: { @@ -1913,7 +1917,8 @@ submissionType: '', passQty: '', notPassQty: '', - batchQualifiedQty: '' + batchQualifiedQty: '', + inspectCode: '' }, detailInformationFlag: false, iqcRecordOverFlag: false, @@ -2687,7 +2692,42 @@ && (row.disposalMeasures === '让步接收' || row.disposalMeasures === '挑选使用') }, + isFullInspect (inspectCode) { + return String(inspectCode || '').trim().toUpperCase() === 'F' + }, + + isDisposalAllowed (inspectCode, inspectionResult, disposalMeasures) { + const disposal = disposalMeasures == null ? '' : String(disposalMeasures).trim() + if (!disposal) { + return true + } + if (this.isFullInspect(inspectCode)) { + return disposal !== '拒收退回' && disposal !== '返工返修' && disposal !== '让步接收' + } + return !(inspectionResult === '不合格' && disposal === '挑选使用') + }, + + disposalForbiddenTip (inspectCode) { + if (this.isFullInspect(inspectCode)) { + return '全检任务不允许选择拒收退回、返工返修、让步接收' + } + return '抽检任务检验结论为不合格时,不允许选择挑选使用' + }, + + clearIllegalDisposal () { + if (this.detailData.submitFlag === 'Y') { + return + } + if (!this.isDisposalAllowed(this.detailData.inspectCode, this.detailData.inspectionResult, this.detailData.disposalMeasures)) { + this.detailData.disposalMeasures = '' + } + }, + async Transfer (type) { + if (this.detailData.submitFlag !== 'Y' && !this.isDisposalAllowed(this.detailData.inspectCode, this.detailData.inspectionResult, this.detailData.disposalMeasures)) { + this.$message.warning(this.disposalForbiddenTip(this.detailData.inspectCode)) + return + } if (type === '2') { if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) { this.$message.warning('请选择检验结论!') @@ -2885,6 +2925,7 @@ this.detailData.responsiblePersonName = row.responsiblePersonName this.detailData.invdefinetype = row.invdefinetype this.detailData.state = row.state + this.detailData.inspectCode = row.inspectCode || '' this.$set(this.detailData, 'submissionType', row.submissionType || '') this.$set(this.detailData, 'supplierNo', row.supplierNo || '') // if (row.state === '待检验') { @@ -2897,6 +2938,7 @@ this.detailData.passQty = row.passQty this.detailData.notPassQty = row.notPassQty this.detailData.batchQualifiedQty = row.batchQualifiedQty + this.clearIllegalDisposal() this.getInspectionFormData() this.inspectorSearch() // this.acquisitionList = [] @@ -3121,6 +3163,7 @@ submitResult () { let tempData1 = '' // 记录不是待审核状态的单号 let tempData2 = '' // 记录处置措施未填写的单号 + let tempData3 = '' // 记录处置措施与检验方式不符的单号 if (this.IQCSelections.length === 0) { this.$message.warning('请勾选要审核的检验单!') return @@ -3132,6 +3175,9 @@ if (this.IQCSelections[i].inspectionResult === '不合格' && (this.IQCSelections[i].disposalMeasures === '' || this.IQCSelections[i].disposalMeasures == null)) { tempData2 = tempData2 + this.IQCSelections[i].inspectionNo + '、' } + if (!this.isDisposalAllowed(this.IQCSelections[i].inspectCode, this.IQCSelections[i].inspectionResult, this.IQCSelections[i].disposalMeasures)) { + tempData3 = tempData3 + this.IQCSelections[i].inspectionNo + '、' + } } if (tempData1 !== '') { tempData1 = tempData1.substring(0, tempData1.length - 1) @@ -3143,6 +3189,11 @@ this.$message.warning('检验单号 ' + tempData2 + ', 的处置措施未选择!') return } + if (tempData3 !== '') { + tempData3 = tempData3.substring(0, tempData3.length - 1) + this.$message.warning('检验单号 ' + tempData3 + ' 的处置措施与检验方式不符,请重新选择') + return + } // this.submitData.site = row.site // this.submitData.inspectionNo = row.inspectionNo // this.submitData.inspectionResult = row.inspectionResult @@ -3474,6 +3525,7 @@ if (this.detailData.inspectionResult === '不合格') { this.detailData.passQty = 0 } + this.clearIllegalDisposal() }, // 校验用户是否收藏