|
@@ -1,5 +1,122 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
+ <el-form :model="zjParams" ref="zjParams" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <div>
|
|
|
+ <span style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:25px;">直降方案</span>
|
|
|
+ <el-button icon="el-icon-plus" size="mini" @click="handleAddZJ" style="float:right" type="warning" v-hasPermi="['market:plan:add']" >添加直降信息</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <el-table v-loading="loading" :data="ZJplanList" >
|
|
|
+ <el-table-column label="id" align="center" prop="id" v-if="false" />
|
|
|
+ <el-table-column label="方案名称" align="center" prop="grade" />
|
|
|
+ <el-table-column label="油品名称" align="center" prop="oilName" />
|
|
|
+ <el-table-column label="油品名称" align="center" prop="discountTerm" v-if="false" :formatter="discountTermFormat" />
|
|
|
+ <el-table-column label="优惠条件" align="center" :formatter="planFormat"/>
|
|
|
+ <el-table-column label="优惠条件金额" v-if="false" align="center" prop="discountAmt" />
|
|
|
+ <el-table-column label="优惠金额" v-if="false" align="center" prop="gasoilDiscountAmt" />
|
|
|
+ <el-table-column label="会员优惠是否叠加" align="center" prop="vipDiscountyPlus" :formatter="vipDiscountyPlusFotmat" />
|
|
|
+ <el-table-column label="可否叠加劵" align="center" prop="couponPlus" :formatter="couponPlusFotmat"
|
|
|
+ />
|
|
|
+ <el-table-column label="优惠方案类型" v-if="false" align="center" prop="discountPlanType" />
|
|
|
+ <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="handleUpdateZJ(scope2.row)"
|
|
|
+ v-hasPermi="['market:plan:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDeleteZJ(scope2.row)"
|
|
|
+ v-hasPermi="['market:plan:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-dialog :title="titlezj" :visible.sync="openzj" width="500px" append-to-body>
|
|
|
+ <el-form ref="zjform" :model="zjform" :rules="zjrules" label-width="130px">
|
|
|
+ <el-form-item label="方案名称" prop="grade">
|
|
|
+ <el-input v-model="zjform.grade" placeholder="请输入方案名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="油站名称" prop="stationId" >
|
|
|
+ <el-select
|
|
|
+ v-model="zjform.stationId"
|
|
|
+ placeholder="请选择油站"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @change="onInstitutionChang"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in stationOptions"
|
|
|
+ :key="item.stationId"
|
|
|
+ :label="item.stationName"
|
|
|
+ :value="item.stationId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="油站名称" v-show="false" prop="personnelName">
|
|
|
+ <el-input v-model="zjform.stationName" placeholder="请输入油站名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="油品名称" prop="oilName">
|
|
|
+ <el-select v-model="zjform.oilName" placeholder="油品名称" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in oilNameOptions"
|
|
|
+ :key="dict.dictLabel"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictLabel"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠条件" prop="discountTerm">
|
|
|
+ <el-radio-group v-model="zjform.discountTerm" @change="changeHandler">
|
|
|
+ <el-radio
|
|
|
+ v-for="dict in discountTermOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictValue"
|
|
|
+ >{{dict.dictLabel}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ <div>
|
|
|
+ 满
|
|
|
+ <el-input-number v-model="zjform.discountAmt" size="mini" :min="0" />
|
|
|
+ <span v-show=laters>L</span>
|
|
|
+ <span v-show=yuan>元</span>
|
|
|
+ 每升优惠
|
|
|
+ <el-input-number v-model="zjform.gasoilDiscountAmt" size="mini" :min="0" />元
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="会员优惠是否叠加" prop="vipDiscountyPlus">
|
|
|
+ <el-radio-group v-model="zjform.vipDiscountyPlus">
|
|
|
+ <el-radio
|
|
|
+ v-for="dict in vipDiscountyPlusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictValue"
|
|
|
+ >{{dict.dictLabel}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="可否叠加劵" prop="couponPlus">
|
|
|
+ <el-radio-group v-model="zjform.couponPlus">
|
|
|
+ <el-radio
|
|
|
+ v-for="dict in couponPlusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictValue"
|
|
|
+ >{{dict.dictLabel}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-show="false" label="优惠方案类型" prop="discountPlanType">
|
|
|
+ <el-select v-model="zjform.discountPlanType" placeholder="请选择优惠方案类型">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFormZJ">确 定</el-button>
|
|
|
+ <el-button @click="cancelZJ">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<!--满减方案-->
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
<div>
|
|
@@ -131,19 +248,19 @@
|
|
|
<el-table-column label="可否叠加劵" align="center" prop="couponPlus" :formatter="couponPlusFotmat" />
|
|
|
<el-table-column label="优惠方案类型" v-if="false" align="center" prop="discountPlanType" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope1">
|
|
|
+ <template slot-scope="scope2">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
- @click="handleUpdateDT(scope1.row)"
|
|
|
+ @click="handleUpdateDT(scope2.row)"
|
|
|
v-hasPermi="['market:plan:edit']"
|
|
|
>修改</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
- @click="handleDeleteDT(scope1.row)"
|
|
|
+ @click="handleDeleteDT(scope2.row)"
|
|
|
v-hasPermi="['market:plan:remove']"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
@@ -247,15 +364,21 @@
|
|
|
// 客户优惠等级设置表格数据
|
|
|
planList: [],
|
|
|
DTplanList: [],
|
|
|
+ ZJplanList: [],
|
|
|
couponPlusOptions:[],
|
|
|
vipDiscountyPlusOptions:[],
|
|
|
stationOptions:[],
|
|
|
oilNameOptions:[],
|
|
|
+ discountTermOptions:[],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
+ titlezj: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ yuan: true,
|
|
|
+ laters: false,
|
|
|
opendt: false,
|
|
|
+ openzj: false,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -273,7 +396,6 @@
|
|
|
date: null,
|
|
|
deductionGrowthValue: null
|
|
|
},// 查询参数
|
|
|
-
|
|
|
selectParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
@@ -290,23 +412,49 @@
|
|
|
date: null,
|
|
|
deductionGrowthValue: null
|
|
|
},
|
|
|
+ zjParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ grade: null,
|
|
|
+ discountWay: null,
|
|
|
+ gasoilDiscountLitre: null,
|
|
|
+ dieseloilDiscountLitre: null,
|
|
|
+ gradeType: null,
|
|
|
+ gasoilConsume: null,
|
|
|
+ gasoilGrowthValue: null,
|
|
|
+ dieseloilConsume: null,
|
|
|
+ dieseloilGrowthValue: null,
|
|
|
+ growthValue: null,
|
|
|
+ date: null,
|
|
|
+ deductionGrowthValue: null
|
|
|
+ },
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
dtform: {},
|
|
|
+ zjform: {},
|
|
|
ruleForm: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
},
|
|
|
dtrules: {
|
|
|
+ },
|
|
|
+ zjrules: {
|
|
|
+ discountTerm: [
|
|
|
+ { required: true, message: "选择优惠执行规则", trigger: "blur" }
|
|
|
+ ]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
this.getList2();
|
|
|
+ this.getList3();
|
|
|
this.getDicts("coupon_plus").then(response => {
|
|
|
this.couponPlusOptions = response.data;
|
|
|
});
|
|
|
+ this.getDicts("discount_term").then(response => {
|
|
|
+ this.discountTermOptions = response.data;
|
|
|
+ });
|
|
|
this.getDicts("vip_discounty_plus").then(response => {
|
|
|
this.vipDiscountyPlusOptions = response.data;
|
|
|
});
|
|
@@ -319,6 +467,17 @@
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeHandler(value) {
|
|
|
+ if(value=="1"){
|
|
|
+ this.laters=true;
|
|
|
+ this.yuan=false;
|
|
|
+ this.zjform.discountTerm="1";
|
|
|
+ }else if(value=="2"){
|
|
|
+ this.yuan=true;
|
|
|
+ this.laters=false;
|
|
|
+ this.zjform.discountTerm="2";
|
|
|
+ }
|
|
|
+ },
|
|
|
onInstitutionChang(e){
|
|
|
let obj = {};
|
|
|
obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
|
|
@@ -353,7 +512,16 @@
|
|
|
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ getList3() {
|
|
|
+ this.zjParams.discountPlanType="3";
|
|
|
+ this.loading = true;
|
|
|
+ listPlan(this.zjParams).then(response => {
|
|
|
+ if(response.hasOwnProperty('rows')){
|
|
|
+ this.ZJplanList = response.rows;
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
vipDiscountyPlusFotmat(row, column){
|
|
|
if(row.vipDiscountyPlus === '1'){
|
|
|
return '是'
|
|
@@ -378,6 +546,11 @@
|
|
|
this.opendt = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
+ // 取消按钮
|
|
|
+ cancelZJ() {
|
|
|
+ this.openzj = false;
|
|
|
+ this.resetZJ();
|
|
|
+ },
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
@@ -415,12 +588,30 @@
|
|
|
};
|
|
|
this.resetForm("dtform");
|
|
|
},
|
|
|
+ resetZJ() {
|
|
|
+ this.zjform = {
|
|
|
+ id: null,
|
|
|
+ grade: null,
|
|
|
+ discountWay: null,
|
|
|
+ gasoilDiscountLitre: null,
|
|
|
+ dieseloilDiscountLitre: null,
|
|
|
+ gradeType: null,
|
|
|
+ gasoilConsume: null,
|
|
|
+ gasoilGrowthValue: null,
|
|
|
+ dieseloilConsume: null,
|
|
|
+ dieseloilGrowthValue: null,
|
|
|
+ growthValue: null,
|
|
|
+ date: null,
|
|
|
+ deductionGrowthValue: null
|
|
|
+ };
|
|
|
+ this.resetForm("zjform");
|
|
|
+ },
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
- this.title = "添加客户优惠等级设置";
|
|
|
+ this.title = "添加满减优惠";
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
@@ -429,14 +620,14 @@
|
|
|
getPlan(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
- this.title = "修改客户优惠等级设置";
|
|
|
+ this.title = "修改满减优惠";
|
|
|
});
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAddDT() {
|
|
|
this.resetDT();
|
|
|
this.opendt = true;
|
|
|
- this.title = "添加客户优惠等级设置";
|
|
|
+ this.title = "添加立减优惠";
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdateDT(row) {
|
|
@@ -445,7 +636,24 @@
|
|
|
getPlan(id).then(response => {
|
|
|
this.dtform = response.data;
|
|
|
this.opendt = true;
|
|
|
- this.title = "修改客户优惠等级设置";
|
|
|
+ this.title = "修改立减优惠";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAddZJ() {
|
|
|
+ this.resetZJ();
|
|
|
+ this.openzj = true;
|
|
|
+ //this.zjform.discountTerm="1";
|
|
|
+ this.titlezj = "添加直降优惠";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdateZJ(row) {
|
|
|
+ this.resetZJ();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getPlan(id).then(response => {
|
|
|
+ this.zjform = response.data;
|
|
|
+ this.openzj = true;
|
|
|
+ this.titlezj = "修改直降优惠";
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
@@ -468,6 +676,7 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitFormDT() {
|
|
@@ -490,10 +699,31 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitFormZJ() {
|
|
|
+ this.zjform.discountPlanType="3";
|
|
|
+ this.$refs["zjform"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.zjform.id != null) {
|
|
|
+ updatePlan(this.zjform).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.openzj = false;
|
|
|
+ this.getList3();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addPlan(this.zjform).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.openzj= false;
|
|
|
+ this.getList3();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$confirm('是否确认删除客户优惠等级设置编号为"' + ids + '"的数据项?', "警告", {
|
|
|
+ this.$confirm('是否确认删除满减优惠编号为"' + ids + '"的数据项?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
@@ -507,7 +737,7 @@
|
|
|
/** 删除按钮操作 */
|
|
|
handleDeleteDT(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$confirm('是否确认删除客户优惠等级设置编号为"' + ids + '"的数据项?', "警告", {
|
|
|
+ this.$confirm('是否确认删除立减优惠编号为"' + ids + '"的数据项?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
@@ -518,10 +748,24 @@
|
|
|
this.msgSuccess("删除成功");
|
|
|
})
|
|
|
},
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDeleteZJ(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm('是否确认删除直降优惠编号为"' + ids + '"的数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delPlan(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList3();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
const queryParams = this.queryParams;
|
|
|
- this.$confirm('是否确认导出所有客户优惠等级设置数据项?', "警告", {
|
|
|
+ this.$confirm('是否确认导出所有优惠设置数据项?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
@@ -530,6 +774,22 @@
|
|
|
}).then(response => {
|
|
|
this.download(response.msg);
|
|
|
})
|
|
|
+ },
|
|
|
+ discountTermFormat(row, column) {
|
|
|
+ if (row.discountTerm === "1") {
|
|
|
+ return '按加油升数优惠'
|
|
|
+ } else {
|
|
|
+ return '按加油金额优惠'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ planFormat(row, column) {
|
|
|
+ if (row.discountTerm === "1") {
|
|
|
+ let ss = "满 " +row.discountAmt +"L,每升优惠 "+row.gasoilDiscountAmt+"元";
|
|
|
+ return ss
|
|
|
+ } else {
|
|
|
+ let ss = "满 " +row.discountAmt +"元,每升优惠 "+row.gasoilDiscountAmt+"元";
|
|
|
+ return ss
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|