|
|
|
@ -690,14 +690,53 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 文件清单 --> |
|
|
|
<el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px"> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item v-if="detailInformationFlag"> |
|
|
|
<el-button type="primary" @click="addUploadFileModal">上传文件</el-button> |
|
|
|
<!-- 图纸清单(与 DMQcPartAttribute 图纸一致:MES 刀模图纸) --> |
|
|
|
<el-dialog title="图纸清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px"> |
|
|
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="检验类型"> |
|
|
|
<el-select v-model="sopData.inspectionTypeNo" disabled placeholder="请选择"> |
|
|
|
<el-option label="全部" value=""></el-option> |
|
|
|
<el-option |
|
|
|
v-for="i in typeOptions" |
|
|
|
:key="i.inspectionTypeNo" |
|
|
|
:label="i.inspectionTypeName" |
|
|
|
:value="i.inspectionTypeNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="getMesDrawingFileList">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<iqc-file-table :columns="fileColumnList" :data-list="fileContentList" :query-loading="fileLoading"></iqc-file-table> |
|
|
|
<el-table |
|
|
|
v-loading="fileLoading" |
|
|
|
:height="350" |
|
|
|
:data="sopList" |
|
|
|
border |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in sopColumnList" |
|
|
|
: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" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a style="margin-right: 8px" href="javascript:void(0)" @click="previewDrawingFile(scope.row)">预览</a> |
|
|
|
<a href="javascript:void(0)" @click="downloadDrawingFile(scope.row)">下载</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-footer style="height:35px;margin-top: 10px;text-align:center"> |
|
|
|
<el-button type="primary" @click="fileFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
@ -813,9 +852,6 @@ |
|
|
|
|
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
|
|
|
|
<!-- 上传文件的modal --> |
|
|
|
<qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="()=>{this.getFileContentData(this.detailData)}" v-drag></qcFAIUploadFile> |
|
|
|
|
|
|
|
<!-- 上传文件的modal --> |
|
|
|
<comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData" v-drag></comQcItemImageUploadFile> |
|
|
|
|
|
|
|
@ -868,31 +904,24 @@ |
|
|
|
cancelDMFAIApproval, |
|
|
|
queryDmTemplateList, |
|
|
|
} from "@/api/qc/dmFai.js" |
|
|
|
import { dmToolInfoSearch, dmAttributeTemplateFirstByTool } from "@/api/qc/dmBasic.js"; |
|
|
|
import { dmToolInfoSearch, dmAttributeTemplateFirstByTool, dmMesToolDrawingList, dmMesToolDrawingPreview, dmMesToolDrawingDownload } from "@/api/qc/dmBasic.js"; |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
import {getInspectionFile} from '@/api/eam/eam_object_list.js' |
|
|
|
import { |
|
|
|
deleteObjectFile, |
|
|
|
getUserRoleList, // 获取用户角色列表 |
|
|
|
getOperatorList |
|
|
|
} from '@/api/eam/eam.js' |
|
|
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
|
|
|
import {qcPrint} from '@/api/qc/qcPrint.js' |
|
|
|
import qcFAIUploadFile from "../qc/qc_FAI_upload_file" |
|
|
|
import comQcItemImageUploadFile from "../qc/com_qc_itemImage_upload_file" |
|
|
|
import subDetailUpload from "../qc/sub_detail_upload"; |
|
|
|
import QrCode from "../common/QrCode.vue"; |
|
|
|
import IqcFileTable from './IQCFileTable.vue' |
|
|
|
/*上传文件的組件*/ |
|
|
|
import QrCode from "../common/QrCode.vue"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
QrCode, |
|
|
|
Chooselist, |
|
|
|
qcFAIUploadFile, |
|
|
|
comQcItemImageUploadFile, |
|
|
|
subDetailUpload, |
|
|
|
IqcFileTable |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
templateTableData () { |
|
|
|
@ -941,7 +970,58 @@ |
|
|
|
transferLoadFlag: false, |
|
|
|
inspectionNo: '', |
|
|
|
fileFlag: false, |
|
|
|
fileContentList: [], |
|
|
|
sopData: { site: '', buNo: '', partNo: '', inspectionTypeNo: '' }, |
|
|
|
sopList: [], |
|
|
|
sopColumnList: [ |
|
|
|
{ |
|
|
|
columnProp: 'fileName', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '文件名称', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'createdBy', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '上传人', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: true, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'createDate', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '上传时间', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: true, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'orderRef3', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '文档类别', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: true, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
}, |
|
|
|
], |
|
|
|
// 是否收藏 |
|
|
|
favorite: false, |
|
|
|
// 导出 start |
|
|
|
@ -1815,56 +1895,6 @@ |
|
|
|
columnWidth: 100, |
|
|
|
}, |
|
|
|
], |
|
|
|
fileColumnList: [ |
|
|
|
{ |
|
|
|
columnProp: 'fileName', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '文件名称', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'createdBy', |
|
|
|
headerAlign: "center", |
|
|
|
align: 'center', |
|
|
|
columnLabel: '上传人', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: true, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'createDate', |
|
|
|
headerAlign: "center", |
|
|
|
align: 'center', |
|
|
|
columnLabel: '上传时间', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: true, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'orderRef3', |
|
|
|
headerAlign: "center", |
|
|
|
align: 'center', |
|
|
|
columnLabel: '备注', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: true, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
], |
|
|
|
// 派工单号 |
|
|
|
seqInfoList: [], |
|
|
|
seqDetailFlag: false, |
|
|
|
@ -2897,44 +2927,104 @@ |
|
|
|
this.IPQCSelections = val |
|
|
|
}, |
|
|
|
|
|
|
|
//刷新派设备文档的列表 |
|
|
|
// MES 刀模图纸列表(与 DMQcPartAttribute 图纸一致) |
|
|
|
getFileContentData (row) { |
|
|
|
let currentData = { |
|
|
|
orderRef1: row.site, |
|
|
|
orderRef2: row.inspectionNo, |
|
|
|
orderRef4: row.buNo, |
|
|
|
partNo: row.partNo |
|
|
|
this.sopData = { |
|
|
|
site: row.site, |
|
|
|
buNo: row.buNo, |
|
|
|
partNo: row.partNo, |
|
|
|
inspectionTypeNo: '823', |
|
|
|
} |
|
|
|
this.getMesDrawingFileList() |
|
|
|
this.fileFlag = true |
|
|
|
}, |
|
|
|
getMesDrawingFileList () { |
|
|
|
const tempData = { |
|
|
|
site: this.sopData.site, |
|
|
|
partNo: this.sopData.partNo, |
|
|
|
inspectionTypeNo: this.sopData.inspectionTypeNo, |
|
|
|
} |
|
|
|
this.fileLoading = true |
|
|
|
getInspectionFile(currentData).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.fileContentList = data.rows |
|
|
|
} else { |
|
|
|
this.fileContentList = [] |
|
|
|
} |
|
|
|
dmMesToolDrawingList(tempData).then(({ data }) => { |
|
|
|
this.sopList = data && data.code === 200 ? data.rows : [] |
|
|
|
this.fileLoading = false |
|
|
|
}).catch(()=>{ |
|
|
|
}).catch(() => { |
|
|
|
this.sopList = [] |
|
|
|
this.fileLoading = false |
|
|
|
}) |
|
|
|
this.fileFlag = true |
|
|
|
}, |
|
|
|
|
|
|
|
/*新增文件的modal*/ |
|
|
|
addUploadFileModal () { |
|
|
|
let currentData = { |
|
|
|
titleCon: 'IPQC文件上传', |
|
|
|
site: this.detailData.site, |
|
|
|
buNo: this.detailData.buNo, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
inspectionNo: this.detailData.inspectionNo, |
|
|
|
remark: '', |
|
|
|
folder: 'qcIPQC', |
|
|
|
previewDrawingFile (row) { |
|
|
|
if (!row.id) { |
|
|
|
this.$message.warning('文件标识无效') |
|
|
|
return |
|
|
|
} |
|
|
|
//打开组件 去做新增业务 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.qcFAIUploadFile.init(currentData) |
|
|
|
}) |
|
|
|
dmMesToolDrawingPreview(row.id, false) |
|
|
|
.then(({ data, headers }) => { |
|
|
|
if (!data || !data.size) { |
|
|
|
this.$message.warning('未获取到文件内容') |
|
|
|
return |
|
|
|
} |
|
|
|
const contentType = (headers && (headers['content-type'] || headers['Content-Type'])) || '' |
|
|
|
if (contentType.includes('text/html')) { |
|
|
|
this.$message.error('登录已过期或无权访问,请刷新后重试') |
|
|
|
return |
|
|
|
} |
|
|
|
if (contentType.includes('application/json')) { |
|
|
|
const reader = new FileReader() |
|
|
|
reader.onload = () => { |
|
|
|
try { |
|
|
|
const j = JSON.parse(reader.result) |
|
|
|
this.$message.error((j && j.msg) || '预览失败') |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('预览失败') |
|
|
|
} |
|
|
|
} |
|
|
|
reader.readAsText(data) |
|
|
|
return |
|
|
|
} |
|
|
|
const blob = new Blob([data], { type: contentType || 'application/octet-stream' }) |
|
|
|
const fileURL = URL.createObjectURL(blob) |
|
|
|
window.open(fileURL, '_blank') |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.$message.error('预览失败,请检查 MES 鉴权或网络') |
|
|
|
}) |
|
|
|
}, |
|
|
|
downloadDrawingFile (row) { |
|
|
|
if (!row.id) { |
|
|
|
this.$message.warning('文件标识无效') |
|
|
|
return |
|
|
|
} |
|
|
|
dmMesToolDrawingDownload(row.id, true) |
|
|
|
.then(({ data, headers }) => { |
|
|
|
const contentType = (headers && (headers['content-type'] || headers['Content-Type'])) || '' |
|
|
|
if (contentType.includes('application/json')) { |
|
|
|
const reader = new FileReader() |
|
|
|
reader.onload = () => { |
|
|
|
try { |
|
|
|
const j = JSON.parse(reader.result) |
|
|
|
this.$message.error((j && j.msg) || '下载失败') |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('下载失败') |
|
|
|
} |
|
|
|
} |
|
|
|
reader.readAsText(data) |
|
|
|
return |
|
|
|
} |
|
|
|
const blob = new Blob([data], { type: contentType || 'application/octet-stream' }) |
|
|
|
const fileName = row.fileName || 'download' |
|
|
|
const linkNode = document.createElement('a') |
|
|
|
linkNode.download = fileName |
|
|
|
linkNode.style.display = 'none' |
|
|
|
linkNode.href = URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(linkNode) |
|
|
|
linkNode.click() |
|
|
|
URL.revokeObjectURL(linkNode.href) |
|
|
|
document.body.removeChild(linkNode) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.$message.error('下载失败,请检查 MES 服务或网络') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 上传项目图片 |
|
|
|
|