From 873c8b1a33d7f11c638f8bf58be2527da60d79f6 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 6 May 2025 16:49:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sys/labeltemplate.vue | 44 ++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/src/views/sys/labeltemplate.vue b/src/views/sys/labeltemplate.vue index 6a158697..af830ba8 100644 --- a/src/views/sys/labeltemplate.vue +++ b/src/views/sys/labeltemplate.vue @@ -30,10 +30,19 @@ - + - + + + + + + @@ -55,7 +64,7 @@ return { apiObj: this.$API.cm.labeltemplate.list, selection: [], - checkList: [], + options: [], search: { keyword: null }, @@ -80,8 +89,15 @@ } }, mounted() { + this.getProcess(); }, methods: { + getProcess(){ + let that = this; + that.$API.mtm.process.list.req({page:0}).then(res=>{ + that.options = res; + }) + }, //添加模板 labelTemplateAdd(){ this.limitedVisible = true; @@ -92,27 +108,21 @@ }, submitHandle(){ let that = this; + this.$refs.addForm.validate( (valid) => { if (valid) { this.isSaveing = true; - str = [ - "SIZE 70 mm,100 mm", - "GAP 7 mm,7 mm", - "CLS", - "REFERENCE 0,0", - 'QRCODE 30,400,H,5,A,0,"' +code +'"', - "WINTEXT 240,550,28,90,0,0,Simhei," + row.number, - "PRINT 1", - ]; - let res; + let arr = []; + arr = that.addForm.commands.split("\n"); + that.addForm.commands = arr; if(this.type==='add'){ - this.$API.system.labelTemplate.create.req(that.addForm).then(res=>{ + this.$API.cm.labeltemplate.create.req(that.addForm).then(res=>{ this.isSaveing = false; this.limitedVisible = false; this.$refs.table.refresh(); }).catch(e=>{this.isSaveing = false;}) }else{ - this.$API.system.labelTemplate.update.req(that.addForm.id,that.addForm).then(res=>{ + this.$API.cm.labeltemplate.update.req(that.addForm.id,that.addForm).then(res=>{ this.isSaveing = false; this.limitedVisible = false; this.$refs.table.refresh(); @@ -127,14 +137,14 @@ this.type='edit'; this.addForm.id=row.id; this.addForm.name=row.name; - this.addForm.commands=row.commands; + this.addForm.commands=row.commands.join("\n"); this.limitedVisible = true; }, //删除模板 async labelTemplateDel(row){ var id = row.id; - var res = await this.$API.system.labelTemplate.delete.req(id); + var res = await this.$API.cm.labeltemplate.delete.req(id); if(res.err_msg){ this.$message.error(res.err_msg) }else{