|
|
|
@ -104,10 +104,9 @@ |
|
|
|
<el-table-column header-align="center" align="center" width="90" label="是否阅读"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.state !== '待检验'">—</span> |
|
|
|
<span v-else-if="scope.row.hasWorkFile === 'N'">无需</span> |
|
|
|
<span v-else-if="scope.row.workFileRead === 'Y'" style="color: #3ac252">是</span> |
|
|
|
<span v-else-if="scope.row.hasWorkFile === 'Y' && scope.row.workFileRead === 'Y'" style="color: #3ac252">是</span> |
|
|
|
<span v-else-if="scope.row.hasWorkFile === 'Y'" style="color: red">否</span> |
|
|
|
<span v-else>—</span> |
|
|
|
<span v-else>无需</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-for="(item,index) in columnList1" :key="index" :sortable="item.columnSortable" |
|
|
|
@ -3325,6 +3324,22 @@ export default { |
|
|
|
return matched || row |
|
|
|
}, |
|
|
|
|
|
|
|
// part_sop(mes) / 物料属性SOP(orderRef2=料号) 需阅读;本页按检验单号上传的不需阅读 |
|
|
|
isMustReadWorkFile(file, row) { |
|
|
|
if (!file) { |
|
|
|
return false |
|
|
|
} |
|
|
|
if (file.orderReftype === 'mes') { |
|
|
|
return true |
|
|
|
} |
|
|
|
const partNo = row && row.partNo |
|
|
|
return !!(partNo && file.orderRef2 === partNo) |
|
|
|
}, |
|
|
|
|
|
|
|
getMustReadWorkFiles(files, row) { |
|
|
|
return (files || []).filter(file => this.isMustReadWorkFile(file, row)) |
|
|
|
}, |
|
|
|
|
|
|
|
saveWorkFileReadToServer(row) { |
|
|
|
const target = this.resolveWorkFileRow(row) |
|
|
|
if (!target || !target.inspectionNo || target.workFileRead === 'Y') { |
|
|
|
@ -3341,8 +3356,8 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onWorkFilePreviewed() { |
|
|
|
if (this.currentWorkFileRow) { |
|
|
|
onWorkFilePreviewed(file) { |
|
|
|
if (this.currentWorkFileRow && this.isMustReadWorkFile(file, this.currentWorkFileRow)) { |
|
|
|
this.saveWorkFileReadToServer(this.currentWorkFileRow) |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -3382,7 +3397,8 @@ export default { |
|
|
|
} else { |
|
|
|
this.fileContentList = [] |
|
|
|
} |
|
|
|
this.$set(this.resolveWorkFileRow(row), 'hasWorkFile', this.fileContentList.length > 0 ? 'Y' : 'N') |
|
|
|
const mustReadFiles = this.getMustReadWorkFiles(this.fileContentList, row) |
|
|
|
this.$set(this.resolveWorkFileRow(row), 'hasWorkFile', mustReadFiles.length > 0 ? 'Y' : 'N') |
|
|
|
this.fileLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
@ -3675,28 +3691,29 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 明细记录信息查询 |
|
|
|
// 明细记录信息查询:无文件→无需阅读直接进;有需阅读文件且未读才拦截 |
|
|
|
detailModal(row) { |
|
|
|
if (row.state === '待检验' && row.workFileRead !== 'Y') { |
|
|
|
if (row.hasWorkFile === 'N') { |
|
|
|
if (row.state !== '待检验') { |
|
|
|
this.openDetailModal(row) |
|
|
|
return |
|
|
|
} |
|
|
|
if (row.workFileRead === 'Y' || row.hasWorkFile === 'N') { |
|
|
|
this.openDetailModal(row) |
|
|
|
return |
|
|
|
} |
|
|
|
this.fetchWorkFiles(row).then(files => { |
|
|
|
const target = this.resolveWorkFileRow(row) |
|
|
|
this.$set(target, 'hasWorkFile', files.length > 0 ? 'Y' : 'N') |
|
|
|
if (files.length > 0 && target.workFileRead !== 'Y') { |
|
|
|
const mustReadFiles = this.getMustReadWorkFiles(files, target) |
|
|
|
this.$set(target, 'hasWorkFile', mustReadFiles.length > 0 ? 'Y' : 'N') |
|
|
|
if (mustReadFiles.length === 0 || target.workFileRead === 'Y') { |
|
|
|
this.openDetailModal(row) |
|
|
|
return |
|
|
|
} |
|
|
|
this.$message.warning('请先预览工作文件后再进行检验操作') |
|
|
|
this.currentWorkFileRow = target |
|
|
|
this.fileContentList = files |
|
|
|
this.fileFlag = true |
|
|
|
return |
|
|
|
} |
|
|
|
this.openDetailModal(row) |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.openDetailModal(row) |
|
|
|
}, |
|
|
|
|
|
|
|
openDetailModal(row) { |
|
|
|
|