From 10f33fac3f3dda79435892d6a9829c314fe384a7 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Fri, 7 Jun 2024 22:32:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=BD=93=E4=BA=A7=E5=93=81=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/dailyReportNew/index.vue | 4 +- src/views/mes/mesLine/index.vue | 213 ++++++++++++++--------- src/views/mes/mesLine/selectMaterial.vue | 7 +- 3 files changed, 142 insertions(+), 82 deletions(-) diff --git a/src/views/mes/dailyReportNew/index.vue b/src/views/mes/dailyReportNew/index.vue index 58eb9258..5baa0657 100644 --- a/src/views/mes/dailyReportNew/index.vue +++ b/src/views/mes/dailyReportNew/index.vue @@ -74,10 +74,10 @@ - + - + diff --git a/src/views/mes/mesLine/index.vue b/src/views/mes/mesLine/index.vue index 06dc58de..a893a7e0 100644 --- a/src/views/mes/mesLine/index.vue +++ b/src/views/mes/mesLine/index.vue @@ -24,18 +24,18 @@ @keyup.enter.native="handleQuery" /> - + - + 导出 + + 导入 + + - - - - - - - + + + + + + + + - + + + + + + + + + + + + @@ -187,65 +210,47 @@ - - + + - - - - - - - 删除 - - - - - - - 选择产品 - - - - - - - - - - - - - + + + + + +
将文件拖到此处,或点击上传
+
+ 仅允许导入xls、xlsx格式文件。 + 下载模板 + +
+
+ +
+ " + response.msg + "", "导入结果", {dangerouslyUseHTMLString: true}); + this.getList(); + }, + // 导入-提交上传文件 + submitFileForm() { + this.$refs.upload.submit(); + }, + // 导入-下载模板 + importTemplate() { + this.download('/mes/mesLine/importTemplate', {}, `mes_product_template_${new Date().getTime()}.xlsx`) }, //物料选择确认 onSelectMaterial(obj) { - obj.map(item => { - if(item.productCode) { - if(this.form.productList.some(e => e.productCode === item.productCode)) { - this.$modal.msgError("该物料已存在"); - return; - } - this.form.productList.push(item); - } - }) - console.log(this.form.productList); + this.form.productName = obj[0].productName; + this.form.productCode = obj[0].productCode; }, deleteProduct(row) { const productCode = row.productCode; @@ -543,7 +593,12 @@ export default { return ''; } }, - + //产品编码格式化 + productCodeFormate(row, column, cellValue) { + if (cellValue != null) { + return cellValue.slice(7, 18); //返回值 + } + }, }, }; diff --git a/src/views/mes/mesLine/selectMaterial.vue b/src/views/mes/mesLine/selectMaterial.vue index e326fc78..4dfee3a7 100644 --- a/src/views/mes/mesLine/selectMaterial.vue +++ b/src/views/mes/mesLine/selectMaterial.vue @@ -135,7 +135,12 @@ export default { // 多选框选中数据 handleBomSelectionChange(selection) { - this.productList = selection; + if(selection.length==1){ + this.productList = selection; + }else{ + this.$modal.msgSuccess("请选择一个产品"); + } + },