| <!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"/> | 
|     <style> | 
|         .el-col{ | 
|             line-height: 40px; | 
|         } | 
|         .gray{ | 
|             color:#aaaaaa; | 
|         } | 
|   | 
|     </style> | 
| </head> | 
| <body> | 
| <div class="ibox-content" id="app" v-cloak> | 
|     <el-tabs  type="card" v-model="activeName" @tab-click="handleClick"> | 
|         <el-tab-pane label="积分规则" name="first"> | 
|         <p class="el-big-title">设置积分规则</p> | 
|             <el-table | 
|                     :data="tableData" | 
|                     style="width: 100%"> | 
|                 <el-table-column | 
|                         prop="date" | 
|                         label="获得条件" | 
|                         width="180"> | 
|                 </el-table-column> | 
|                 <el-table-column | 
|                         prop="name" | 
|                         label="支付方式" | 
|                         width="180"> | 
|                 </el-table-column> | 
|                 <el-table-column | 
|                         label="获取积分"> | 
|                     <template slot-scope="scope"> | 
|                          <el-input v-model="scope.row.point" style="width: 100px;" type="number"></el-input> | 
|                         <span>元/积分</span> | 
|                     </template> | 
|                 </el-table-column> | 
|             </el-table> | 
|   | 
|   | 
|             <el-button class="mt-20" type="primary" @click="onSubmit(1)" >保存规则</el-button> | 
|   | 
|   | 
|         </el-tab-pane> | 
|         <el-tab-pane label="积分抵现" name="second"> | 
|             <p class="el-big-title">设置积分抵现比例</p> | 
|             <el-row> | 
|                 <el-col :span="3">积分抵现:</el-col> | 
|                 <el-col :span="10"> | 
|                     <el-row > | 
|                     <el-radio-group v-model="VipPoints_IsOpen"> | 
|                         <el-radio :label="2">关闭</el-radio> | 
|                         <el-radio :label="1">开启</el-radio> | 
|                     </el-radio-group> | 
|                     </el-row> | 
|                     <template v-if="VipPoints_IsOpen==1"> | 
|                     <el-row > | 
|                         <el-col :span="4">  抵现比例:</el-col> | 
|                         <el-col :span="6"> | 
|                             <el-input v-model="VipPoints_ToMoneyRate"  type="number" ></el-input> | 
|                         </el-col> | 
|                         <el-col :offset="1" :span="10">  积分 = 1 元 </el-col> | 
|   | 
|                     </el-row> | 
|                         <el-row > <el-col class="gray" :span="24">客户在进行积分抵现消费时,多少积分可以抵1元现金</el-col></el-row> | 
|                     </template> | 
|                     <el-button class="mt-20" type="primary"  @click="onSubmit(2)" >保存</el-button> | 
|                 </el-col> | 
|   | 
|             </el-row> | 
|   | 
|   | 
|         </el-tab-pane> | 
|     </el-tabs> | 
|   | 
| </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: { | 
|             VipPoints_IsOpen:1, | 
|             VipPoints_ToMoneyRate:'0', | 
|             input:'', | 
|             activeName: 'first', | 
|             tableData: [{ | 
|                 date: '购买产品', | 
|                 name: '现金支付', | 
|                 point: '' | 
|             }, { | 
|                 date: '购买产品', | 
|                 name: '余额支付', | 
|                 point: '' | 
|             }, { | 
|                 date: '服务划扣', | 
|                 name: '-', | 
|                 point: '' | 
|             }] | 
|         }, | 
|         created: function () { | 
|            this.loadInfo(); | 
|         }, | 
|   | 
|         methods: { | 
|             handleClick(tab, event) { | 
|                 console.log(tab, event); | 
|             }, | 
|   | 
|             loadInfo() { | 
|                 let _this = this; | 
|   | 
|   | 
|                 //加载配置 | 
|                 AjaxProxy.requst({ | 
|                     app: _this, | 
|                     data: [ | 
|                             'VipPoint_CashPay', | 
|                             'VipPoint_CardMoneyPay', | 
|                             'VipPoint_ServiceHk', | 
|                             'VipPoints_IsOpen', | 
|                             'VipPoints_ToMoneyRate'], | 
|                     url: basePath + '/admin/busParameterSettings/getByCodes', | 
|                     callback: function (data) { | 
|   | 
|                       _this.tableData[0].point=data.rows[0].paramValue; | 
|                       _this.tableData[1].point=data.rows[1].paramValue; | 
|                       _this.tableData[2].point=data.rows[2].paramValue; | 
|                       _this.VipPoints_IsOpen= parseInt(data.rows[3].paramValue); | 
|                       _this.VipPoints_ToMoneyRate=data.rows[4].paramValue; | 
|                     } | 
|                 }); | 
|             }, | 
|   | 
|             onSubmit(type) { | 
|                 let _this = this; | 
|                 let data={}; | 
|                 if(type==1){ | 
|                     //保存第一个选项卡 | 
|                     data = [{ paramCode: "VipPoint_CashPay", paramValue: _this.tableData[0].point  }, | 
|                             { paramCode: "VipPoint_CardMoneyPay", paramValue:_this.tableData[1].point }, | 
|                             { paramCode: "VipPoint_ServiceHk", paramValue: _this.tableData[2].point }] | 
|                 }else if(type==2){ | 
|                     //保存第二个选项卡 | 
|                     data = [{ paramCode: "VipPoints_IsOpen", paramValue: _this.VipPoints_IsOpen  }, | 
|                         { paramCode: "VipPoints_ToMoneyRate", paramValue: _this.VipPoints_ToMoneyRate }] | 
|                 } | 
|   | 
|                 AjaxProxy.requst({ | 
|                     app: _this, | 
|                     data: data, | 
|                     url: basePath + '/admin/busParameterSettings/modifyParams', | 
|                     callback: function (data) { | 
|                         _this.$message({ | 
|                             message: data.info, | 
|                             type: 'success' | 
|                         }); | 
|                     } | 
|                 }); | 
|   | 
|             } | 
|         } | 
|   | 
|     }) | 
| </script> | 
|   | 
| </body> | 
| </html> |