diff --git a/src/views/modules/qc/qcItem.vue b/src/views/modules/qc/qcItem.vue index ae176c3..53342ac 100644 --- a/src/views/modules/qc/qcItem.vue +++ b/src/views/modules/qc/qcItem.vue @@ -161,7 +161,7 @@ 抽样方案编码 - + @@ -170,7 +170,7 @@ 检验水平编码 - + @@ -191,10 +191,10 @@ - + - + 需上传图片 @@ -1246,6 +1246,33 @@ this.inspectionTypeSearch() }, + hasSamplingValue (val) { + return val !== null && val !== undefined && String(val).trim() !== '' + }, + onSamplingPlanOrLevelChange () { + if (this.hasSamplingValue(this.modalData.samplingProgrammeNo) || this.hasSamplingValue(this.modalData.samplingLevelNo)) { + this.modalData.itemSamplingQuantity = '' + this.modalData.defaultSamplingProportion = '' + } + }, + onSamplingQuantityChange () { + if (this.hasSamplingValue(this.modalData.itemSamplingQuantity)) { + this.modalData.samplingProgrammeNo = '' + this.modalData.samplingProgrammeDesc = '' + this.modalData.samplingLevelNo = '' + this.modalData.samplingLevelDesc = '' + this.modalData.defaultSamplingProportion = '' + } + }, + onSamplingProportionChange () { + if (this.hasSamplingValue(this.modalData.defaultSamplingProportion)) { + this.modalData.samplingProgrammeNo = '' + this.modalData.samplingProgrammeDesc = '' + this.modalData.samplingLevelNo = '' + this.modalData.samplingLevelDesc = '' + this.modalData.itemSamplingQuantity = '' + } + }, // 列表方法的回调 getBaseData (val) { if (this.tagNo === 1036) { @@ -1255,10 +1282,12 @@ if (this.tagNo === 207) { this.modalData.samplingProgrammeNo = val.sampling_programme_no this.modalData.samplingProgrammeDesc = val.sampling_programme_desc + this.onSamplingPlanOrLevelChange() } if (this.tagNo === 208) { this.modalData.samplingLevelNo = val.sampling_level_no this.modalData.samplingLevelDesc = val.sampling_level_desc + this.onSamplingPlanOrLevelChange() } }, diff --git a/src/views/modules/qc/qcPartAttribute.vue b/src/views/modules/qc/qcPartAttribute.vue index b264f75..ac416ac 100644 --- a/src/views/modules/qc/qcPartAttribute.vue +++ b/src/views/modules/qc/qcPartAttribute.vue @@ -304,7 +304,7 @@ + label="抽样方案"> + min-width="170" + label="检验水平"> + + + + min-width="60" + label="检验周期(h)"> i.columnProp === 'inspectionTypeName') if (idx === -1) return [] return list.slice(idx + 1) + }, + detailColumnsAfterIpqcBeforeQty () { + const list = this.detailColumnsAfterIpqc + const idx = list.findIndex(i => i.columnProp === 'defaultSamplingQuantity') + if (idx === -1) return list + return list.slice(0, idx) + }, + detailColumnsAfterIpqcFromQty () { + const list = this.detailColumnsAfterIpqc + const idx = list.findIndex(i => i.columnProp === 'defaultSamplingQuantity') + if (idx === -1) return [] + return list.slice(idx) } }, @@ -2226,6 +2260,30 @@ this.detailList.forEach(r => this.normalizeIpqcInspectionMethod(r)) }, + hasSamplingValue (val) { + return val !== null && val !== undefined && String(val).trim() !== '' + }, + onDetailSamplingPlanOrLevelChange (row) { + if (this.hasSamplingValue(row.samplingProgrammeNo) || this.hasSamplingValue(row.samplingLevelNo)) { + this.$set(row, 'defaultSamplingQuantity', '') + this.$set(row, 'defaultSamplingProportion', '') + } + }, + onDetailSamplingFieldInput (row, field) { + if (field === 'defaultSamplingQuantity' && this.hasSamplingValue(row.defaultSamplingQuantity)) { + this.$set(row, 'samplingProgrammeNo', '') + this.$set(row, 'samplingProgrammeDesc', '') + this.$set(row, 'samplingLevelNo', '') + this.$set(row, 'samplingLevelDesc', '') + this.$set(row, 'defaultSamplingProportion', '') + } else if (field === 'defaultSamplingProportion' && this.hasSamplingValue(row.defaultSamplingProportion)) { + this.$set(row, 'samplingProgrammeNo', '') + this.$set(row, 'samplingProgrammeDesc', '') + this.$set(row, 'samplingLevelNo', '') + this.$set(row, 'samplingLevelDesc', '') + this.$set(row, 'defaultSamplingQuantity', '') + } + }, chooseLevel (row) { this.tempLevelRow = row this.getBaseList(208) @@ -2269,10 +2327,12 @@ if (this.tagNo === 208) { this.tempLevelRow.samplingLevelNo = val.sampling_level_no this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc + this.onDetailSamplingPlanOrLevelChange(this.tempLevelRow) } if (this.tagNo === 207) { this.tempProgrammeRow.samplingProgrammeNo = val.sampling_programme_no this.tempProgrammeRow.samplingProgrammeDesc = val.sampling_programme_desc + this.onDetailSamplingPlanOrLevelChange(this.tempProgrammeRow) } if (this.tagNo === 1056) { this.modalData.supplierNo = val.supplier_id diff --git a/src/views/modules/qc/qcTemplate.vue b/src/views/modules/qc/qcTemplate.vue index dd22b2e..c8e54fa 100644 --- a/src/views/modules/qc/qcTemplate.vue +++ b/src/views/modules/qc/qcTemplate.vue @@ -149,7 +149,7 @@ 抽样方案编码 - + @@ -158,7 +158,7 @@ 检验水平编码 - + @@ -169,10 +169,10 @@ - + - + @@ -1260,6 +1260,34 @@ this.inspectionTypeSearch() }, + hasSamplingValue (val) { + return val !== null && val !== undefined && String(val).trim() !== '' + }, + onSamplingPlanOrLevelChange () { + if (this.hasSamplingValue(this.modalData.samplingProgrammeNo) || this.hasSamplingValue(this.modalData.samplingLevelNo)) { + this.modalData.defaultSamplingQuantity = '' + this.modalData.defaultSamplingProportion = '' + } + }, + onSamplingQuantityChange () { + if (this.hasSamplingValue(this.modalData.defaultSamplingQuantity)) { + this.modalData.samplingProgrammeNo = '' + this.modalData.samplingProgrammeDesc = '' + this.modalData.samplingLevelNo = '' + this.modalData.samplingLevelDesc = '' + this.modalData.defaultSamplingProportion = '' + } + }, + onSamplingProportionChange () { + if (this.hasSamplingValue(this.modalData.defaultSamplingProportion)) { + this.modalData.samplingProgrammeNo = '' + this.modalData.samplingProgrammeDesc = '' + this.modalData.samplingLevelNo = '' + this.modalData.samplingLevelDesc = '' + this.modalData.defaultSamplingQuantity = '' + } + }, + // 查询设备 objectSearch () { let tempData = { @@ -1338,10 +1366,12 @@ if (this.tagNo === 207) { this.modalData.samplingProgrammeNo = val.sampling_programme_no this.modalData.samplingProgrammeDesc = val.sampling_programme_desc + this.onSamplingPlanOrLevelChange() } if (this.tagNo === 208) { this.modalData.samplingLevelNo = val.sampling_level_no this.modalData.samplingLevelDesc = val.sampling_level_desc + this.onSamplingPlanOrLevelChange() } },