xiaoyong931011
2021-02-24 c71601fab220a0e1d497e0bed9f036faaae0626a
积分规则设置20210224
6 files added
1 files deleted
5 files modified
799 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/common/dao/BusParameterSettingsDao.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java 51 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderAction.java 28 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java 151 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/constant/ScoreSettingConstant.java 71 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderDao.java patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dto/SocreRuleDto.java 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderService.java 49 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/vo/ScoreRuleSettingsVo.java 139 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml 10 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/score/score-setting.html 289 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/dao/BusParameterSettingsDao.java
@@ -42,7 +42,7 @@
    List<BusParameterSettings> selectByCodes(@Param("list")List<String> codeList, @Param("companyId")Long companyId,@Param("shopId")Long shopId);
    List<BusParameterSettings> selectByCodesAndCompanyId(@Param("list")List<String> codeList, @Param("companyId")Long companyId);
    BusParameterSettings selectByCode(@Param("code")String code, @Param("companyId")Long companyId,@Param("shopId")Long shopId);
zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java
New file
@@ -0,0 +1,51 @@
package com.matrix.system.common.service.impl;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysCompany;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.score.constant.ScoreSettingConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class InitBusParameterSettingService {
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    /**
     * 初始化默认积分规则设置
     */
    public void initBusParameterSetting(SysCompany sysCompany) {
        long companyId = sysCompany.getComId();
        List<BusParameterSettings> ruleSettings=new ArrayList<>();
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CREDIT_POINTS_CASH, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.GIVE_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.REFERRALS_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.SIGN_SHOP, companyId));
        busParameterSettingsDao.batchInsert(ruleSettings);
    }
    private BusParameterSettings addScoreRuleSetting(String code,long companyId) {
        BusParameterSettings busParameterSetting = new BusParameterSettings();
        busParameterSetting.setParamCode(code);
        busParameterSetting.setCompanyId(companyId);
        return busParameterSetting;
    }
}
zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java
@@ -62,6 +62,9 @@
    @Autowired
    private InitShopProductCateService initShopProductCateService;
    @Autowired
    private InitBusParameterSettingService initBusParameterSettingService;
    @Transactional
    @Override
@@ -76,6 +79,7 @@
        initRolePowerService.initRolePower(sysCompany);
        initGoodsTypeService.initRolePower(sysCompany);
        initShopProductCateService.initShopProductCate(sysCompany);
        initBusParameterSettingService.initBusParameterSetting(sysCompany);
        return i;
zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java
New file
@@ -0,0 +1,151 @@
package com.matrix.system.score.action;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.ParameterSettings;
import com.matrix.system.hive.bean.SysProjUse;
import com.matrix.system.score.constant.ScoreSettingConstant;
import com.matrix.system.score.service.ScoreOrderService;
import com.matrix.system.score.vo.ScoreOrderVo;
import com.matrix.system.score.vo.ScoreRuleSettingsVo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import net.sf.jsqlparser.util.AddAliasesVisitor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
 * @author wzy
 * @date 2021-02-22
 **/
