MES:原材料条码完善逻辑
master
xs 5 months ago
parent 24942596ca
commit 87d2aa5cdc

@ -82,6 +82,7 @@
icon="el-icon-printer" icon="el-icon-printer"
size="mini" size="mini"
@click="handlePrintBarcodes" @click="handlePrintBarcodes"
:disabled="batchPrintBtnDisabled"
v-hasPermi="['mes:barcode:print']" v-hasPermi="['mes:barcode:print']"
>打印 >打印
</el-button> </el-button>
@ -408,13 +409,13 @@
import { import {
listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode, listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode,
printBarcodes, getMaterialInfoByErpId, selectProductBarcodeInfoByBarcodeInfo, printBarcodes, getMaterialInfoByErpId, selectProductBarcodeInfoByBarcodeInfo,
addInternalBarcode,regenerateBarcode addInternalBarcode, regenerateBarcode
} from "@/api/mes/barcode"; } from "@/api/mes/barcode";
import addPurchaseOrder from '@//views/mes/purchaseOrder/addPurchaseOrder.vue'; import addPurchaseOrder from '@//views/mes/purchaseOrder/addPurchaseOrder.vue';
export default { export default {
name: "Barcode", 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: { components: {
'add-purchaseOrder': addPurchaseOrder 'add-purchaseOrder': addPurchaseOrder
}, },
@ -552,6 +553,7 @@ export default {
], ],
}, },
batchPrintBtnDisabled: false
}; };
}, },
created() { created() {
@ -687,9 +689,21 @@ export default {
/** 打印条码按钮操作 */ /** 打印条码按钮操作 */
handlePrintBarcodes(row) { handlePrintBarcodes(row) {
const barcodeIds = row.barcodeId || this.ids; 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 => { printBarcodes(barcodeIds).then(response => {
this.$modal.msgSuccess("打印条码成功"); this.$modal.msgSuccess("打印条码成功");
this.getList(); this.getList();
this.batchPrintBtnDisabled = false;
}).catch(() => { }).catch(() => {
}); });
@ -701,7 +715,7 @@ export default {
const barcodeInfo = row.barcodeInfo; const barcodeInfo = row.barcodeInfo;
this.$modal.confirm('重新生成后之前的条码将会作废,是否确认重新生成条码内容为"' + barcodeInfo + '"的数据项?').then(function () { this.$modal.confirm('重新生成后之前的条码将会作废,是否确认重新生成条码内容为"' + barcodeInfo + '"的数据项?').then(function () {
return regenerateBarcode({"barcodeId":barcodeId,"barcodeInfo":barcodeInfo}); return regenerateBarcode({"barcodeId": barcodeId, "barcodeInfo": barcodeInfo});
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("重新生成成功"); this.$modal.msgSuccess("重新生成成功");
@ -812,28 +826,27 @@ export default {
return; return;
} }
this.$set(this.internalForm,"materialId",response.data.materialId); this.$set(this.internalForm, "materialId", response.data.materialId);
this.$set(this.internalForm,"materialCode",response.data.materialCode); this.$set(this.internalForm, "materialCode", response.data.materialCode);
this.$set(this.internalForm,"materialName",response.data.materialName); this.$set(this.internalForm, "materialName", response.data.materialName);
this.$set(this.internalForm,"productionDate",response.data.productionDate); this.$set(this.internalForm, "productionDate", response.data.productionDate);
this.$set(this.internalForm,"saleOrderId",response.data.saleOrderId); this.$set(this.internalForm, "saleOrderId", response.data.saleOrderId);
this.$set(this.internalForm,"saleorderCode",response.data.saleorderCode); this.$set(this.internalForm, "saleorderCode", response.data.saleorderCode);
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitInternalForm() { submitInternalForm() {
this.$refs["internalForm"].validate(valid => { this.$refs["internalForm"].validate(valid => {
if (valid) { if (valid) {
addInternalBarcode(this.internalForm).then(response => { addInternalBarcode(this.internalForm).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.internalOpen = false; this.internalOpen = false;
this.getList(); this.getList();
}); });
} }
}); });

Loading…
Cancel
Save