This commit is contained in:
闫晓茹 2023-03-01 16:50:59 +08:00
parent 9c63477c5b
commit 622a50df62
2 changed files with 46 additions and 21 deletions

View File

@ -596,15 +596,15 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
console.log(row) console.log(row)
this.reset(); this.open = true;
const hospitalPersonId = row.hospitalPersonId || this.hospitalPersonIds; const hospitalPersonId = row.hospitalPersonId || this.hospitalPersonIds;
// const id = row.id || this.ids;
getCertificate(hospitalPersonId).then((response) => { getCertificate(hospitalPersonId).then((response) => {
console.log(response,'打印返回的值') console.log(response,'打印返回的值')
this.form = response.data; this.form = response.data;
this.open = true;
this.title = "修改健康咨询-科室人员资质证书信息"; this.title = "修改健康咨询-科室人员资质证书信息";
}); });
this.reset();
}, },
/** 提交按钮 */ /** 提交按钮 */

View File

@ -259,7 +259,7 @@
style="width: 220px" style="width: 220px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="优惠券有效期(天)" prop="couponReductionDays"> <el-form-item label="优惠券有效期(天)" prop="couponReductionDays">
<el-input <el-input
maxlength="5" maxlength="5"
@ -271,19 +271,19 @@
</el-form-item> </el-form-item>
<el-form-item label="优惠券面额" prop="couponPrice"> <el-form-item label="优惠券面额" prop="couponPrice">
<el-input <el-input
@input.native="changeInput($event)" @keyup.native="form.couponPrice =oninput(form.couponPrice) "
v-model="form.couponPrice" v-model="form.couponPrice"
maxlength="8" maxlength="8"
oninput="value=value.replace(/[^\d]/g,'')"
placeholder="请输入优惠券面额,单位:元" placeholder="请输入优惠券面额,单位:元"
style="width: 220px" style="width: 220px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="优惠券适用门槛" prop="couponConsumePrice"> <el-form-item label="优惠券适用门槛" prop="couponConsumePrice">
<el-input <el-input
@input.native="changeInput($event)" @keyup.native="form.couponConsumePrice =oninput(form.couponConsumePrice) "
maxlength="8" maxlength="8"
oninput="value=value.replace(/[^\d]/g,'')"
v-model="form.couponConsumePrice" v-model="form.couponConsumePrice"
placeholder="请输入优惠券适用门槛" placeholder="请输入优惠券适用门槛"
style="width: 220px" style="width: 220px"
@ -383,8 +383,6 @@ import {
export default { export default {
name: "Coupon", name: "Coupon",
data() { data() {
return { return {
// //
loading: true, loading: true,
@ -501,7 +499,6 @@ export default {
required: true, required: true,
message: "请输入优惠券面额", message: "请输入优惠券面额",
trigger: "blur", trigger: "blur",
}, },
], ],
couponDescription: [ couponDescription: [
@ -539,7 +536,32 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
oninput(num) {
let str = num;
const len1 = str.substr(0, 1);
const len2 = str.substr(1, 1);
//0
if (str.length > 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() { getList() {
this.loading = true; this.loading = true;
@ -550,10 +572,13 @@ export default {
}); });
}, },
changeInput(e) { changeInput(e) {
if (e.target.value.indexOf('.') >= 0) { if (e.target.value.indexOf(".") >= 0) {
e.target.value = e.target.value.substring(0, e.target.value.indexOf('.') + 3); e.target.value = e.target.value.substring(
} 0,
}, e.target.value.indexOf(".") + 3
);
}
},
// //
cancel() { cancel() {
@ -617,13 +642,13 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
if(this.form.couponPrice){ if (this.form.couponPrice) {
this.form.couponPrice = Number(this.form.couponPrice ) this.form.couponPrice = Number(this.form.couponPrice);
} }
if(this.form.couponConsumePrice){ if (this.form.couponConsumePrice) {
this.form.couponConsumePrice = Number(this.form.couponConsumePrice ) this.form.couponConsumePrice = Number(this.form.couponConsumePrice);
} }
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {