wzy
2021-04-01 d388e2788b7ef088d7cd40f901b0acdcec460bc3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!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>