|
@@ -1,56 +1,103 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-table :data="detailList" >
|
|
|
- <el-table-column label="电子会员卡充值规则" align="center" prop="parentId" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-show="scope.row.oilName=='1'">汽油</span>
|
|
|
- <span v-show="scope.row.oilName=='2'">柴油</span>
|
|
|
- <span>充值金额大于等于{{scope.row.discountAmtStart}}元小于{{scope.row.discountAmtEnd}}元赠送</span>
|
|
|
- <span v-show="scope.row.settingRuleType==1">{{scope.row.presentAmt}}元</span>
|
|
|
- <span v-show="scope.row.settingRuleType==2">{{scope.row.presentAmt}}%</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="是否启用充值规则" align="center" prop="cardOilsType" >
|
|
|
- <template slot-scope="scope1">
|
|
|
- <span v-show="scope1.row.cardOilsType=='1' && scope1.row.oilName=='1'">开启</span>
|
|
|
- <span v-show="scope1.row.cardOilsType=='2' && scope1.row.oilName=='2'">开启</span>
|
|
|
- <span v-show="scope1.row.cardOilsType=='1,2'">开启</span>
|
|
|
- <span v-show="scope1.row.cardOilsType=='2,1'">开启</span>
|
|
|
- <span v-show="scope1.row.cardOilsType==''">关闭</span>
|
|
|
- <span v-show="scope1.row.cardOilsType=='2' && scope1.row.oilName=='1'">关闭</span>
|
|
|
- <span v-show="scope1.row.cardOilsType=='1' && scope1.row.oilName=='2'">关闭</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="充值活动设置" align="center" prop="discountTimeSetting" :formatter="discountTimeSettingFormatter" width="100px;"/>
|
|
|
- <el-table-column label="周期类型" align="center" prop="discountTimeType" :formatter="discountTimeTypeFormatter" width="90px;"/>
|
|
|
- <el-table-column label="赠送比例" align="center" width="90px;" >
|
|
|
- <template slot-scope="scope1">
|
|
|
- <span >{{scope1.row.presentScale}}</span>
|
|
|
- <span v-show="scope1.row.presentScale!=null&&scope1.row.presentScale!=''">%</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="电子卡支付产生积分可享受倍数" align="center" width="90px;" >
|
|
|
- <template slot-scope="scope2">
|
|
|
- <span >{{scope2.row.enjoyIntegralMultiple}}</span>
|
|
|
- <span v-show="scope2.row.enjoyIntegralMultiple!=null&&scope2.row.enjoyIntegralMultiple!=''">倍</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="是否叠加优惠劵" align="center" prop="isDiscountCoupon" :formatter="isDiscountCouponFormatter" width="90px;"/>
|
|
|
- <el-table-column label="是否叠加营销活动" align="center" prop="isMarket" :formatter="isMarketFormatter" width="90px;"/>
|
|
|
- <el-table-column label="是否叠加等级设置" align="center" prop="isGradeSetting" :formatter="isGradeSettingFormatter" width="90px;"/>
|
|
|
- </el-table>
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <el-form :model="sumForm">
|
|
|
+ <el-form-item label="电子卡启动状态">
|
|
|
+ {{ sumForm.cardEnabledFlag == 0 ? "未开启" : "已开启" }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="目前启动的电子卡"
|
|
|
+ v-if="sumForm.cardEnabledFlag == 1"
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ sumForm.cardOilsType.length == 0
|
|
|
+ ? "你尚未选择要启动的电子卡"
|
|
|
+ : sumForm.cardOilsType.join(", ")
|
|
|
+ }}
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!-- <el-form-item
|
|
|
+ label="所有积分规则的失效时间"
|
|
|
+ v-if="sumForm.termDateManage == 2"
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ sumForm.termDateManage == 0 ? "积分规则永久有效" : sumForm.emptyDate
|
|
|
+ }}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="多倍积分活动的状态">
|
|
|
+ {{
|
|
|
+ sumForm.integralActivity == 0 ? "未开启" : integralActivityDatePicker
|
|
|
+ }}
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item
|
|
|
+ label="正在生效中的充值规则"
|
|
|
+ v-if="sumForm.cardEnabledFlag == 1"
|
|
|
+ >
|
|
|
+ {{ sumForm.detailList.length===0 ? "你尚没有正在生效的规则":"" }}
|
|
|
+ <el-table :data="sumForm.detailList" v-if="sumForm.detailList.length!==0">
|
|
|
+ <af-table-column
|
|
|
+ label="电子卡"
|
|
|
+ align="center"
|
|
|
+ :formatter="oilNameFormatter"
|
|
|
+ />
|
|
|
+ <af-table-column label="条件" align="center" prop="discountAmtTerm">
|
|
|
+ <template slot-scope="scope1">
|
|
|
+ {{ scope1.row.discountAmtStart }}≤充值金额(元)<{{
|
|
|
+ scope1.row.discountAmtEnd
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+
|
|
|
+ <af-table-column label="赠送" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.row.settingRuleType == 1
|
|
|
+ ? "按金额赠送"
|
|
|
+ : scope.row.settingRuleType == 2
|
|
|
+ ? "按比例赠送"
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
+ --- 额度为 {{ scope.row.presentAmt }}
|
|
|
+ {{
|
|
|
+ scope.row.settingRuleType == "1"
|
|
|
+ ? "元"
|
|
|
+ : scope.row.settingRuleType == "2"
|
|
|
+ ? "%"
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ label="电子卡会执行的优惠方案"
|
|
|
+ v-if="sumForm.cardEnabledFlag == 1"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ {{ sumForm.isMarket == 1 ? "营销方案 ":""}}
|
|
|
+ {{ sumForm.isGradeSetting == 1 ? "等级优惠 ":""}}
|
|
|
+ {{ sumForm.isDiscountCoupon == 1 ? "优惠券 ":""}}
|
|
|
+ {{ sumForm.isMarket == 1 || sumForm.isGradeSetting == 1 || sumForm.isDiscountCoupon == 1 ? '' : "您未启动叠加,电子卡不会执行任何优惠方案" }}
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ label="充值活动"
|
|
|
+ v-if="sumForm.cardEnabledFlag == 1"
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ sumForm.discountTimeSetting == 0 ? "未开启" : integralActivityDatePicker
|
|
|
+ }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listDetailInfo} from "@/api/customer/cardSettingDetail";
|
|
|
+import { listDetailInfo } from "@/api/customer/cardSettingDetail";
|
|
|
+import { selectCustomerCardSetting } from "@/api/customer/cardSetting";
|
|
|
export default {
|
|
|
name: "Detail",
|
|
|
data() {
|
|
@@ -66,72 +113,156 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
+ pageSize: 10,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ rules: {},
|
|
|
+ sumForm: {},
|
|
|
+ timeSelect: [
|
|
|
+ ,
|
|
|
+ ["周天", "周一", "周二", "周三", "周四", "周五", "周六"],
|
|
|
+ [
|
|
|
+ "1号",
|
|
|
+ "2号",
|
|
|
+ "3号",
|
|
|
+ "4号",
|
|
|
+ "5号",
|
|
|
+ "6号",
|
|
|
+ "7号",
|
|
|
+ "8号",
|
|
|
+ "9号",
|
|
|
+ "10号",
|
|
|
+ "11号",
|
|
|
+ "12号",
|
|
|
+ "13号",
|
|
|
+ "14号",
|
|
|
+ "15号",
|
|
|
+ "16号",
|
|
|
+ "17号",
|
|
|
+ "18号",
|
|
|
+ "19号",
|
|
|
+ "20号",
|
|
|
+ "21号",
|
|
|
+ "22号",
|
|
|
+ "23号",
|
|
|
+ "24号",
|
|
|
+ "25号",
|
|
|
+ "26号",
|
|
|
+ "27号",
|
|
|
+ "28号",
|
|
|
+ "29号",
|
|
|
+ "30号",
|
|
|
+ "31号",
|
|
|
+ ],
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ this.init();
|
|
|
},
|
|
|
- methods: {
|
|
|
- cardOilsTypeFormatter(row, column){
|
|
|
- if(row.cardOilsType === '1'){
|
|
|
- return '汽油卡'
|
|
|
- }else if(row.cardOilsType === '2'){
|
|
|
- return '柴油卡'
|
|
|
- }else if(row.cardOilsType === '1,2'){
|
|
|
- return '汽油卡,柴油卡'
|
|
|
+ computed:{
|
|
|
+ integralActivityDatePicker() {
|
|
|
+ if (!this.sumForm.discountTime) {
|
|
|
+ return "";
|
|
|
}
|
|
|
- },
|
|
|
- discountTimeSettingFormatter(row, column){
|
|
|
- if(row.discountTimeSetting === '1'){
|
|
|
- return '开启'
|
|
|
- }else if(row.discountTimeSetting === '2'){
|
|
|
- return '关闭'
|
|
|
+ if (this.sumForm.integralActivity == 0) {
|
|
|
+ return "";
|
|
|
}
|
|
|
- },
|
|
|
- discountTimeTypeFormatter(row, column){
|
|
|
- if(row.discountTimeSetting === '1'){
|
|
|
- return '每周指定日'
|
|
|
- }else if(row.discountTimeSetting === '2'){
|
|
|
- return '每月指定日'
|
|
|
- }else if(row.discountTimeSetting === '2'){
|
|
|
- return '固定活动日'
|
|
|
+
|
|
|
+ let timeString = "";
|
|
|
+ const discountTimeType = this.sumForm.discountTimeType;
|
|
|
+ console.log("time", this.sumForm.discountTime);
|
|
|
+
|
|
|
+ if (discountTimeType == 1) {
|
|
|
+ timeString += "每周的";
|
|
|
}
|
|
|
- },
|
|
|
- isDiscountCouponFormatter(row, column){
|
|
|
- if(row.isDiscountCoupon === '0'){
|
|
|
- return '是'
|
|
|
- }else if(row.isDiscountCoupon === '1'){
|
|
|
- return '否'
|
|
|
+ if (discountTimeType == 2) {
|
|
|
+ timeString += "每月的";
|
|
|
}
|
|
|
- },
|
|
|
- isMarketFormatter(row, column){
|
|
|
- if(row.isMarket === '0'){
|
|
|
- return '是'
|
|
|
- }else if(row.isMarket === '1'){
|
|
|
- return '否'
|
|
|
+ if (discountTimeType == 3) {
|
|
|
+ timeString += "指定的日期 ";
|
|
|
}
|
|
|
+ if (discountTimeType == 1 || discountTimeType == 2) {
|
|
|
+ this.sumForm.discountTime.forEach((ele) => {
|
|
|
+ timeString += this.timeSelect[discountTimeType][ele] + "、";
|
|
|
+ });
|
|
|
+ } else if (discountTimeType == 3) {
|
|
|
+ console.log(this.sumForm.discountTime);
|
|
|
+ timeString += this.sumForm.discountTime.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ timeString = timeString.replace(/(、)$/g, "") + " 享受赠送比例是" + this.sumForm.presentScale + '%的活动优惠';
|
|
|
+ return timeString;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ selectCustomerCardSetting().then((response) => {
|
|
|
+ this.sumForm = response.data;
|
|
|
+ this.sumForm.cardOilsType = this.sumForm.cardOilsType
|
|
|
+ .split(",")
|
|
|
+ .filter((ele) => {
|
|
|
+ return ele != "";
|
|
|
+ });
|
|
|
+
|
|
|
+ this.sumForm.detailList = this.sumForm.detailList.filter((ele)=>{
|
|
|
+ return this.sumForm.cardOilsType.includes(ele.cardType)
|
|
|
+ })
|
|
|
+
|
|
|
+ const oilType = ["汽油卡", "柴油卡", "非油品卡", "LNG卡", "CNG卡"];
|
|
|
+ this.sumForm.cardOilsType.map((ele, index) => {
|
|
|
+ this.sumForm.cardOilsType[index] = oilType[ele];
|
|
|
+ });
|
|
|
+ console.log(this.sumForm);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (
|
|
|
+ this.sumForm.discountTimeType == "1" ||
|
|
|
+ this.sumForm.discountTimeType == "2"
|
|
|
+ ) {
|
|
|
+ // if( this.form.discountTime == ""){
|
|
|
+ // this.form.discountTime = [];
|
|
|
+ // }
|
|
|
+ this.sumForm.discountTime = this.sumForm.discountTime
|
|
|
+ .split(",")
|
|
|
+ .map(parseFloat);
|
|
|
+ } else if (this.sumForm.discountTimeType == "3") {
|
|
|
+ if (this.sumForm.discountTime.length == 0) {
|
|
|
+ this.sumForm.discountTime = [];
|
|
|
+ } else {
|
|
|
+ this.sumForm.discountTime = this.sumForm.discountTime.split(
|
|
|
+ ","
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- isGradeSettingFormatter(row, column){
|
|
|
- if(row.isGradeSetting === '0'){
|
|
|
- return '是'
|
|
|
- }else if(row.isGradeSetting === '1'){
|
|
|
- return '否'
|
|
|
+ oilNameFormatter(row, column) {
|
|
|
+ if (row.cardType === "1") {
|
|
|
+ return "汽油卡";
|
|
|
+ } else if (row.cardType === "2") {
|
|
|
+ return "柴油卡";
|
|
|
+ } else if (row.cardType === "3") {
|
|
|
+ return "非油品卡";
|
|
|
+ } else if (row.cardType === "4") {
|
|
|
+ return "LNG卡";
|
|
|
+ } else if (row.cardType === "5") {
|
|
|
+ return "CNG卡";
|
|
|
+ } else {
|
|
|
+ return row.cardType;
|
|
|
}
|
|
|
},
|
|
|
/** 查询客户电子会员卡充值优惠设置明细列表 */
|
|
|
getList() {
|
|
|
- listDetailInfo(this.queryParams).then(response => {
|
|
|
+ listDetailInfo(this.queryParams).then((response) => {
|
|
|
this.detailList = response.rows;
|
|
|
this.total = response.total;
|
|
|
});
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|