Browse Source

物料中将iqc放最前面

master
shenzhouyu 3 weeks ago
parent
commit
91a332e40f
  1. 31
      cclqms-vue/src/views/modules/qc/qcPartAttribute.vue

31
cclqms-vue/src/views/modules/qc/qcPartAttribute.vue

@ -670,7 +670,7 @@
<!-- 检验标准维护 --> <!-- 检验标准维护 -->
<el-tab-pane :label="$t('qc.partAttributePage.tabQcSpec')" name="qcSpec"> <el-tab-pane :label="$t('qc.partAttributePage.tabQcSpec')" name="qcSpec">
<div class="qc-spec-type-bar"> <div class="qc-spec-type-bar">
<span v-for="i in options" :key="i.inspectionTypeNo" class="qc-spec-type-item"
<span v-for="i in qcSpecTypeOptions" :key="i.inspectionTypeNo" class="qc-spec-type-item"
:class="{ 'is-active': qcSpecFilterType === String(i.inspectionTypeNo) }" :class="{ 'is-active': qcSpecFilterType === String(i.inspectionTypeNo) }"
@click="qcSpecFilterType = String(i.inspectionTypeNo)">{{ i.inspectionTypeName }}</span> @click="qcSpecFilterType = String(i.inspectionTypeNo)">{{ i.inspectionTypeName }}</span>
</div> </div>
@ -2600,7 +2600,7 @@ export default {
qcSpecSortedCacheSource: null, qcSpecSortedCacheSource: null,
qcSpecListSkipSchedule: false, qcSpecListSkipSchedule: false,
qcSpecDragSaving: false, qcSpecDragSaving: false,
qcSpecFilterType: '',
qcSpecFilterType: '105',
qcSpecFilterIpqcMethod: '', qcSpecFilterIpqcMethod: '',
qcSpecFilterOperation: '', qcSpecFilterOperation: '',
qcSpecCurrentRow: null, qcSpecCurrentRow: null,
@ -3747,6 +3747,21 @@ export default {
}) })
return [...operationSet].sort((a, b) => a.localeCompare(b, 'zh-CN')) 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: { methods: {
@ -4432,9 +4447,15 @@ export default {
resetQcSpecFilters() { resetQcSpecFilters() {
this.qcSpecFilterIpqcMethod = '' this.qcSpecFilterIpqcMethod = ''
this.qcSpecFilterOperation = '' this.qcSpecFilterOperation = ''
this.ensureDefaultQcSpecFilterType()
this.qcSpecFilterType = this.getDefaultQcSpecFilterType()
this.resetQcSpecTableSelection() 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() { ensureDefaultQcSpecFilterType() {
const opts = this.options || [] const opts = this.options || []
if (!opts.length) { if (!opts.length) {
@ -4445,8 +4466,8 @@ export default {
const exists = opts.some( const exists = opts.some(
(item) => String(item.inspectionTypeNo) === current (item) => String(item.inspectionTypeNo) === current
) )
if (!exists) {
this.qcSpecFilterType = String(opts[0].inspectionTypeNo)
if (!current || !exists) {
this.qcSpecFilterType = this.getDefaultQcSpecFilterType()
} }
}, },
resetFileCollectQuery() { resetFileCollectQuery() {

Loading…
Cancel
Save