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) {
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();
},
/** 提交按钮 */

View File

@ -259,7 +259,7 @@
style="width: 220px"
/>
</el-form-item>
<el-form-item label="优惠券有效期(天)" prop="couponReductionDays">
<el-input
maxlength="5"
@ -271,19 +271,19 @@
</el-form-item>
<el-form-item label="优惠券面额" prop="couponPrice">
<el-input
@input.native="changeInput($event)"
@keyup.native="form.couponPrice =oninput(form.couponPrice) "
v-model="form.couponPrice"
maxlength="8"
oninput="value=value.replace(/[^\d]/g,'')"
placeholder="请输入优惠券面额,单位:元"
style="width: 220px"
/>
</el-form-item>
<el-form-item label="优惠券适用门槛" prop="couponConsumePrice">
<el-input
@input.native="changeInput($event)"
@keyup.native="form.couponConsumePrice =oninput(form.couponConsumePrice) "
maxlength="8"
oninput="value=value.replace(/[^\d]/g,'')"
v-model="form.couponConsumePrice"
placeholder="请输入优惠券适用门槛"
style="width: 220px"
@ -383,8 +383,6 @@ import {
export default {
name: "Coupon",
data() {
return {
//
loading: true,
@ -501,7 +499,6 @@ export default {
required: true,
message: "请输入优惠券面额",
trigger: "blur",
},
],
couponDescription: [
@ -539,7 +536,32 @@ export default {
this.getList();
},
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() {
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) {