diff --git a/hw-ui/src/main.js b/hw-ui/src/main.js index 1b770c2..e65278e 100644 --- a/hw-ui/src/main.js +++ b/hw-ui/src/main.js @@ -25,7 +25,8 @@ import { selectDictLabel, selectDictLabels, handleTree, - formatDayHourMinutes + formatDayHourMinutes, + fileDownload } from "@/utils/ruoyi"; // 分页组件 import Pagination from "@/components/Pagination"; @@ -57,6 +58,7 @@ Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree Vue.prototype.formatDayHourMinutes = formatDayHourMinutes +Vue.prototype.fileDownload = fileDownload // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/hw-ui/src/utils/ruoyi.js b/hw-ui/src/utils/ruoyi.js index 4c3b186..f1e1418 100644 --- a/hw-ui/src/utils/ruoyi.js +++ b/hw-ui/src/utils/ruoyi.js @@ -249,3 +249,20 @@ export function formatDayHourMinutes(seconds) { } return result; } + +export function fileDownload(file) { + fetch(file.url).then(res => res.blob()).then((blob) => { + let reader = new FileReader(); + reader.readAsDataURL(blob); // 转换为base64,可以直接放入a标签href + reader.onload = function (e) { + // 转换完成,创建一个a标签用于下载 + let a = document.createElement('a'); + a.download = file.name; + a.href = e.target.result; + document.body.appendChild(a); + a.click(); + // 移除元素 + document.body.removeChild(a); + } + }) +} diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index cd25046..0313e0f 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -420,7 +420,7 @@ - + @@ -428,7 +428,7 @@ - + @@ -827,7 +827,7 @@ export default { }, async startPlan(val,materialBarcode) { let data; - if(materialBarcode && materialBarcode!=null && materialBarcode!=undefined && materialBarcode!=''){ + if(materialBarcode && materialBarcode!==''){ data = await scan2StartNextProductPlanDetail({planId: val.planId,materialBarcode:materialBarcode}) }else{ data = await startNextProductPlanDetail({planId: val.planId}) @@ -854,7 +854,7 @@ export default { this.$modal.msgWarning("请扫描或输入物料条码"); return; } - this.startPlan(val,this.input1); + await this.startPlan(val, this.input1); document.body.click() // const data = await startNextProductPlanDetail({planId: val.planId}) diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 5a00d4c..741eb69 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -515,36 +515,38 @@ - - + + - + - + - - + + - - - + + + - - + + - + - - + + 取 消 @@ -553,6 +555,65 @@ + + + +
+ + {{ file.name }} + + + + + + + + +
+
+ +
+ + + + + + @@ -570,20 +631,66 @@ import { firstFloorProduceInstock, scanMaterial2Confirm, applyRawReturn } from '@/api/board' +import {getToken} from "@/utils/auth"; const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { name: 'Board1', - dicts: ['mes_plan_detail_status','wms_raw_return_task_type'], + dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type'], components: { Chart, PrintPage }, data() { return { + 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' + }, + ], + SOPModel: true, + pictureDetailModel: false, + dialogImageUrl: '', returnModelVisible: false, - returnModelForm:{}, - WarehousesList:[], + returnModelForm: {}, + WarehousesList: [], PrintData: {}, printModel: false, nowNum1: 1, @@ -631,9 +738,12 @@ export default { }, returnModelFormRules: { taskType: [ - { required: true, message: '请选择退库类型', trigger: 'change' } + {required: true, message: '请选择退库类型', trigger: 'change'} ], }, + headers: { + Authorization: "Bearer " + getToken(), + }, } }, @@ -1108,31 +1218,31 @@ export default { }, returnMaterial(e) { this.returnModelVisible = true - this.returnModelForm = {materialName:this.nowMaterial,...e.row} + this.returnModelForm = {materialName: this.nowMaterial, ...e.row} }, - setReturnModelForm(){ + setReturnModelForm() { getWarehouses({ - warehouseFloor:1, - materialBarcode:this.returnModelForm.materialBarcode - }).then(e=>{ - this.WarehousesList = e.data.map(v=>{ + warehouseFloor: 1, + materialBarcode: this.returnModelForm.materialBarcode + }).then(e => { + this.WarehousesList = e.data.map(v => { return { - label:v.warehouseName, - value:v.warehouseId, + label: v.warehouseName, + value: v.warehouseId, } }) }) }, - returnModelConfirm(){ + returnModelConfirm() { this.$refs.returnModelForm.validate((valid) => { if (valid) { let data = {} - let keys = ['warehouseId','planCode','planDetailCode','productId','materialBarcode','planAmount','taskType','applyReason'] - keys.forEach(v=>{ + let keys = ['warehouseId', 'planCode', 'planDetailCode', 'productId', 'materialBarcode', 'planAmount', 'taskType', 'applyReason'] + keys.forEach(v => { data[v] = this.returnModelForm[v] }) - applyRawReturn(data).then(v=>{ - if(v.code === 200){ + applyRawReturn(data).then(v => { + if (v.code === 200) { this.$message({ message: '退库成功', type: 'success' @@ -1144,7 +1254,22 @@ export default { return false; } }); - } + }, + + //查看图纸预览 + 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()) + }, } } @@ -1260,4 +1385,8 @@ export default { /deep/ .dialog .el-dialog__body { padding: 0 !important; } + +/deep/ .el-upload { + display: none; +} diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index 3051fb5..000e089 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -364,7 +364,7 @@
- + @@ -372,7 +372,7 @@ - +