@Api(value = "积分订单", tags = "积分订单")
@RestController
@RequestMapping(value = "/score/ruleSetting")
public class ScoreRuleSettingAction {
    @Autowired
    private ScoreOrderService scoreOrderService;
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    @GetMapping(value = "/testApi")
    public AjaxResult testApi() {
        scoreOrderService.testMethod();
        return AjaxResult.buildSuccessInstance("success");
    }
    /**
     *查询积分规则配置
     */
    @RequestMapping(value = "/selectScoreRule")
    public AjaxResult selectScoreRule() {
       AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
       SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
       Long companyId = user.getCompanyId();
       //积分有效期
       String[] jfyxqArrayCode={ScoreSettingConstant.VALID_PERIOD_POINTS};
       String[] jfyxqArrayName={"积分有效期:从获得开始 到"};
       List<ScoreRuleSettingsVo> jfyxqRuleSettingsVo = getRuleSettingsVo(jfyxqArrayCode,jfyxqArrayName,companyId);
       result.putInMap("jfyxq", jfyxqRuleSettingsVo);
       //积分抵扣现金
       String[] jfdxjArrayCode={ScoreSettingConstant.CREDIT_POINTS_CASH};
       String[] jfdxjArrayName={"积分抵扣现金"};
       List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(jfdxjArrayCode), companyId);
       List<ScoreRuleSettingsVo> jfdxjRuleSettingsVo=new ArrayList<ScoreRuleSettingsVo>();
       int index=0;
       for (BusParameterSettings item:dataList){
           ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo();
            BeanUtils.copyProperties(item,paramVo);
            paramVo.setParamName(jfdxjArrayName[index]);
            String paramValue = paramVo.getParamValue();
            if(StrUtil.isNotEmpty(paramValue)) {
                paramVo.setParamSwitch(Boolean.TRUE);
            }else {
                paramVo.setParamSwitch(Boolean.FALSE);
            }
            jfdxjRuleSettingsVo.add(paramVo);
            index++;
       }
       result.putInMap("jfdxj", jfdxjRuleSettingsVo);
       //门店积分规则
       String[] mdjfArrayCode={
               ScoreSettingConstant.CASH_CONSUMPTION,
               ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION,
               ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION,
               ScoreSettingConstant.PRINCIPAL_CONSUMPTION,
               ScoreSettingConstant.GIVE_CONSUMPTION,
               ScoreSettingConstant.REFERRALS_CONSUMPTION};
       String[] mdjfArrayName={
               "现金消费",
               "本金余额消费",
               "赠金余额消费",
               "本金消耗",
               "赠送消耗",
               "转介客户"};
       List<ScoreRuleSettingsVo> mdjfRuleSettingsVo = getRuleSettingsVo(mdjfArrayCode,mdjfArrayName,companyId);
       result.putInMap("mdjf", mdjfRuleSettingsVo);
       //商城积分规则
       String[] scjfArrayCode={
               ScoreSettingConstant.CASH_CONSUMPTION_SHOP,
               ScoreSettingConstant.RESERVATION_SERVICE_SHOP,
               ScoreSettingConstant.EVALUATUIN_ORDER_SHOP,
               ScoreSettingConstant.SIGN_SHOP};
       String[] scjfArrayName={
               "现金消费",
               "预约服务",
               "评价订单",
               "签到"};
       List<ScoreRuleSettingsVo> scjfRuleSettingsVo =getRuleSettingsVo(scjfArrayCode,scjfArrayName,companyId);
       result.putInMap("scjf", scjfRuleSettingsVo);
       return result;
    }
    /**
     *获取对应的积分规则设置数据
     * @param ArrayCode
     * @param ArrayName
     * @param companyId
     * @return
     */
    private List<ScoreRuleSettingsVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){
        List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId);
        List<ScoreRuleSettingsVo> scoreRuleSettingsVos=new ArrayList<ScoreRuleSettingsVo>();
        int index=0;
        for (BusParameterSettings item:dataList){
            ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo();
             BeanUtils.copyProperties(item,paramVo);
             paramVo.setParamName(ArrayName[index]);
             scoreRuleSettingsVos.add(paramVo);
             index++;
        }
        return scoreRuleSettingsVos;
    }
    /**
     * 修改公司维度的积分规则
     */
    @PostMapping(value = "/updateScoreRule")
    public @ResponseBody
    AjaxResult updateScoreRule(@RequestBody List<BusParameterSettings> busParameterSettings) {
        return scoreOrderService.updateScoreRuleByCompanyId(busParameterSettings);
    }
}
zq-erp/src/main/java/com/matrix/system/score/constant/ScoreSettingConstant.java
New file
@@ -0,0 +1,71 @@
package com.matrix.system.score.constant;
public class ScoreSettingConstant {
    /**
     * 积分有效期
     */
    public final static String VALID_PERIOD_POINTS = "VALID_PERIOD_POINTS";
    public final static String VALID_PERIOD_POINTS_NAME = "积分有效期:从获得开始 到";
    /**
     * 积分抵扣现金
     */
    public final static String CREDIT_POINTS_CASH = "CREDIT_POINTS_CASH";
    public final static String CREDIT_POINTS_CASH_NAME = "积分抵扣现金";
    //门店设置
    /**
     * 现金消费
     */
    public final static String CASH_CONSUMPTION = "CASH_CONSUMPTION";
    public final static String CASH_CONSUMPTION_NAME = "现金消费";
    /**
     * 本金余额消费
     */
    public final static String PRINCIPAL_BALANCE_CONSUMPTION = "PRINCIPAL_BALANCE_CONSUMPTION";
    public final static String PRINCIPAL_BALANCE_CONSUMPTION_NAME = "本金余额消费";
    /**
     * 赠金余额消费
     */
    public final static String BONUS_BALANCE_CONSUMPTION = "BONUS_BALANCE_CONSUMPTION";
    public final static String BONUS_BALANCE_CONSUMPTION_NAME = "赠金余额消费";
    /**
     * 本金消耗
     */
    public final static String PRINCIPAL_CONSUMPTION = "PRINCIPAL_CONSUMPTION";
    public final static String PRINCIPAL_CONSUMPTION_NAME = "本金消耗";
    /**
     * 赠送消耗
     */
    public final static String GIVE_CONSUMPTION = "GIVE_CONSUMPTION";
    public final static String GIVE_CONSUMPTION_NAME = "赠送消耗";
    /**
     * 转介客户
     */
    public final static String REFERRALS_CONSUMPTION = "REFERRALS_CONSUMPTION";
    public final static String REFERRALS_CONSUMPTION_NAME = "转介客户";
    //商城设置
    /**
     * 现金消费
     */
    public final static String CASH_CONSUMPTION_SHOP = "CASH_CONSUMPTION_SHOP";
    public final static String CASH_CONSUMPTION_SHOP_NAME = "现金消费";
    /**
     * 预约服务
     */
    public final static String RESERVATION_SERVICE_SHOP = "RESERVATION_SERVICE_SHOP";
    public final static String RESERVATION_SERVICE_SHOP_NAME = "预约服务";
    /**
     * 评价订单
     */
    public final static String EVALUATUIN_ORDER_SHOP = "EVALUATUIN_ORDER_SHOP";
    public final static String EVALUATUIN_ORDER_SHOP_NAME = "评价订单";
    /**
     * 签到
     */
    public final static String SIGN_SHOP = "SIGN_SHOP";
    public final static String SIGN_SHOP_NAME = "签到";
}
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderDao.java
zq-erp/src/main/java/com/matrix/system/score/dto/SocreRuleDto.java
New file
@@ -0,0 +1,5 @@
package com.matrix.system.score.dto;
public class SocreRuleDto {
}
zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderService.java
@@ -1,10 +1,28 @@
package com.matrix.system.score.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.hive.bean.ParameterSettings;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.score.constant.ScoreSettingConstant;
import com.matrix.system.score.dao.ScoreOrderDao;
import com.matrix.system.score.entity.ScoreOrderEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * @author wzy
@@ -15,9 +33,40 @@
    @Autowired
    private ScoreOrderDao scoreOrderDao;
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    @Autowired
    private SysVipInfoDao sysVipInfoDao;
    public void testMethod() {
        scoreOrderDao.selectById(1L);
    }
    public AjaxResult updateScoreRuleByCompanyId(List<BusParameterSettings> busParameterSettings) {
        //获取当前登录人员信息
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        for (BusParameterSettings busParameterSetting:busParameterSettings ) {
            String paramCode = busParameterSetting.getParamCode();
            if(StringUtils.isNotBlank(paramCode)){
                //删除原有code
                BusParameterSettings delParanm=new BusParameterSettings();
                delParanm.setCompanyId(user.getCompanyId());
                delParanm.setParamCode(paramCode);
                busParameterSettingsDao.deleteByModel(delParanm);
                //添加新的code
                BusParameterSettings newParam=new BusParameterSettings();
                newParam.setParamCode(paramCode);
                newParam.setCompanyId(user.getCompanyId());
                newParam.setParamValue(busParameterSetting.getParamValue());
                newParam.setParamValue1(busParameterSetting.getParamValue1());
                newParam.setParamValue2(busParameterSetting.getParamValue2());
                busParameterSettingsDao.insert(newParam);
            }else{
                return AjaxResult.buildFailInstance("code不能为空");
            }
        }
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "更新成功");
        return result;
    }
}
zq-erp/src/main/java/com/matrix/system/score/vo/ScoreRuleSettingsVo.java
New file
@@ -0,0 +1,139 @@
package com.matrix.system.score.vo;
import com.matrix.core.anotations.Extend;
public class ScoreRuleSettingsVo {
    @Extend
    private static final long serialVersionUID = 1L;
    private Long paramId;
    /**
     * 参数名称
     */
    private String paramName;
    /**
     * 参数编码
     */
    private String paramCode;
    /**
     * switch按钮
     */
    private Boolean paramSwitch;
    /**
     * 参数值
     */
    private String paramValue;
    /**
     * 值1
     */
    private String paramValue1;
    /**
     * 值2
     */
    private String paramValue2;
    /**
     * 值3
     */
    private String paramValue3;
    private Long companyId;
    private Long shopId;
    public Long getShopId() {
        return shopId;
    }
    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }
    public Long getCompanyId() {
        return companyId;
    }
    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }
    public Long getParamId() {
        return paramId;
    }
    public void setParamId(Long paramId) {
        this.paramId = paramId;
    }
    public String getParamCode() {
        return paramCode;
    }
    public void setParamCode(String paramCode) {
        this.paramCode = paramCode;
    }
    public String getParamValue() {
        return paramValue;
    }
    public void setParamValue(String paramValue) {
        this.paramValue = paramValue;
    }
    public String getParamValue1() {
        return paramValue1;
    }
    public void setParamValue1(String paramValue1) {
        this.paramValue1 = paramValue1;
    }
    public String getParamValue2() {
        return paramValue2;
    }
    public void setParamValue2(String paramValue2) {
        this.paramValue2 = paramValue2;
    }
    public String getParamValue3() {
        return paramValue3;
    }
    public void setParamValue3(String paramValue3) {
        this.paramValue3 = paramValue3;
    }
    public String getParamName() {
        return paramName;
    }
    public void setParamName(String paramName) {
        this.paramName = paramName;
    }
    public Boolean getParamSwitch() {
        return paramSwitch;
    }
    public void setParamSwitch(Boolean paramSwitch) {
        this.paramSwitch = paramSwitch;
    }
}
zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml
@@ -384,6 +384,16 @@
        </foreach>
    </select>
    <select id="selectByCodesAndCompanyId" resultMap="BusParameterSettingsMap">
        select * from bus_parameter_settings where company_id=#{companyId}
        and param_code in
        <foreach collection="list" index="index" item="item" open="("
                 separator="," close=")">
            #{item}
        </foreach>
    </select>
    <select id="selectByCode" resultMap="BusParameterSettingsMap">
         select * from bus_parameter_settings where
         param_code=#{code}
