Browse Source

IPQC、FQC检验单需要卡控阅读SOP,未阅读不能保存检验单

ecss-tx
shenzhouyu 6 months ago
parent
commit
eed195a3fd
  1. 2
      src/api/qc/qc.js
  2. 87
      src/views/modules/qc/FQCResultEntry.vue
  3. 89
      src/views/modules/qc/IPQCResultEntry.vue
  4. 10
      src/views/modules/qc/IQCFileTable.vue

2
src/api/qc/qc.js

@ -111,6 +111,7 @@ export const saveFAIInspection = data => createAPI(`/pms/qc/saveFAIInspection`,'
export const qcFQCInspectionSearch = data => createAPI(`/pms/qc/qcFQCInspectionSearch`,'post',data)
export const fqcDetailSearch = data => createAPI(`/pms/qc/fqcDetailSearch`,'post',data)
export const fqcRecordDelete = data => createAPI(`/pms/qc/fqcRecordDelete`,'post',data)
export const markFQCWorkFileRead = data => createAPI(`/pms/qc/markFQCWorkFileRead`,'post',data)
export const saveFQCDetailedRecord = data => createAPI(`/pms/qc/saveFQCDetailedRecord`,'post',data)
export const saveFQCSubmitResult = data => createAPI(`/pms/qc/saveFQCSubmitResult`,'post',data)
export const saveFQCSubDetailed = data => createAPI(`/pms/qc/saveFQCSubDetailed`,'post',data)
@ -158,6 +159,7 @@ export const getColumnDisplayFlagList = data => createAPI(`/pms/pqc/getColumnDis
export const qcIPQCInspectionSearch = data => createAPI(`/pms/qc/qcIPQCInspectionSearch`,'post',data)
export const ipqcDetailSearch = data => createAPI(`/pms/qc/ipqcDetailSearch`,'post',data)
export const ipqcRecordDelete = data => createAPI(`/pms/qc/ipqcRecordDelete`,'post',data)
export const markIPQCWorkFileRead = data => createAPI(`/pms/qc/markIPQCWorkFileRead`,'post',data)
export const saveIPQCDetailedRecord = data => createAPI(`/pms/qc/saveIPQCDetailedRecord`,'post',data)
export const saveIPQCSubmitResult = data => createAPI(`/pms/qc/saveIPQCSubmitResult`,'post',data)
export const saveIPQCSubDetailed = data => createAPI(`/pms/qc/saveIPQCSubDetailed`,'post',data)

87
src/views/modules/qc/FQCResultEntry.vue

@ -101,6 +101,15 @@
</div>
</template>
</el-table-column>
<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'" style="color: red">否</span>
<span v-else>—</span>
</template>
</el-table-column>
<el-table-column v-for="(item,index) in columnList1" :key="index" :sortable="item.columnSortable"
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align" :fixed="item.fixed === '' ? false : item.fixed" :min-width="item.columnWidth"
@ -651,7 +660,7 @@
</el-form-item>
</el-form>
<iqc-file-table :columns="fileColumnList" :data-list="fileContentList"
:query-loading="fileLoading"></iqc-file-table>
:query-loading="fileLoading" @file-previewed="onWorkFilePreviewed"></iqc-file-table>
<el-footer style="height:35px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="fileFlag = false">关闭</el-button>
</el-footer>
@ -802,6 +811,7 @@ import {
fqcDetailSearch, // 查询FAI的检验明细
inspectorSearch, // 查询检验员
fqcRecordDelete, // 删除检验记录
markFQCWorkFileRead, // 标记工作文件已阅读
saveFQCDetailedRecord, // 新增明细信息
saveFQCSubmitResult, // 审核
saveFQCSubDetailed, // 新增子明细信息
@ -917,6 +927,7 @@ export default {
inspectionNo: '',
fileFlag: false,
fileContentList: [],
currentWorkFileRow: null,
// 是否收藏
favorite: false,
// 导出 start
@ -3290,8 +3301,58 @@ export default {
this.FAISelections = val
},
resolveWorkFileRow(row) {
if (!row || !row.inspectionNo) {
return row
}
const matched = this.dataList.find(item =>
item.site === row.site && item.buNo === row.buNo && item.inspectionNo === row.inspectionNo
)
return matched || row
},
saveWorkFileReadToServer(row) {
const target = this.resolveWorkFileRow(row)
if (!target || !target.inspectionNo || target.workFileRead === 'Y') {
return Promise.resolve()
}
return markFQCWorkFileRead({
site: target.site,
buNo: target.buNo,
inspectionNo: target.inspectionNo
}).then(({ data }) => {
if (data && data.code === 0) {
this.$set(target, 'workFileRead', 'Y')
}
})
},
onWorkFilePreviewed() {
if (this.currentWorkFileRow) {
this.saveWorkFileReadToServer(this.currentWorkFileRow)
}
},
fetchWorkFiles(row) {
const currentData = {
orderRef1: row.site,
orderRef2: row.inspectionNo,
orderRef4: row.buNo,
partNo: row.partNo,
}
return getInspectionFile(currentData)
.then(({ data }) => {
if (data && data.code === 0) {
return data.rows || []
}
return []
})
.catch(() => [])
},
// 刷新派设备文档的列表
getFileContentData(row) {
this.currentWorkFileRow = this.resolveWorkFileRow(row)
let currentData = {
orderRef1: row.site,
orderRef2: row.inspectionNo,
@ -3307,6 +3368,7 @@ export default {
} else {
this.fileContentList = []
}
this.$set(this.resolveWorkFileRow(row), 'hasWorkFile', this.fileContentList.length > 0 ? 'Y' : 'N')
this.fileLoading = false
})
.catch(() => {
@ -3601,6 +3663,29 @@ export default {
// 明细记录信息查询
detailModal(row) {
if (row.state === '待检验' && row.workFileRead !== 'Y') {
if (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') {
this.$message.warning('请先预览工作文件后再进行检验操作')
this.currentWorkFileRow = target
this.fileContentList = files
this.fileFlag = true
return
}
this.openDetailModal(row)
})
return
}
this.openDetailModal(row)
},
openDetailModal(row) {
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.inspectionNo = row.inspectionNo

89
src/views/modules/qc/IPQCResultEntry.vue

@ -133,6 +133,19 @@
</div>
</template>
</el-table-column>
<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'" style="color: red">否</span>
<span v-else>—</span>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList1" :key="index"
:sortable="item.columnSortable"
@ -771,7 +784,7 @@
<el-button type="primary" @click="addUploadFileModal">上传文件</el-button>
</el-form-item>
</el-form>
<iqc-file-table :columns="fileColumnList" :data-list="fileContentList" :query-loading="fileLoading"></iqc-file-table>
<iqc-file-table :columns="fileColumnList" :data-list="fileContentList" :query-loading="fileLoading" @file-previewed="onWorkFilePreviewed"></iqc-file-table>
<el-footer style="height:35px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="fileFlag = false">关闭</el-button>
</el-footer>
@ -907,6 +920,7 @@
ipqcDetailSearch, // 查询IPQC的检验明细
inspectorSearch, // 查询检验员
ipqcRecordDelete, // 删除检验记录
markIPQCWorkFileRead, // 标记工作文件已阅读
saveIPQCDetailedRecord, // 新增明细信息
saveIPQCSubmitResult, // 审核
saveIPQCSubDetailed, // 新增子明细信息
@ -1010,6 +1024,7 @@
inspectionNo: '',
fileFlag: false,
fileContentList: [],
currentWorkFileRow: null,
// 是否收藏
favorite: false,
// 导出 start
@ -3000,8 +3015,56 @@
this.IPQCSelections = val
},
resolveWorkFileRow (row) {
if (!row || !row.inspectionNo) {
return row
}
const matched = this.dataList.find(item =>
item.site === row.site && item.buNo === row.buNo && item.inspectionNo === row.inspectionNo
)
return matched || row
},
saveWorkFileReadToServer (row) {
const target = this.resolveWorkFileRow(row)
if (!target || !target.inspectionNo || target.workFileRead === 'Y') {
return Promise.resolve()
}
return markIPQCWorkFileRead({
site: target.site,
buNo: target.buNo,
inspectionNo: target.inspectionNo
}).then(({data}) => {
if (data && data.code === 0) {
this.$set(target, 'workFileRead', 'Y')
}
})
},
onWorkFilePreviewed () {
if (this.currentWorkFileRow) {
this.saveWorkFileReadToServer(this.currentWorkFileRow)
}
},
fetchWorkFiles (row) {
const currentData = {
orderRef1: row.site,
orderRef2: row.inspectionNo,
orderRef4: row.buNo,
partNo: row.partNo
}
return getInspectionFile(currentData).then(({data}) => {
if (data && data.code === 0) {
return data.rows || []
}
return []
}).catch(() => [])
},
//刷新派设备文档的列表
getFileContentData (row) {
this.currentWorkFileRow = this.resolveWorkFileRow(row)
let currentData = {
orderRef1: row.site,
orderRef2: row.inspectionNo,
@ -3016,6 +3079,7 @@
} else {
this.fileContentList = []
}
this.$set(this.resolveWorkFileRow(row), 'hasWorkFile', this.fileContentList.length > 0 ? 'Y' : 'N')
this.fileLoading = false
}).catch(()=>{
this.fileLoading = false
@ -3686,6 +3750,29 @@
// 明细记录信息查询
detailModal (row) {
if (row.state === '待检验' && row.workFileRead !== 'Y') {
if (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') {
this.$message.warning('请先预览工作文件后再进行检验操作')
this.currentWorkFileRow = target
this.fileContentList = files
this.fileFlag = true
return
}
this.openDetailModal(row)
})
return
}
this.openDetailModal(row)
},
openDetailModal (row) {
this.detailData.site = row.site
this.detailData.buNo = row.buNo
this.detailData.inspectionNo = row.inspectionNo

10
src/views/modules/qc/IQCFileTable.vue

@ -18,6 +18,10 @@ export default {
}
},
methods: {
emitFilePreviewed (row) {
this.$emit('file-previewed', row)
},
// 预览
previewFile (row) {
// 预览文件
@ -52,7 +56,8 @@ export default {
// 创建URL来生成预览
const fileURL = URL.createObjectURL(blob);
// 在新标签页中打开文件预览
const newTab = window.open(fileURL, '_blank')
window.open(fileURL, '_blank')
this.emitFilePreviewed(row)
})
},
@ -90,7 +95,8 @@ export default {
// 创建URL来生成预览
const fileURL = URL.createObjectURL(blob);
// 在新标签页中打开文件预览
const newTab = window.open(fileURL, '_blank')
window.open(fileURL, '_blank')
this.emitFilePreviewed(row)
})
},

Loading…
Cancel
Save