diff --git a/src/views/mes/dv/machinery/index.vue b/src/views/mes/dv/machinery/index.vue index e5d6c42..7bd7c9b 100644 --- a/src/views/mes/dv/machinery/index.vue +++ b/src/views/mes/dv/machinery/index.vue @@ -154,7 +154,7 @@ icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['mes:dv:machinery:remove']" - >删除 + >删除 @@ -231,13 +231,7 @@ -
- -
- -
-
-
+
@@ -304,12 +298,13 @@ import {genCode} from "@/api/system/autocode/rule" import { getToken } from "@/utils/auth"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import BarcodeImg from "@/components/barcodeImg/index.vue" import {getBarcodeUrl} from "@/api/mes/wm/barcode"; export default { name: "Machinery", dicts: ['sys_yes_no','mes_machinery_status'], - components: { Treeselect }, + components: { Treeselect,BarcodeImg }, data() { return { //自动生成编码 @@ -484,7 +479,7 @@ export default { createBy: null, createTime: null, updateBy: null, - updateTime: null + updateTime: null }; this.autoGenFlag = false; this.resetForm("form"); @@ -516,7 +511,9 @@ export default { this.open = true; this.title = "查看设备信息"; this.optType = "view"; - this.getBarcodeUrl(); + this.$nextTick(()=>{ + this.$refs.barcodeImg.getBarcode(); + }) }); }, /** 新增按钮操作 */ @@ -543,19 +540,12 @@ export default { this.open = true; this.title = "修改设备"; this.optType = "edit"; - this.getBarcodeUrl(); - }); - }, - //获取二维码地址 - getBarcodeUrl(){ - this.barcodeParams.bussinessId = this.form.machineryId; - this.barcodeParams.bussinessCode = this.form.machineryCode; - getBarcodeUrl(this.barcodeParams).then( response =>{ - if(response.data != null){ - this.$set(this.form,'barcodeUrl',response.data.barcodeUrl);//强制刷新DOM - } + this.$nextTick(()=>{ + this.$refs.barcodeImg.getBarcode(); + }) }); }, + /** 提交按钮 */ submitForm: function() { this.$refs["form"].validate(valid => { @@ -645,4 +635,4 @@ export default { position: relative; display: inline-block; } - \ No newline at end of file + diff --git a/src/views/mes/md/mditem/index.vue b/src/views/mes/md/mditem/index.vue index bf19348..a2aa358 100644 --- a/src/views/mes/md/mditem/index.vue +++ b/src/views/mes/md/mditem/index.vue @@ -246,13 +246,7 @@ -
- -
- -
-
-
+
@@ -406,11 +400,11 @@ import { treeselect } from "@/api/mes/md/itemtype"; import Treeselect from "@riophae/vue-treeselect"; import { getBarcodeUrl } from "@/api/mes/wm/barcode"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; - +import BarcodeImg from "@/components/barcodeImg/index.vue" export default { name: "MdItem", dicts: ['sys_yes_no','mes_item_product'], - components: { Treeselect,ItemBom,SOPTab,SIPTab }, + components: { Treeselect,ItemBom,SOPTab,SIPTab,BarcodeImg }, data() { return { // 遮罩层 @@ -608,7 +602,9 @@ export default { this.open = true; this.title = "查看物料/产品"; this.optType = "view"; - this.getBarcodeUrl(); + this.$nextTick(()=>{ + this.$refs.barcodeImg.getBarcode(); + }) }); }, /** 新增按钮操作 */ @@ -632,7 +628,9 @@ export default { this.open = true; this.optType = "edit"; this.title = "修改物料/产品"; - this.getBarcodeUrl(); + this.$nextTick(()=>{ + this.$refs.barcodeImg.getBarcode(); + }) }); }, /** 提交按钮 */ diff --git a/src/views/mes/md/workshop/index.vue b/src/views/mes/md/workshop/index.vue index 0320545..9ea5468 100644 --- a/src/views/mes/md/workshop/index.vue +++ b/src/views/mes/md/workshop/index.vue @@ -98,7 +98,7 @@ - + -
- -
- -
-
-
+
@@ -201,8 +195,10 @@