|
@@ -1,11 +1,10 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
+ <div class="app-container" style="padding-top: 5px;">
|
|
|
<!--固态等级-->
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="handleAdd" v-hasPermi="['customer:setting:add']" >添加等级</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <p style="margin: 5px"><span class="textlineHeader">固定等级</span>
|
|
|
+ <el-button class="settingButton" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['customer:setting:add']" >添加固定等级</el-button>
|
|
|
+ </p>
|
|
|
+ <div class="cutLine firstLine"></div>
|
|
|
<el-table v-loading="loading" :data="settingList" >
|
|
|
<el-table-column label="id" align="center" prop="id" v-if="false"/>
|
|
|
<el-table-column label="等级名称" align="center" prop="grade" />
|
|
@@ -55,33 +54,79 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!--成长规则-->
|
|
|
+ <p style="margin-left: 5px; margin-top: 25px; margin-bottom: 5px;">
|
|
|
+ <span class="textlineHeader">成长规则</span>
|
|
|
+ <el-button icon="el-icon-plus" size="mini" @click="handleAddGrouthRules" class="settingButton">添加成长规则</el-button>
|
|
|
+ </p>
|
|
|
+ <div class="cutLine secLine"></div>
|
|
|
+ <el-table v-loading="loading" :data="grouthRuleList" >
|
|
|
+ <el-table-column label="id" align="center" prop="id" v-if="false" />
|
|
|
+ <el-table-column label="成长规则名称" align="center" prop="grouthValueName" />
|
|
|
+ <el-table-column label="消费值" align="center" prop="grouthValueConsume" />
|
|
|
+ <el-table-column label="成长值" align="center" prop="grouthValue" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope2">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="grouthRuleUpdate(scope2.row)"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="grouthRuleDelete(scope2.row)"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!--添加或修改成长规则-->
|
|
|
+ <el-dialog :title="title" :visible.sync="openGrouthRule" width="500px" append-to-body>
|
|
|
+ <el-form ref="formGrouthRule" :model="formGrouthRule" :rules="grouthRules" label-width="100px">
|
|
|
+ <el-form-item label="成长规则名称" prop="grouthValueName">
|
|
|
+ <el-input v-model="formGrouthRule.grouthValueName" placeholder="请输入成长规则名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="消费值" prop="grouthValueConsume">
|
|
|
+ <el-input v-model="formGrouthRule.grouthValueConsume" placeholder="请输入消费值" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="成长值" prop="grouthValue">
|
|
|
+ <el-input v-model="formGrouthRule.grouthValue" placeholder="请输入成长值" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFormGrouthRule">确 定</el-button>
|
|
|
+ <el-button @click="cancelGrouthRule">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
- <el-form ref="ruleForm" :model="ruleForm" :inline="true" label-width="100px" >
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="汽油消费" prop="gasoilConsume">
|
|
|
- <el-input size="small" v-model="ruleForm.gasoilConsume" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="获得成长值" prop="gasoilGrowthValue">
|
|
|
- <el-input size="small" v-model="ruleForm.gasoilGrowthValue" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="柴油消费" prop="dieseloilConsume">
|
|
|
- <el-input size="small" v-model="ruleForm.dieseloilConsume" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="获得成长值" prop="dieseloilGrowthValue">
|
|
|
- <el-input size="small" v-model="ruleForm.dieseloilGrowthValue" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
+<!-- <el-form ref="ruleForm" :model="ruleForm" inline="true" label-width="110px">-->
|
|
|
+<!-- <el-row>-->
|
|
|
+<!-- <el-col :span="6">-->
|
|
|
+<!-- <el-form-item label="汽油消费" prop="gasoilConsume">-->
|
|
|
+<!-- <el-input size="small" v-model="ruleForm.gasoilConsume" />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- <el-col :span="6">-->
|
|
|
+<!-- <el-form-item label="获得成长值" prop="gasoilGrowthValue">-->
|
|
|
+<!-- <el-input size="small" v-model="ruleForm.gasoilGrowthValue" />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </el-row>-->
|
|
|
+<!-- <el-row>-->
|
|
|
+<!-- <el-col :span="6">-->
|
|
|
+<!-- <el-form-item label="柴油消费" prop="dieseloilConsume">-->
|
|
|
+<!-- <el-input size="small" v-model="ruleForm.dieseloilConsume" />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- <el-col :span="6">-->
|
|
|
+<!-- <el-form-item label="获得成长值" prop="dieseloilGrowthValue">-->
|
|
|
+<!-- <el-input size="small" v-model="ruleForm.dieseloilGrowthValue" />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </el-row>-->
|
|
|
+<!-- <el-row>-->
|
|
|
<!-- <el-col :span="6">-->
|
|
|
<!-- <el-form-item label="会员充值" prop="memberRecharge">-->
|
|
|
<!-- <el-input size="small" v-model="ruleForm.memberRecharge" />-->
|
|
@@ -92,27 +137,14 @@
|
|
|
<!-- <el-input size="small" v-model="ruleForm.memberGrowthValue" />-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<!-- </el-col>-->
|
|
|
- </el-row>
|
|
|
- <el-row v-show="false">
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="id" prop="id">
|
|
|
- <el-input size="small" v-model="ruleForm.id" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">保存</el-button>
|
|
|
- </div>
|
|
|
+<!-- </el-row>-->
|
|
|
+<!-- </el-form>-->
|
|
|
|
|
|
<!--动态等级-->
|
|
|
- <el-form :model="selectParams" ref="selectFrom" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="handleAddDT" v-hasPermi="['customer:setting:add']" >添加动态等级</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <p style="margin-left: 5px; margin-top: 25px;"><span class="textlineHeader">动态等级</span>
|
|
|
+ <el-button class="settingButton" icon="el-icon-plus" size="mini" @click="handleAddDT" v-hasPermi="['customer:setting:add']" >添加动态等级</el-button>
|
|
|
+ </p>
|
|
|
+ <div class="cutLine"></div>
|
|
|
<el-table v-loading="loading" :data="DTsettingList" >
|
|
|
<el-table-column label="id" align="center" prop="id" v-if="false" />
|
|
|
<el-table-column label="等级名称" align="center" prop="grade" />
|
|
@@ -183,7 +215,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listSetting, getSetting, delSetting, addSetting, updateSetting, exportSetting } from "@/api/customer/setting";
|
|
|
+import { listSetting, getGrouthRuleList, addGrouthRule, editGrouthRule, delGrouthRule, getSetting, delSetting, addSetting, updateSetting, exportSetting } from "@/api/customer/setting";
|
|
|
|
|
|
export default {
|
|
|
name: "Setting",
|
|
@@ -202,6 +234,8 @@ export default {
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
// 客户优惠等级设置表格数据
|
|
|
+ ruleList: [],
|
|
|
+ grouthRuleList:[],
|
|
|
settingList: [],
|
|
|
DTsettingList: [],
|
|
|
// 弹出层标题
|
|
@@ -209,6 +243,7 @@ export default {
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
opendt: false,
|
|
|
+ openGrouthRule: false,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -218,11 +253,13 @@ export default {
|
|
|
gasoilDiscountLitre: null,
|
|
|
dieseloilDiscountLitre: null,
|
|
|
gradeType: null,
|
|
|
- gasoilConsume: null,
|
|
|
- gasoilGrowthValue: null,
|
|
|
- dieseloilConsume: null,
|
|
|
- dieseloilGrowthValue: null,
|
|
|
- growthValue: null,
|
|
|
+ grouthValueName: null,
|
|
|
+ grouthValueConsume: null,
|
|
|
+ grouthValue: null,
|
|
|
+ // gasoilConsume: null,
|
|
|
+ // gasoilGrowthValue: null,
|
|
|
+ // dieseloilConsume: null,
|
|
|
+ // dieseloilGrowthValue: null,
|
|
|
date: null,
|
|
|
deductionGrowthValue: null
|
|
|
},// 查询参数
|
|
@@ -235,29 +272,33 @@ export default {
|
|
|
gasoilDiscountLitre: null,
|
|
|
dieseloilDiscountLitre: null,
|
|
|
gradeType: null,
|
|
|
- gasoilConsume: null,
|
|
|
- gasoilGrowthValue: null,
|
|
|
- dieseloilConsume: null,
|
|
|
- dieseloilGrowthValue: null,
|
|
|
- growthValue: null,
|
|
|
+ grouthValueName: null,
|
|
|
+ grouthValueConsume: null,
|
|
|
+ grouthValue: null,
|
|
|
+ // gasoilConsume: null,
|
|
|
+ // gasoilGrowthValue: null,
|
|
|
+ // dieseloilConsume: null,
|
|
|
+ // dieseloilGrowthValue: null,
|
|
|
date: null,
|
|
|
deductionGrowthValue: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
+ formGrouthRule:{},
|
|
|
dtform: {},
|
|
|
ruleForm: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
},
|
|
|
+ grouthRules: {},
|
|
|
dtrules: {
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ this.getRuleList();
|
|
|
this.getList2();
|
|
|
- this.getList3();
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询客户优惠等级设置列表 */
|
|
@@ -270,6 +311,7 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
getList2() {
|
|
|
this.selectParams.gradeType="3";
|
|
|
this.loading = true;
|
|
@@ -280,18 +322,12 @@ export default {
|
|
|
|
|
|
});
|
|
|
},
|
|
|
- getList3() {
|
|
|
- this.selectParams.gradeType="2";
|
|
|
- this.loading = true;
|
|
|
- listSetting(this.selectParams).then(response => {
|
|
|
- this.ruleForm = response.data;
|
|
|
- });
|
|
|
- },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
+
|
|
|
// 取消按钮
|
|
|
cancelDT() {
|
|
|
this.opendt = false;
|
|
@@ -306,15 +342,18 @@ export default {
|
|
|
gasoilDiscountLitre: null,
|
|
|
dieseloilDiscountLitre: null,
|
|
|
gradeType: null,
|
|
|
- gasoilConsume: null,
|
|
|
- gasoilGrowthValue: null,
|
|
|
- dieseloilConsume: null,
|
|
|
- dieseloilGrowthValue: null,
|
|
|
- growthValue: null,
|
|
|
+ grouthValueName: null,
|
|
|
+ grouthValueConsume: null,
|
|
|
+ grouthValue: null,
|
|
|
+ // gasoilConsume: null,
|
|
|
+ // gasoilGrowthValue: null,
|
|
|
+ // dieseloilConsume: null,
|
|
|
+ // dieseloilGrowthValue: null,
|
|
|
date: null,
|
|
|
deductionGrowthValue: null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
+ //this.resetForm("formGrouthRule");
|
|
|
},
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
@@ -333,6 +372,81 @@ export default {
|
|
|
this.title = "修改客户优惠等级设置";
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ //查询成长规则列表
|
|
|
+ getRuleList() {
|
|
|
+ this.loading = true;
|
|
|
+ getGrouthRuleList(this.selectParams).then(response => {
|
|
|
+ this.grouthRuleList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //打开新增成长规则窗口
|
|
|
+ handleAddGrouthRules(){
|
|
|
+ this.reset();
|
|
|
+ this.openGrouthRule = true;
|
|
|
+ this.title = "添加成长规则";
|
|
|
+ },
|
|
|
+ //打开修改成长规则窗口
|
|
|
+ grouthRuleUpdate(row){
|
|
|
+ this.reset();
|
|
|
+ this.formGrouthRule = row;
|
|
|
+ this.openGrouthRule = true;
|
|
|
+ this.title = "修改成长规则";
|
|
|
+ //const id = row.id
|
|
|
+ // editGrouthRule(id).then(response => {
|
|
|
+ // this.formGrouthRule = response.data;
|
|
|
+ // this.openGrouthRule = true;
|
|
|
+ // this.title = "修改成长规则"
|
|
|
+ // });
|
|
|
+ },
|
|
|
+
|
|
|
+ //取消按钮
|
|
|
+ cancelGrouthRule(){
|
|
|
+ this.openGrouthRule = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+
|
|
|
+ //提交新增和修改成长规则
|
|
|
+ submitFormGrouthRule(){
|
|
|
+ this.$refs['formGrouthRule'].validate(valid =>{
|
|
|
+ if(valid){
|
|
|
+ if(this.formGrouthRule.id != null){
|
|
|
+ editGrouthRule(this.formGrouthRule).then(response =>{
|
|
|
+ this.msgSuccess("修改成功")
|
|
|
+ this.openGrouthRule = false;
|
|
|
+ this.getRuleList();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ addGrouthRule(this.formGrouthRule).then(response =>{
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.openGrouthRule =false;
|
|
|
+ this.getRuleList();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //删除成长规则
|
|
|
+ grouthRuleDelete(row){
|
|
|
+ const ids = row.id || this.ids
|
|
|
+ if(row.id !=null || this.ids != null){
|
|
|
+ this.$confirm('是否确认删除该成长规则的数据项?', "警告",{
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function () {
|
|
|
+ delGrouthRule(ids);
|
|
|
+ }).then(() =>{
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
/** 新增按钮操作 */
|
|
|
handleAddDT() {
|
|
|
this.reset();
|
|
@@ -349,6 +463,7 @@ export default {
|
|
|
this.title = "修改客户优惠等级设置";
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.form.gradeType="1";
|
|
@@ -415,7 +530,7 @@ export default {
|
|
|
}).then(function() {
|
|
|
return delSetting(ids);
|
|
|
}).then(() => {
|
|
|
- this.getList();
|
|
|
+ this.getList2();
|
|
|
this.msgSuccess("删除成功");
|
|
|
})
|
|
|
},
|
|
@@ -435,3 +550,27 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
+<style>
|
|
|
+ .two{
|
|
|
+ margin-top: 30px;
|
|
|
+ }
|
|
|
+ .settingButton{
|
|
|
+ border: 0px;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+ .cutLine{
|
|
|
+ width: 65px;
|
|
|
+ height: 2px;
|
|
|
+ background: #71f332;
|
|
|
+ /*margin-top: 5px;*/
|
|
|
+ margin-left: 5px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ .textlineHeader{
|
|
|
+ /*margin-bottom: 20px;*/
|
|
|
+ font-family: Bahnschrift;
|
|
|
+ /*text-shadow: #32a9f3 1px 1px 1px;*/
|
|
|
+ /*font-size: ;*/
|
|
|
+ color: #32a9f3;
|
|
|
+ }
|
|
|
+</style>
|