From 87d2aa5cdc9c067d04d58207f299177445718983 Mon Sep 17 00:00:00 2001 From: xs Date: Sat, 22 Jun 2024 16:02:24 +0800 Subject: [PATCH] =?UTF-8?q?2.4.6=20MES:=E5=8E=9F=E6=9D=90=E6=96=99?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E5=AE=8C=E5=96=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw-ui/src/views/mes/barcode/index.vue | 43 +++++++++++++++++---------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/hw-ui/src/views/mes/barcode/index.vue b/hw-ui/src/views/mes/barcode/index.vue index 71bd28a..246be6f 100644 --- a/hw-ui/src/views/mes/barcode/index.vue +++ b/hw-ui/src/views/mes/barcode/index.vue @@ -82,6 +82,7 @@ icon="el-icon-printer" size="mini" @click="handlePrintBarcodes" + :disabled="batchPrintBtnDisabled" v-hasPermi="['mes:barcode:print']" >打印 @@ -408,13 +409,13 @@ import { listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode, printBarcodes, getMaterialInfoByErpId, selectProductBarcodeInfoByBarcodeInfo, - addInternalBarcode,regenerateBarcode + addInternalBarcode, regenerateBarcode } from "@/api/mes/barcode"; import addPurchaseOrder from '@//views/mes/purchaseOrder/addPurchaseOrder.vue'; export default { name: "Barcode", - dicts: ['bind_status', 'active_flag', 'barcode_type','mes_safe_flag','mes_print_flag'], + dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_safe_flag', 'mes_print_flag'], components: { 'add-purchaseOrder': addPurchaseOrder }, @@ -552,6 +553,7 @@ export default { ], }, + batchPrintBtnDisabled: false }; }, created() { @@ -687,9 +689,21 @@ export default { /** 打印条码按钮操作 */ handlePrintBarcodes(row) { const barcodeIds = row.barcodeId || this.ids; + if (barcodeIds == null || barcodeIds == '') { + this.$modal.msgWarning("请选择要打印的物料条码"); + return; + } + + if (row.printFlag) { + row.printFlag = '1'; + } else { + this.batchPrintBtnDisabled = true; + } + printBarcodes(barcodeIds).then(response => { this.$modal.msgSuccess("打印条码成功"); this.getList(); + this.batchPrintBtnDisabled = false; }).catch(() => { }); @@ -701,7 +715,7 @@ export default { const barcodeInfo = row.barcodeInfo; this.$modal.confirm('重新生成后之前的条码将会作废,是否确认重新生成条码内容为"' + barcodeInfo + '"的数据项?').then(function () { - return regenerateBarcode({"barcodeId":barcodeId,"barcodeInfo":barcodeInfo}); + return regenerateBarcode({"barcodeId": barcodeId, "barcodeInfo": barcodeInfo}); }).then(() => { this.getList(); this.$modal.msgSuccess("重新生成成功"); @@ -812,28 +826,27 @@ export default { return; } - this.$set(this.internalForm,"materialId",response.data.materialId); - this.$set(this.internalForm,"materialCode",response.data.materialCode); - this.$set(this.internalForm,"materialName",response.data.materialName); - this.$set(this.internalForm,"productionDate",response.data.productionDate); - this.$set(this.internalForm,"saleOrderId",response.data.saleOrderId); - this.$set(this.internalForm,"saleorderCode",response.data.saleorderCode); + this.$set(this.internalForm, "materialId", response.data.materialId); + this.$set(this.internalForm, "materialCode", response.data.materialCode); + this.$set(this.internalForm, "materialName", response.data.materialName); + this.$set(this.internalForm, "productionDate", response.data.productionDate); + this.$set(this.internalForm, "saleOrderId", response.data.saleOrderId); + this.$set(this.internalForm, "saleorderCode", response.data.saleorderCode); }); }, - /** 提交按钮 */ submitInternalForm() { this.$refs["internalForm"].validate(valid => { if (valid) { - addInternalBarcode(this.internalForm).then(response => { - this.$modal.msgSuccess("新增成功"); - this.internalOpen = false; - this.getList(); - }); + addInternalBarcode(this.internalForm).then(response => { + this.$modal.msgSuccess("新增成功"); + this.internalOpen = false; + this.getList(); + }); } });