|
@@ -1,54 +1,80 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
|
|
- <el-form-item style="float:right">
|
|
|
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">刷新</el-button>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-form
|
|
|
+ :model="sumForm"
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ label="开始积分功能"
|
|
|
+ >
|
|
|
+ {{sumForm.integralFlag == 0 ? '未关闭':'已开启'}}
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="积分清空的日期"
|
|
|
+ v-if="sumForm.integralTermSetting==2"
|
|
|
+ >
|
|
|
+ {{ sumForm.integralFlag == 0 ? '积分永久有效':sumForm.integralEmptyTime }}
|
|
|
+ </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>
|
|
|
+
|
|
|
+
|
|
|
+ <el-form
|
|
|
+ :model="queryParams"
|
|
|
+ ref="queryForm"
|
|
|
+ :inline="true"
|
|
|
+ label-width="68px"
|
|
|
+ >
|
|
|
+ <el-form-item style="float: right">
|
|
|
+ <el-button
|
|
|
+ type="cyan"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ @click="handleQuery"
|
|
|
+ >刷新</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-table :data="ruleList">
|
|
|
- <el-table-column label="油站id" align="center" prop="stationId" v-if="false"/>
|
|
|
- <el-table-column label="规则" align="center" >
|
|
|
+ <af-table-column
|
|
|
+ label="油站id"
|
|
|
+ align="center"
|
|
|
+ prop="stationId"
|
|
|
+ v-if="false"
|
|
|
+ />
|
|
|
+ <af-table-column
|
|
|
+ label="油品"
|
|
|
+ align="center"
|
|
|
+ prop="oilName"
|
|
|
+ />
|
|
|
+ <af-table-column
|
|
|
+ label="会员等级"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <div v-show="scope.row.oilType==1">
|
|
|
- <span v-show="scope.row.ruleType==3">以加油升数累计</span>
|
|
|
- <span v-show="scope.row.ruleType==1">以订单实付金额累计</span>
|
|
|
- <span v-show="scope.row.ruleType==2">以订单应付金额累计</span>
|
|
|
- <span>满{{scope.row.ruleTerms}}</span>
|
|
|
- <span v-show="scope.row.ruleType==3">L起累计</span>
|
|
|
- <span v-show="scope.row.ruleType!=3">元起累计</span>
|
|
|
- <span>{{ scope.row.oilName}}油</span>
|
|
|
- <span v-show="scope.row.gread=='所有人'">{{ scope.row.gread}}每消费</span>
|
|
|
- <span v-show="scope.row.gread!='所有人'">{{ scope.row.gread}}会员每消费</span>
|
|
|
- <span>{{ scope.row.saleAmt}}</span>
|
|
|
- <span v-show="scope.row.ruleType==3">L</span>
|
|
|
- <span v-show="scope.row.ruleType!=3">元</span>
|
|
|
- <span>{{scope.row.integral}}积分</span>
|
|
|
- </div>
|
|
|
- <div v-show="scope.row.oilType==2">
|
|
|
- <span>非油品满{{scope.row.ruleTerms}}元起累计每消费</span>
|
|
|
- <span>{{ scope.row.saleAmt}}元兑换{{scope.row.integral}}积分</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="积分规则是否开启" align="center" prop="integralFlag" width="100px;">
|
|
|
- <template slot-scope="scope2">
|
|
|
- <span v-show="scope2.row.integralFlag==1">开启</span>
|
|
|
- <span v-show="scope2.row.integralFlag==2">关闭</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="油站名称" align="center" prop="stationName" width="100px;" />
|
|
|
- <el-table-column label="积分活动时限" align="center" prop="termDateManage" :formatter="termDateManageFormat" width="120px;"/>
|
|
|
- <el-table-column label="多倍积分活动" align="center" prop="integralActivity" :formatter="integralActivityFormat" width="100px;"/>
|
|
|
- <el-table-column label="周期类型" align="center" prop="datePicker" :formatter="datePickerFormat" width="100px;"/>
|
|
|
- <el-table-column label="积分比例" align="center" prop="integralProportion" width="100px;">
|
|
|
- <template slot-scope="scope1">
|
|
|
- <span>{{ scope1.row.integralProportion}}</span>
|
|
|
- <span v-show="scope1.row.integralProportion!=''">倍</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <span>{{scope.row.gradeName === null ? '所有人' : scope.row.gradeName}}</span>
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ <af-table-column label="规则" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{(!scope.row.ruleType? '' : ruleTypeFormat[scope.row.ruleType]+"---") + '满' + scope.row.ruleTerms + (!scope.row.ruleType? '元开始积分' : ruleTermsFormat[scope.row.ruleType]+"---") + '---每消费' + scope.row.saleAmt + '元获得' + scope.row.integral + '积分'}}</span>
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
@@ -58,86 +84,186 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {listRuleInfo} from "@/api/integral/rule";
|
|
|
+import { listRuleInfo, listRuleOne } from "@/api/integral/rule";
|
|
|
export default {
|
|
|
- name: "Rule",
|
|
|
+ name: "RuleList",
|
|
|
data() {
|
|
|
return {
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
- total:0,
|
|
|
+ total: 0,
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- ruleList:[],
|
|
|
+ ruleList: [],
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
- queryInfo:{},
|
|
|
+ queryInfo: {},
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
itemsDetail: [{}],
|
|
|
notOilList: [{}],
|
|
|
- imgFileList:[]
|
|
|
+ imgFileList: [],
|
|
|
},
|
|
|
// 表单校验
|
|
|
- rules: {}
|
|
|
+ rules: {},
|
|
|
+ ruleTypeFormat:[,'以订单实付累计','以订单应付累计','以加油升数累计'],
|
|
|
+ ruleTermsFormat:[,'元开始积分','元开始积分','L开始积分'],
|
|
|
+ datePickerFormat:['','每周指定日','每月指定日','固定活动日'],
|
|
|
+ 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号",
|
|
|
+ ],
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ integralActivityDatePicker(){
|
|
|
+ if(!this.sumForm.datePickerTime){
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ if(this.sumForm.integralActivity == 0){
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+
|
|
|
+ let timeString = ''
|
|
|
+ const datePicker = this.sumForm.datePicker
|
|
|
+ console.log('time',this.sumForm.datePickerTime);
|
|
|
+
|
|
|
+ if(datePicker == 1){
|
|
|
+ timeString += "每周的"
|
|
|
+ }
|
|
|
+ if(datePicker == 2){
|
|
|
+ timeString += "每月的"
|
|
|
+ }
|
|
|
+ if(datePicker == 3){
|
|
|
+ timeString += "指定的日期 "
|
|
|
+ }
|
|
|
+ if(datePicker == 1 || datePicker == 2){
|
|
|
+ this.sumForm.datePickerTime.forEach((ele)=>{
|
|
|
+ timeString += this.timeSelect[datePicker][ele] + '、'
|
|
|
+ })
|
|
|
+ }else if(datePicker == 3){
|
|
|
+ console.log(this.sumForm.datePickerTime);
|
|
|
+ timeString += this.sumForm.datePickerTime.toString()
|
|
|
+ }
|
|
|
+
|
|
|
+ timeString = timeString.replace(/(、)$/g,'') + " 启动双倍积分"
|
|
|
+ return timeString
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
created() {
|
|
|
+ // 5.20
|
|
|
+ listRuleOne({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ }).then((response) => {
|
|
|
+ this.sumForm = response.data;
|
|
|
+ if (this.sumForm.datePicker == "1" || this.sumForm.datePicker == "2") {
|
|
|
+ if(this.sumForm.datePickerTime.indexOf(',') == -1) {
|
|
|
+ const temp = [parseFloat(this.sumForm.datePickerTime)]
|
|
|
+ this.sumForm.datePickerTime = temp
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.sumForm.datePickerTime = this.sumForm.datePickerTime
|
|
|
+ .split(",")
|
|
|
+ .map(parseFloat).sort((a,b)=>{return a-b});
|
|
|
+ } else if (this.sumForm.datePicker == '3'){
|
|
|
+ this.sumForm.datePickerTime = this.sumForm.datePickerTime
|
|
|
+ .split(",");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
this.getList();
|
|
|
- this.getDicts("term_date").then(response => {
|
|
|
+ this.getDicts("term_date").then((response) => {
|
|
|
this.termDateManageOptions = response.data;
|
|
|
});
|
|
|
- this.getDicts("expiration").then(response => {
|
|
|
+ this.getDicts("expiration").then((response) => {
|
|
|
this.expirationOptions = response.data;
|
|
|
});
|
|
|
- this.getDicts("integral_deduction_oil").then(response => {
|
|
|
+ this.getDicts("integral_deduction_oil").then((response) => {
|
|
|
this.integralDeductionOilOptions = response.data;
|
|
|
});
|
|
|
- this.getDicts("integral_manage").then(response => {
|
|
|
+ this.getDicts("integral_manage").then((response) => {
|
|
|
this.integralActivityOptions = response.data;
|
|
|
});
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询列表 */
|
|
|
getList() {
|
|
|
//积分规则信息
|
|
|
- listRuleInfo(this.queryParams).then(response => {
|
|
|
+ listRuleInfo(this.queryParams).then((response) => {
|
|
|
+ console.log('getList',response)
|
|
|
this.ruleList = response.rows;
|
|
|
this.total = response.total;
|
|
|
});
|
|
|
},
|
|
|
- termDateManageFormat(row, column){
|
|
|
- if(row.termDateManage === '1'){
|
|
|
- return '不指定结束时间'
|
|
|
- }else if(row.termDateManage === '2'){
|
|
|
- return '指定结束时间'
|
|
|
- }
|
|
|
- },
|
|
|
- integralActivityFormat(row, column){
|
|
|
- if(row.integralActivity === '1'){
|
|
|
- return '开启'
|
|
|
- }else if(row.integralActivity === '0'){
|
|
|
- return '关闭'
|
|
|
- }
|
|
|
- },
|
|
|
- datePickerFormat(row, column){
|
|
|
- if(row.datePicker === '1'){
|
|
|
- return '每周指定日'
|
|
|
- }else if(row.datePicker === '2'){
|
|
|
- return '每月指定日'
|
|
|
- }else if(row.datePicker === '3'){
|
|
|
- return '固定活动日'
|
|
|
+ // termDateManageFormat(row, column) {
|
|
|
+ // if (row.termDateManage === "1") {
|
|
|
+ // return "永久";
|
|
|
+ // } else if (row.termDateManage === "2") {
|
|
|
+ // return "指定结束时间";
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ integralActivityFormat(row, column) {
|
|
|
+ if (row.integralActivity === "1") {
|
|
|
+ return "开启";
|
|
|
+ } else if (row.integralActivity === "0") {
|
|
|
+ return "关闭";
|
|
|
}
|
|
|
},
|
|
|
+ // datePickerFormat(row, column) {
|
|
|
+ // if (row.datePicker === "1") {
|
|
|
+ // return "每周指定日";
|
|
|
+ // } else if (row.datePicker === "2") {
|
|
|
+ // return "每月指定日";
|
|
|
+ // } else if (row.datePicker === "3") {
|
|
|
+ // return "固定活动日";
|
|
|
+ // }
|
|
|
+ // },
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|