Browse Source

qms项目优化

master
shenzhouyu 3 months ago
parent
commit
981bd72600
  1. 1
      cclqms-vue/src/i18n/locales/qc.cn.js
  2. 1
      cclqms-vue/src/i18n/locales/qc.en.js
  3. 34
      cclqms-vue/src/utils/qcCollectedLock.js
  4. 33
      cclqms-vue/src/utils/qcItemResultPersist.js
  5. 142
      cclqms-vue/src/views/modules/qc/FQCResultEntry.vue
  6. 142
      cclqms-vue/src/views/modules/qc/IPQCResultEntry.vue
  7. 151
      cclqms-vue/src/views/modules/qc/IQCResultEntry.vue
  8. 153
      cclqms-vue/src/views/modules/qc/OQCResultEntry.vue
  9. 142
      cclqms-vue/src/views/modules/qc/SQCResultEntry.vue
  10. 110
      cclqms-vue/src/views/modules/qc/qcPartAttribute.vue

1
cclqms-vue/src/i18n/locales/qc.cn.js

@ -420,6 +420,7 @@ module.exports = {
lineChangeTimeRequired: '换线时间不能为空!',
lineChangePersonRequired: '换线人员不能为空!',
selectInspectionConclusion: '请选择检验结论!',
exceptionFix: '异常修改',
selectMachine: '请选择机台!',
fillSendQty: '请填写送检数量!',
fillArrivalQty: '请填写到货数量!',

1
cclqms-vue/src/i18n/locales/qc.en.js

@ -420,6 +420,7 @@ module.exports = {
lineChangeTimeRequired: 'Line change time is required!',
lineChangePersonRequired: 'Line change operator is required!',
selectInspectionConclusion: 'Please select inspection conclusion!',
exceptionFix: 'Exception Fix',
selectMachine: 'Please select machine!',
fillSendQty: 'Please enter quantity for inspection!',
fillArrivalQty: 'Please enter received quantity!',

34
cclqms-vue/src/utils/qcCollectedLock.js

@ -0,0 +1,34 @@
export function isCollectionFlagOn (flag) {
if (flag === true || flag === 1) return true
const value = String(flag == null ? '' : flag).trim().toUpperCase()
return value === 'Y' || value === 'TRUE' || value === '1'
}
export function hasSubDetailData (row) {
if (!row) return false
const count = Number(row.subDetailRecordNum)
return !isNaN(count) && count > 0
}
export function isCollectedItemLocked (row, collectedItemMap, exceptionFixMode) {
if (exceptionFixMode) return false
if (!hasSubDetailData(row)) return false
if (isCollectionFlagOn(row.collectionFlag)) return true
if (collectedItemMap && collectedItemMap[row.itemNo]) return true
return false
}
export function canShowExceptionFixButton (row) {
return row && (row.state === '待检验' || row.state === '待审核')
}
export function mergeCollectedDetailFlags (detailList, collectedItemMap, vueSet) {
if (!detailList || !detailList.length || !collectedItemMap || !vueSet) return
detailList.forEach(row => {
if (isCollectionFlagOn(row.collectionFlag) && hasSubDetailData(row)) {
vueSet(collectedItemMap, row.itemNo, true)
} else if (collectedItemMap[row.itemNo] && !isCollectionFlagOn(row.collectionFlag)) {
vueSet(row, 'collectionFlag', 'Y')
}
})
}

33
cclqms-vue/src/utils/qcItemResultPersist.js

@ -0,0 +1,33 @@
const APPLY_TIMER_KEY = '_itemResultApplyTimer'
/** 结论/实测值变更后,防抖调用检验单「应用」(type=1) 落库 */
export function scheduleSilentDetailApply (vm, debounceMs = 400) {
if (!vm || !vm.detailData || vm.detailData.submitFlag === 'Y') {
return
}
if (typeof vm.applyDetailInformationSilently !== 'function') {
return
}
if (vm[APPLY_TIMER_KEY]) {
clearTimeout(vm[APPLY_TIMER_KEY])
}
vm[APPLY_TIMER_KEY] = setTimeout(() => {
vm[APPLY_TIMER_KEY] = null
vm.applyDetailInformationSilently()
}, debounceMs)
}
/** 关闭弹框前立即应用,避免防抖未触发导致未落库 */
export function flushSilentDetailApply (vm) {
if (!vm) {
return Promise.resolve()
}
if (vm[APPLY_TIMER_KEY]) {
clearTimeout(vm[APPLY_TIMER_KEY])
vm[APPLY_TIMER_KEY] = null
}
if (typeof vm.applyDetailInformationSilently === 'function') {
return vm.applyDetailInformationSilently()
}
return Promise.resolve()
}

142
cclqms-vue/src/views/modules/qc/FQCResultEntry.vue

@ -319,11 +319,12 @@
fixed="right"
header-align="center"
align="center"
width="130"
width="170"
:label="$t('qc.common.operation')">
<template slot-scope="scope">
<el-link style="cursor: pointer" v-if="!authStartInspection && scope.row.state === '未开始'" @click="actionModal(scope.row)">{{ $t('qc.iqcPage.startInspection') }}</el-link>
<el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">{{ $t('qc.iqcPage.inspectionSheet') }}</el-link>
<el-link style="cursor: pointer" v-if="!authExceptionFix && canShowExceptionFix(scope.row)" @click="exceptionFixModal(scope.row)">{{ $t('qc.entry.exceptionFix') }}</el-link>
<el-link style="cursor: pointer" v-if="!authFile" @click="getFileContentData(scope.row)">{{ $t('qc.iqcPage.workFile') }}</el-link>
</template>
</el-table-column>
@ -709,16 +710,11 @@
</template>
<!-- 不合格数量 -->
<template v-else-if="item.columnProp === 'unqualifiedQuantity'">
<el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled style="height: 11px; width: 98%"></el-input-number>
<el-input-number :controls="false" :step="0" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
<el-input-number :controls="false" :step="0" :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
</template>
<!-- 项目检验结论 -->
<template v-else-if="item.columnProp === 'itemResult'">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px" >
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px" :placeholder="$t('qc.iqcPage.qualified')">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-model="scope.row.itemResult" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" @change="onItemResultChange(scope.row)" style="height: 11px" :placeholder="$t('qc.iqcPage.qualified')">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
@ -736,15 +732,15 @@
<div class="dialog-footer">
<el-button v-if="!authApply && detailData.state === '待检验'" type="primary" :loading="transferLoadFlag" @click="Transfer('1')">{{ $t('qc.iqcPage.apply') }}</el-button>
<el-button v-if="!authUpdate && (detailData.state === '待检验' || detailData.state === '待审核')" type="primary" :loading="transferLoadFlag" @click="Transfer('2')">{{ $t('qc.common.save') }}</el-button>
<el-button @click="detailInformationFlag=false">{{ $t('qc.common.close') }}</el-button>
<el-button @click="closeDetailModal">{{ $t('qc.common.close') }}</el-button>
</div>
</el-dialog>
<!-- 子明细信息 -->
<el-dialog :title="$t('qc.iqcPage.subDetailInfo')" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="1262px">
<el-button v-if="!authSubDetailAdd" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<el-button v-if="!authSubDetailAdd && !isCollectedLocked(subDetailData)" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete && !isCollectedLocked(subDetailData)" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<div class="rq ">
<el-table
:height="400"
@ -759,43 +755,43 @@
<el-table-column :label="$t('qc.iqcPage.serialNumber')" align="center" prop="num" width="50"></el-table-column>
<el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosA')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
</template>
</el-table-column>
<el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosB')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredA')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit==='Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit==='Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredB')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `d`" v-model="templateTableData[row.xh-1].subDetailValueB" @keyup.enter.native="nextFocus4(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueC" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredC')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `e`" v-model="templateTableData[row.xh-1].subDetailValueC" @keyup.enter.native="nextFocus5(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueD" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredD')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `f`" v-model="templateTableData[row.xh-1].subDetailValueD" @keyup.enter.native="nextFocus6(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueE" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredE')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `g`" v-model="templateTableData[row.xh-1].subDetailValueE" @keyup.enter.native="nextFocus7(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
</template>
</el-table-column>
@ -816,7 +812,7 @@
</el-pagination>
</div>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y' && !isCollectedLocked(subDetailData)" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="subDetailFlag = false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -835,7 +831,7 @@
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailBatchAdd" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="batchHandleAddModalFlag=false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -1365,6 +1361,8 @@
import QcDataAcquisitionDialog from './QcDataAcquisitionDialog.vue'
import QcMeasuredValueCopyDialog from './QcMeasuredValueCopyDialog.vue'
import { createMrbLaunchPayload, resolveMrbRouteName } from '@/utils/mrbLaunch.js'
import { isCollectedItemLocked, mergeCollectedDetailFlags, canShowExceptionFixButton } from '@/utils/qcCollectedLock'
import { scheduleSilentDetailApply, flushSilentDetailApply } from '@/utils/qcItemResultPersist'
/*上传文件的組件*/
export default {
mixins: [qcItemObjectBatchDeviceMixin],
@ -2155,6 +2153,8 @@
latestParseTimeText: '',
latestParseTimeTimer: null,
detailList: [],
collectedItemMap: {},
exceptionFixMode: false,
saveInformationData: {
site: '',
buNo: '',
@ -2834,6 +2834,7 @@
authCancelCheck: false,
authDelete: false,
authDetail: false,
authExceptionFix: false,
authStartInspection: false,
authFile: false,
authOverload: false,
@ -3277,12 +3278,41 @@
const n = Number(val)
return isNaN(n) ? 0 : n
},
/** 有采集标识且已数据采集后,锁定相关录入字段 */
isCollectedLocked (row) {
return isCollectedItemLocked(row, this.collectedItemMap, this.exceptionFixMode)
},
canShowExceptionFix (row) {
return canShowExceptionFixButton(row)
},
closeDetailModalWithoutFlush () {
this.detailInformationFlag = false
this.exceptionFixMode = false
},
closeDetailModal () {
flushSilentDetailApply(this).finally(() => {
this.closeDetailModalWithoutFlush()
})
},
resetCollectedItemMap () {
this.collectedItemMap = {}
},
markCollectedItems (rows) {
if (!rows || typeof rows !== 'object') return
Object.keys(rows).forEach(itemNo => {
this.$set(this.collectedItemMap, itemNo, true)
})
},
applyCollectedFlagsToDetailList () {
mergeCollectedDetailFlags(this.detailList, this.collectedItemMap, this.$set)
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
},
onDataAcquisitionSuccess (rows) {
this.markCollectedItems(rows)
this.changeMyString(rows)
this.getInspectionFormData()
},
@ -3300,6 +3330,7 @@
}
dataAcquisitionByItem(tempDate).then(({data}) => {
if (data.code === 0) {
this.markCollectedItems({ [row.itemNo]: data.rows ? data.rows[row.itemNo] : 0 })
this.changeMyString(data.rows)
this.getInspectionFormData()
this.$message.success(this.$t('qc.entry.dataCollectSuccess'))
@ -4413,7 +4444,8 @@
},
// 新增明细信息
saveDetailInformation (type) {
saveDetailInformation (type, options = {}) {
const { silent = false, skipRefresh = false, skipListReload = false } = options
this.saveInformationData.site = this.detailData.site
this.saveInformationData.buNo = this.detailData.buNo
this.saveInformationData.inspectionNo = this.detailData.inspectionNo
@ -4434,23 +4466,45 @@
this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
this.saveInformationData.batchQualifiedQty = this.detailData.batchQualifiedQty == null ? 0 : this.detailData.batchQualifiedQty
this.saveInformationData.type = type
this.transferLoadFlag = true
saveFQCDetailedRecord(this.saveInformationData).then(({data}) => {
if (!silent) {
this.transferLoadFlag = true
}
return saveFQCDetailedRecord(this.saveInformationData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
// 应用时(type=1)不关闭对话框,只刷新数据
if (!skipListReload) {
this.getDataList()
}
if (type === '1') {
this.getInspectionFormData()
if (!skipRefresh) {
this.getInspectionFormData()
}
} else {
this.detailInformationFlag = false
this.closeDetailModalWithoutFlush()
}
this.$message.success(this.$t('qc.common.operationSuccess'))
} else {
if (!silent) {
this.$message.success(this.$t('qc.common.operationSuccess'))
}
} else if (!silent) {
this.$message.error(data.msg)
}
this.transferLoadFlag = false
}).catch(()=>{
this.transferLoadFlag = false
return data
}).catch((err) => {
throw err
}).finally(() => {
if (!silent) {
this.transferLoadFlag = false
}
})
},
applyDetailInformationSilently () {
if (this.detailData.submitFlag === 'Y' || this.transferLoadFlag) {
return Promise.resolve()
}
return this.saveDetailInformation('1', {
silent: true,
skipRefresh: true,
skipListReload: true
})
},
@ -4503,7 +4557,9 @@
},
// 明细记录信息查询
detailModal (row) {
detailModal (row, exceptionFix = false) {
this.exceptionFixMode = !!exceptionFix
this.resetCollectedItemMap()
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.inspectionNo = row.inspectionNo
@ -4542,11 +4598,16 @@
this.detailInformationFlag = true
},
exceptionFixModal (row) {
this.detailModal(row, true)
},
// 检验单明细
getInspectionFormData () {
fqcDetailSearch(this.detailData).then(({data}) => {
return fqcDetailSearch(this.detailData).then(({data}) => {
if (data && data.code === 0) {
this.detailList = data.rows
this.applyCollectedFlagsToDetailList()
} else {
this.detailList = []
}
@ -4788,9 +4849,7 @@
return;
}
if (row.maxValue == null && row.minValue == null) {
if (row.numberValue!=row.defaultValue){
row.itemResult = 'N'
}
row.itemResult = row.numberValue != row.defaultValue ? 'N' : 'Y'
}else if (row.maxValue != null && row.minValue != null){
if (row.numberValue>row.maxValue ||row.numberValue<row.minValue){
row.itemResult = 'N'
@ -4811,6 +4870,11 @@
}
}
refreshItemSpecWarning(row, this.detailData, 'fqc', evaluateItemSpecWarning)
scheduleSilentDetailApply(this)
},
onItemResultChange () {
this.applyDetailInformationSilently()
},
//删除(确认后立即落库,无需再点底部保存)
@ -5192,6 +5256,7 @@
let saveFlag = this.isAuth(this.menuId + ":save")
let deleteFlag = this.isAuth(this.menuId + ":delete")
let detailFlag = this.isAuth(this.menuId + ":detail")
let exceptionFixFlag = this.isAuth(this.menuId + ":exceptionFix")
let startInspectionFlag = this.isAuth(this.menuId + ":startInspection")
let fileFlag = this.isAuth(this.menuId + ":file")
let cancelCheckFlag = this.isAuth(this.menuId + ":cancelCheck")
@ -5229,6 +5294,7 @@
this.authSave = !saveFlag
this.authDelete = !deleteFlag
this.authDetail = !detailFlag
this.authExceptionFix = !exceptionFixFlag
this.authStartInspection = !startInspectionFlag
this.authFile = !fileFlag
this.authCancelCheck = !cancelCheckFlag

142
cclqms-vue/src/views/modules/qc/IPQCResultEntry.vue

@ -348,11 +348,12 @@
fixed="right"
header-align="center"
align="center"
width="130"
width="170"
:label="$t('qc.common.operation')">
<template slot-scope="scope">
<el-link style="cursor: pointer" v-if="!authStartInspection && scope.row.state === '未开始'" @click="actionModal(scope.row)">{{ $t('qc.iqcPage.startInspection') }}</el-link>
<el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">{{ $t('qc.iqcPage.inspectionSheet') }}</el-link>
<el-link style="cursor: pointer" v-if="!authExceptionFix && canShowExceptionFix(scope.row)" @click="exceptionFixModal(scope.row)">{{ $t('qc.entry.exceptionFix') }}</el-link>
<el-link style="cursor: pointer" v-if="!authFile" @click="getFileContentData(scope.row)">{{ $t('qc.iqcPage.workFile') }}</el-link>
</template>
</el-table-column>
@ -764,16 +765,11 @@
</template>
<!-- 不合格数量 -->
<template v-else-if="item.columnProp === 'unqualifiedQuantity'">
<el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled style="height: 11px; width:98%"></el-input-number>
<el-input-number :controls="false" :step="0" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
<el-input-number :controls="false" :step="0" :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
</template>
<!-- 项目检验结论 -->
<template v-else-if="item.columnProp === 'itemResult'">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" :placeholder="$t('qc.iqcPage.qualified')">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-model="scope.row.itemResult" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" @change="onItemResultChange(scope.row)" style="height: 11px;padding: 0px" :placeholder="$t('qc.iqcPage.qualified')">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
@ -791,15 +787,15 @@
<div class="dialog-footer">
<el-button v-if="!authApply && detailData.state === '待检验'" type="primary" :loading="transferLoadFlag" @click="Transfer('1')">{{ $t('qc.iqcPage.apply') }}</el-button>
<el-button v-if="!authUpdate && (detailData.state === '待检验' || detailData.state === '待审核')" type="primary" :loading="transferLoadFlag" @click="Transfer('2')">{{ $t('qc.common.save') }}</el-button>
<el-button @click="detailInformationFlag=false">{{ $t('qc.common.close') }}</el-button>
<el-button @click="closeDetailModal">{{ $t('qc.common.close') }}</el-button>
</div>
</el-dialog>
<!-- 子明细信息 -->
<el-dialog :title="$t('qc.iqcPage.subDetailInfo')" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="1262px">
<el-button v-if="!authSubDetailAdd" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<el-button v-if="!authSubDetailAdd && !isCollectedLocked(subDetailData)" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete && !isCollectedLocked(subDetailData)" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<div class="rq ">
<el-table
:height="400"
@ -814,43 +810,43 @@
<el-table-column :label="$t('qc.iqcPage.serialNumber')" align="center" prop="num" width="50"></el-table-column>
<el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosA')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
</template>
</el-table-column>
<el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosB')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredA')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredB')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `d`" v-model="templateTableData[row.xh-1].subDetailValueB" @keyup.enter.native="nextFocus4(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueC" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredC')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `e`" v-model="templateTableData[row.xh-1].subDetailValueC" @keyup.enter.native="nextFocus5(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueD" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredD')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `f`" v-model="templateTableData[row.xh-1].subDetailValueD" @keyup.enter.native="nextFocus6(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueE" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredE')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `g`" v-model="templateTableData[row.xh-1].subDetailValueE" @keyup.enter.native="nextFocus7(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
</template>
</el-table-column>
@ -871,7 +867,7 @@
</el-pagination>
</div>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y' && !isCollectedLocked(subDetailData)" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="subDetailFlag = false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -974,7 +970,7 @@
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailBatchAdd" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="batchHandleAddModalFlag=false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -1592,6 +1588,8 @@
import QcMeasuredValueCopyDialog from './QcMeasuredValueCopyDialog.vue'
import {queryResourceList3} from "../../../api/qc/qc";
import { createMrbLaunchPayload, resolveMrbRouteName } from '@/utils/mrbLaunch.js'
import { isCollectedItemLocked, mergeCollectedDetailFlags, canShowExceptionFixButton } from '@/utils/qcCollectedLock'
import { scheduleSilentDetailApply, flushSilentDetailApply } from '@/utils/qcItemResultPersist'
/*上传文件的組件*/
export default {
mixins: [qcItemObjectBatchDeviceMixin],
@ -2417,6 +2415,8 @@
latestParseTimeText: '',
latestParseTimeTimer: null,
detailList: [],
collectedItemMap: {},
exceptionFixMode: false,
saveInformationData: {
site: '',
buNo: '',
@ -3110,6 +3110,7 @@
authOverload: false,
authDelete: false,
authDetail: false,
authExceptionFix: false,
authStartInspection: false,
authFile: false,
authReset: false,
@ -3578,12 +3579,41 @@
const n = Number(val)
return isNaN(n) ? 0 : n
},
/** 有采集标识且已数据采集后,锁定相关录入字段 */
isCollectedLocked (row) {
return isCollectedItemLocked(row, this.collectedItemMap, this.exceptionFixMode)
},
canShowExceptionFix (row) {
return canShowExceptionFixButton(row)
},
closeDetailModalWithoutFlush () {
this.detailInformationFlag = false
this.exceptionFixMode = false
},
closeDetailModal () {
flushSilentDetailApply(this).finally(() => {
this.closeDetailModalWithoutFlush()
})
},
resetCollectedItemMap () {
this.collectedItemMap = {}
},
markCollectedItems (rows) {
if (!rows || typeof rows !== 'object') return
Object.keys(rows).forEach(itemNo => {
this.$set(this.collectedItemMap, itemNo, true)
})
},
applyCollectedFlagsToDetailList () {
mergeCollectedDetailFlags(this.detailList, this.collectedItemMap, this.$set)
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
},
onDataAcquisitionSuccess (rows) {
this.markCollectedItems(rows)
this.changeMyString(rows)
this.getInspectionFormData()
},
@ -3601,6 +3631,7 @@
}
dataAcquisitionByItem(tempDate).then(({data}) => {
if (data.code === 0) {
this.markCollectedItems({ [row.itemNo]: data.rows ? data.rows[row.itemNo] : 0 })
this.changeMyString(data.rows)
this.getInspectionFormData()
this.$message.success(this.$t('qc.entry.dataCollectSuccess'))
@ -4741,7 +4772,8 @@
},
// 新增明细信息
saveDetailInformation (type) {
saveDetailInformation (type, options = {}) {
const { silent = false, skipRefresh = false, skipListReload = false } = options
this.saveInformationData.site = this.detailData.site
this.saveInformationData.buNo = this.detailData.buNo
this.saveInformationData.inspectionNo = this.detailData.inspectionNo
@ -4762,23 +4794,45 @@
this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
this.saveInformationData.batchQualifiedQty = this.detailData.batchQualifiedQty == null ? 0 : this.detailData.batchQualifiedQty
this.saveInformationData.type = type
this.transferLoadFlag = true
saveIPQCDetailedRecord(this.saveInformationData).then(({data}) => {
if (!silent) {
this.transferLoadFlag = true
}
return saveIPQCDetailedRecord(this.saveInformationData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
// 应用时(type=1)不关闭对话框,只刷新数据
if (!skipListReload) {
this.getDataList()
}
if (type === '1') {
this.getInspectionFormData()
if (!skipRefresh) {
this.getInspectionFormData()
}
} else {
this.detailInformationFlag = false
this.closeDetailModalWithoutFlush()
}
this.$message.success(this.$t('qc.common.operationSuccess'))
} else {
if (!silent) {
this.$message.success(this.$t('qc.common.operationSuccess'))
}
} else if (!silent) {
this.$message.error(data.msg)
}
this.transferLoadFlag = false
}).catch(()=>{
this.transferLoadFlag = false
return data
}).catch((err) => {
throw err
}).finally(() => {
if (!silent) {
this.transferLoadFlag = false
}
})
},
applyDetailInformationSilently () {
if (this.detailData.submitFlag === 'Y' || this.transferLoadFlag) {
return Promise.resolve()
}
return this.saveDetailInformation('1', {
silent: true,
skipRefresh: true,
skipListReload: true
})
},
@ -4832,7 +4886,9 @@
},
// 明细记录信息查询
detailModal (row) {
detailModal (row, exceptionFix = false) {
this.exceptionFixMode = !!exceptionFix
this.resetCollectedItemMap()
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.inspectionNo = row.inspectionNo
@ -4874,11 +4930,16 @@
this.detailInformationFlag = true
},
exceptionFixModal (row) {
this.detailModal(row, true)
},
// 检验单明细
getInspectionFormData () {
ipqcDetailSearch(this.detailData).then(({data}) => {
return ipqcDetailSearch(this.detailData).then(({data}) => {
if (data && data.code === 0) {
this.detailList = data.rows
this.applyCollectedFlagsToDetailList()
} else {
this.detailList = []
}
@ -5120,9 +5181,7 @@
return;
}
if (row.maxValue == null && row.minValue == null) {
if (row.numberValue!=row.defaultValue){
row.itemResult = 'N'
}
row.itemResult = row.numberValue != row.defaultValue ? 'N' : 'Y'
}else if (row.maxValue != null && row.minValue != null){
if (row.numberValue>row.maxValue ||row.numberValue<row.minValue){
row.itemResult = 'N'
@ -5143,6 +5202,11 @@
}
}
refreshItemSpecWarning(row, this.detailData, 'ipqc', evaluateItemSpecWarning)
scheduleSilentDetailApply(this)
},
onItemResultChange () {
this.applyDetailInformationSilently()
},
//删除(确认后立即落库,无需再点底部保存)
@ -5521,6 +5585,7 @@
let saveFlag = this.isAuth(this.menuId + ":save")
let deleteFlag = this.isAuth(this.menuId + ":delete")
let detailFlag = this.isAuth(this.menuId + ":detail")
let exceptionFixFlag = this.isAuth(this.menuId + ":exceptionFix")
let startInspectionFlag = this.isAuth(this.menuId + ":startInspection")
let fileFlag = this.isAuth(this.menuId + ":file")
let cancelCheckFlag = this.isAuth(this.menuId + ":cancelCheck")
@ -5558,6 +5623,7 @@
this.authSave = !saveFlag
this.authDelete = !deleteFlag
this.authDetail = !detailFlag
this.authExceptionFix = !exceptionFixFlag
this.authStartInspection = !startInspectionFlag
this.authFile = !fileFlag
this.authCancelCheck = !cancelCheckFlag

151
cclqms-vue/src/views/modules/qc/IQCResultEntry.vue

@ -277,13 +277,15 @@
style="width: 100px; height: 80px" /></span>
</template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="130"
<el-table-column fixed="right" header-align="center" align="center" width="170"
:label="$t('qc.common.operation')">
<template slot-scope="scope">
<el-link style="cursor: pointer" v-if="!authStartInspection && scope.row.state === '未开始'"
@click="actionModal(scope.row)">{{ $t('qc.iqcPage.startInspection') }}</el-link>
<el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'"
@click="detailModal(scope.row)">{{ $t('qc.iqcPage.inspectionSheet') }}</el-link>
<el-link style="cursor: pointer" v-if="!authExceptionFix && canShowExceptionFix(scope.row)"
@click="exceptionFixModal(scope.row)">{{ $t('qc.entry.exceptionFix') }}</el-link>
<el-link style="cursor: pointer" v-if="!authFile"
@click="getFileContentData(scope.row)">{{ $t('qc.iqcPage.workFile') }}</el-link>
</template>
@ -972,23 +974,19 @@
</template>
<!-- 不合格数量 -->
<template v-else-if="item.columnProp === 'unqualifiedQuantity'">
<el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'"
v-model="scope.row.unqualifiedQuantity" disabled style="height: 11px; width: 98%"></el-input-number>
<el-input-number :controls="false" :step="0" v-else :ref="`unqualifiedQuantity${scope.$index}`"
<el-input-number :controls="false" :step="0" :ref="`unqualifiedQuantity${scope.$index}`"
v-model="scope.row.unqualifiedQuantity"
:disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)"
@keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')"
style="height: 11px; width: 98%"></el-input-number>
</template>
<!-- 项目检验结论 -->
<template v-else-if="item.columnProp === 'itemResult'">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}"
v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled
style="height: 11px;padding: 0px">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}"
v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px"
v-model="scope.row.itemResult"
:disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)"
@change="onItemResultChange(scope.row)"
style="height: 11px;padding: 0px"
:placeholder="$t('qc.iqcPage.qualified')">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
@ -1011,7 +1009,7 @@
@click="Transfer('1')">{{ $t('qc.iqcPage.apply') }}</el-button>
<el-button v-if="!authUpdate && (detailData.state === '待检验' || detailData.state === '待审核')" type="primary"
:loading="transferLoadFlag" @click="Transfer('2')">{{ $t('qc.common.save') }}</el-button>
<el-button @click="detailInformationFlag=false">{{ $t('qc.common.close') }}</el-button>
<el-button @click="closeDetailModal">{{ $t('qc.common.close') }}</el-button>
</div>
</el-dialog>
@ -1060,11 +1058,11 @@
<!-- 子明细信息 -->
<el-dialog :title="$t('qc.iqcPage.subDetailInfo')" :close-on-click-modal="false" v-drag
:visible.sync="subDetailFlag" width="1262px">
<el-button v-if="!authSubDetailAdd" type="success" icon="el-icon-plus" size="mini"
<el-button v-if="!authSubDetailAdd && !isCollectedLocked(subDetailData)" type="success" icon="el-icon-plus" size="mini"
@click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete" type="danger" icon="el-icon-delete" size="mini"
<el-button v-if="!authSubDetailDelete && !isCollectedLocked(subDetailData)" type="danger" icon="el-icon-delete" size="mini"
@click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd" type="primary" icon="el-icon-more" size="mini"
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" icon="el-icon-more" size="mini"
@click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<div class="rq ">
<el-table :height="400" :data="templateTableData" border v-loading="subDetailLoading"
@ -1076,7 +1074,7 @@
<el-table-column prop="samplingLocation" header-align="center" align="center" :required="true"
:label="$t('qc.iqcPage.samplingPosA')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'"
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)"
v-model="templateTableData[row.xh-1].samplingLocation" readonly
:placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation"
@ -1086,7 +1084,7 @@
<el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true"
:label="$t('qc.iqcPage.samplingPosB')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'"
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)"
v-model="templateTableData[row.xh-1].samplingLocationB" readonly
:placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB"
@ -1096,7 +1094,7 @@
<el-table-column prop="subDetailValue" header-align="center" align="center" :required="true"
:label="$t('qc.iqcPage.measuredA')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'"
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)"
v-model="templateTableData[row.xh-1].subDetailValue" readonly
:placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue"
@ -1106,7 +1104,7 @@
<el-table-column prop="subDetailValueB" header-align="center" align="center" :required="true"
:label="$t('qc.iqcPage.measuredB')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'"
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)"
v-model="templateTableData[row.xh-1].subDetailValueB" readonly
:placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `d`" v-model="templateTableData[row.xh-1].subDetailValueB"
@ -1116,7 +1114,7 @@
<el-table-column prop="subDetailValueC" header-align="center" align="center" :required="true"
:label="$t('qc.iqcPage.measuredC')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'"
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)"
v-model="templateTableData[row.xh-1].subDetailValueC" readonly
:placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `e`" v-model="templateTableData[row.xh-1].subDetailValueC"
@ -1126,7 +1124,7 @@
<el-table-column prop="subDetailValueD" header-align="center" align="center" :required="true"
:label="$t('qc.iqcPage.measuredD')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'"
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)"
v-model="templateTableData[row.xh-1].subDetailValueD" readonly
:placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `f`" v-model="templateTableData[row.xh-1].subDetailValueD"
@ -1136,7 +1134,7 @@
<el-table-column prop="subDetailValueE" header-align="center" align="center" :required="true"
:label="$t('qc.iqcPage.measuredE')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'"
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)"
v-model="templateTableData[row.xh-1].subDetailValueE" readonly
:placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `g`" v-model="templateTableData[row.xh-1].subDetailValueE"
@ -1157,7 +1155,7 @@
</el-pagination>
</div>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y'" type="primary"
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y' && !isCollectedLocked(subDetailData)" type="primary"
@click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="subDetailFlag = false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
@ -1518,6 +1516,8 @@ import QcDataAcquisitionDialog from './QcDataAcquisitionDialog.vue'
import QcMeasuredValueCopyDialog from './QcMeasuredValueCopyDialog.vue'
import IqcBatchPurchaseAdd from './IQCBatchPurchaseAdd.vue'
import { createMrbLaunchPayload, resolveMrbRouteName } from '@/utils/mrbLaunch.js'
import { isCollectedItemLocked, mergeCollectedDetailFlags, canShowExceptionFixButton } from '@/utils/qcCollectedLock'
import { scheduleSilentDetailApply, flushSilentDetailApply } from '@/utils/qcItemResultPersist'
export default {
mixins: [qcItemObjectBatchDeviceMixin],
components: {
@ -3120,6 +3120,8 @@ export default {
latestParseTimeText: '',
latestParseTimeTimer: null,
detailList: [],
collectedItemMap: {},
exceptionFixMode: false,
saveInformationData: {
site: '',
buNo: '',
@ -3191,6 +3193,7 @@ export default {
authOverLoad: false,
authDelete: false,
authDetail: false,
authExceptionFix: false,
authStartInspection: false,
authFile: false,
authReset: false,
@ -3724,12 +3727,41 @@ export default {
const n = Number(val)
return isNaN(n) ? 0 : n
},
/** 有采集标识且已数据采集后,锁定相关录入字段 */
isCollectedLocked (row) {
return isCollectedItemLocked(row, this.collectedItemMap, this.exceptionFixMode)
},
canShowExceptionFix (row) {
return canShowExceptionFixButton(row)
},
closeDetailModalWithoutFlush () {
this.detailInformationFlag = false
this.exceptionFixMode = false
},
closeDetailModal () {
flushSilentDetailApply(this).finally(() => {
this.closeDetailModalWithoutFlush()
})
},
resetCollectedItemMap () {
this.collectedItemMap = {}
},
markCollectedItems (rows) {
if (!rows || typeof rows !== 'object') return
Object.keys(rows).forEach(itemNo => {
this.$set(this.collectedItemMap, itemNo, true)
})
},
applyCollectedFlagsToDetailList () {
mergeCollectedDetailFlags(this.detailList, this.collectedItemMap, this.$set)
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
},
onDataAcquisitionSuccess (rows) {
this.markCollectedItems(rows)
this.changeMyString(rows)
this.getInspectionFormData()
},
@ -3748,6 +3780,7 @@ export default {
dataAcquisitionByItem(tempDate)
.then(({ data }) => {
if (data.code === 0) {
this.markCollectedItems({ [row.itemNo]: data.rows ? data.rows[row.itemNo] : 0 })
this.changeMyString(data.rows)
this.getInspectionFormData()
this.$message({
@ -4948,7 +4981,8 @@ export default {
},
// 新增明细信息
saveDetailInformation(type) {
saveDetailInformation(type, options = {}) {
const { silent = false, skipRefresh = false, skipListReload = false } = options
this.saveInformationData.site = this.detailData.site
this.saveInformationData.buNo = this.detailData.buNo
this.saveInformationData.inspectionNo = this.detailData.inspectionNo
@ -4983,29 +5017,52 @@ export default {
this.detailData.batchQualifiedQty == null
? 0
: this.detailData.batchQualifiedQty
this.transferLoadFlag = true
// this.saveInformationData.subDetailList = this.acquisitionList
saveIQCDetailedRecord(this.saveInformationData)
if (!silent) {
this.transferLoadFlag = true
}
return saveIQCDetailedRecord(this.saveInformationData)
.then(({ data }) => {
if (data && data.code === 0) {
this.getDataList()
// 应用时(type=1)不关闭对话框,只刷新数据
if (!skipListReload) {
this.getDataList()
}
if (type === '1') {
this.getInspectionFormData()
if (!skipRefresh) {
this.getInspectionFormData()
}
} else {
this.detailInformationFlag = false
this.closeDetailModalWithoutFlush()
}
this.$message.success(this.$t('qc.common.operationSuccess'))
} else {
if (!silent) {
this.$message.success(this.$t('qc.common.operationSuccess'))
}
} else if (!silent) {
this.$message.error(data.msg)
}
this.transferLoadFlag = false
return data
})
.catch(() => {
this.transferLoadFlag = false
.catch((err) => {
throw err
})
.finally(() => {
if (!silent) {
this.transferLoadFlag = false
}
})
},
/** 项目结论/实测值变更后静默应用落库 */
applyDetailInformationSilently() {
if (this.detailData.submitFlag === 'Y' || this.transferLoadFlag) {
return Promise.resolve()
}
return this.saveDetailInformation('1', {
silent: true,
skipRefresh: true,
skipListReload: true,
})
},
// 开始检验
actionModal(row) {
this.actionData = {
@ -5059,7 +5116,9 @@ export default {
},
// 明细记录信息查询
detailModal(row) {
detailModal(row, exceptionFix = false) {
this.exceptionFixMode = !!exceptionFix
this.resetCollectedItemMap()
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.inspectionNo = row.inspectionNo
@ -5113,11 +5172,16 @@ export default {
this.detailInformationFlag = true
},
exceptionFixModal (row) {
this.detailModal(row, true)
},
// 检验单明细
getInspectionFormData() {
iqcDetailSearch(this.detailData).then(({ data }) => {
return iqcDetailSearch(this.detailData).then(({ data }) => {
if (data && data.code === 0) {
this.detailList = data.rows
this.applyCollectedFlagsToDetailList()
} else {
this.detailList = []
}
@ -5501,9 +5565,7 @@ export default {
return
}
if (row.maxValue == null && row.minValue == null) {
if (row.numberValue != row.defaultValue) {
row.itemResult = 'N'
}
row.itemResult = row.numberValue != row.defaultValue ? 'N' : 'Y'
} else if (row.maxValue != null && row.minValue != null) {
if (row.numberValue > row.maxValue || row.numberValue < row.minValue) {
row.itemResult = 'N'
@ -5529,6 +5591,11 @@ export default {
'iqc',
evaluateItemSpecWarning
)
scheduleSilentDetailApply(this)
},
onItemResultChange () {
this.applyDetailInformationSilently()
},
//删除(确认后立即落库,无需再点底部保存)
@ -5963,6 +6030,7 @@ export default {
let deleteItemFlag = this.isAuth(this.menuId + ':deleteItem')
let importTemplateFlag = this.isAuth(this.menuId + ':importTemplate')
let launchMrbFlag = this.isAuth(this.menuId + ':launchMrb') || saveFlag
let exceptionFixFlag = this.isAuth(this.menuId + ':exceptionFix')
//处理页面的权限数据
this.authSearch = !searchFlag
this.authLaunchMrb = !launchMrbFlag
@ -5971,6 +6039,7 @@ export default {
this.authOverLoad = !overLoadFlag
this.authDelete = !deleteFlag
this.authDetail = !detailFlag
this.authExceptionFix = !exceptionFixFlag
this.authStartInspection = !startInspectionFlag
this.authFile = !fileFlag
this.authCancelCheck = !cancelCheckFlag

153
cclqms-vue/src/views/modules/qc/OQCResultEntry.vue

@ -328,11 +328,12 @@
fixed="right"
header-align="center"
align="center"
width="130"
width="170"
:label="$t('qc.common.operation')">
<template slot-scope="scope">
<el-link style="cursor: pointer" v-if="!authStartInspection && scope.row.state === '未开始'" @click="actionModal(scope.row)">{{ $t('qc.iqcPage.startInspection') }}</el-link>
<el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">{{ $t('qc.iqcPage.inspectionSheet') }}</el-link>
<el-link style="cursor: pointer" v-if="!authExceptionFix && canShowExceptionFix(scope.row)" @click="exceptionFixModal(scope.row)">{{ $t('qc.entry.exceptionFix') }}</el-link>
<el-link style="cursor: pointer" v-if="!authFile" @click.native="getFileContentData(scope.row)">{{ $t('qc.iqcPage.workFile') }}</el-link>
<!-- <el-dropdown trigger="click">
<el-link style="cursor: pointer;font-size: 12px">{{ $t('qc.oqcPage.more') }}</el-link>
@ -718,16 +719,11 @@
</template>
<!-- 不合格数量 -->
<template v-else-if="item.columnProp === 'unqualifiedQuantity'">
<el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled type="number" style="height: 11px; width: 98%"></el-input>
<el-input class="inlineNumber numInput" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input>
<el-input class="inlineNumber numInput" :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input>
</template>
<!-- 项目检验结论 -->
<template v-else-if="item.columnProp === 'itemResult'">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" :placeholder="$t('qc.iqcPage.qualified')">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-model="scope.row.itemResult" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" @change="onItemResultChange(scope.row)" style="height: 11px;padding: 0px" :placeholder="$t('qc.iqcPage.qualified')">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
@ -745,7 +741,7 @@
<div class="dialog-footer">
<el-button v-if="!authApply && detailData.state === '待检验'" type="primary" :loading="transferLoadFlag" @click="Transfer('1')">{{ $t('qc.iqcPage.apply') }}</el-button>
<el-button v-if="!authUpdate && (detailData.state === '待检验' || detailData.state === '待审核')" type="primary" :loading="transferLoadFlag" @click="Transfer('2')">{{ $t('qc.common.save') }}</el-button>
<el-button @click="detailInformationFlag=false">{{ $t('qc.common.close') }}</el-button>
<el-button @click="closeDetailModal">{{ $t('qc.common.close') }}</el-button>
</div>
</el-dialog>
@ -796,9 +792,9 @@
<!-- 子明细信息 -->
<el-dialog :title="$t('qc.iqcPage.subDetailInfo')" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="1262px">
<el-button v-if="!authSubDetailAdd" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<el-button v-if="!authSubDetailAdd && !isCollectedLocked(subDetailData)" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete && !isCollectedLocked(subDetailData)" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<div class="rq ">
<el-table
:height="400"
@ -811,43 +807,43 @@
<el-table-column :label="$t('qc.iqcPage.serialNumber')" align="center" prop="rowI" width="50"></el-table-column>
<el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosA')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
</template>
</el-table-column>
<el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosB')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredA')" width="200">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.oqcPage.enterMeasured')" ></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.oqcPage.enterMeasured')" ></el-input>
<el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" :placeholder="$t('qc.oqcPage.enterMeasured')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredB')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `d`" v-model="templateTableData[row.xh-1].subDetailValueB" @keyup.enter.native="nextFocus4(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueC" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredC')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `e`" v-model="templateTableData[row.xh-1].subDetailValueC" @keyup.enter.native="nextFocus5(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueD" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredD')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `f`" v-model="templateTableData[row.xh-1].subDetailValueD" @keyup.enter.native="nextFocus6(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueE" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredE')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `g`" v-model="templateTableData[row.xh-1].subDetailValueE" @keyup.enter.native="nextFocus7(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
</template>
</el-table-column>
@ -868,7 +864,7 @@
</el-pagination>
</div>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y' && !isCollectedLocked(subDetailData)" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="subDetailFlag = false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -887,7 +883,7 @@
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailBatchAdd" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="batchHandleAddModalFlag = false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -1427,6 +1423,8 @@
import {qcPrint} from '@/api/qc/qcPrint.js'
import { getWarningDisplay, getWarningCellStyle, getWarningTitle, hasWarningIndicator, applySpecWarningToRow, refreshItemSpecWarning } from '@/utils/qcSpecWarningDisplay.js'
import { createMrbLaunchPayload, resolveMrbRouteName } from '@/utils/mrbLaunch.js'
import { isCollectedItemLocked, mergeCollectedDetailFlags, canShowExceptionFixButton } from '@/utils/qcCollectedLock'
import { scheduleSilentDetailApply, flushSilentDetailApply } from '@/utils/qcItemResultPersist'
export default {
components: {
Chooselist,
@ -2632,6 +2630,8 @@
latestParseTimeText: '',
latestParseTimeTimer: null,
detailList: [],
collectedItemMap: {},
exceptionFixMode: false,
saveInformationData: {
site: '',
buNo: '',
@ -2695,6 +2695,7 @@
authOverLoad: false,
authDelete: false,
authDetail: false,
authExceptionFix: false,
authStartInspection: false,
authFile: false,
authChange: false,
@ -3126,12 +3127,41 @@
const n = Number(val)
return isNaN(n) ? 0 : n
},
/** 有采集标识且已数据采集后,锁定相关录入字段 */
isCollectedLocked (row) {
return isCollectedItemLocked(row, this.collectedItemMap, this.exceptionFixMode)
},
canShowExceptionFix (row) {
return canShowExceptionFixButton(row)
},
closeDetailModalWithoutFlush () {
this.detailInformationFlag = false
this.exceptionFixMode = false
},
closeDetailModal () {
flushSilentDetailApply(this).finally(() => {
this.closeDetailModalWithoutFlush()
})
},
resetCollectedItemMap () {
this.collectedItemMap = {}
},
markCollectedItems (rows) {
if (!rows || typeof rows !== 'object') return
Object.keys(rows).forEach(itemNo => {
this.$set(this.collectedItemMap, itemNo, true)
})
},
applyCollectedFlagsToDetailList () {
mergeCollectedDetailFlags(this.detailList, this.collectedItemMap, this.$set)
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
},
onDataAcquisitionSuccess (rows) {
this.markCollectedItems(rows)
this.changeMyString(rows)
this.getInspectionFormData()
},
@ -3149,6 +3179,7 @@
}
dataAcquisitionByItem(tempDate).then(({data}) => {
if (data.code === 0) {
this.markCollectedItems({ [row.itemNo]: data.rows ? data.rows[row.itemNo] : 0 })
this.changeMyString(data.rows)
this.getInspectionFormData()
this.$message({
@ -4334,7 +4365,8 @@
},
// 新增明细信息
saveDetailInformation (type) {
saveDetailInformation (type, options = {}) {
const { silent = false, skipRefresh = false, skipListReload = false } = options
this.saveInformationData.site = this.detailData.site
this.saveInformationData.buNo = this.detailData.buNo
this.saveInformationData.inspectionNo = this.detailData.inspectionNo
@ -4354,30 +4386,53 @@
this.saveInformationData.passQty = this.detailData.passQty == null ? 0 : this.detailData.passQty
this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
this.saveInformationData.type = type
this.transferLoadFlag = true
saveFQASDetailedRecord(this.saveInformationData).then(({data}) => {
if (!silent) {
this.transferLoadFlag = true
}
return saveFQASDetailedRecord(this.saveInformationData).then(({data}) => {
if (data && data.code === 0) {
this.searchData.inspectionNo = ''
this.getDataList()
// 应用时(type=1)不关闭对话框,只刷新数据
if (!skipListReload) {
this.searchData.inspectionNo = ''
this.getDataList()
}
if (type === '1') {
this.getInspectionFormData()
if (!skipRefresh) {
this.getInspectionFormData()
}
} else {
this.detailInformationFlag = false
this.closeDetailModalWithoutFlush()
}
this.$message({
message: this.$t('qc.common.operationSuccess'),
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
if (!silent) {
this.$message({
message: this.$t('qc.common.operationSuccess'),
type: 'success',
duration: 1500,
onClose: () => {}
})
}
} else if (!silent) {
this.$alert(data.msg, this.$t('qc.common.errorTitle'), {
confirmButtonText: this.$t('qc.common.confirm')
})
}
}).finally(()=>{
this.transferLoadFlag = false
return data
}).catch((err) => {
throw err
}).finally(() => {
if (!silent) {
this.transferLoadFlag = false
}
})
},
applyDetailInformationSilently () {
if (this.detailData.submitFlag === 'Y' || this.transferLoadFlag) {
return Promise.resolve()
}
return this.saveDetailInformation('1', {
silent: true,
skipRefresh: true,
skipListReload: true
})
},
@ -4418,7 +4473,9 @@
},
// 明细记录信息查询
detailModal (row) {
detailModal (row, exceptionFix = false) {
this.exceptionFixMode = !!exceptionFix
this.resetCollectedItemMap()
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.inspectionNo = row.inspectionNo
@ -4454,11 +4511,16 @@
this.detailInformationFlag = true
},
exceptionFixModal (row) {
this.detailModal(row, true)
},
// 检验单明细
getInspectionFormData () {
fqasDetailSearch(this.detailData).then(({data}) => {
return fqasDetailSearch(this.detailData).then(({data}) => {
if (data && data.code === 0) {
this.detailList = data.rows
this.applyCollectedFlagsToDetailList()
} else {
this.detailList = []
}
@ -4750,9 +4812,7 @@
return
}
if (row.maxValue == null && row.minValue == null) {
if (row.numberValue != row.defaultValue) {
row.itemResult = 'N'
}
row.itemResult = row.numberValue != row.defaultValue ? 'N' : 'Y'
} else if (row.maxValue != null && row.minValue != null) {
if (row.numberValue > row.maxValue || row.numberValue < row.minValue) {
row.itemResult = 'N'
@ -4773,6 +4833,11 @@
}
}
refreshItemSpecWarning(row, this.detailData, 'oqc', evaluateItemSpecWarning)
scheduleSilentDetailApply(this)
},
onItemResultChange () {
this.applyDetailInformationSilently()
},
//删除(确认后立即落库,无需再点底部保存)
@ -5178,6 +5243,7 @@
let overLoadFlag = this.isAuth(this.menuId+":overLoad")
let deleteFlag = this.isAuth(this.menuId+":delete")
let detailFlag = this.isAuth(this.menuId+":detail")
let exceptionFixFlag = this.isAuth(this.menuId+":exceptionFix")
let startInspectionFlag = this.isAuth(this.menuId+":startInspection")
let fileFlag = this.isAuth(this.menuId+":file")
let changeFlag = this.isAuth(this.menuId+":change")
@ -5220,6 +5286,7 @@
this.authOverLoad = !overLoadFlag
this.authDelete = !deleteFlag
this.authDetail = !detailFlag
this.authExceptionFix = !exceptionFixFlag
this.authStartInspection = !startInspectionFlag
this.authFile = !fileFlag
this.authChange = !changeFlag

142
cclqms-vue/src/views/modules/qc/SQCResultEntry.vue

@ -304,11 +304,12 @@
fixed="right"
header-align="center"
align="center"
width="130"
width="170"
:label="$t('qc.common.operation')">
<template slot-scope="scope">
<el-link style="cursor: pointer" v-if="!authStartInspection && scope.row.state === '未开始'" @click="actionModal(scope.row)">{{ $t('qc.iqcPage.startInspection') }}</el-link>
<el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">{{ $t('qc.iqcPage.inspectionSheet') }}</el-link>
<el-link style="cursor: pointer" v-if="!authExceptionFix && canShowExceptionFix(scope.row)" @click="exceptionFixModal(scope.row)">{{ $t('qc.entry.exceptionFix') }}</el-link>
<el-link style="cursor: pointer" v-if="!authFile" @click="getFileContentData(scope.row)">{{ $t('qc.iqcPage.workFile') }}</el-link>
</template>
</el-table-column>
@ -720,16 +721,11 @@
</template>
<!-- 不合格数量 -->
<template v-else-if="item.columnProp === 'unqualifiedQuantity'">
<el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled style="height: 11px; width:98%"></el-input-number>
<el-input-number :controls="false" :step="0" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
<el-input-number :controls="false" :step="0" :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
</template>
<!-- 项目检验结论 -->
<template v-else-if="item.columnProp === 'itemResult'">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" :placeholder="$t('qc.iqcPage.qualified')">
<el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-model="scope.row.itemResult" :disabled="detailData.submitFlag === 'Y' || isCollectedLocked(scope.row)" @change="onItemResultChange(scope.row)" style="height: 11px;padding: 0px" :placeholder="$t('qc.iqcPage.qualified')">
<el-option :label="$t('qc.iqcPage.qualified')" value="Y" style="color: green"></el-option>
<el-option :label="$t('qc.iqcPage.unqualified')" value="N" style="color: red"></el-option>
</el-select>
@ -747,15 +743,15 @@
<div class="dialog-footer">
<el-button v-if="!authApply && detailData.state === '待检验'" type="primary" :loading="transferLoadFlag" @click="Transfer('1')">{{ $t('qc.iqcPage.apply') }}</el-button>
<el-button v-if="!authUpdate && (detailData.state === '待检验' || detailData.state === '待审核')" type="primary" :loading="transferLoadFlag" @click="Transfer('2')">{{ $t('qc.common.save') }}</el-button>
<el-button @click="detailInformationFlag=false">{{ $t('qc.common.close') }}</el-button>
<el-button @click="closeDetailModal">{{ $t('qc.common.close') }}</el-button>
</div>
</el-dialog>
<!-- 子明细信息 -->
<el-dialog :title="$t('qc.iqcPage.subDetailInfo')" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="1262px">
<el-button v-if="!authSubDetailAdd" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<el-button v-if="!authSubDetailAdd && !isCollectedLocked(subDetailData)" type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">{{ $t('qc.common.add') }}</el-button>
<el-button v-if="!authSubDetailDelete && !isCollectedLocked(subDetailData)" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">{{ $t('qc.common.delete') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">{{ $t('qc.iqcPage.batchAdd') }}</el-button>
<div class="rq ">
<el-table
:height="400"
@ -770,43 +766,43 @@
<el-table-column :label="$t('qc.iqcPage.serialNumber')" align="center" prop="num" width="50"></el-table-column>
<el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosA')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocation" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosA')"></el-input>
</template>
</el-table-column>
<el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.samplingPosB')" width="120">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].samplingLocationB" readonly :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" :placeholder="$t('qc.iqcPage.enterSamplingPosB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredA')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValue" readonly :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredA')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueB" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredB')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueB" readonly :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `d`" v-model="templateTableData[row.xh-1].subDetailValueB" @keyup.enter.native="nextFocus4(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredB')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueC" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredC')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueC" readonly :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `e`" v-model="templateTableData[row.xh-1].subDetailValueC" @keyup.enter.native="nextFocus5(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredC')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueD" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredD')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueD" readonly :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `f`" v-model="templateTableData[row.xh-1].subDetailValueD" @keyup.enter.native="nextFocus6(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredD')"></el-input>
</template>
</el-table-column>
<el-table-column prop="subDetailValueE" header-align="center" align="center" :required="true" :label="$t('qc.iqcPage.measuredE')" width="150">
<template slot-scope="{row}">
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y' || isCollectedLocked(subDetailData)" v-model="templateTableData[row.xh-1].subDetailValueE" readonly :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
<el-input v-else :ref="`${row.xh-1}` + `g`" v-model="templateTableData[row.xh-1].subDetailValueE" @keyup.enter.native="nextFocus7(row.xh-1)" :placeholder="$t('qc.iqcPage.enterMeasuredE')"></el-input>
</template>
</el-table-column>
@ -827,7 +823,7 @@
</el-pagination>
</div>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailSave && detailData.submitFlag !== 'Y' && !isCollectedLocked(subDetailData)" type="primary" @click="saveSubDetailResult">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="subDetailFlag = false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -909,7 +905,7 @@
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button v-if="!authSubDetailBatchAdd" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button v-if="!authSubDetailBatchAdd && !isCollectedLocked(subDetailData)" type="primary" @click="batchHandleAddModal">{{ $t('qc.common.save') }}</el-button>
<el-button type="primary" @click="batchHandleAddModalFlag=false">{{ $t('qc.common.close') }}</el-button>
</el-footer>
</el-dialog>
@ -1536,6 +1532,8 @@
import QcMeasuredValueCopyDialog from './QcMeasuredValueCopyDialog.vue'
import {queryResourceList3} from "../../../api/qc/qc";
import { createMrbLaunchPayload, resolveMrbRouteName } from '@/utils/mrbLaunch.js'
import { isCollectedItemLocked, mergeCollectedDetailFlags, canShowExceptionFixButton } from '@/utils/qcCollectedLock'
import { scheduleSilentDetailApply, flushSilentDetailApply } from '@/utils/qcItemResultPersist'
/*上传文件的組件*/
export default {
mixins: [qcItemObjectBatchDeviceMixin],
@ -2363,6 +2361,8 @@
latestParseTimeText: '',
latestParseTimeTimer: null,
detailList: [],
collectedItemMap: {},
exceptionFixMode: false,
saveInformationData: {
site: '',
buNo: '',
@ -3058,6 +3058,7 @@
authOverload: false,
authDelete: false,
authDetail: false,
authExceptionFix: false,
authStartInspection: false,
authFile: false,
authReset: false,
@ -3528,12 +3529,41 @@
const n = Number(val)
return isNaN(n) ? 0 : n
},
/** 有采集标识且已数据采集后,锁定相关录入字段 */
isCollectedLocked (row) {
return isCollectedItemLocked(row, this.collectedItemMap, this.exceptionFixMode)
},
canShowExceptionFix (row) {
return canShowExceptionFixButton(row)
},
closeDetailModalWithoutFlush () {
this.detailInformationFlag = false
this.exceptionFixMode = false
},
closeDetailModal () {
flushSilentDetailApply(this).finally(() => {
this.closeDetailModalWithoutFlush()
})
},
resetCollectedItemMap () {
this.collectedItemMap = {}
},
markCollectedItems (rows) {
if (!rows || typeof rows !== 'object') return
Object.keys(rows).forEach(itemNo => {
this.$set(this.collectedItemMap, itemNo, true)
})
},
applyCollectedFlagsToDetailList () {
mergeCollectedDetailFlags(this.detailList, this.collectedItemMap, this.$set)
},
// 数据采集
dataAcquisition () {
this.dataAcquisitionDialogVisible = true
},
onDataAcquisitionSuccess (rows) {
this.markCollectedItems(rows)
this.changeMyString(rows)
this.getInspectionFormData()
},
@ -3551,6 +3581,7 @@
}
dataAcquisitionByItem(tempDate).then(({data}) => {
if (data.code === 0) {
this.markCollectedItems({ [row.itemNo]: data.rows ? data.rows[row.itemNo] : 0 })
this.changeMyString(data.rows)
this.getInspectionFormData()
this.$message.success(this.$t('qc.entry.dataCollectSuccess'))
@ -4741,7 +4772,8 @@
},
// 新增明细信息
saveDetailInformation (type) {
saveDetailInformation (type, options = {}) {
const { silent = false, skipRefresh = false, skipListReload = false } = options
this.saveInformationData.site = this.detailData.site
this.saveInformationData.buNo = this.detailData.buNo
this.saveInformationData.inspectionNo = this.detailData.inspectionNo
@ -4762,23 +4794,45 @@
this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
this.saveInformationData.batchQualifiedQty = this.detailData.batchQualifiedQty == null ? 0 : this.detailData.batchQualifiedQty
this.saveInformationData.type = type
this.transferLoadFlag = true
saveSQCDetailedRecord(this.saveInformationData).then(({data}) => {
if (!silent) {
this.transferLoadFlag = true
}
return saveSQCDetailedRecord(this.saveInformationData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
// 应用时(type=1)不关闭对话框,只刷新数据
if (!skipListReload) {
this.getDataList()
}
if (type === '1') {
this.getInspectionFormData()
if (!skipRefresh) {
this.getInspectionFormData()
}
} else {
this.detailInformationFlag = false
this.closeDetailModalWithoutFlush()
}
this.$message.success(this.$t('qc.common.operationSuccess'))
} else {
if (!silent) {
this.$message.success(this.$t('qc.common.operationSuccess'))
}
} else if (!silent) {
this.$message.error(data.msg)
}
this.transferLoadFlag = false
}).catch(()=>{
this.transferLoadFlag = false
return data
}).catch((err) => {
throw err
}).finally(() => {
if (!silent) {
this.transferLoadFlag = false
}
})
},
applyDetailInformationSilently () {
if (this.detailData.submitFlag === 'Y' || this.transferLoadFlag) {
return Promise.resolve()
}
return this.saveDetailInformation('1', {
silent: true,
skipRefresh: true,
skipListReload: true
})
},
@ -4832,7 +4886,9 @@
},
// 明细记录信息查询
detailModal (row) {
detailModal (row, exceptionFix = false) {
this.exceptionFixMode = !!exceptionFix
this.resetCollectedItemMap()
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.inspectionNo = row.inspectionNo
@ -4874,11 +4930,16 @@
this.detailInformationFlag = true
},
exceptionFixModal (row) {
this.detailModal(row, true)
},
// 检验单明细
getInspectionFormData () {
sqcDetailSearch(this.detailData).then(({data}) => {
return sqcDetailSearch(this.detailData).then(({data}) => {
if (data && data.code === 0) {
this.detailList = data.rows
this.applyCollectedFlagsToDetailList()
} else {
this.detailList = []
}
@ -5120,9 +5181,7 @@
return;
}
if (row.maxValue == null && row.minValue == null) {
if (row.numberValue!=row.defaultValue){
row.itemResult = 'N'
}
row.itemResult = row.numberValue != row.defaultValue ? 'N' : 'Y'
}else if (row.maxValue != null && row.minValue != null){
if (row.numberValue>row.maxValue ||row.numberValue<row.minValue){
row.itemResult = 'N'
@ -5143,6 +5202,11 @@
}
}
refreshItemSpecWarning(row, this.detailData, 'sqc', evaluateItemSpecWarning)
scheduleSilentDetailApply(this)
},
onItemResultChange () {
this.applyDetailInformationSilently()
},
//删除(确认后立即落库,无需再点底部保存)
@ -5519,6 +5583,7 @@
let saveFlag = this.isAuth(this.menuId + ":save")
let deleteFlag = this.isAuth(this.menuId + ":delete")
let detailFlag = this.isAuth(this.menuId + ":detail")
let exceptionFixFlag = this.isAuth(this.menuId + ":exceptionFix")
let startInspectionFlag = this.isAuth(this.menuId + ":startInspection")
let fileFlag = this.isAuth(this.menuId + ":file")
let cancelCheckFlag = this.isAuth(this.menuId + ":cancelCheck")
@ -5556,6 +5621,7 @@
this.authSave = !saveFlag
this.authDelete = !deleteFlag
this.authDetail = !detailFlag
this.authExceptionFix = !exceptionFixFlag
this.authStartInspection = !startInspectionFlag
this.authFile = !fileFlag
this.authCancelCheck = !cancelCheckFlag

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

@ -2325,7 +2325,7 @@
<!-- 文件采集配置-选择项目 -->
<el-dialog :title="$t('qc.itemPage.uiDialogItemList')" :close-on-click-modal="false" v-drag
:visible.sync="fileCollectItemFlag" width="820px" append-to-body @close="fileCollectPickerRow = null">
:visible.sync="fileCollectItemFlag" width="920px" append-to-body @close="fileCollectPickerRow = null">
<el-form :inline="true" label-position="top" :model="fileCollectItemQuery">
<el-form-item :label="$t('qc.table.inspectionType')" required>
<el-select v-model="fileCollectItemQuery.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')"
@ -2354,6 +2354,8 @@
highlight-current-row
border
style="width: 100%;">
<el-table-column prop="buDesc" :label="$t('qc.method.colBu')" header-align="center" align="left"
min-width="90" show-overflow-tooltip></el-table-column>
<el-table-column prop="itemNo" :label="$t('qc.table.itemCode')" header-align="center" align="center" min-width="100"></el-table-column>
<el-table-column prop="itemDesc" :label="$t('qc.table.itemName')" header-align="center" align="left" min-width="160" show-overflow-tooltip></el-table-column>
<el-table-column prop="methodName" :label="$t('qc.table.inspectionMethod')" header-align="center" align="left" min-width="100" show-overflow-tooltip></el-table-column>
@ -2512,6 +2514,11 @@ export default {
qcSpecList: [],
qcSpecTableList: [],
qcSpecSortable: null,
qcSpecSyncTimer: null,
qcSpecRowKeyMap: null,
qcSpecSortedCache: null,
qcSpecSortedCacheSource: null,
qcSpecListSkipSchedule: false,
qcSpecDragSaving: false,
qcSpecFilterType: '',
qcSpecFilterIpqcMethod: '',
@ -3543,10 +3550,12 @@ export default {
deactivated() {
window.removeEventListener('resize', this.handleViewportResize)
this.clearQcSpecSyncTimers()
},
beforeDestroy() {
window.removeEventListener('resize', this.handleViewportResize)
this.clearQcSpecSyncTimers()
this.destroyQcSpecSortable()
},
@ -3554,25 +3563,25 @@ export default {
'$i18n.locale'() {
this.initPartAttributeI18n()
},
qcSpecList: {
handler() {
this.syncQcSpecTableList()
},
deep: true,
qcSpecList() {
this.qcSpecSortedCache = null
if (this.qcSpecListSkipSchedule) return
this.scheduleQcSpecTableSync()
},
qcSpecFilterType() {
this.syncQcSpecTableList()
this.scheduleQcSpecTableSync()
},
qcSpecFilterIpqcMethod() {
this.syncQcSpecTableList()
this.scheduleQcSpecTableSync()
},
qcSpecFilterOperation() {
this.syncQcSpecTableList()
this.scheduleQcSpecTableSync()
},
activeTable(val) {
if (val === 'qcSpec') {
this.$nextTick(() => this.initQcSpecSortable())
} else {
this.clearQcSpecSyncTimers()
this.destroyQcSpecSortable()
}
},
@ -4265,6 +4274,7 @@ export default {
}).then(({ data }) => {
if (data && data.code === 0) {
this.qcSpecList = data.rows || []
this.assignQcSpecRowKeys(this.qcSpecList)
this.validateQcSpecFilters()
this.syncQcSpecCurrentRow()
}
@ -4322,7 +4332,26 @@ export default {
}
})
},
assignQcSpecRowKeys(list) {
this.qcSpecRowKeyMap = new WeakMap()
const baseCount = {}
;(list || []).forEach((row, index) => {
const base = [
row.itemNo || '',
row.inspectionTypeNo != null ? row.inspectionTypeNo : '',
row.rowNo != null && row.rowNo !== '' ? row.rowNo : index,
].join('_')
const count = baseCount[base] || 0
baseCount[base] = count + 1
const key = count === 0 ? base : `${base}__${count}`
this.qcSpecRowKeyMap.set(row, key)
})
},
getQcSpecRowKey(row) {
if (!row) return ''
if (this.qcSpecRowKeyMap && this.qcSpecRowKeyMap.has(row)) {
return this.qcSpecRowKeyMap.get(row)
}
if (row.rowNo !== null && row.rowNo !== undefined && row.rowNo !== '') {
return `${row.itemNo}_${row.inspectionTypeNo}_${row.rowNo}`
}
@ -4344,14 +4373,42 @@ export default {
return (a.itemNo || '').localeCompare(b.itemNo || '')
})
},
syncQcSpecTableList() {
let list = this.qcSpecList
if (this.qcSpecFilterType) {
getQcSpecSortedSourceList() {
if (this.qcSpecSortedCacheSource === this.qcSpecList && this.qcSpecSortedCache) {
return this.qcSpecSortedCache
}
const sorted = this.sortQcSpecByRowNo(this.qcSpecList || [])
this.qcSpecSortedCache = sorted
this.qcSpecSortedCacheSource = this.qcSpecList
return sorted
},
clearQcSpecSyncTimers() {
if (this.qcSpecSyncTimer) {
clearTimeout(this.qcSpecSyncTimer)
this.qcSpecSyncTimer = null
}
},
scheduleQcSpecTableSync() {
if (this.qcSpecSyncTimer) {
clearTimeout(this.qcSpecSyncTimer)
}
this.qcSpecSyncTimer = setTimeout(() => {
this.qcSpecSyncTimer = null
this.applyQcSpecTableFilter()
}, 120)
},
applyQcSpecTableFilter() {
if (this.activeTable === 'qcSpec') {
this.destroyQcSpecSortable()
}
let list = this.getQcSpecSortedSourceList()
const filterType = String(this.qcSpecFilterType || '')
if (filterType) {
list = list.filter(
(item) => item.inspectionTypeNo === this.qcSpecFilterType
(item) => String(item.inspectionTypeNo || '') === filterType
)
}
if (this.qcSpecFilterType === '101' && this.qcSpecFilterIpqcMethod) {
if (filterType === '101' && this.qcSpecFilterIpqcMethod) {
list = list.filter(
(item) => item.ipqcInspectionMethod === this.qcSpecFilterIpqcMethod
)
@ -4361,12 +4418,12 @@ export default {
(item) => (item.operation || '') === this.qcSpecFilterOperation
)
}
this.qcSpecTableList = this.sortQcSpecByRowNo(list)
this.$nextTick(() => {
if (this.activeTable === 'qcSpec') {
this.qcSpecTableList = list.slice()
if (this.activeTable === 'qcSpec' && !this.editQcSpecBatchVisible) {
this.$nextTick(() => {
this.initQcSpecSortable()
}
})
})
}
},
destroyQcSpecSortable() {
if (this.qcSpecSortable) {
@ -4375,12 +4432,15 @@ export default {
}
},
initQcSpecSortable() {
this.destroyQcSpecSortable()
if (this.activeTable !== 'qcSpec' || this.editQcSpecBatchVisible) return
const table = this.$refs.qcSpecTable
if (!table || !table.$el) return
const tbody = table.$el.querySelector('.el-table__body-wrapper tbody')
if (!tbody) return
if (!tbody || !tbody.children.length) return
if (this.qcSpecSortable) {
this.qcSpecSortable.option('disabled', this.editQcSpecBatchVisible)
return
}
this.qcSpecSortable = Sortable.create(tbody, {
animation: 150,
ghostClass: 'qc-spec-sortable-ghost',
@ -4432,8 +4492,12 @@ export default {
}
row.rowNo = newRowNo
})
this.qcSpecSortedCache = null
this.qcSpecListSkipSchedule = true
this.qcSpecList = orderedList
this.syncQcSpecTableList()
this.assignQcSpecRowKeys(this.qcSpecList)
this.qcSpecListSkipSchedule = false
this.applyQcSpecTableFilter()
if (updates.length === 0) {
return
}
@ -4442,7 +4506,6 @@ export default {
.then(({ data }) => {
if (data && data.code === 0) {
this.$message.success(this.$t('qc.common.operationSuccess'))
this.syncQcSpecTableList()
this.syncQcSpecCurrentRow()
} else {
this.$message.error((data && data.msg) || this.$t('qc.common.saveFailed'))
@ -5655,7 +5718,6 @@ export default {
if (data && data.code === 0) {
this.editQcSpecBatchVisible = false
this.refreshQcSpecList()
this.$nextTick(() => this.initQcSpecSortable())
this.$message.success(
this.$t('qc.partAttributePage.batchSaveSuccess')
)

Loading…
Cancel
Save