From d0e719bd6bb8d2a840211d60efbb46b83d77455d Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期四, 21 九月 2023 09:51:54 +0800 Subject: [PATCH] 添加玻璃尺寸不在范围内的提示并不允许上片 --- CanadaMes-ui/src/views/home/index.vue | 89 +++++++++++++++++++++++--------------------- 1 files changed, 47 insertions(+), 42 deletions(-) diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue index cc2c24d..82c639a 100644 --- a/CanadaMes-ui/src/views/home/index.vue +++ b/CanadaMes-ui/src/views/home/index.vue @@ -302,22 +302,22 @@ <el-dialog :visible.sync="dialogFormVisible" :title="$t('Please confirm the glass information')"> <el-form :model="form" label-width="100px" style="padding-right: 30px"> <el-form-item :label="$t('order')"> - <el-input v-model="form.orderno" autocomplete="off" /> + <el-input v-model="form.orderId" autocomplete="off" /> + </el-form-item> + <el-form-item :label="$t('glassid')"> + <el-input v-model="form.glassId" autocomplete="off" /> </el-form-item> <el-form-item :label="$t('length')"> - <el-input v-model="form.length" autocomplete="off" /> + <el-input v-model="form.height" autocomplete="off" /> </el-form-item> <el-form-item :label="$t('width')"> <el-input v-model="form.width" autocomplete="off" /> </el-form-item> - <el-form-item :label="$t('coating')"> - <el-input v-model="form.coating" autocomplete="off" /> - </el-form-item> </el-form> <template #footer> <span class="dialog-footer"> - <el-button @click="cancal()">{{ $t('cancal') }}</el-button> <el-button @click="sbumitglassid()" type="primary">{{ $t('confirm') }}</el-button> + <el-button @click="cancal()">{{ $t('cancal') }}</el-button> </span> </template> </el-dialog> @@ -332,8 +332,8 @@ </el-form> <template #footer> <span class="dialog-footer"> - <el-button @click="cancal1()">{{ $t('cancal') }}</el-button> <el-button @click="getOrder();" type="primary">{{ $t('confirm') }}</el-button> + <el-button @click="cancal1()">{{ $t('cancal') }}</el-button> </span> </template> </el-dialog> @@ -370,7 +370,7 @@ </template> <script> -import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword } from "../../api/home"; +import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword, SelectGlassByGlassID } from "../../api/home"; import LanguageMixin from '../../lang/LanguageMixin' @@ -386,10 +386,10 @@ dialogFormVisible2: false, dialogFormVisible3: false, form: { - orderno: "NG2210210", - length: 800, - width: 1000, - coating: "red", + orderId: "", + glassId: "", + height: "", + width: "" }, form1: { order: "NG2210210", @@ -454,8 +454,6 @@ this.car2 = 210 + 8.15 * Math.abs(obj.params[0][1] - this.carlist[1]['start']) / Math.abs(this.carlist[1]['end'] - this.carlist[1]['start']) * 100; // this.car1 = 210 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100; // this.car2 = 300 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100; - console.log(obj.params[0][1], this.carlist[1]['start']); - console.log(obj.params[0][0], this.carlist[0]['start']); } this.tableData = obj.tableData[0]; this.cagelist1 = obj.cagelist1[0]; @@ -464,7 +462,6 @@ this.cagelist4 = obj.cagelist4[0]; this.tasklist1 = obj.tasklist1[0]; this.tasklist2 = obj.tasklist2[0]; - console.log(this.cagelist4); this.alarm = obj.alarmmg[0]; this.loadglassheight = obj.loadglassheight; this.zhuangtai = obj.zhuangtai[0]; @@ -518,7 +515,6 @@ }); Loadcarlist().then(res => { this.carlist = res.data.carlist; - console.log(this.carlist); }); SelectPassword().then(res => { this.password = res.data.password; @@ -557,37 +553,41 @@ //鎵嬪姩涓婄墖 sbumitglassid() { if (this.form.order != "") { - if (this.zhuangtai == true) { - Addglassid(this.glassid).then(res => { - if (res.data.message2 == 200) { - this.$message.success(this.$t('Operation successful')); - this.cancal(); - } else if (res.data.message2 == 500) { - this.$message.success(this.$t('There are currently tasks')); - } - else if (res.data.message2 == 300) { - this.$message.success(this.$t('There is no such glass')); - } - else if (res.data.message2 == 400) { - this.$message.success(this.$t('There is no such grid')); - } - }); + if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) { + this.$message.success(this.$t('The glass size is not within the range')); } else { - this.$message.success(this.$t('There are currently tasks')); + if (this.zhuangtai == true) { + Addglassid(this.glassid).then(res => { + if (res.data.message2 == 200) { + this.$message.success(this.$t('Operation successful')); + this.cancal(); + } else if (res.data.message2 == 500) { + this.$message.success(this.$t('There are currently tasks')); + } + else if (res.data.message2 == 300) { + this.$message.success(this.$t('There is no such glass')); + } + else if (res.data.message2 == 400) { + this.$message.success(this.$t('There is no such grid')); + } + }); + } else { + this.$message.success(this.$t('There are currently tasks')); + } } - } }, showform() { if (this.glassid != "") { - this.form = - { - orderno: "NG2210210", - length: 800, - width: 1000, - coating: "red", - }; - this.dialogFormVisible = true; + SelectGlassByGlassID(this.glassid).then(res => { + if(res.data.form!=null){ + this.form = res.data.form; + this.dialogFormVisible = true; + }else{ + this.$message.success(this.$t('There is no such glass')); + } + }); + } }, showform1() { @@ -604,7 +604,12 @@ }, cancal() { this.dialogFormVisible = false; - this.form = {}; + this.form = { + orderId: "", + glassId: "", + height: "", + width: "" + }; }, cancal1() { this.dialogFormVisible1 = false; -- Gitblit v1.8.0