From 622a50df62739cb3c94ff84fdbb6ace5bd001e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Wed, 1 Mar 2023 16:50:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/certificate/index.vue | 6 +-- src/views/system/coupon/index.vue | 61 ++++++++++++++++++-------- 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/src/views/system/certificate/index.vue b/src/views/system/certificate/index.vue index 396adab..704f40f 100644 --- a/src/views/system/certificate/index.vue +++ b/src/views/system/certificate/index.vue @@ -596,15 +596,15 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { console.log(row) - this.reset(); + this.open = true; const hospitalPersonId = row.hospitalPersonId || this.hospitalPersonIds; - // const id = row.id || this.ids; getCertificate(hospitalPersonId).then((response) => { console.log(response,'打印返回的值') this.form = response.data; - this.open = true; + this.title = "修改健康咨询-科室人员资质证书信息"; }); + this.reset(); }, /** 提交按钮 */ diff --git a/src/views/system/coupon/index.vue b/src/views/system/coupon/index.vue index 5e2391f..8cc112e 100644 --- a/src/views/system/coupon/index.vue +++ b/src/views/system/coupon/index.vue @@ -259,7 +259,7 @@ style="width: 220px" /> - + 1 && len1 == 0 && len2 != ".") { + str = str.substr(1, 1); + } + //第一位不能是. + if (len1 == ".") { + str = ""; + } + //限制只能输入一个小数点 + if (str.indexOf(".") != -1) { + const str_ = str.substr(str.indexOf(".") + 1); + if (str_.indexOf(".") != -1) { + str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1); + } + } + //正则替换 + str = str.replace(/[^\d^.\\ .]+/g, ""); // 保留数字和小数点 + str = str.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); // 小数点后只能输两位 + str = str.replace(/^(-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); + return str; + }, + /** 查询优惠券信息列表 */ getList() { this.loading = true; @@ -550,10 +572,13 @@ export default { }); }, changeInput(e) { - if (e.target.value.indexOf('.') >= 0) { - e.target.value = e.target.value.substring(0, e.target.value.indexOf('.') + 3); - } - }, + if (e.target.value.indexOf(".") >= 0) { + e.target.value = e.target.value.substring( + 0, + e.target.value.indexOf(".") + 3 + ); + } + }, // 取消按钮 cancel() { @@ -617,13 +642,13 @@ export default { }, /** 提交按钮 */ submitForm() { - if(this.form.couponPrice){ - this.form.couponPrice = Number(this.form.couponPrice ) + if (this.form.couponPrice) { + this.form.couponPrice = Number(this.form.couponPrice); } - if(this.form.couponConsumePrice){ - this.form.couponConsumePrice = Number(this.form.couponConsumePrice ) + if (this.form.couponConsumePrice) { + this.form.couponConsumePrice = Number(this.form.couponConsumePrice); } - + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id != null) {