常熟吴彦祖 6 days ago
parent
commit
36b7fa49ef
  1. 5
      src/views/modules/qc/IQCFileTable.vue
  2. 210
      src/views/modules/qc/qcPartAttribute.vue
  3. 367
      src/views/modules/srmBaseInformation/srmPartFamily.vue

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

@ -215,7 +215,10 @@ export default {
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="previewFile(scope.row)">预览</el-link> <el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="previewFile(scope.row)">预览</el-link>
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link> <el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link>
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="deleteFile(scope.row)">删除</el-link>
<el-link
v-if="scope.row.orderReftype !== 'mes' && scope.row.orderReftype !== 'PartSop' && scope.row.orderReftype !== 'PartFamilySop'"
style="cursor: pointer"
@click="deleteFile(scope.row)">删除</el-link>
<el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="previewFileMes(scope.row)">预览</el-link> <el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="previewFileMes(scope.row)">预览</el-link>
<el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="downloadFileMes(scope.row)">下载</el-link> <el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="downloadFileMes(scope.row)">下载</el-link>
</template> </template>

210
src/views/modules/qc/qcPartAttribute.vue

@ -32,7 +32,7 @@
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button> <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
</el-form-item> </el-form-item>
<el-form-item :label="' '"> <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 <download-excel
:fields="fields()" :fields="fields()"
:data="exportData" :data="exportData"
@ -80,13 +80,14 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="180"
width="240"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a> <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="!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="!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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -638,6 +639,61 @@
</el-table> </el-table>
</el-dialog> </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-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;"> <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 {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import {deleteObjectFile} from '@/api/eam/eam.js' import {deleteObjectFile} from '@/api/eam/eam.js'
import {queryOssFilePlus, ossUploadNoSaveOSSForYJY, previewOssFileById, removeOss} from '@/api/oss/oss'
import qcUpload from "./qc_upload" import qcUpload from "./qc_upload"
import qcSOPUploadFile from "./qc_SOP_upload_file" import qcSOPUploadFile from "./qc_SOP_upload_file"
export default { export default {
@ -1312,6 +1369,19 @@
}, },
sopList: [], sopList: [],
sopFileModelFlag: false, sopFileModelFlag: false,
partSopFileModelFlag: false,
partSopLoading: false,
ossVisible: false,
uploadLoading: false,
partSopCurrent: {
site: '',
partNo: ''
},
partSopList: [],
fileList2: [],
ossForm: {
remark: ''
},
sopColumnList: [ sopColumnList: [
{ {
columnProp: 'fileName', 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) { async getTableUserColumn (tableId, columnId) {
let queryTableUser = { let queryTableUser = {
@ -2443,4 +2642,9 @@
height: auto; height: auto;
line-height: 1.5; line-height: 1.5;
} }
.rq .auto /deep/ .el-form-item__content {
height: auto;
line-height: 1.5;
}
</style> </style>

367
src/views/modules/srmBaseInformation/srmPartFamily.vue

@ -102,15 +102,17 @@
align="center" align="center"
width="120"
width="210"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link style="cursor: pointer" v-if="authUpdate" @click="updateModal(scope.row)">编辑 |</el-link>
<el-link style="cursor: pointer" v-if="authUpdate" @click="updateModal(scope.row)">编辑</el-link>
<el-link style="cursor: pointer" v-if="authDelete" @click="deletePartFamilyHandle(scope.row)">删除</el-link>
<el-link style="cursor: pointer" v-if="authDelete" @click="deletePartFamilyHandle(scope.row)"> | 删除</el-link>
<el-link style="cursor: pointer" @click="openSopList(scope.row)"> | SOP上传</el-link>
</template> </template>
@ -138,6 +140,108 @@
</el-pagination> </el-pagination>
<el-dialog title="SOP文件清单" :close-on-click-modal="false" v-drag :visible.sync="sopDialogVisible" width="860px">
<el-form :inline="true" label-position="top">
<el-form-item>
<el-button type="primary" @click="openSopUploadDialog">上传文件</el-button>
</el-form-item>
</el-form>
<el-table :height="360" :data="sopFileList" border v-loading="sopLoading" style="width: 100%">
<el-table-column prop="fileName" label="文件名称" min-width="300" 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 label="操作" width="130" align="center" fixed="right">
<template slot-scope="scope">
<el-link type="primary" @click="previewSopFile(scope.row)">查看 |</el-link>
<el-link type="danger" @click="removeSopFile(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="sopDialogVisible = false">关闭</el-button>
</el-footer>
</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="modalTitle" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="560px"> <el-dialog :title="modalTitle" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="560px">
@ -273,6 +377,12 @@ import {
deletePartFamily deletePartFamily
} from '@/api/baseInformation/srmPartFamily.js' } from '@/api/baseInformation/srmPartFamily.js'
import {
queryOssFilePlus,
ossUploadNoSaveOSSForYJY,
previewOssFileById,
removeOss
} from '@/api/oss/oss'
@ -382,6 +492,26 @@ export default {
modalDisableFlag: false, modalDisableFlag: false,
sopDialogVisible: false,
ossVisible: false,
sopLoading: false,
uploadLoading: false,
sopCurrentRow: null,
sopFileList: [],
fileList2: [],
ossForm: {
remark: ''
},
modalData: { modalData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -1172,6 +1302,229 @@ export default {
}, },
buildSopQueryParams (row) {
return {
orderRef1: row.site,
orderRef2: row.familyId,
orderRef3: '',
orderReftype: 'PartFamilySop'
}
},
openSopList (row) {
this.sopCurrentRow = {
site: row.site,
familyId: row.familyId
}
this.sopDialogVisible = true
this.fetchSopFileList()
},
fetchSopFileList () {
if (!this.sopCurrentRow) {
this.sopFileList = []
return
}
this.sopLoading = true
queryOssFilePlus(this.buildSopQueryParams(this.sopCurrentRow)).then(({ data }) => {
if (data && data.code === 0) {
this.sopFileList = data.rows || []
} else {
this.sopFileList = []
}
}).catch(() => {
this.sopFileList = []
}).finally(() => {
this.sopLoading = false
})
},
openSopUploadDialog () {
if (!this.sopCurrentRow) {
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.sopCurrentRow) {
this.$message.warning('请先选择分类')
return
}
if (!this.fileList2 || this.fileList2.length === 0) {
this.$message.warning('请选择文件')
return
}
const formData = new FormData()
for (let i = 0; i < this.fileList2.length; i++) {
formData.append('file', this.fileList2[i].raw)
}
formData.append('orderRef1', this.sopCurrentRow.site)
formData.append('orderRef2', this.sopCurrentRow.familyId)
formData.append('orderRef3', '')
formData.append('createdBy', this.$store.state.user.name)
formData.append('CAdditionalInfo', this.ossForm.remark || '')
formData.append('orderReftype', 'PartFamilySop')
this.uploadLoading = true
ossUploadNoSaveOSSForYJY(formData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('上传成功')
this.ossVisible = false
this.fileList2 = []
this.ossForm.remark = ''
this.fetchSopFileList()
} else {
this.$message.warning((data && data.msg) || '上传失败')
}
}).catch(() => {
this.$message.error('上传失败')
}).finally(() => {
this.uploadLoading = false
})
},
previewSopFile (row) {
previewOssFileById({ id: row.id }).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)
})
},
removeSopFile (row) {
this.$confirm('确定要删除该文件吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeOss([row.id]).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('删除成功')
this.fetchSopFileList()
} else {
this.$message.warning((data && data.msg) || '删除失败')
}
})
}).catch(() => {})
},
getButtonAuthData () { getButtonAuthData () {
let searchFlag = this.isAuth(this.menuId + ':search') let searchFlag = this.isAuth(this.menuId + ':search')
@ -1208,6 +1561,14 @@ export default {
} }
.rq .auto /deep/ .el-form-item__content {
height: auto;
line-height: 1.5;
}
</style> </style>
Loading…
Cancel
Save