diff --git a/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue b/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue index 16aea0d..1a2f37d 100644 --- a/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue +++ b/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue @@ -670,7 +670,7 @@
- {{ i.inspectionTypeName }}
@@ -2600,7 +2600,7 @@ export default { qcSpecSortedCacheSource: null, qcSpecListSkipSchedule: false, qcSpecDragSaving: false, - qcSpecFilterType: '', + qcSpecFilterType: '105', qcSpecFilterIpqcMethod: '', qcSpecFilterOperation: '', qcSpecCurrentRow: null, @@ -3747,6 +3747,21 @@ export default { }) return [...operationSet].sort((a, b) => a.localeCompare(b, 'zh-CN')) }, + /** 质检项目设置:IQC 与 IPQC 互换位置,IQC 排最前 */ + qcSpecTypeOptions() { + const opts = [...(this.options || [])] + const iqcIdx = opts.findIndex((item) => String(item.inspectionTypeNo) === '105') + const ipqcIdx = opts.findIndex((item) => String(item.inspectionTypeNo) === '101') + if (iqcIdx < 0 || ipqcIdx < 0 || iqcIdx === ipqcIdx) { + return opts + } + const result = [...opts] + const iqc = result[iqcIdx] + const ipqc = result[ipqcIdx] + result[iqcIdx] = ipqc + result[ipqcIdx] = iqc + return result + }, }, methods: { @@ -4432,9 +4447,15 @@ export default { resetQcSpecFilters() { this.qcSpecFilterIpqcMethod = '' this.qcSpecFilterOperation = '' - this.ensureDefaultQcSpecFilterType() + this.qcSpecFilterType = this.getDefaultQcSpecFilterType() this.resetQcSpecTableSelection() }, + getDefaultQcSpecFilterType() { + const opts = this.qcSpecTypeOptions + if (!opts.length) return '' + const iqc = opts.find((item) => String(item.inspectionTypeNo) === '105') + return iqc ? '105' : String(opts[0].inspectionTypeNo) + }, ensureDefaultQcSpecFilterType() { const opts = this.options || [] if (!opts.length) { @@ -4445,8 +4466,8 @@ export default { const exists = opts.some( (item) => String(item.inspectionTypeNo) === current ) - if (!exists) { - this.qcSpecFilterType = String(opts[0].inspectionTypeNo) + if (!current || !exists) { + this.qcSpecFilterType = this.getDefaultQcSpecFilterType() } }, resetFileCollectQuery() {