修改
This commit is contained in:
parent
9c63477c5b
commit
622a50df62
@ -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();
|
||||
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user