|
|
|
@ -32,7 +32,7 @@ |
|
|
|
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button> |
|
|
|
<!-- <el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>--> |
|
|
|
<download-excel |
|
|
|
:fields="fields()" |
|
|
|
:data="exportData" |
|
|
|
@ -80,13 +80,14 @@ |
|
|
|
fixed="right" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="180" |
|
|
|
width="240" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a> |
|
|
|
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a> |
|
|
|
<a v-if="!authDelete" type="text" size="small" @click="deletePropertiesModel(scope.row)">删除</a> |
|
|
|
<a v-if="!authFile" type="text" size="small" @click="sopFileList(scope.row)">SOP文件</a> |
|
|
|
<!-- <a type="text" size="small" @click="sopFileList(scope.row)">SOP文件</a>--> |
|
|
|
<a type="text" size="small" @click="openPartSopFileList(scope.row)">物料SOP</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -638,6 +639,61 @@ |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="物料SOP文件清单" :close-on-click-modal="false" v-drag :visible.sync="partSopFileModelFlag" width="860px"> |
|
|
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="openPartSopUploadDialog">上传文件</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:height="350" |
|
|
|
:data="partSopList" |
|
|
|
border |
|
|
|
v-loading="partSopLoading" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column prop="fileName" label="文件名称" min-width="260" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="createdBy" label="上传人" width="120" align="center" /> |
|
|
|
<el-table-column prop="createDate" label="上传时间" width="180" align="center" /> |
|
|
|
<el-table-column prop="cadditionalInfo" label="备注" min-width="180" show-overflow-tooltip /> |
|
|
|
<el-table-column fixed="right" header-align="center" align="center" width="120" label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a @click="previewPartSopFile(scope.row)">查看 |</a> |
|
|
|
<a type="text" size="small" @click="removePartSopFile(scope.row)">删除</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="上传" :visible.sync="ossVisible" v-drag width="400px" append-to-body :close-on-click-modal="false"> |
|
|
|
<el-form ref="form" class="rq" label-width="80px" label-position="top"> |
|
|
|
<el-row :gutter="10"> |
|
|
|
<slot></slot> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label=" " class="auto"> |
|
|
|
<el-upload drag :file-list="fileList2" |
|
|
|
action="#" ref="upload" |
|
|
|
:on-remove="onRemoveFile" |
|
|
|
:on-change="onChangeFile" |
|
|
|
multiple |
|
|
|
:auto-upload="false"> |
|
|
|
<i class="el-icon-upload"></i> |
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24" > |
|
|
|
<el-form-item label="备注" class="auto" > |
|
|
|
<el-input type="textarea" v-model="ossForm.remark" resize="none" :autosize="{minRows: 3, maxRows: 3}"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" :loading="uploadLoading" @click="handleUploadFiles">确认</el-button> |
|
|
|
<el-button @click="ossVisible = false">取消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 物料编码 --> |
|
|
|
<el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
@ -730,6 +786,7 @@ |
|
|
|
import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js' |
|
|
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
|
|
|
import {deleteObjectFile} from '@/api/eam/eam.js' |
|
|
|
import {queryOssFilePlus, ossUploadNoSaveOSSForYJY, previewOssFileById, removeOss} from '@/api/oss/oss' |
|
|
|
import qcUpload from "./qc_upload" |
|
|
|
import qcSOPUploadFile from "./qc_SOP_upload_file" |
|
|
|
export default { |
|
|
|
@ -1312,6 +1369,19 @@ |
|
|
|
}, |
|
|
|
sopList: [], |
|
|
|
sopFileModelFlag: false, |
|
|
|
partSopFileModelFlag: false, |
|
|
|
partSopLoading: false, |
|
|
|
ossVisible: false, |
|
|
|
uploadLoading: false, |
|
|
|
partSopCurrent: { |
|
|
|
site: '', |
|
|
|
partNo: '' |
|
|
|
}, |
|
|
|
partSopList: [], |
|
|
|
fileList2: [], |
|
|
|
ossForm: { |
|
|
|
remark: '' |
|
|
|
}, |
|
|
|
sopColumnList: [ |
|
|
|
{ |
|
|
|
columnProp: 'fileName', |
|
|
|
@ -2335,6 +2405,135 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 物料SOP文件列表 |
|
|
|
openPartSopFileList (row) { |
|
|
|
this.partSopCurrent = { |
|
|
|
site: row.site, |
|
|
|
partNo: row.partNo |
|
|
|
} |
|
|
|
this.fetchPartSopList() |
|
|
|
this.partSopFileModelFlag = true |
|
|
|
}, |
|
|
|
|
|
|
|
fetchPartSopList () { |
|
|
|
if (!this.partSopCurrent || !this.partSopCurrent.site || !this.partSopCurrent.partNo) { |
|
|
|
this.partSopList = [] |
|
|
|
return |
|
|
|
} |
|
|
|
const params = { |
|
|
|
orderRef1: this.partSopCurrent.site, |
|
|
|
orderRef2: this.partSopCurrent.partNo, |
|
|
|
orderRef3: '', |
|
|
|
orderReftype: 'PartSop' |
|
|
|
} |
|
|
|
this.partSopLoading = true |
|
|
|
queryOssFilePlus(params).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.partSopList = data.rows || [] |
|
|
|
} else { |
|
|
|
this.partSopList = [] |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.partSopList = [] |
|
|
|
}).finally(() => { |
|
|
|
this.partSopLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
openPartSopUploadDialog () { |
|
|
|
if (!this.partSopCurrent || !this.partSopCurrent.site || !this.partSopCurrent.partNo) { |
|
|
|
this.$message.warning('请先选择物料') |
|
|
|
return |
|
|
|
} |
|
|
|
this.fileList2 = [] |
|
|
|
this.ossForm.remark = '' |
|
|
|
this.ossVisible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.upload) { |
|
|
|
this.$refs.upload.clearFiles() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onRemoveFile (file, fileList) { |
|
|
|
this.fileList2 = fileList |
|
|
|
}, |
|
|
|
|
|
|
|
onChangeFile (file, fileList) { |
|
|
|
this.fileList2 = fileList |
|
|
|
}, |
|
|
|
|
|
|
|
handleUploadFiles () { |
|
|
|
if (!this.partSopCurrent || !this.partSopCurrent.site || !this.partSopCurrent.partNo) { |
|
|
|
this.$message.warning('请先选择物料') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.fileList2 || this.fileList2.length === 0) { |
|
|
|
this.$message.warning('请选择文件') |
|
|
|
return |
|
|
|
} |
|
|
|
let formData = new FormData() |
|
|
|
for (let i = 0; i < this.fileList2.length; i++) { |
|
|
|
formData.append('file', this.fileList2[i].raw) |
|
|
|
} |
|
|
|
formData.append('orderRef1', this.partSopCurrent.site) |
|
|
|
formData.append('orderRef2', this.partSopCurrent.partNo) |
|
|
|
formData.append('orderRef3', '') |
|
|
|
formData.append('createdBy', this.$store.state.user.name) |
|
|
|
formData.append('CAdditionalInfo', this.ossForm.remark || '') |
|
|
|
formData.append('orderReftype', 'PartSop') |
|
|
|
this.uploadLoading = true |
|
|
|
ossUploadNoSaveOSSForYJY(formData).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('上传成功') |
|
|
|
this.ossVisible = false |
|
|
|
this.fileList2 = [] |
|
|
|
this.ossForm.remark = '' |
|
|
|
this.fetchPartSopList() |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg || '上传失败') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('上传失败') |
|
|
|
}).finally(() => { |
|
|
|
this.uploadLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
previewPartSopFile (row) { |
|
|
|
let params = { |
|
|
|
id: row.id |
|
|
|
} |
|
|
|
previewOssFileById(params).then((response) => { |
|
|
|
const contentType = (response.headers && response.headers['content-type']) || 'application/octet-stream' |
|
|
|
const blob = new Blob([response.data], { type: contentType }) |
|
|
|
const link = document.createElement('a') |
|
|
|
link.href = URL.createObjectURL(blob) |
|
|
|
link.setAttribute('download', row.fileName) |
|
|
|
link.target = '_blank' |
|
|
|
link.click() |
|
|
|
URL.revokeObjectURL(link.href) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
removePartSopFile (row) { |
|
|
|
this.$confirm('确定要删除该文件吗?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
removeOss([row.id]).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.fetchPartSopList() |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg || '删除失败') |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 动态列开始 获取 用户保存的 格式列 |
|
|
|
async getTableUserColumn (tableId, columnId) { |
|
|
|
let queryTableUser = { |
|
|
|
@ -2443,4 +2642,9 @@ |
|
|
|
height: auto; |
|
|
|
line-height: 1.5; |
|
|
|
} |
|
|
|
|
|
|
|
.rq .auto /deep/ .el-form-item__content { |
|
|
|
height: auto; |
|
|
|
line-height: 1.5; |
|
|
|
} |
|
|
|
</style> |