zq-erp/src/main/resources/templates/views/admin/score/score-setting.html
New file
@@ -0,0 +1,289 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
    <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
    <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="ibox-content" id="app" v-cloak>
    <el-form label-width="120px" >
        <el-row>
            <p class="el-big-title">积分规则</p>
        </el-row>
        <el-row>
            <el-col :span="10">
                <template v-for="paramSettingOnes in jfyxq">
                    <el-form-item label-width="200px;">
                        <span slot="label">{{paramSettingOnes.paramName}}</span>
                        <el-col :span="8">
                            <el-select v-model="paramSettingOnes.paramValue" placeholder="请选择">
                                <el-option label="本年后" value="1"></el-option>
                                <el-option label="1年后" value="2"></el-option>
                                <el-option label="2年后" value="3"></el-option>
                                <el-option label="3年后" value="4"></el-option>
                                <el-option label="4年后" value="5"></el-option>
                                <el-option label="5年后" value="6"></el-option>
                                </el-select>
                        </el-col>
                        <el-col :span="2" style="margin-left: 10px;display: flex;align-items: center;height: 40px">
                            <el-tooltip class="item" effect="dark" content="设置为“1年后”,表示在今年获得的用户积分将在明年的12月31号23:59:59失效,以此类推" placement="top">
                                <i class="el-icon-question" style="font-size: 18px;color:#999999" ></i>
                            </el-tooltip>
                        </el-col>
                    </el-form-item >
                </template>
            </el-col>
            <el-col :span="14">
                <template v-for="paramSettingTwos in jfdxj">
                    <el-form-item>
                        <span slot="label">{{paramSettingTwos.paramName}}</span>
                        <el-col :span="1">
                            <el-switch v-model="paramSettingTwos.paramSwitch" active-color="#13ce66" inactive-color="#ccc" @change="change">
                            </el-switch>
                        </el-col>
                        <el-col :span="2" style="margin-left: 10px;display: flex;align-items: center;height: 40px">
                            <el-tooltip class="item" effect="dark" content="客户付款时,可以选择积分抵现付款" placement="top">
                                <i class="el-icon-question" style="font-size: 18px;color:#999999" ></i>
                            </el-tooltip>
                        </el-col>
                        <el-col :span="11">
                            <transition>
                            <div v-show="paramSettingTwos.paramSwitch">
                                <el-col :span="6">
                                    <el-input v-model="paramSettingTwos.paramValue" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input>
                                </el-col>
                                <el-col class="line" :span="5">积分=1元</el-col>
                            </div>
                            </transition>
                        </el-col>
                    </el-form-item>
                </template>
            </el-col>
        </el-row>
        <el-row>
            <el-tabs v-model="activeName" >
                <el-tab-pane label="门店积分规则" name="first">
                <el-row>
                    <el-col :span="24">
                            <el-form-item>
                                <el-col class="line" :span="8">本人积分</el-col>
                                <el-col class="line" :span="8">老带新积分</el-col>
                                <el-col class="line" :span="8">二级老带新积分</el-col>
                            </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <template v-for="paramSetting in mdjf">
                            <el-form-item>
                                <span slot="label">{{paramSetting.paramName}}</span>
                                <el-col :span="4">
                                    <el-input v-model="paramSetting.paramValue" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input>
                                </el-col>
                                <el-col class="line" :span="4">元/积分</el-col>
                                <el-col :span="4">
                                    <el-input v-model="paramSetting.paramValue1" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input>
                                </el-col>
                                <el-col class="line" :span="4">元/积分</el-col>
                                <el-col :span="4">
                                    <el-input v-model="paramSetting.paramValue2" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input>
                                </el-col>
                                <el-col class="line" :span="4">元/积分</el-col>
                            </el-form-item>
                        </template>
                    </el-col>
                </el-row>
            </el-tab-pane>
                <el-tab-pane label="商城积分规则" name="second">
                    <el-row>
                        <el-col :span="24">
                            <el-form-item>
                                <el-col class="line" :span="8">本人积分</el-col>
                                <el-col class="line" :span="8">老带新积分</el-col>
                                <el-col class="line" :span="8">二级老带新积分</el-col>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <template v-for="paramSettingShop in scjf">
                                <el-form-item>
                                    <span slot="label">{{paramSettingShop.paramName}}</span>
                                    <el-col :span="4">
                                        <el-input v-model="paramSettingShop.paramValue" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input>
                                    </el-col>
                                    <el-col class="line" :span="4">元/积分</el-col>
                                    <el-col :span="4">
                                        <el-input v-model="paramSettingShop.paramValue1" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input>
                                    </el-col>
                                    <el-col class="line" :span="4">元/积分</el-col>
                                    <el-col :span="4">
                                        <el-input v-model="paramSettingShop.paramValue2" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input>
                                    </el-col>
                                    <el-col class="line" :span="4">元/积分</el-col>
                                </el-form-item>
                            </template>
                        </el-col>
                    </el-row>
                </el-tab-pane>
            </el-tabs>
        </el-row>
        <el-row justify="center" type="flex">
            <el-button type="primary" @click="submit()">保存</el-button>
        </el-row>
    </el-form>
