Joe преди 4 години
родител
ревизия
a4dc09c18e

+ 97 - 626
src/views/customer/cardSetting/index.vue

@@ -1,666 +1,137 @@
 <template>
   <div class="app-container">
-    <el-form ref="form" :model="form" :rules="rules" label-width="130px">
-      <el-row>
-        <el-col :span="6" style=""> 
-          <el-form-item label="是否启用充值规则">
-            <el-checkbox-group v-model="cardOilsTypeList">
-              <el-checkbox v-for = "item in checkList" :key="item.id" :label="item.id" :value="item.value">{{item.value}}</el-checkbox>
-            </el-checkbox-group>
-          </el-form-item> 
-        </el-col>
-        <el-col :span="8" style=""> 
-          <el-button type="primary" style="" @click="handleAdd">新增充值规则</el-button>
-        </el-col> 
-      </el-row>
-      <div>
-        <el-table v-loading="false" :data="form.detailList" >
-          <el-table-column label="id" align="center" prop="id" v-if="false" />
-          <el-table-column label="所对应电子会员卡ID" align="center" prop="parentId"  v-if="false" />
-          <el-table-column label="油品" align="center" prop="oilName"  :formatter="oilNameFormatter"/>
-          <el-table-column label="优惠条件金额" align="center" prop="discountAmtTerm" >
-            <template slot-scope="scope1">
-               {{scope1.row.discountAmtStart}}≤充值金额(元)&lt;{{scope1.row.discountAmtEnd}}
-            </template>
-          </el-table-column>
-          <el-table-column label="赠送方式" align="center" prop="settingRuleType"  :formatter="settingRuleTypeFotmat"/>
-          <el-table-column label="赠送金额值或比例" align="center" prop="presentAmt">
-            <template slot-scope="scope2">
-               {{scope2.row.presentAmt}}
-                <span v-show="scope2.row.settingRuleType=='1'">元</span>
-                <span v-show="scope2.row.settingRuleType=='2'">%</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-            <template slot-scope="scope">
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-edit"
-                @click="handleUpdate(scope.$index,scope.row)"
-              >修改</el-button>
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-delete"
-                @click="handleDelete(scope.$index,scope.row)"
-              >删除</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <el-form-item label="充值活动设置">
-      </el-form-item>
-      <el-form-item >
-       <el-radio-group v-model="form.discountTimeSetting">
-          <el-radio
-            v-for="dict in discountTimeSettingOptions"
-            :key="dict.dictValue"
-            :label="dict.dictValue"
-          >{{dict.dictLabel}}</el-radio>
-        </el-radio-group>
-      </el-form-item>  
-      <el-row>
-        <el-col :span="8" style="">
-          <el-form-item  label="周期选择" >
-            <el-select v-model="form.discountTimeType" clearable  size="mini"  @change="datePickerChang" >
-                <el-option
-                  v-for="item in discountTimeTypeOptions"
-                  :key="item.dictValue"
-                  :label="item.dictLabel"
-                  :value="item.dictValue"
-                ></el-option>
-              </el-select>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">  
-          <el-form-item v-show="workDaytrue">
-            <div style="display: flex;flex-wrap: wrap;border-style: solid;border-color:#F5F7FA">
-              <div v-for="(item, index) in workDay" :key="index" style="margin:3px;">
-                <div class="hover-style" style="border-radius:5px;font-weight:bold;font-size:12px;cursor: pointer;" @click="clickWorkDayCalendar(item, index)">
-                  <div>{{ item }}</div>
-                  <div v-if="collectClickWorkDay.indexOf(index) > -1" style="width:4px;height:4px;border-radius:50%;background-color:red;position: relative;left:calc(50% - 2px);"></div>
-                  <div v-else style="width:4px;height:4px;"></div>
-                </div>
-              </div>
-             </div>
-          </el-form-item>
-          <el-form-item v-show="moonDaytrue" >
-             <div style="display: flex;flex-wrap: wrap;border-style: solid;border-color:#F5F7FA">
-              <div v-for="(item, index) in moonEverDay" :key="index" style="margin:3px;">
-                <div class="hover-style" style="border-radius:5px;font-weight:bold;font-size:12px;cursor: pointer;" @click="clickCalendar(item, index)">
-                  <div>{{ item }}</div>
-                  <div v-if="collectClickCalendar.indexOf(index) > -1" style="width:4px;height:4px;border-radius:50%;background-color:red;position: relative;left:calc(50% - 2px);"></div>
-                  <div v-else style="width:4px;height:4px;"></div>
-                </div>
-              </div>
-             </div>
-          </el-form-item>
-          <el-form-item  v-show="datetrue">
-            <el-date-picker clearable size="small" style="margin-left: 10px;width: 200px"
-                            v-model="pickerTime"
-                            type="dates"
-                            value-format="yyyy-MM-dd"
-                            placeholder="选择提醒时间设置">
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="赠送比例" prop="presentScale">
-            <el-input v-model="form.presentScale" placeholder="请输入赠送比例" style="width:70px;"/>%
-          </el-form-item>
-        </el-col>
-      </el-row>  
-      <el-form-item label="叠加优惠设置" ></el-form-item>
-      <el-row style="margin-left:80px;">
-        <el-col :span="8" >
-          <el-form-item  prop="isDiscountCoupon" label="是否叠加优惠券">
-            <el-radio-group v-model="form.isDiscountCoupon">
-              <el-radio
-                v-for="dict in isDiscountCouponOptions"
-                :key="dict.dictValue"
-                :label="dict.dictValue"
-              >{{dict.dictLabel}}</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8" >
-          <el-form-item  prop="isMarket" label="是否叠加营销方案">
-            <el-radio-group v-model="form.isMarket">
-              <el-radio
-                v-for="dict in isDiscountCouponOptions"
-                :key="dict.dictValue"
-                :label="dict.dictValue"
-              >{{dict.dictLabel}}</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8" >
-          <el-form-item  prop="isGradeSetting" label="是否叠加等级优惠">
-            <el-radio-group v-model="form.isGradeSetting">
-              <el-radio
-                v-for="dict in isDiscountCouponOptions"
-                :key="dict.dictValue"
-                :label="dict.dictValue"
-              >{{dict.dictLabel}}</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="8" style="margin-left:80px;">
-          <el-form-item  prop="isDiscountCoupon" label="电子卡支付产生积分可享受倍数" label-width="225px">
-            <el-input v-model="form.enjoyIntegralMultiple" placeholder="请输入积分可享受倍数" style="width:100px;"/>倍
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-    <div slot="footer" class="dialog-footer">
-      <el-button type="primary" @click="submitForm">确 定</el-button>
-    </div>
-
-     <!-- 添加或修改客户电子会员卡充值优惠设置明细对话框 -->
-    <el-dialog :title="title" :visible.sync="open"  append-to-body>
-      <el-form ref="infoform" :model="infoform" :rules="rules" label-width="110px">
-        <el-form-item label="选择油品" >
-          <el-select
-            v-model="infoform.oilName"
-            placeholder="请选择油品"
-            clearable
-            size="small"
-          >
-          <el-option
-            v-for="item in oilOptions"
-            :key="item.dictLabel"
-            :label="item.dictLabel"
-            :value="item.dictValue"
-          ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="充值条件金额" prop="discountAmtTerm">
-          <el-input-number v-model="infoform.discountAmtStart" placeholder="请输入充值条件开始金额" style="width:200px;" /> 
-          <span>≤充值金额(元)&lt;</span>
-          <el-input-number v-model="infoform.discountAmtEnd" placeholder="请输入充值条件结束金额" style="width:200px;"/> 
-        </el-form-item>
-        <el-form-item label="赠送方式"></el-form-item>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item >
-              <el-select v-model="infoform.settingRuleType" placeholder="请选择赠送方式" @change="settingRuleTypeChange">
-                <el-option
-                  v-for="item in settingRuleTypeOptions"
-                  :key="item.dictLabel"
-                  :label="item.dictLabel"
-                  :value="item.dictValue"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12" >
-            <el-form-item>
-              <el-input v-model="infoform.presentAmt" style="width:100px;"/>
-              <span v-show="jine">元</span>
-              <span v-show="bili">%</span>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-           <span style="color:red;margin-left:90px;">例:按赠送金额:充100赠送10元;按赠送比例:充100赠送10%</span>
-        </el-row>
-        <!-- <el-form-item label="状态">
-           <el-radio-group v-model="infoform.status">
-            <el-radio v-for="dict in statusOptions"
-            :key="dict.dictValue"
-            :label="dict.dictValue"
-            >{{dict.dictLabel}}</el-radio>
-          </el-radio-group>
-        </el-form-item> -->
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="save">设置</el-button>
-      </div>
-    </el-dialog>
+    <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"
+    />
   </div>
 </template>
 
 <script>
