|
|
|
@ -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 |
|
|
|
|