</div>
</body>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            activeName: 'first',
            jfyxq:[],
            jfdxj:[],
            mdjf:[],
            scjf:[],
        },
        created: function () {
            this.loadInfo();
        },
        mounted: function () {
        },
        methods: {
            //加载分类
            loadInfo() {
                let _this = this;
                _this.loadParamSetting();
            },
            loadParamSetting() {
                let _this = this;
                //加载配置
                AjaxProxy.requst({
                    app: _this,
                    data: {},
                    url: basePath + '/score/ruleSetting/selectScoreRule',
                    callback: function (data) {
                        _this.jfyxq = data.mapInfo.jfyxq;
                        _this.jfdxj = data.mapInfo.jfdxj;
                        _this.mdjf = data.mapInfo.mdjf;
                        _this.scjf = data.mapInfo.scjf;
                        console.log("over");
                    }
                });
            },
            change(data){
                if(data){
                    this.paramSwitch = true;
                }else{
                    this.paramSwitch = false;
                }
            },
            submit() {
                console.log("提交");
                let _this = this;
                let submitDate = [];
                for (let i = 0; i < _this.jfyxq.length; i++) {
                    let paramSetting = _this.jfyxq[i];
                    let paramCode = paramSetting.paramCode;
                    let paramValue = paramSetting.paramValue;
                    let paramValue1 = paramSetting.paramValue1;
                    let paramValue2 = paramSetting.paramValue2;
                    let obj = {
                        paramCode: paramCode,
                        paramValue: paramValue,
                        paramValue1: paramValue1,
                        paramValue2: paramValue2,
                    }
                    submitDate.push(obj);
                }
                for (let i = 0; i < _this.scjf.length; i++) {
                    let paramSetting = _this.scjf[i];
                    let paramCode = paramSetting.paramCode;
                    let paramValue = paramSetting.paramValue;
                    let paramValue1 = paramSetting.paramValue1;
                    let paramValue2 = paramSetting.paramValue2;
                    let obj = {
                        paramCode: paramCode,
                        paramValue: paramValue,
                        paramValue1: paramValue1,
                        paramValue2: paramValue2,
                    }
                    submitDate.push(obj);
                }
                for (let i = 0; i < _this.mdjf.length; i++) {
                    let paramSetting = _this.mdjf[i];
                    let paramCode = paramSetting.paramCode;
                    let paramValue = paramSetting.paramValue;
                    let paramValue1 = paramSetting.paramValue1;
                    let paramValue2 = paramSetting.paramValue2;
                    let obj = {
                        paramCode: paramCode,
                        paramValue: paramValue,
                        paramValue1: paramValue1,
                        paramValue2: paramValue2,
                    }
                    submitDate.push(obj);
                }
                for (let i = 0; i < _this.jfdxj.length; i++) {
                    let paramSetting = _this.jfdxj[i];
                    let paramCode = paramSetting.paramCode;
                    let paramSwitch = paramSetting.paramSwitch;
                    let paramValue;
                    if(paramSwitch){
                        paramValue = paramSetting.paramValue;
                    }
                    let paramValue1 = paramSetting.paramValue1;
                    let paramValue2 = paramSetting.paramValue2;
                    let obj = {
                        paramCode: paramCode,
                        paramValue: paramValue,
                        paramValue1: paramValue1,
                        paramValue2: paramValue2,
                    }
                    submitDate.push(obj);
                }
                AjaxProxy.requst({
                    app: _this,
                    data: submitDate,
                    url: basePath + '/score/ruleSetting/updateScoreRule',
                    callback: function (data) {
                        _this.$message({
                            message: data.info,
                            type: 'success',
                            onClose: function () {
                                _this.loadParamSetting();
                            }
                        });
                    }
                });
            }
        }
    })
</script>
</body>
</html>