diff --git a/hw-ui/src/components/viewFile/index.vue b/hw-ui/src/components/viewFile/index.vue index ac63897..ebb2ed0 100644 --- a/hw-ui/src/components/viewFile/index.vue +++ b/hw-ui/src/components/viewFile/index.vue @@ -7,31 +7,59 @@ width="30%" @close="closeDialog" > -
- - + +
+ + {{ file.name }} + + - - - {{ file.name }} - - -
+ + + + + + +
+ 取 消 + + + + @@ -86,6 +114,11 @@ export default { .filter(file => this.isAssetTypeAnImage(file.name)) .map(file => file.url); }, + //查看图纸预览 + handlePictureCardPreview(file) { + this.dialogImageUrl = file.url; + this.pictureDetailModel = true; + }, // 下载非图片文件 handleDownload(file) { window.open(file.url); @@ -98,27 +131,8 @@ export default { }; - diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index 688d839..24a67fb 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -206,7 +206,7 @@ size="small" style="margin-right: 12px" type="text" - @click="SOP(scope.row)" + @click="handleViewSOP(scope.row)" > SOP预览 @@ -411,67 +411,6 @@ - - - - -
- - {{ file.name }} - - - - - - - - -
-
- -
- - - - - - - - +
+ +
@@ -547,6 +489,8 @@ import { import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue'; import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" +import ViewFile from "@/components/viewFile/index.vue"; +import {getDispatchSOPAttachList} from "@/api/mes/productplan"; const setState = (e) => { if (e === '1') { @@ -566,7 +510,8 @@ export default { 'apply-raw-outstock': applyRawOutstock, Chart, PrintPage, - WorkshopNotice + WorkshopNotice, + ViewFile }, dicts: ['wms_raw_return_task_type', 'mes_safe_flag'], provide(){ @@ -717,7 +662,12 @@ export default { {required: true, message: "物料条码不能为空", trigger: "blur"} ] }, - + //显示预览文件 + showFileDialog: false, + //显示预览文件标题 + thisTitle: "查看SOP附件", + //预览文件数据列表 + fileListData: [], } }, async mounted() { @@ -1639,70 +1589,26 @@ export default { this.resetContinueRawInstock(); }, - async SOP(e) { - this.fileList = [] - - console.log(e) - // const data = await fun() - // this.fileList = data.map(v=>v) - - this.fileList = [ - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - ] - this.SOPModel = true; - }, - //查看图纸预览 - handlePictureCardPreview(file) { - this.dialogImageUrl = file.url; - this.pictureDetailModel = true; - }, - //图纸下载 - async handleDownload(file) { - this.fileDownload(file) - }, - isAssetTypeAnImage(ext) { - let suffix = ext.lastIndexOf("."); - let name = ext.substr(suffix + 1); - return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase()) + /** SOP预览*/ + handleViewSOP(e){ + this.fileListData = []; + getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + let attachList = res.data; + let thisFileList = []; + attachList.forEach(e => { + let previewFile = {}; + previewFile.url = e.attachPath; + previewFile.name = e.attachName; + thisFileList.push(previewFile); + }) + console.log("thisFileList:", thisFileList) + if (thisFileList.length > 0){ + this.fileListData = thisFileList; + this.showFileDialog = true; + } else { + this.$modal.msgWarning("此派工派工单号无SOP附件!"); + } + }) }, completeCollectMaterials() { diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 7311f9c..c9c8373 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -79,7 +79,7 @@ SOP预览 @@ -419,67 +419,13 @@
- - - -
- - {{ file.name }} - - - - - - - - -
-
- -
- - - - - -
+ +
+ +
@@ -505,6 +451,8 @@ import { import {getToken} from "@/utils/auth"; import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue"; import {getNowDateTime} from "@/utils/ruoyi"; +import ViewFile from "@/components/viewFile/index.vue"; +import {getDispatchSOPAttachList} from "@/api/mes/productplan"; const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { @@ -519,7 +467,8 @@ export default { 'apply-raw-outstock': applyRawOutstock, Chart, PrintPage, - WorkshopNotice + WorkshopNotice, + ViewFile }, mixins: [monitorSerialData, noticeData], data() { @@ -604,6 +553,12 @@ export default { productPlanData: {}, reloadFlag: "0", + //显示预览文件 + showFileDialog: false, + //显示预览文件标题 + thisTitle: "查看SOP附件", + //预览文件数据列表 + fileListData: [], } }, mounted() { @@ -1020,70 +975,26 @@ export default { }); }, - async SOP(e) { - this.fileList = [] - - console.log(e) - // const data = await fun() - // this.fileList = data.map(v=>v) - - this.fileList = [ - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - ] - this.SOPModel = true; - }, - //查看图纸预览 - handlePictureCardPreview(file) { - this.dialogImageUrl = file.url; - this.pictureDetailModel = true; - }, - //图纸下载 - async handleDownload(file) { - this.fileDownload(file) - }, - isAssetTypeAnImage(ext) { - let suffix = ext.lastIndexOf("."); - let name = ext.substr(suffix + 1); - return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase()) + /** SOP预览*/ + handleViewSOP(e){ + this.fileListData = []; + getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + let attachList = res.data; + let thisFileList = []; + attachList.forEach(e => { + let previewFile = {}; + previewFile.url = e.attachPath; + previewFile.name = e.attachName; + thisFileList.push(previewFile); + }) + console.log("thisFileList:", thisFileList) + if (thisFileList.length > 0){ + this.fileListData = thisFileList; + this.showFileDialog = true; + } else { + this.$modal.msgWarning("此派工派工单号无SOP附件!"); + } + }) }, diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index d1da527..559cad8 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -76,7 +76,7 @@ SOP预览 @@ -333,6 +333,10 @@ +
+ +
+ @@ -356,6 +360,8 @@ import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue'; import {getNowDateTime} from "@/utils/ruoyi"; import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" +import ViewFile from "@/components/viewFile/index.vue"; +import {getDispatchSOPAttachList} from "@/api/mes/productplan"; const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { @@ -371,7 +377,8 @@ export default { 'apply-raw-outstock': applyRawOutstock, Chart, PrintPage, - WorkshopNotice + WorkshopNotice, + ViewFile }, data() { return { @@ -460,7 +467,12 @@ export default { INTERNAL: '2'//对内条码 }, reloadFlag: "0", - + //显示预览文件 + showFileDialog: false, + //显示预览文件标题 + thisTitle: "查看SOP附件", + //预览文件数据列表 + fileListData: [], } }, created() { @@ -1099,6 +1111,27 @@ export default { }, + /** SOP预览*/ + handleViewSOP(e){ + this.fileListData = []; + getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + let attachList = res.data; + let thisFileList = []; + attachList.forEach(e => { + let previewFile = {}; + previewFile.url = e.attachPath; + previewFile.name = e.attachName; + thisFileList.push(previewFile); + }) + console.log("thisFileList:", thisFileList) + if (thisFileList.length > 0){ + this.fileListData = thisFileList; + this.showFileDialog = true; + } else { + this.$modal.msgWarning("此派工派工单号无SOP附件!"); + } + }) + }, setSerialData() { // if (!this.checkSerialConnected()) {//判断是否已连接,如果没有连接则需要连接 diff --git a/hw-ui/src/views/board/fourthFloor/weld.vue b/hw-ui/src/views/board/fourthFloor/weld.vue index e42721b..2625dcd 100644 --- a/hw-ui/src/views/board/fourthFloor/weld.vue +++ b/hw-ui/src/views/board/fourthFloor/weld.vue @@ -115,7 +115,7 @@ SOP预览 @@ -225,6 +225,10 @@ +
+ +
+ @@ -240,6 +244,8 @@ import { import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" import {monitorSerialData} from "@/utils/serial"; +import ViewFile from "@/components/viewFile/index.vue"; +import {getDispatchSOPAttachList} from "@/api/mes/productplan"; const setState = (e) => { if (e === '1') { @@ -257,7 +263,8 @@ export default { name: 'Board1', components: { Chart, - WorkshopNotice + WorkshopNotice, + ViewFile }, mixins: [noticeData], data() { @@ -271,6 +278,12 @@ export default { form: {}, tableData: [], vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100, + //显示预览文件 + showFileDialog: false, + //显示预览文件标题 + thisTitle: "查看SOP附件", + //预览文件数据列表 + fileListData: [], } }, mounted() { @@ -850,71 +863,26 @@ export default { }); }, - - async SOP(e) { - this.fileList = [] - - console.log(e) - // const data = await fun() - // this.fileList = data.map(v=>v) - - this.fileList = [ - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: 'Snipaste_2023-09-04_08-16-59.png', - url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png' - }, - { - name: '会议纪要 0825_20240417143926A014.docx', - url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx' - }, - ] - this.SOPModel = true; - }, - //查看图纸预览 - handlePictureCardPreview(file) { - this.dialogImageUrl = file.url; - this.pictureDetailModel = true; - }, - //图纸下载 - async handleDownload(file) { - this.fileDownload(file) - }, - isAssetTypeAnImage(ext) { - let suffix = ext.lastIndexOf("."); - let name = ext.substr(suffix + 1); - return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase()) + /** SOP预览*/ + handleViewSOP(e){ + this.fileListData = []; + getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + let attachList = res.data; + let thisFileList = []; + attachList.forEach(e => { + let previewFile = {}; + previewFile.url = e.attachPath; + previewFile.name = e.attachName; + thisFileList.push(previewFile); + }) + console.log("thisFileList:", thisFileList) + if (thisFileList.length > 0){ + this.fileListData = thisFileList; + this.showFileDialog = true; + } else { + this.$modal.msgWarning("此派工派工单号无SOP附件!"); + } + }) }, } }