-import { addSetting, updateSetting,selectCustomerCardSetting} from "@/api/customer/cardSetting";
-import { getDept } from "@/api/system/dept";
+import { listDetailInfo} from "@/api/customer/cardSettingDetail";
 export default {
-  name: "Setting",
+  name: "Detail",
   data() {
     return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
       // 总条数
       total: 0,
-      // 客户电子会员卡充值优惠设置表格数据
-      settingList: [],
-      oilOptions:[],
-      statusOptions:[],
-      isDiscountCouponOptions:[],
-      discountTimeSettingOptions:[],
-      collectClickCalendar: [], // 收集固定日期选择的日子
-      collectClickWorkDay:[],
-      discountTimeTypeOptions :[],
-      stationOptions:[],
-      settingRuleTypeOptions:[],
-      checkList:[
-        {id:"1",value:"汽油"},
-        {id:"2",value:"柴油"}
-      ],
-      cardOilsTypeList:[],
-      pickerTime:"",
-      moonEverDay: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10',
-      '11', '12', '13', '14', '15', '16', '17', '18', '19', '20',
-      '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
-      workDay:["周天","周一","周二","周三","周四","周五","周六"],
-      workDaytrue:false,
-      moonDaytrue:false,
-      datetrue:false,
-      jine:false,
-      bili:false,
+      // 客户电子会员卡充值优惠设置明细表格数据
+      detailList: [],
       // 弹出层标题
       title: "",
-      // 表单参数
-      form: {
-        detailList:[]
-      },
-      //判断保存次数
-      num:0,
-      query:{
-        deptId: null
-      },
-      deptId:null,
-      queryParams:{
-        stationId: null
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10
       },
-      deptInfo:{},
-      checked: {},
-      index:null,
-      open:false,
-      infoform:{},
+      // 表单参数
+      form: {},
       // 表单校验
       rules: {
       }
     };
   },
   created() {
-    this.getDicts("integral_manage").then(response => {
-      this.discountTimeSettingOptions = response.data;
-    });
-    
-    this.getDicts("status").then(response => {
-      this.statusOptions = response.data;
-    });
-    this.getDicts("date_picker").then(response => {
-      this.discountTimeTypeOptions = response.data;
-    });
-    this.getDicts("is_flag").then(response => {
-      this.isDiscountCouponOptions = response.data;
-    });
-    this.getDicts("oil").then(response => {
-      this.oilOptions = response.data;
-    });
-    this.getDicts("setting_rule_type").then(response => {
-      this.settingRuleTypeOptions = response.data;
-    });
-    this.deptId=this.$store.selectDeptId;
-    if(this.deptId==null || this.deptId==""){
-      this.deptId =this.$store.state.user.deptId;
-    }
-    getDept(this.deptId).then(response => {
-      this.deptInfo = response.data;
-      if(this.deptInfo.jiBie==2){
-        this.queryParams.stationId=this.deptInfo.deptId;
-        this.form.stationId = this.deptInfo.deptId;
-        this.form.stationName =this.deptInfo.deptName;
-        selectCustomerCardSetting(this.queryParams).then(response => {
-          if(response.hasOwnProperty('data')){
-            this.form = response.data;
-            if(this.form.cardOilsType!=null &&this.form.cardOilsType!="" ){
-              this.cardOilsTypeList=this.form.cardOilsType.split(",");
-            }
-            if(this.form.discountTimeType == "1"){
-              this.workDaytrue=true;
-              this.moonDaytrue=false;
-              this.datetrue=false;
-              this.collectClickWorkDay =this.form.discountTime.split(",").map(parseFloat);
-            }else if(this.form.discountTimeType == "2"){
-              this.workDaytrue=false;
-              this.moonDaytrue=true;
-              this.datetrue=false;
-              this.collectClickCalendar= this.form.discountTime.split(',').map(parseFloat);
-            }else if(this.form.discountTimeType == "3"){
-              this.workDaytrue=false;
-              this.moonDaytrue=false;
-              this.datetrue=true;
-              if(this.form.discountTime!=""){
-                  this.pickerTime =this.form.discountTime.split(",");
-              }else{
-                this.pickerTime =null;
-              }
-            }
-          }
-        });
-      }else{
-          this.msgSuccess("请选择油站");
-      }
-    });
+    this.getList();
   },
   methods: {
-    oilNameFormatter(row, column){
-      if(row.oilName === '1'){
-        return '汽油'
-      }else if(row.oilName === '2'){
-        return '柴油'
+    cardOilsTypeFormatter(row, column){
+      if(row.cardOilsType === '1'){
+        return '汽油卡'
+      }else if(row.cardOilsType === '2'){
+        return '柴油卡'
+      }else if(row.cardOilsType === '1,2'){
+        return '汽油卡,柴油卡'
       }
     },
-    settingRuleTypeFotmat(row, column){
-      if(row.settingRuleType === '1'){
-        return '按赠送金额'
-      }else if(row.settingRuleType === '2'){
-        return '按赠送比例'
-      }
-    },
-    settingRuleTypeChange(){
-      if(this.infoform.settingRuleType == "1"){
-        this.jine=true;
-        this.bili=false;
-      }else if(this.infoform.settingRuleType == "2"){
-        this.jine=false;
-        this.bili=true;
-      }
-    },
-    statusFormatter(row, column){
-      if(row.status === '1'){
+    discountTimeSettingFormatter(row, column){
+      if(row.discountTimeSetting === '1'){
         return '开启'
-      }else if(row.status === '2'){
+      }else if(row.discountTimeSetting === '2'){
         return '关闭'
       }
     },
-    datePickerChang(){
-      if(this.form.discountTimeType == "1"){
-        this.workDaytrue=true;
-        this.moonDaytrue=false;
-        this.datetrue=false;
-      }else if(this.form.discountTimeType == "2"){
-        this.workDaytrue=false;
-        this.moonDaytrue=true;
-        this.datetrue=false;
-      }else if(this.form.discountTimeType == "3"){
-        this.workDaytrue=false;
-        this.moonDaytrue=false;
-        this.datetrue=true;
-      }
-    },
-    // 取消按钮
-    cancel() {
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        cardOilsType: null,
-        discountTimeSetting: null,
-        discountTime: null,
-        presentScale: null,
-        isDiscountCoupon: null,
-        enjoyIntegralMultiple: null,
-        stationId: null,
-        stationName: null,
-        createTime: null,
-        detailList:[],
-        datePicker:null
-      };
-      this.resetForm("form");
-
-    },
-    resetInfo() {
-      this.infoform = {
-        id: null,
-        parentId:null,
-        oilName: null,
-        discountAmtStart: null,
-        discountAmtEnd: null,
-        settingRuleType: null,
-        presentAmt: null
-      };
-      this.resetForm("infoform");
-
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.resetInfo();
-      this.index1=null;
-      this.open = true;
-      this.title = "添加客户电子会员卡充值优惠设置";
-      // this.infoform.status="1";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(index,row) {
-      this.index1=index;
-      this.infoform = row;
-      this.open = true;
-      this.title = "修改客户电子会员卡充值优惠设置";
-      this.settingRuleTypeChange();
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          let flag=true;
-          if(this.cardOilsTypeList !=null && this.cardOilsTypeList.length>0){
-            this.form.cardOilsType=this.cardOilsTypeList.toString();
-          }else{
-            this.form.cardOilsType="";
-            flag=false;
-          }
-          if (this.form.id != null) {
-            let datepicker = this.form.discountTimeType;
-            if(datepicker=="1"){
-              if(this.collectClickWorkDay!=null&&this.collectClickWorkDay.length>0){
-                let discountTime=null;
-                for(let i =0;i<this.collectClickWorkDay.length;i++){
-                  if(!isNaN(this.collectClickWorkDay[i]) && this.collectClickWorkDay[i]!="NaN"){
-                    if( discountTime!=null){
-                      discountTime =discountTime+","+this.collectClickWorkDay[i];
-                    }else{
-                      discountTime =this.collectClickWorkDay[i];
-                    }
-                  }else{
-                    discountTime =discountTime;
-                  }
-                }
-                this.form.discountTime=discountTime; 
-                discountTime=null;
-              } else{
-                  this.form.discountTime=""; 
-              }
-            }else if(datepicker=="2"){
-              if(this.collectClickCalendar!=null&&this.collectClickCalendar.length>0){
-                let discountTime=null;
-                for(let i =0;i<this.collectClickCalendar.length;i++){
-                  if(!isNaN(this.collectClickCalendar[i]) && this.collectClickCalendar[i]!="NaN"){
-                    if( discountTime!=null){
-                      discountTime =discountTime+","+this.collectClickCalendar[i];
-                    }else{
-                      discountTime =this.collectClickCalendar[i];
-                    }
-                  }else{
-                    discountTime =discountTime;
-                  }
-                }
-                this.form.discountTime=discountTime; 
-                discountTime=null;
-              } else{
-                  this.form.discountTime=""; 
-              }
-            }else{
-              if(this.pickerTime!=null){
-                  this.form.discountTime = this.pickerTime.toString();
-              }else{
-                this.form.discountTime = "";
-              }
-            }    
-            updateSetting(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.jine=false;
-              this.bili=false;
-            });
-          } else {
-            if(this.num==0){
-              if(datepicker=="1"){
-                if(this.collectClickWorkDay!=null&&this.collectClickWorkDay.length>0){
-                  let discountTime=null;
-                  for(let i =0;i<this.collectClickWorkDay.length;i++){
-                    if(!isNaN(this.collectClickWorkDay[i]) && this.collectClickWorkDay[i]!="NaN"){
-                      if( discountTime!=null){
-                        discountTime =discountTime+","+this.collectClickWorkDay[i];
-                      }else{
-                        discountTime =this.collectClickWorkDay[i];
-                      }
-                    }else{
-                      discountTime =discountTime;
-                    }
-                  }
-                  this.form.discountTime=discountTime; 
-                  discountTime=null;
-                } else{
-                    this.form.discountTime=""; 
-                }
-              }else if(datepicker=="2"){
-                  // this.form.discountTime=this.collectClickCalendar.toString();
-                  if(this.collectClickCalendar!=null&&this.collectClickCalendar.length>0){
-                    let discountTime=null;
-                    for(let i =0;i<this.collectClickCalendar.length;i++){
-                      if(!isNaN(this.collectClickCalendar[i]) && this.collectClickCalendar[i]!="NaN"){
-                        if( discountTime!=null){
-                          discountTime =discountTime+","+this.collectClickCalendar[i];
-                        }else{
-                          discountTime =this.collectClickCalendar[i];
-                        }
-                      }else{
-                        discountTime =discountTime;
-                      }
-                    }
-                    this.form.discountTime=discountTime; 
-                    discountTime=null;
-                  } else{
-                      this.form.discountTime=""; 
-                  }
-              }else{
-                if(this.pickerTime!=null){
-                   this.form.discountTime = this.pickerTime.toString();
-                }else{
-                  this.form.discountTime = "";
-                }
-              }
-              addSetting(this.form).then(response => {
-                this.msgSuccess("新增成功");
-                this.num=this.num+1;
-                this.jine=false;
-                this.bili=false;
-              });
-            }else{
-              this.msgSuccess("已新增成功,如需修改请刷新页面");
-            }
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(index) {
-     this.form.detailList.splice(index, 1)
-    },
-    deleteItemFromArr(item) {
-      // eslint-disable-next-line
-      Array.prototype.indexOf = function(val) {
-        for (var i = 0; i < this.length; i++) {
-          if (this[i] === val) {
-            return i
-          }
-        }
-        return -1
-      }
-      // 通过索引删除数组元素
-      Array.prototype.remove = function(val) {
-        var index = this.indexOf(val)
-        if (index > -1) {
-          this.splice(index, 1)
-        }
+    discountTimeTypeFormatter(row, column){
+      if(row.discountTimeSetting === '1'){
+        return '每周指定日'
+      }else if(row.discountTimeSetting === '2'){
+        return '每月指定日'
+      }else if(row.discountTimeSetting === '2'){
+        return '固定活动日'
       }
-      // 删除数组元素
-      this.collectClickCalendar.remove(item)
     },
-    clickCalendar(item, index) {
-      if (this.collectClickCalendar.indexOf(index) === -1) {
-        this.collectClickCalendar.push(index)
-      } else if (this.collectClickCalendar.indexOf(index) > -1) {
-        this.deleteItemFromArr(index)
+    isDiscountCouponFormatter(row, column){
+      if(row.isDiscountCoupon === '0'){
+        return '是'
+      }else if(row.isDiscountCoupon === '1'){
+        return '否'
       }
     },
-    deleteWorkDayFromArr(item) {
-      Array.prototype.indexOf = function(val) {
-        for (var i = 0; i < this.length; i++) {
-          if (this[i] === val) {
-            return i
-          }
-        }
-        return -1
+    isMarketFormatter(row, column){
+      if(row.isMarket === '0'){
+        return '是'
+      }else if(row.isMarket === '1'){
+        return '否'
       }
-      // 通过索引删除数组元素
-      Array.prototype.remove = function(val) {
-        var index = this.indexOf(val)
-        if (index > -1) {
-          this.splice(index, 1)
-        }
-      }
-      // 删除数组元素
-      this.collectClickWorkDay.remove(item);
     },
-    clickWorkDayCalendar(item, index) {
-      if (this.collectClickWorkDay.indexOf(index) === -1) {
-        this.collectClickWorkDay.push(index)
-      } else if (this.collectClickWorkDay.indexOf(index) > -1) {
-        this.deleteWorkDayFromArr(index)
+    isGradeSettingFormatter(row, column){
+      if(row.isGradeSetting === '0'){
+        return '是'
+      }else if(row.isGradeSetting === '1'){
+        return '否'
       }
     },
-    cancelOpen(){
-      this.infoform = {
-        oilName: null,
-        discountAmtStart: null,
-        discountAmtEnd: null,
-        settingRuleType: null,
-        presentAmt: null
-      };
-      this.index1=null;
-      this.resetForm("infoform");
-      this.open = false;
-      this.jine=false;
-      this.bili=false;
-    },
-    save(){
-      const that = this;
-      this.$refs["infoform"].validate(valid => {
-        if (valid) {
-          if(that.index1!=null){
-            that.handleDelete(that.index1);
-          }
-          that.form.detailList.push(that.infoform);
-        }
+    /** 查询客户电子会员卡充值优惠设置明细列表 */
+    getList() {
+      listDetailInfo(this.queryParams).then(response => {
+        this.detailList = response.rows;
+        this.total = response.total;
       });
-      this.cancelOpen();
-    }
+    },
   }
 };
 </script>

+ 90 - 131
src/views/customer/cardSettingDetail/index.vue

@@ -1,61 +1,72 @@
 <template>
   <div class="app-container">
-    <!-- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="" prop="presentAmt">
+    <el-form :model="queryParams" ref="queryForm" :inline="true"  label-width="68px">
+      <el-form-item label="会员名" prop="customerName">
         <el-input
-          v-model="queryParams.presentAmt"
+          v-model="queryParams.customerName"
+          placeholder="请输入客户名"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item> 
+      </el-form-item>
+     <el-form-item label="油品" prop="cardOilsType">
+        <el-select
+          v-model="queryParams.cardOilsType"
+          placeholder="请选择油品"
+          clearable
+          size="small"
+        >
+          <el-option
+            v-for="item in oilOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="消费时间" prop="">
+        <el-date-picker
+          v-model="dateRangeCreatedDate"
+          type="daterange"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+         >
+        </el-date-picker>
+      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">汇总</el-button> -->
+        <!-- <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['customer:record:export']" >导出</el-button> -->
       </el-form-item>
-    </el-form>-->
-
-    <el-table v-loading="loading" :data="detailList" >
-      <el-table-column label="电子会员卡充值规则" align="center" prop="parentId" >
+    </el-form>
+    <el-table  :data="recordList" >
+      <el-table-column label="id" align="center" prop="id" v-if="false" />
+      <el-table-column label="消费单号" align="center" prop="orderNo" />
+      <el-table-column label="微信用户唯一标识" align="center" prop="unionId" v-if="false" />
+      <el-table-column label="电子卡号" align="center" prop="customerNo" />
+      <el-table-column label="会员名" align="center" prop="customerName" />
+      <el-table-column label="油品" align="center" prop="cardOilsType" :formatter="cardOilsTypeFotmat"/>
+      <el-table-column label="电子会员卡消费充值类型:+,充值;-,消费;" align="center" prop="usageType" v-if="false" />
+      <el-table-column label="电子会员卡充值消费类型:1.微信;2.POS机" align="center" prop="payType" v-if="false"/>
+      <el-table-column label="消费金额" align="center" prop="amt" />
+      <el-table-column label="余额" align="center" prop="balance"  />
+      <el-table-column label="油站ID" align="center" prop="stationId" v-if="false"/>
+      <el-table-column label="油站名称" align="center" prop="stationName" />
+      <el-table-column label="支付时间" align="center" prop="payDate" width="150">
         <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>
+          <span>{{ parseTime(scope.row.payDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <!-- <el-table-column label="已开通油卡类型" align="center" prop="cardOilsType" width="120px;"/> -->
-      <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;" >
+      <el-table-column label="创建时间" align="center" prop="createTime" width="150">
         <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>
+          <span>{{ parseTime(scope1.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</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-column label="是否消费成功:0,未成功;1,成功" align="center" prop="status" v-if="false"/>
     </el-table>
-
     <pagination
       v-show="total>0"
       :total="total"
@@ -67,37 +78,29 @@
 </template>
 
 <script>
-import { listDetailInfo} from "@/api/customer/cardSettingDetail";
+import { listConsumption, exportConsumption } from "@/api/customer/consumption";
+
 export default {
-  name: "Detail",
+  name: "Record",
   data() {
     return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
+      //创建订单时间间隔
+      dateRangeCreatedDate:[],
       // 总条数
       total: 0,
-      // 客户电子会员卡充值优惠设置明细表格数据
-      detailList: [],
+      // 客户电子会员卡充值消费记录表格数据
+      recordList: [],
+      oilOptions:[],
       // 弹出层标题
       title: "",
-      // 是否显示弹出层
-      open: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        parentId: null,
-        settingRuleType: null,
-        discountAmtTerm: null,
-        presentAmt: null
+        customerName: null,
+        usageType: "-",
+        cardOilsType: null,
+        status: 1
       },
       // 表单参数
       form: {},
@@ -108,83 +111,25 @@ export default {
   },
   created() {
     this.getList();
+    this.getDicts("oil").then(response => {
+      this.oilOptions = response.data;
+    });
   },
   methods: {
-    cardOilsTypeFormatter(row, column){
-      if(row.cardOilsType === '1'){
-        return '汽油卡'
-      }else if(row.cardOilsType === '2'){
-        return '柴油卡'
-      }else if(row.cardOilsType === '1,2'){
-        return '汽油卡,柴油卡'
+    cardOilsTypeFotmat(row, column){
+      if(row.cardOilsType === '2'){
+        return '柴油'
+      }else if(row.cardOilsType === '1'){
+        return '汽油'
       }
     },
-    discountTimeSettingFormatter(row, column){
-      if(row.discountTimeSetting === '1'){
-        return '开启'
-      }else if(row.discountTimeSetting === '2'){
-        return '关闭'
-      }
-    },
-    discountTimeTypeFormatter(row, column){
-      if(row.discountTimeSetting === '1'){
-        return '每周指定日'
-      }else if(row.discountTimeSetting === '2'){
-        return '每月指定日'
-      }else if(row.discountTimeSetting === '2'){
-        return '固定活动日'
-      }
-    },
-    isDiscountCouponFormatter(row, column){
-      if(row.isDiscountCoupon === '0'){
-        return '是'
-      }else if(row.isDiscountCoupon === '1'){
-        return '否'
-      }
-    },
-    isMarketFormatter(row, column){
-      if(row.isMarket === '0'){
-        return '是'
-      }else if(row.isMarket === '1'){
-        return '否'
-      }
-    },
-    isGradeSettingFormatter(row, column){
-      if(row.isGradeSetting === '0'){
-        return '是'
-      }else if(row.isGradeSetting === '1'){
-        return '否'
-      }
-    },
-    /** 查询客户电子会员卡充值优惠设置明细列表 */
+    /** 查询客户电子会员卡充值消费记录列表 */
     getList() {
-      this.loading = true;
-      this.queryParams.stationId=this.$store.selectDeptId;
-      if(this.queryParams.stationId==null || this.queryParams.stationId==""){
-        this.queryParams.stationId =this.$store.state.user.deptId;
-      }
-      listDetailInfo(this.queryParams).then(response => {
-        this.detailList = response.rows;
+      listConsumption(this.addDateRange(this.queryParams, this.dateRangeCreatedDate)).then(response => {
+        this.recordList = response.rows;
         this.total = response.total;
-        this.loading = false;
       });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        parentId: null,
-        settingRuleType: null,
-        discountAmtTerm: null,
-        presentAmt: null
-      };
-      this.resetForm("form");
-    },
+    }, 
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
@@ -195,6 +140,20 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有客户电子会员卡充值记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportConsumption(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    }
   }
 };
 </script>

+ 31 - 101
src/views/customer/consumption/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
       <el-form-item label="会员名" prop="customerName">
         <el-input
           v-model="queryParams.customerName"
@@ -10,7 +10,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-     <el-form-item label="油品" prop="cardOilsType">
+      <el-form-item label="油品" prop="cardOilsType">
         <el-select
           v-model="queryParams.cardOilsType"
           placeholder="请选择油品"
@@ -25,7 +25,7 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="消费时间" prop="">
+      <el-form-item label="充值时间" prop="">
         <el-date-picker
           v-model="dateRangeCreatedDate"
           type="daterange"
@@ -42,30 +42,20 @@
         <!-- <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['customer:record:export']" >导出</el-button> -->
       </el-form-item>
     </el-form>
-    <el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
+    <el-table  :data="recordList" >
       <el-table-column label="id" align="center" prop="id" v-if="false" />
-      <el-table-column label="消费单号" align="center" prop="orderNo" />
+      <el-table-column label="充值单号" align="center" prop="orderNo" />
       <el-table-column label="微信用户唯一标识" align="center" prop="unionId" v-if="false" />
       <el-table-column label="电子卡号" align="center" prop="customerNo" />
       <el-table-column label="会员名" align="center" prop="customerName" />
       <el-table-column label="油品" align="center" prop="cardOilsType" :formatter="cardOilsTypeFotmat"/>
       <el-table-column label="电子会员卡消费充值类型:+,充值;-,消费;" align="center" prop="usageType" v-if="false" />
-      <el-table-column label="电子会员卡充值消费类型:1.微信;2.POS机" align="center" prop="payType" v-if="false"/>
-      <el-table-column label="消费金额" align="center" prop="amt" />
-      <el-table-column label="余额" align="center" prop="balance"  />
+      <el-table-column label="充值金额" align="center" prop="amt" />
+      <el-table-column label="余额" align="center" prop="balance" />
+      <el-table-column label="消费方式" align="center" prop="payType" :formatter="payTypeFotmat"/>
       <el-table-column label="油站ID" align="center" prop="stationId" v-if="false"/>
       <el-table-column label="油站名称" align="center" prop="stationName" />
-      <el-table-column label="支付时间" align="center" prop="payDate" width="150">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.payDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime" width="150">
-        <template slot-scope="scope1">
-          <span>{{ parseTime(scope1.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="是否消费成功:0,未成功;1,成功" align="center" prop="status" v-if="false"/>
+      <el-table-column label="油站名称" align="center" prop="create_time" v-if="false"/>
     </el-table>
     <pagination
       v-show="total>0"
@@ -78,7 +68,7 @@
 </template>
 
 <script>
-import { listConsumption, exportConsumption } from "@/api/customer/consumption";
+import { listRecharge, exportRecharge } from "@/api/customer/recharge";
 
 export default {
   name: "Record",
@@ -86,16 +76,6 @@ export default {
     return {
       //创建订单时间间隔
       dateRangeCreatedDate:[],
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
       // 总条数
       total: 0,
       // 客户电子会员卡充值消费记录表格数据
@@ -103,31 +83,17 @@ export default {
       oilOptions:[],
       // 弹出层标题
       title: "",
-      // 是否显示弹出层
-      open: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        orderNo: null,
-        unionId: null,
-        customerNo: null,
         customerName: null,
-        usageType: "-",
-        payType: null,
+        usageType: "+",
         cardOilsType: null,
-        amt: null,
-        presentAmt: null,
-        balance: null,
-        stationId: null,
-        stationName: null, 
         status: 1
       },
       // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
+      form: {}     
     };
   },
   created() {
@@ -137,81 +103,45 @@ export default {
     });
   },
   methods: {
+    payTypeFotmat(row, column){
+      if(row.payType === '1'){
+        return '小程序'
+      }else if(row.payType === '2'){
+        return 'POS'
+      }
+    },
     cardOilsTypeFotmat(row, column){
-      if(row.cardOilsType === '2'){
-        return '柴油'
-      }else if(row.cardOilsType === '1'){
+      if(row.cardOilsType === '1'){
         return '汽油'
+      }else if(row.cardOilsType === '2'){
+        return '柴油'
       }
     },
     /** 查询客户电子会员卡充值消费记录列表 */
     getList() {
-      this.loading = true;
-      this.queryParams.stationId= this.$store.selectDeptId;
-      if(this.queryParams.stationId==null || this.queryParams.stationId==""){
-        this.queryParams.stationId =this.$store.state.user.deptId;
-      }
-      listConsumption(this.addDateRange(this.queryParams, this.dateRangeCreatedDate)).then(response => {
+      listRecharge(this.addDateRange(this.queryParams, this.dateRangeCreatedDate)).then(response => {
         this.recordList = response.rows;
         this.total = response.total;
-        this.loading = false;
       });
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        orderNo: null,
-        unionId: null,
-        customerNo: null,
-        customerName: null,
-        usageType: null,
-        payType: null,
-        cardOilsType: null,
-        amt: null,
-        presentAmt: null,
-        balance: null,
-        createTime: null,
-        stationId: null,
-        stationName: null,
-        status: "0"
-      };
-      this.resetForm("form");
-    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.getList();
     },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
     /** 导出按钮操作 */
     handleExport() {
       this.queryParams.stationId= this.$store.selectDeptId;
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有客户电子会员卡充值记录数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportConsumption(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return exportRecharge(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
     }
   }
 };

+ 233 - 0
src/views/point/Point_Bill.vue

@@ -0,0 +1,233 @@
+<template>
+  <div class="app-container">
+    <el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="主键自增" align="center" prop="id" />
+      <el-table-column label="微信用户唯一标识" align="center" prop="unionId" />
+      <el-table-column label="客户名称" align="center" prop="customerName" />
+      <el-table-column label="积分记录类型:-,消耗; +,增加;" align="center" prop="recordType"  />
+      <el-table-column label="消耗或增加积分" align="center" prop="integral" />
+      <el-table-column label="时间" align="center" prop="createTime" />
+      <el-table-column label="油站ID" align="center" prop="stationId" />
+      <el-table-column label="油站名称" align="center" prop="stationName" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['integral:record:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['integral:record:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改客户积分记录对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="微信用户唯一标识" prop="unionId">
+          <el-input v-model="form.unionId" placeholder="请输入微信用户唯一标识" />
+        </el-form-item>
+        <el-form-item label="客户名称" prop="customerName">
+          <el-input v-model="form.customerName" placeholder="请输入客户名称" />
+        </el-form-item>
+        <el-form-item label="积分记录类型:-,消耗; +,增加;" prop="recordType">
+          <el-select v-model="form.recordType" placeholder="请选择积分记录类型:-,消耗; +,增加;">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="消耗或增加积分" prop="integral">
+          <el-input v-model="form.integral" placeholder="请输入消耗或增加积分" />
+        </el-form-item>
+        <el-form-item label="油站ID" prop="stationId">
+          <el-input v-model="form.stationId" placeholder="请输入油站ID" />
+        </el-form-item>
+        <el-form-item label="油站名称" prop="stationName">
+          <el-input v-model="form.stationName" placeholder="请输入油站名称" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listRecord, getRecord, delRecord, addRecord, updateRecord, exportRecord } from "@/api/integral/record";
+
+export default {
+  name: "Record",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 客户积分记录表格数据
+      recordList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        unionId: null,
+        customerName: null,
+        recordType: null,
+        integral: null,
+        stationId: null,
+        stationName: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询客户积分记录列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.stationId= this.$store.selectDeptId;
+      if(this.queryParams.stationId==null || this.queryParams.stationId==""){
+        this.queryParams.stationId =this.$store.state.user.deptId;
+      }
+      listRecord(this.queryParams).then(response => {
+        this.recordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        unionId: null,
+        customerName: null,
+        recordType: null,
+        integral: null,
+        createTime: null,
+        stationId: null,
+        stationName: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加客户积分记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getRecord(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改客户积分记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateRecord(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addRecord(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除客户积分记录', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delRecord(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有客户积分记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportRecord(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    }
+  }
+};
+</script>

+ 164 - 0
src/views/point/Point_Order.vue

@@ -0,0 +1,164 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="90px">
+      <el-form-item label="积分订单号" prop="integralOrderNo">
+        <el-input
+          v-model="queryParams.integralOrderNo"
+          placeholder="请输入积分订单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="商品名称" prop="waresName">
+        <el-input
+          v-model="queryParams.waresName"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="会员名称" prop="customerName">
+        <el-input
+          v-model="queryParams.customerName"
+          placeholder="请输入会员名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="兑换时间" prop="exchangeTime">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.exchangeTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择兑换时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table :data="orderList">
+      <af-table-column label="积分订单id" align="center" prop="id" v-if="false"/>
+      <af-table-column label="订单号" align="center" prop="integralOrderNo" />
+      <af-table-column label="商品类型" align="center" prop="waresType" v-if="false"/>
+      <af-table-column label="商品名称" align="center" prop="waresName" />
+      <af-table-column label="微信唯一标识" align="center" prop="unionId"  v-if="false"/>
+      <af-table-column label="会员名称" align="center" prop="customerName" />
+      <af-table-column label="手机号" align="center" prop="mobilePhone" />bu
+      <af-table-column label="兑换数量" align="center" prop="exchangeNum" />
+      <af-table-column label="兑换时间" align="center" prop="exchangeTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.exchangeTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </af-table-column>
+      <af-table-column label="订单状态" align="center" prop="status" :formatter="statusFormat" />
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+  </div>
+</template>
+
+<script>
+import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/integral/order";
+
+export default {
+  name: "Order",
+  data() {
+    return {
+      // 总条数
+      total: 0,
+      // 积分消费订单表格数据
+      orderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        integralOrderNo: null,
+        waresType: null,
+        waresName: null,
+        unionId: null,
+        customerName: null,
+        exchangeNum: null,
+        exchangeTime: null,
+        status: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    statusFormat(row, column){
+      if(row.status === '1'){
+        return '已兑换'
+      }else if(row.status === '2'){
+        return '兑换中'
+      }
+    },
+    /** 查询积分消费订单列表 */
+    getList() {
+      this.queryParams.stationId= this.$store.selectDeptId;
+      if(this.queryParams.stationId==null || this.queryParams.stationId==""){
+        this.queryParams.stationId =this.$store.state.user.deptId;
+      }
+      listOrder(this.queryParams).then(response => {
+        this.orderList = response.rows;
+        this.total = response.total;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        integralOrderNo: null,
+        waresType: null,
+        waresName: null,
+        unionId: null,
+        customerName: null,
+        exchangeNum: null,
+        exchangeTime: null,
+        status: "0"
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    }
+  }
+};
+</script>

+ 271 - 0
src/views/point/Point_Product.vue

@@ -0,0 +1,271 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true"  label-width="68px">
+      <el-form-item label="商品名称" prop="waresName">
+        <el-input
+          v-model="queryParams.waresName"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button type="info" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="waresList" @selection-change="handleSelectionChange">
+      <el-table-column label="商品id" align="center" prop="id"  v-if="false" />
+      <el-table-column label="商品类别" align="center" prop="waresType"  v-if="false" />
+      <el-table-column label="商品名称" align="center" prop="waresName" />
+      <el-table-column label="消费积分" align="center" prop="saleIntegral" />
+      <el-table-column label="商品图片" align="center" prop="waresPic" v-if="false" />
+      <el-table-column label="商品详情" align="center" prop="waresDetail"  width="155" />
+      <el-table-column label="油站ID" align="center" prop="stationId" v-if="false" />
+      <el-table-column label="油站名称" align="center" prop="stationName" />
+      <el-table-column label="库存" align="center" prop="waresCount" />
+      <el-table-column label="商品状态" align="center" prop="waresStatus" :formatter="waresStatusFotmat" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <div  v-if="scope.row.waresStatus==2">
+            <el-button
+                       size="mini"
+                       type="text"
+                       icon="el-icon-edit"
+                       @click="updateSJ(scope.row)"
+            >上架</el-button>
+          </div>
+          <div  v-if="scope.row.waresStatus==1">
+            <el-button size="mini"
+                       type="text"
+                       icon="el-icon-edit"
+                       @click="updateSJ(scope.row)"
+            >下架</el-button>
+          </div>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['integral:wares:edit']"
+          >修改</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改【请填写功能名称】对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="商品图片" prop="waresPic">
+          <el-upload
+            class="avatar-uploader"
+            :action="addressUrl"
+            :headers="headers"
+            :show-file-list="false"
+            :on-success="handleAvatarSuccess"
+            :before-upload="beforeAvatarUpload">
+            <img v-if="form.waresPic" :src="form.waresPic" style="width:150px;height: 150px;" class="avatar">
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+            <div class="el-upload__tip" slot="tip">点击图片重新上传,只能上传jpg/png文件,图片大小不超过2M</div>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="商品名称" prop="waresName">
+          <el-input v-model="form.waresName" placeholder="请输入商品名称" />
+        </el-form-item>
+        <el-form-item label="商品详情" prop="waresDetail">
+          <textarea v-model="form.waresDetail" placeholder="请输入商品详情" rows="4" cols="50"></textarea>
+        </el-form-item>
+        <el-form-item label="消费积分" prop="saleIntegral">
+          <el-input-number v-model="form.saleIntegral" :min="0" placeholder="请输入消费积分" />
+        </el-form-item>
+        <el-form-item label="库存"  prop="waresCount">
+          <el-input-number v-model="form.waresCount" :min="0" placeholder="请输入库存数量" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listWares, getWares, delWares, addWares, updateWares, exportWares } from "@/api/integral/wares";
+import {getToken} from "@/utils/auth";
+import { getDept } from "@/api/system/dept";
+export default {
+  name: "Wares",
+  data() {
+    return {
+      // 总条数
+      total: 0,
+      // 表格数据
+      waresList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        waresName: null
+      },
+      deptInfo:{},
+      deptId: null,
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      headers: { Authorization: "Bearer " + getToken() },
+      addressUrl: location.protocol+"//"+location.host+ process.env.VUE_APP_BASE_API+"/common/upload"
+  
+    };
+  },
+  created() {
+    this.getList();
+    
+  },
+  methods: {
+    waresStatusFotmat(row, column) {
+      if (row.waresStatus === '1') {
+        return '已上架'
+      } else if (row.waresStatus === '2') {
+        return '已下架'
+      }
+    },
+   
+    /** 查询【请填写功能名称】列表 */
+    getList() {
+      listWares(this.queryParams).then(response => {
+        this.waresList = response.rows;
+        this.total = response.total;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        waresType: null,
+        waresName: null,
+        saleIntegral: null,
+        waresPic: null,
+        waresDetail: null,
+        waresStatus: "1",
+        createTime: null,
+        createBy: null,
+        updateTime: null,
+        updateBy: null,
+        waresCount: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.deptId=this.$store.selectDeptId;
+      if(this.deptId==null || this.deptId==""){
+        this.deptId =this.$store.state.user.deptId;
+      }
+      getDept(this.deptId).then(response => {
+          this.deptInfo = response.data;
+          if(this.deptInfo.jiBie==2){
+            this.open = true;
+            this.title = "添加商品信息";
+          }else{
+              this.msgSuccess("请选择油站");
+          }
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id 
+      getWares(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改商品信息";
+      });
+    },
+    updateSJ(row){
+      this.reset();
+      this.form.id= row.id;
+      if(row.waresStatus==1){
+        this.form.waresStatus=2;
+      }else{
+        this.form.waresStatus = 1;
+      }
+      if (this.form.id != null) {
+        updateWares(this.form).then(response => {
+          this.msgSuccess("修改成功");
+          this.getList();
+        });
+      }
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateWares(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addWares(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    // 文件上传成功处理++ =
+    handleAvatarSuccess(res, file) {
+      let imgurl=location.protocol+"//"+location.host+process.env.VUE_APP_BASE_API+res .fileName;
+      this.form.waresPic = imgurl;
+    },
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === 'image/jpeg'|| 'image/png';
+      const isLt2M = file.size / 1024 / 1024 < 2;
+      if (!isJPG) {
+        this.$message.error('上传头像图片只能是 JPG 格式!');
+      }
+      if (!isLt2M) {
+        this.$message.error('上传头像图片大小不能超过 2MB!');
+      }
+      return isJPG && isLt2M;
+    }
+  }
+};
+</script>

+ 143 - 0
src/views/point/Point_RuleList.vue

@@ -0,0 +1,143 @@
+<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-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" >
+          <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>
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import {listRuleInfo} from "@/api/integral/rule";
+export default {
+  name: "Rule",
+  data() {
+    return {
+      // 弹出层标题
+      title: "",
+      total:0,
+      // 是否显示弹出层
+      open: false,
+      ruleList:[],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      queryInfo:{},
+      // 表单参数
+      form: {
+        itemsDetail: [{}],
+        notOilList: [{}],
+        imgFileList:[]
+      },
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("term_date").then(response => {
+      this.termDateManageOptions = response.data;
+    });
+    this.getDicts("expiration").then(response => {
+      this.expirationOptions = response.data;
+    });
+    this.getDicts("integral_deduction_oil").then(response => {
+      this.integralDeductionOilOptions = response.data;
+    });
+    this.getDicts("integral_manage").then(response => {
+      this.integralActivityOptions = response.data;
+    });
+        
+  },
+  methods: {
+    /** 查询列表 */
+    getList() {
+      //积分规则信息
+      listRuleInfo(this.queryParams).then(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 '固定活动日'
+      }
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+  }
+};
+</script>