|
@@ -11,36 +11,37 @@
|
|
|
</el-alert>
|
|
|
<el-row>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ prop="minMonthFee"
|
|
|
+ label="月度团练宝机构定价范围最低:"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
]"
|
|
|
>
|
|
|
- 月度团练宝机构定价范围最低:
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form.minMonthFee"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
- 最高
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ label="最高"
|
|
|
+ prop="maxMonthFee"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
+ { validator: validateMonthMax, trigger: 'blur' }
|
|
|
]"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form.maxMonthFee"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
@@ -49,36 +50,37 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ prop="minQuarterlyFee"
|
|
|
+ label="季度团练宝机构定价范围最低:"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
]"
|
|
|
>
|
|
|
- 季度团练宝机构定价范围最低:
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form.minQuarterlyFee"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
- 最高
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ label="最高"
|
|
|
+ prop="maxQuarterlyFee"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
+ { validator: validateQuarterlyMax, trigger: 'blur' }
|
|
|
]"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form['maxQuarterlyFee']"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
@@ -87,36 +89,37 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ prop="minHalfYearFee"
|
|
|
+ label="半年团练宝机构定价范围最低:"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
]"
|
|
|
>
|
|
|
- 半年团练宝机构定价范围最低:
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form['minHalfYearFee']"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
- 最高
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ prop="maxHalfYearFee"
|
|
|
+ label="最高"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
+ { validator: validateHalfYearMax, trigger: 'blur' }
|
|
|
]"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form['maxHalfYearFee']"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
@@ -125,36 +128,37 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ prop="minYearFee"
|
|
|
+ label="年度团练宝机构定价范围最低:"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
]"
|
|
|
>
|
|
|
- 年度团练宝机构定价范围最低:
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form['minYearFee']"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
- 最高
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- prop="190"
|
|
|
+ prop="maxYearFee"
|
|
|
+ label="最高"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: false,
|
|
|
pattern: /^[1-9][0-9]*$/,
|
|
|
- message: '请输入正确的账号数量',
|
|
|
+ message: '请输入正确的价格',
|
|
|
},
|
|
|
+ { validator: validateYearMax, trigger: 'blur' }
|
|
|
]"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="form['190']"
|
|
|
+ v-model="form['maxYearFee']"
|
|
|
placeholder="请输入金额"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
@@ -170,17 +174,22 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-// {"maxDayFee": 680,"maxMonthFee": 680,"maxHalfYearFee": 4080,"maxYearFee": 8160,"maxQuarterlyFee": 2040,"minDayFee": 680,"minMonthFee": 680,"minQuarterlyFee": 1880,"minHalfYearFee": 3580,"minYearFee": 6880}
|
|
|
import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings"; // 平台的修改和查
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ id: null,
|
|
|
form: {
|
|
|
- maxDayFee: null,
|
|
|
+ // maxDayFee: null,
|
|
|
+ // minDayFee: null,
|
|
|
+ minMonthFee: null,
|
|
|
maxMonthFee: null,
|
|
|
+ minQuarterlyFee: null,
|
|
|
+ maxQuarterlyFee: null,
|
|
|
+ minHalfYearFee: null,
|
|
|
maxHalfYearFee: null,
|
|
|
+ minYearFee: null,
|
|
|
maxYearFee: null,
|
|
|
- maxQuarterlyFee: null,
|
|
|
},
|
|
|
questionList: [],
|
|
|
rulesVisiable: false,
|
|
@@ -196,14 +205,19 @@ export default {
|
|
|
const paramName = 'cloud_price_range'
|
|
|
res.data.forEach((item) => {
|
|
|
if(item.paramName == paramName) {
|
|
|
- const itemValue = item.paranValue
|
|
|
+ const itemValue = item.paranValue ? JSON.parse(item.paranValue) : null
|
|
|
+ if(itemValue) {
|
|
|
+ this.id = item.id
|
|
|
+ this.form = itemValue
|
|
|
+ }
|
|
|
+ console.log(itemValue)
|
|
|
// this.$set(this.form, item.id, item.paranValue);
|
|
|
}
|
|
|
// this.form[item.paramName] = item.paranValue
|
|
|
// this.$set(this.form, item.id, item.paranValue);
|
|
|
});
|
|
|
// this.$forceUpdate()
|
|
|
- console.log(this.form);
|
|
|
+ // console.log(this.form);
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
|
}
|
|
@@ -211,13 +225,11 @@ export default {
|
|
|
async save() {
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- let param = [];
|
|
|
- for (let i in this.form) {
|
|
|
- param.push({
|
|
|
- id: i,
|
|
|
- paranValue: this.form[i],
|
|
|
- });
|
|
|
- }
|
|
|
+ let param = [{
|
|
|
+ id: this.id,
|
|
|
+ paranValue: JSON.stringify(this.form)
|
|
|
+ }];
|
|
|
+
|
|
|
try {
|
|
|
const res = await sysConfigUpdate(param);
|
|
|
this.$message.success("保存成功");
|
|
@@ -228,9 +240,48 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ validateMonthMax(rule, value, callback) {
|
|
|
+ const one = Number(value);
|
|
|
+ const min = Number(this.form.minMonthFee);
|
|
|
+ if (!min || one >= min) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ return callback(new Error("输入值不得小于月度最低金额"));
|
|
|
+ },
|
|
|
+ validateQuarterlyMax(rule, value, callback) {
|
|
|
+ const one = Number(value);
|
|
|
+ const min = Number(this.form.minMonthFee);
|
|
|
+ if (!min || one >= min) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ return callback(new Error("输入值不得小于季度最低金额"));
|
|
|
+ },
|
|
|
+ validateHalfYearMax(rule, value, callback) {
|
|
|
+ const one = Number(value);
|
|
|
+ const min = Number(this.form.minMonthFee);
|
|
|
+ if (!min || one >= min) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ return callback(new Error("输入值不得小于半年最低金额"));
|
|
|
+ },
|
|
|
+ validateYearMax(rule, value, callback) {
|
|
|
+ const one = Number(value);
|
|
|
+ const min = Number(this.form.minMonthFee);
|
|
|
+ if (!min || one >= min) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ return callback(new Error("输入值不得小于年度最低金额"));
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@import "~@scss/views/courseRulersManager/index.scss";
|
|
|
+/deep/.el-form-item__label {
|
|
|
+ font-weight: 500;
|
|
|
+ color: #000;
|
|
|
+}
|
|
|
+/deep/.el-form-item__content {
|
|
|
+ display: inherit;
|
|
|
+}
|
|
|
</style>
|