|
|
@ -617,38 +617,22 @@ |
|
|
</el-dialog> |
|
|
</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-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="900px"> |
|
|
|
|
|
<el-tabs v-model="fileActiveTab" type="border-card"> |
|
|
|
|
|
<el-tab-pane label="QC检验文件" name="qcFile"> |
|
|
|
|
|
<el-form :inline="true" label-position="top" style="margin-bottom: 10px;"> |
|
|
<el-form-item v-if="detailInformationFlag"> |
|
|
<el-form-item v-if="detailInformationFlag"> |
|
|
<el-button type="primary" @click="addUploadFileModal">上传文件</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" @click="addUploadFileModal">上传文件</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-table |
|
|
|
|
|
:height="350" |
|
|
|
|
|
:data="fileContentList" |
|
|
|
|
|
border |
|
|
|
|
|
style="width: 100%; "> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
v-for="(item,index) in fileColumnList" :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"> |
|
|
|
|
|
|
|
|
<el-table :height="350" :data="fileContentList" border style="width: 100%;"> |
|
|
|
|
|
<el-table-column v-for="(item,index) in fileColumnList" :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"> |
|
|
<template slot-scope="scope"> |
|
|
<span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span> |
|
|
<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> |
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column |
|
|
|
|
|
fixed="right" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
width="100" |
|
|
|
|
|
label="操作"> |
|
|
|
|
|
|
|
|
<el-table-column fixed="right" header-align="center" align="center" width="100" label="操作"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-link style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link> |
|
|
<el-link style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link> |
|
|
<el-link style="cursor:pointer" @click="previewFile(scope.row)">预览</el-link> |
|
|
<el-link style="cursor:pointer" @click="previewFile(scope.row)">预览</el-link> |
|
|
@ -656,6 +640,22 @@ |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
</el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="SOP文件" name="sopFile"> |
|
|
|
|
|
<el-table :data="sopFileList" border v-loading="sopFileLoading" height="350" style="width: 100%;"> |
|
|
|
|
|
<el-table-column prop="sopName" header-align="center" align="left" label="文件名称" min-width="200" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="fileType" header-align="center" align="center" label="文件类型" width="100"></el-table-column> |
|
|
|
|
|
<el-table-column prop="version" header-align="center" align="center" label="版本号" width="80"></el-table-column> |
|
|
|
|
|
<el-table-column prop="createdBy" header-align="center" align="center" label="上传人" width="100"></el-table-column> |
|
|
|
|
|
<el-table-column prop="creationDate" header-align="center" align="center" label="上传时间" width="150"></el-table-column> |
|
|
|
|
|
<el-table-column fixed="right" header-align="center" align="center" width="80" label="操作"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link type="primary" @click="previewSopFile(scope.row)">预览</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
<el-footer style="height:35px;margin-top: 10px;text-align:center"> |
|
|
<el-footer style="height:35px;margin-top: 10px;text-align:center"> |
|
|
<el-button type="primary" @click="fileFlag=false">关闭</el-button> |
|
|
<el-button type="primary" @click="fileFlag=false">关闭</el-button> |
|
|
</el-footer> |
|
|
</el-footer> |
|
|
@ -984,7 +984,9 @@ |
|
|
addOQCItemDetails, |
|
|
addOQCItemDetails, |
|
|
deleteOQCItemDetails, |
|
|
deleteOQCItemDetails, |
|
|
getOQCTemplateList, |
|
|
getOQCTemplateList, |
|
|
importOQCTemplateItems |
|
|
|
|
|
|
|
|
importOQCTemplateItems, |
|
|
|
|
|
searchQcSopFileList, |
|
|
|
|
|
downloadSopFile |
|
|
} from "@/api/qc/qc.js" |
|
|
} from "@/api/qc/qc.js" |
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
@ -1918,6 +1920,10 @@ |
|
|
options: [], |
|
|
options: [], |
|
|
fileFlag: false, |
|
|
fileFlag: false, |
|
|
fileContentList: [], |
|
|
fileContentList: [], |
|
|
|
|
|
fileActiveTab: 'qcFile', |
|
|
|
|
|
sopFileList: [], |
|
|
|
|
|
sopFileLoading: false, |
|
|
|
|
|
currentFileRow: null, |
|
|
FQASSelections: [], |
|
|
FQASSelections: [], |
|
|
batchHandleAddModalFlag: false, |
|
|
batchHandleAddModalFlag: false, |
|
|
batchAddData: { |
|
|
batchAddData: { |
|
|
@ -2442,6 +2448,8 @@ |
|
|
|
|
|
|
|
|
// 刷新派设备文档的列表 |
|
|
// 刷新派设备文档的列表 |
|
|
getFileContentData (row) { |
|
|
getFileContentData (row) { |
|
|
|
|
|
this.currentFileRow = row |
|
|
|
|
|
this.fileActiveTab = 'qcFile' |
|
|
this.fileData = { |
|
|
this.fileData = { |
|
|
site: row.site, |
|
|
site: row.site, |
|
|
buNo: row.buNo, |
|
|
buNo: row.buNo, |
|
|
@ -2450,16 +2458,54 @@ |
|
|
inspectionTypeNo: '109' |
|
|
inspectionTypeNo: '109' |
|
|
} |
|
|
} |
|
|
getFileContentList2(this.fileData).then(({data}) => { |
|
|
getFileContentList2(this.fileData).then(({data}) => { |
|
|
//区分请求成功和失败的状况 |
|
|
|
|
|
if (data && data.code == 200) { |
|
|
if (data && data.code == 200) { |
|
|
this.fileContentList = data.rows |
|
|
this.fileContentList = data.rows |
|
|
} else { |
|
|
} else { |
|
|
this.fileContentList = [] |
|
|
this.fileContentList = [] |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.getSopFileList(row) |
|
|
this.fileFlag = true |
|
|
this.fileFlag = true |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取SOP文件列表(OQC传site、partNo和orderNo) |
|
|
|
|
|
getSopFileList(row) { |
|
|
|
|
|
this.sopFileLoading = true |
|
|
|
|
|
this.sopFileList = [] |
|
|
|
|
|
searchQcSopFileList({ |
|
|
|
|
|
site: row.site, |
|
|
|
|
|
partNo: row.partNo || '', |
|
|
|
|
|
orderNo: row.orderNo || '' |
|
|
|
|
|
}).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.sopFileList = data.rows || [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.sopFileList = [] |
|
|
|
|
|
} |
|
|
|
|
|
this.sopFileLoading = false |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.sopFileList = [] |
|
|
|
|
|
this.sopFileLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
previewSopFile(row) { |
|
|
|
|
|
if (!row.sopUrl) { this.$message.warning('该文件暂无预览路径'); return } |
|
|
|
|
|
const fileName = row.sopName || row.sopUrl |
|
|
|
|
|
let fileSuffix = fileName.includes('.') ? fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase() : '' |
|
|
|
|
|
const officeTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] |
|
|
|
|
|
if (officeTypes.includes(fileSuffix)) { this.$message.warning(`暂不支持在线预览${fileSuffix.toUpperCase()}文件`); return } |
|
|
|
|
|
let mimeType = 'application/octet-stream' |
|
|
|
|
|
if (['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(fileSuffix)) { mimeType = 'image/' + fileSuffix } |
|
|
|
|
|
else if (['mp4', 'avi', 'mov', 'wmv', 'flv'].includes(fileSuffix)) { mimeType = 'video/' + fileSuffix } |
|
|
|
|
|
else if (fileSuffix === 'pdf') { mimeType = 'application/pdf' } |
|
|
|
|
|
else if (fileSuffix === 'txt') { mimeType = 'text/plain' } |
|
|
|
|
|
downloadSopFile(row.sopUrl).then(({ data }) => { |
|
|
|
|
|
const blob = new Blob([data], { type: mimeType }) |
|
|
|
|
|
window.open(URL.createObjectURL(blob), '_blank') |
|
|
|
|
|
}).catch(() => { this.$message.error('文件预览失败,请稍后重试') }) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 新增文件的modal |
|
|
// 新增文件的modal |
|
|
addUploadFileModal () { |
|
|
addUploadFileModal () { |
|
|
let currentData = { |
|
|
let currentData = { |
|
|
|