diff --git a/package.json b/package.json index a94d3b70..60d05e19 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "highlight.js": "9.18.5", "js-beautify": "1.13.0", "js-cookie": "3.0.1", + "jsbarcode": "^3.11.6", "jsencrypt": "3.0.0-rc.1", "less": "^3.9.0", "less-loader": "^5.0.0", diff --git a/src/views/device/faultReport/index.vue b/src/views/device/faultReport/index.vue index f32e59a2..cac3d4df 100644 --- a/src/views/device/faultReport/index.vue +++ b/src/views/device/faultReport/index.vue @@ -897,6 +897,9 @@ {{ form.repairDestination }} + {{ + form.auditOpinion + }} - + width="150" + /> - 待审核 + 审核通过 驳回 @@ -1841,6 +1841,10 @@ export default { auditOpinion: null, // 多个维修单号 orderCodes: [], + //多个维修状态 + workStatus: [], + //多个审核状态 + resultInspect: [], // 查询参数 queryParams: { pageNum: 1, @@ -2212,6 +2216,8 @@ export default { handleSelectionChange(selection) { this.ids = selection.map((item) => item.workId); this.orderCodes = selection.map((item) => item.workCode); + this.workStatus = selection.map((item) => item.workStatus); + this.resultInspect = selection.map((item) => item.resultInspect); this.single = selection.length !== 1; this.multiple = !selection.length; }, @@ -2452,6 +2458,7 @@ export default { } }); }, + // 点击结果检验按钮 clickInspect() { if (this.ids.length == 0 || this.ids == null) { @@ -2461,10 +2468,38 @@ export default { }); return; } - // 如果审核通过 那么就只是展示? - //需要加一个结果检验 - this.inspectDialog = true; - this.inspect = "1"; + + let workStatusMsg = true; + this.workStatus.forEach((item) => { + if(item == '0'){ + workStatusMsg = false; + } + }); + + let resultInspectMsg = true; + this.resultInspect.forEach((item) => { + if(item == '1'){ + resultInspectMsg = false; + } + }); + + if (workStatusMsg && resultInspectMsg) { + this.inspectDialog = true; + this.inspect = "1";//默认审核通过 + this.auditOpinion = null;//默认为空 + }else if(workStatusMsg == false){ + this.$message({ + message: "您选择的维修工单存在未完成的工单!", + type: "warning", + }); + return; + }else if(resultInspectMsg == false){ + this.$message({ + message: "您选择的维修工单存在已经审核过的工单,不能再次审核!", + type: "warning", + }); + return; + } }, // 提交检验信息 @@ -2479,10 +2514,17 @@ export default { checkRepairWorkOrder(data).then((response) => { this.getList(); this.inspectDialog = false; - this.$message({ + if(response.code = 500 ){ + this.$message({ + message: response.msg, + type: "warning", + }); + }else{ + this.$message({ message: "提交成功!", type: "success", }); + } }); }, //设备选择 diff --git a/src/views/mes/prepare/index.vue b/src/views/mes/prepare/index.vue index 1e1727a7..20c22471 100644 --- a/src/views/mes/prepare/index.vue +++ b/src/views/mes/prepare/index.vue @@ -233,8 +233,13 @@ - - 生产订单备料单({{printData.printTitle}}) + + + + + + 生产订单备料单({{printData.printTitle}}) + @@ -297,6 +302,8 @@ import { listPrepare, getPrepare, delPrepare, addPrepare, updatePrepare } from "@/api/mes/prepare"; import {printPrepareByCode,printPrepareXByCode} from "@/api/mes/prepareDetail"; import moment from "moment/moment"; +import JsBarcode from 'jsbarcode'; + // import { listPrepareDetail, getPrepareDetail, delPrepareDetail, addPrepareDetail, updatePrepareDetail } from "@/api/mes/prepareDetail"; // import Detail from "./prepareDetail.vue"; export default { @@ -323,6 +330,7 @@ export default { factory: null, productDate: null, workTable: [], + barcode:null,//打印生产物料和反冲物料的条码 }, printDialogVisible: false, // 遮罩层 @@ -400,6 +408,9 @@ export default { created() { this.getList(); }, + mounted() { + this.generateBarcode(); + }, methods: { //产品编码格式化 productCodeFormate(row, column, cellValue){ @@ -463,6 +474,8 @@ export default { this.printData.prodLineCode = response.data.mesPrepare.prodLineCode this.refreshNewWorkerTable = true // 立即将refreshProTable设置为true,显示表格 this.newWorkerLoading = false // 设置加载状态为false,表示加载完成 + + this.generateBarcode(this.selectPrepare[0].workorderCode); //条码 根据工单号生成 }) }, // 打印预览(反冲物料) @@ -503,8 +516,21 @@ export default { this.printData.workTable = chunkedArray; this.refreshNewWorkerTable = true // 立即将refreshProTable设置为true,显示表格 this.newWorkerLoading = false // 设置加载状态为false,表示加载完成 + + this.generateBarcode(this.printData.printDate); //条码 根据打印日期生成 }) }, + + //打印条码 + generateBarcode(barcode){ + JsBarcode("#barcode", barcode, { + format: "CODE128", + height:75, + width:2, + displayValue: true, + }); + }, + // 生成表头序号 indexMethod(index){ return index+1 ; @@ -629,10 +655,16 @@ export default {