Showing
5 changed files
with
461 additions
and
0 deletions
client/js/goods/yohoCoin.js
0 → 100644
1 | +//yoho币 | ||
2 | +'use strict'; | ||
3 | +var $ = require('jquery'), | ||
4 | + common=require('../common/common'); | ||
5 | + | ||
6 | +var ENUM = { | ||
7 | + gender: { | ||
8 | + 1: '男', | ||
9 | + 2: '女', | ||
10 | + 3: '通用' | ||
11 | + }, | ||
12 | + status: { | ||
13 | + 1: '<font color="#428bca">待审核</font>', | ||
14 | + 2: '<font color="#5cb85c">通过</font>', | ||
15 | + 3: '<font color="#d9534f">驳回</font>' | ||
16 | + } | ||
17 | +} | ||
18 | + | ||
19 | +/* | ||
20 | +var g = new common.grid({ | ||
21 | + el: "#yohoCoin_table1", | ||
22 | + parms: function() { | ||
23 | + return { | ||
24 | + product_skn: common.util.__input("skn"), | ||
25 | + shop_id: common.util.__input("shop"), | ||
26 | + brand_id: common.util.__input("brand"), | ||
27 | + supplier_id: common.util.__input("supplier"), | ||
28 | + gender: common.util.__input("gender") | ||
29 | + }; | ||
30 | + }, | ||
31 | + columns: [{ | ||
32 | + display: 'SKN', | ||
33 | + name: 'product_skn' | ||
34 | + }, { | ||
35 | + display: '商品信息', | ||
36 | + name: 'info', | ||
37 | + render: function(item) { | ||
38 | + return '<div>名称:' + item.product_name + '</div>' + | ||
39 | + '<div>品牌:' + item.brand_name + '</div>' + | ||
40 | + '<div>类目:' + item.middle_sort_name + '<b> ></b> ' + item.small_sort_name + '</div>'; | ||
41 | + } | ||
42 | + }, { | ||
43 | + display: '供应商 / 店铺', | ||
44 | + name: 'supplier_name', | ||
45 | + render: function(item) { | ||
46 | + var html = ''; | ||
47 | + if (item.supplier_name) { | ||
48 | + html += item.supplier_name; | ||
49 | + } | ||
50 | + if (item.shop_name) { | ||
51 | + html += '/' + item.shop_name; | ||
52 | + } | ||
53 | + return html; | ||
54 | + } | ||
55 | + }, { | ||
56 | + display: '性别', | ||
57 | + name: 'gender', | ||
58 | + render: function(item) { | ||
59 | + return ENUM.gender[item.gender]; | ||
60 | + } | ||
61 | + }, { | ||
62 | + display: '吊牌价', | ||
63 | + name: 'retail_price' | ||
64 | + }, { | ||
65 | + display: '销售价', | ||
66 | + name: 'sales_price' | ||
67 | + }, { | ||
68 | + display: '返币金额', | ||
69 | + name: 'return_coin' | ||
70 | + }, { | ||
71 | + display: '状态', | ||
72 | + name: 'status', | ||
73 | + render: function(item) { | ||
74 | + return ENUM.status[item.status]; | ||
75 | + } | ||
76 | + },{ | ||
77 | + display: '操作信息', | ||
78 | + name: 'operateInfo', | ||
79 | + render: function(item) { | ||
80 | + var html = ''; | ||
81 | + if (item.founder_name) { | ||
82 | + html += '<div>' + item.founder_name + '</div>'; | ||
83 | + } | ||
84 | + if (item.updateTime) { | ||
85 | + html += '<div>' + item.updateTime + '</div>'; | ||
86 | + } | ||
87 | + return html; | ||
88 | + } | ||
89 | + }, { | ||
90 | + display: '操作', | ||
91 | + render: function(item) { | ||
92 | + return '<a href="javascript:;" class="btn btn-info btn-xs btn-modify" data-skn="' + item.product_skn + '">修改</a>' | ||
93 | + } | ||
94 | + }] | ||
95 | +}); | ||
96 | +*/ | ||
97 | + | ||
98 | +var g = new common.grid({ | ||
99 | + el: "#yohoCoin_table", | ||
100 | + parms: function() { | ||
101 | + return { | ||
102 | + product_skn: common.util.__input("skn"), | ||
103 | + shop_id: common.util.__input("shop"), | ||
104 | + brand_id: common.util.__input("brand"), | ||
105 | + supplier_id: common.util.__input("supplier"), | ||
106 | + gender: common.util.__input("gender") | ||
107 | + }; | ||
108 | + }, | ||
109 | + columns: [{ | ||
110 | + display: '', | ||
111 | + render: function(item){ | ||
112 | + var html = ""; | ||
113 | + if(item.__index == 0){ | ||
114 | + $("#yohoCoin_table").find("thead tr th").html($("#coinListHead").html()); | ||
115 | + } | ||
116 | + item.genderName = ENUM.gender[item.gender]; | ||
117 | + html += common.util.__template2($("#coinList").html(),item); | ||
118 | + return html; | ||
119 | + } | ||
120 | + }] | ||
121 | +}); | ||
122 | + | ||
123 | +g.init($("#gridurl").val()); | ||
124 | + | ||
125 | +$(document).on('click', '.btn-modify', function() { | ||
126 | + if($(this).hasClass("openEditor")){ | ||
127 | + $(this).text("修改").removeClass("openEditor"); | ||
128 | + $(this).parents(".dataForShow").find(".dataForEditor td").hide(); | ||
129 | + }else{ | ||
130 | + $(this).text("收起").addClass("openEditor"); | ||
131 | + $(this).parents(".dataForShow").find(".dataForEditor td").show(); | ||
132 | + } | ||
133 | +}); | ||
134 | + |
client/sass/module/yohocoin.css
0 → 100644
1 | + | ||
2 | +#yohoCoin_table tbody td, #yohoCoin_table thead th { | ||
3 | + padding: 0; | ||
4 | +} | ||
5 | + | ||
6 | +#yohoCoin_table .coinListHead{ | ||
7 | + text-align: center; | ||
8 | + font-weight: bold; | ||
9 | +} | ||
10 | + | ||
11 | +#yohoCoin_table .dataForShow table, #yohoCoin_table .dataForEditor table{ | ||
12 | + width: 100%; | ||
13 | + table-layout:fixed; | ||
14 | +} | ||
15 | + | ||
16 | +#yohoCoin_table .dataForShow tr td, #yohoCoin_table .dataForEditor table tr td{ | ||
17 | + padding: 10px; | ||
18 | + border-left: 1px solid #ddd; | ||
19 | +} | ||
20 | +#yohoCoin_table .center{ | ||
21 | + text-align: center; | ||
22 | +} | ||
23 | +#yohoCoin_table .dataForShow tr td:first-child{ | ||
24 | + border-left: none; | ||
25 | +} | ||
26 | + | ||
27 | +#yohoCoin_table .dataForEditor tr td{ | ||
28 | + padding: 0; | ||
29 | + display: none; | ||
30 | + border-bottom: none; | ||
31 | + background: #d9edf7; | ||
32 | +} | ||
33 | +#yohoCoin_table .dataForEditor tr:first-child{ | ||
34 | + border-bottom: 1px solid #ddd; | ||
35 | + border-top: 1px solid #ddd; | ||
36 | +} | ||
37 | + | ||
38 | + |
server/interface/yohoCoin.js
0 → 100644
1 | +exports.domain = require('../config/common.js').domain; | ||
2 | + | ||
3 | +exports.res = [ | ||
4 | + { | ||
5 | + route: '/goods/yohoCoin/index', | ||
6 | + method: 'GET', | ||
7 | + view: 'pages/goods/yohoCoin', | ||
8 | + src:'/goods/yohoCoin', | ||
9 | + 'data': { | ||
10 | + pagetitle: { | ||
11 | + level1title: '商品管理', | ||
12 | + level2title: '价格管理', | ||
13 | + level3title: 'yoho币管理' | ||
14 | + }, | ||
15 | + filter: { | ||
16 | + skn: true, | ||
17 | + store: true, | ||
18 | + brand: true, | ||
19 | + supplier: true, | ||
20 | + gender: true, | ||
21 | + cate_1: true, | ||
22 | + cate_2: true, | ||
23 | + cate_3: true, | ||
24 | + returnCoinTime: false, | ||
25 | + bulkImport: true | ||
26 | + }, | ||
27 | + gridurl: '/goods/price/list' | ||
28 | + } | ||
29 | + } | ||
30 | +] |
server/views/pages/goods/yohoCoin.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head lang="en"> | ||
4 | + <meta charset="UTF-8"> | ||
5 | + <title></title> | ||
6 | +</head> | ||
7 | +<body> | ||
8 | + | ||
9 | +<div class="pageheader"> | ||
10 | + <div class="media"> | ||
11 | + <div class="pageicon pull-left"> | ||
12 | + <i class="fa fa-th-list"></i> | ||
13 | + </div> | ||
14 | + {{#pagetitle}} | ||
15 | + <div class="media-body"> | ||
16 | + <ul class="breadcrumb"> | ||
17 | + <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> | ||
18 | + <li><a href="">{{level1title}}</a></li> | ||
19 | + <li>{{level2title}}</li> | ||
20 | + </ul> | ||
21 | + <div> | ||
22 | + <div style="width: 30%;float: left;"> | ||
23 | + <h4>{{level3title}}</h4> | ||
24 | + </div> | ||
25 | + </div> | ||
26 | + </div> | ||
27 | + {{/pagetitle}} | ||
28 | + </div> | ||
29 | +</div> | ||
30 | + | ||
31 | +<div class="contentpanel"> | ||
32 | + <div class="panel panel-default" style="margin-bottom:10px;"> | ||
33 | + {{# filter}} | ||
34 | + <div class="panel-body"> | ||
35 | + <div class="row"> | ||
36 | + {{# skn}} | ||
37 | + <div class="panel-col2"> | ||
38 | + <input id="skn" class="form-control panel-input height40" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')"> | ||
39 | + </div> | ||
40 | + {{/ skn}} | ||
41 | + | ||
42 | + {{# store}} | ||
43 | + <div class="panel-col"> | ||
44 | + <select name="shop" id="shop" tabindex="-1" title="" class="form-control"> | ||
45 | + <option value="-1">请选择店铺</option> | ||
46 | + </select> | ||
47 | + </div> | ||
48 | + {{/ store}} | ||
49 | + | ||
50 | + {{# brand}} | ||
51 | + <div class="panel-col"> | ||
52 | + <select name="brand" id="brand" tabindex="-1" title="" class="form-control"> | ||
53 | + <option value="-1">请选择品牌</option> | ||
54 | + </select> | ||
55 | + </div> | ||
56 | + {{/ brand}} | ||
57 | + | ||
58 | + {{# supplier}} | ||
59 | + <div class="panel-col"> | ||
60 | + <select name="supplier" id="supplier" tabindex="-1" title="" class="form-control"> | ||
61 | + <option value="-1">请选择供应商</option> | ||
62 | + </select> | ||
63 | + </div> | ||
64 | + {{/ supplier}} | ||
65 | + | ||
66 | + {{# gender}} | ||
67 | + <div class="panel-col"> | ||
68 | + <select name="gender" id="gender" tabindex="-1" title="" class="form-control"> | ||
69 | + <option value="-1">选择性别</option> | ||
70 | + <option value="1">男</option> | ||
71 | + <option value="2">女</option> | ||
72 | + <option value="3">通用</option> | ||
73 | + </select> | ||
74 | + </div> | ||
75 | + {{/ gender}} | ||
76 | + | ||
77 | + {{# cate_1}} | ||
78 | + <div class="panel-col"> | ||
79 | + <select name="cate_1" id="cate_1" tabindex="-1" title="" class="form-control"> | ||
80 | + <option value="-1">请选择一级类目</option> | ||
81 | + </select> | ||
82 | + </div> | ||
83 | + {{/ cate_1}} | ||
84 | + | ||
85 | + {{# cate_2}} | ||
86 | + <div class="panel-col"> | ||
87 | + <select name="cate_2" id="cate_2" tabindex="-1" title="" class="form-control"> | ||
88 | + <option value="-1">请选择二级类目</option> | ||
89 | + </select> | ||
90 | + </div> | ||
91 | + {{/ cate_2}} | ||
92 | + | ||
93 | + {{# cate_3}} | ||
94 | + <div class="panel-col"> | ||
95 | + <select name="cate_3" id="cate_3" tabindex="-1" title="" class="form-control"> | ||
96 | + <option value="-1">请选择三级类目</option> | ||
97 | + </select> | ||
98 | + </div> | ||
99 | + {{/ cate_3}} | ||
100 | + | ||
101 | + {{# returnCoinTime}} | ||
102 | + <div class="panel-col form-inline" style="width: auto"> | ||
103 | + <div class="form-group" style="margin-right: 0"> | ||
104 | + <label>反币时间:</label> | ||
105 | + <input type="text" class="form-control" jsaction="date:end:endDate" id="startDate" placeholder="开始时间"> | ||
106 | + </div> | ||
107 | + <label>~</label> | ||
108 | + <div class="form-group"> | ||
109 | + <input type="text" class="form-control" jsaction="date:start:startDate" id="endDate" placeholder="结束时间"> | ||
110 | + </div> | ||
111 | + </div> | ||
112 | + {{/ returnCoinTime}} | ||
113 | + | ||
114 | + <div class="panel-col" style="width: auto"> | ||
115 | + <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> | ||
116 | + <a id="all-btn" href="javascript:;" class="btn btn-info">全部</a> | ||
117 | + {{# bulkImport}} | ||
118 | + <a id="import-btn" href="javascript:;" class="btn btn-info">批量导入</a> | ||
119 | + {{/ bulkImport}} | ||
120 | + </div> | ||
121 | + </div> | ||
122 | + </div> | ||
123 | + {{/ filter}} | ||
124 | + </div> | ||
125 | + | ||
126 | + <div class="panel"> | ||
127 | + <div class="dataTables_wrapper no-footer" id="yohoCoin_table"></div> | ||
128 | + | ||
129 | + <div class="panel bulk-import"> | ||
130 | + <div class="import-hd"> | ||
131 | + <span class="excel-upload-wrap"> | ||
132 | + <label>选择文件</label> | ||
133 | + <input id="upload-input" name="file" class="btn btn-default excel-upload" type="file"> | ||
134 | + </span> | ||
135 | + | ||
136 | + <a class="excel-model" href="/ajax/link/{{download}}">表头下载</a> | ||
137 | + <input id="sure-change" class="btn btn-primary" type="button" value="确定变价"> | ||
138 | + </div> | ||
139 | + <ol id="error-msg" class="error-msg" style="color: red"></ol> | ||
140 | + | ||
141 | + <div class="priceTable-wrap"> | ||
142 | + <div class="panel panel-warning" style="margin: 0;"> | ||
143 | + <div class="panel-heading">SKN变价<a id="delete-all" class="btn btn-danger" style="margin-left: 50px;" href="javascript:;">全部删除</a></div> | ||
144 | + </div> | ||
145 | + <div class="dataTables_wrapper no-footer" id="priceTable"></div> | ||
146 | + </div> | ||
147 | + | ||
148 | + <div class="success-wrap" style="display: none;"> | ||
149 | + <a class="btn btn-info" href="">返回变价列表</a> | ||
150 | + <a id="download-btn" class="btn btn-success" data-domain="{{domain}}" href="javascript:;">下载导入结果</a> | ||
151 | + </div> | ||
152 | + </div> | ||
153 | + </div> | ||
154 | +</div> | ||
155 | + | ||
156 | +<input type="hidden" id="gridurl" value="{{gridurl}}"> | ||
157 | + | ||
158 | +<script id="coinListHead" type="text/template"> | ||
159 | + <div class="coinListHead dataForShow"> | ||
160 | + <table><tbody> | ||
161 | + <tr> | ||
162 | + <td style="width: 10%">SKN</td> | ||
163 | + <td style="width: 25%">商品信息</td> | ||
164 | + <td style="width: 20%">供应商 / 店铺</td> | ||
165 | + <td style="width: 5%">性别</td> | ||
166 | + <td style="width: 5%">吊牌价</td> | ||
167 | + <td style="width: 5%">销售价</td> | ||
168 | + <td style="width: 5%">返还金额</td> | ||
169 | + <td style="width: 5%">状态</td> | ||
170 | + <td style="width: 15%">操作信息</td> | ||
171 | + <td style="width: 5%">操作</td> | ||
172 | + </tr> | ||
173 | + </tbody></table> | ||
174 | + </div> | ||
175 | +</script> | ||
176 | + | ||
177 | +<script id="coinList" type="text/template"> | ||
178 | + <div class="dataForShow"> | ||
179 | + <table><tbody> | ||
180 | + <tr> | ||
181 | + <td rowspan="2" span="2" class="center" style="width: 10%">[[product_skn]]</td> | ||
182 | + <td class="" style="width: 25%"> | ||
183 | + <p>名称:[[product_name]]</p> | ||
184 | + <p>品牌:[[brand_name]]</p> | ||
185 | + <div>类目:[[middle_sort_name]] <b>></b>[[small_sort_name]]</div> | ||
186 | + </td> | ||
187 | + <td style="width: 20%"> | ||
188 | + [[if supplier_name]] | ||
189 | + [[supplier_name]] | ||
190 | + [[/if]] | ||
191 | + [[if shop_name]] | ||
192 | + /[[shop_name]] | ||
193 | + [[/if]] | ||
194 | + </td> | ||
195 | + <td class="center" style="width: 5%">[[genderName]]</td> | ||
196 | + <td class="center" style="width: 5%">[[retail_price]]</td> | ||
197 | + <td class="center" style="width: 5%">[[sales_price]]</td> | ||
198 | + <td class="center" style="width: 5%">[[return_coin]]</td> | ||
199 | + <td class="center" style="width: 5%">[[status]]</td> | ||
200 | + <td style="width: 15%"> | ||
201 | + [[if founder_name]] | ||
202 | + <p>[[founder_name]]</p> | ||
203 | + [[/if]] | ||
204 | + [[if updateTime]] | ||
205 | + <p>[[updateTime]]</p> | ||
206 | + [[/if]] | ||
207 | + </td> | ||
208 | + <td class="center" style="width: 5%"><button type="button" class="btn btn-info btn-sm btn-modify">修改</button></td> | ||
209 | + </tr> | ||
210 | + | ||
211 | + <tr class="dataForEditor"> | ||
212 | + <td colspan="9" style="padding: 0"> | ||
213 | + <table> | ||
214 | + <tr class="center"> | ||
215 | + <td width="50%"><b>反币时间</b></td> | ||
216 | + <td><b>返回金币</b></td> | ||
217 | + <td><b>审核人</b></td> | ||
218 | + <td><b>操作</b></td> | ||
219 | + </tr> | ||
220 | + <tr> | ||
221 | + <td> | ||
222 | + <div class="radio" style="margin-top: 0"> | ||
223 | + <label> | ||
224 | + <input type="radio" name="returnCoinTime" value="option1" checked> | ||
225 | + 永久 | ||
226 | + </label> | ||
227 | + </div> | ||
228 | + <div class="radio" style="margin-bottom: 0"> | ||
229 | + <label> | ||
230 | + <input type="radio" name="returnCoinTime" value="option1" checked> | ||
231 | + <form class="form-inline"> | ||
232 | + <div class="form-group" style="margin-right: 0"><input type="text" class="form-control"></div> ~ | ||
233 | + <div class="form-group" style="margin-right: 0"><input type="text" class="form-control"></div> | ||
234 | + </form> | ||
235 | + </label> | ||
236 | + </div> | ||
237 | + </td> | ||
238 | + <td class="center"><input type="text" class="form-control" placeholder="返回yoho币" value="[[return_coin]]"></td> | ||
239 | + <td class="center"> | ||
240 | + <select class="form-control"> | ||
241 | + <option>1</option> | ||
242 | + <option>2</option> | ||
243 | + <option>3</option> | ||
244 | + <option>4</option> | ||
245 | + <option>5</option> | ||
246 | + </select> | ||
247 | + </td> | ||
248 | + <td class="center"><button type="submit" class="btn btn-primary btn-sm">保存</button></td> | ||
249 | + </tr> | ||
250 | + </table> | ||
251 | + </td> | ||
252 | + </tr> | ||
253 | + </tbody></table> | ||
254 | + </div> | ||
255 | +</script> | ||
256 | + | ||
257 | +</body> | ||
258 | +</html> |
-
Please register or login to post a comment