Authored by dongjunjie

代销变价新增学生价

1 module.exports={ 1 module.exports={
2 - namespace:"price",  
3 - apis:{  
4 - queryProductPriceList:{  
5 - title:'代销变价',  
6 - url:'/product/queryProductPriceList',  
7 - params: [  
8 - {name: 'product_skn',type: 'Number'},  
9 - {name: 'shop_id',type: 'Number'},  
10 - {name: 'brand_id',type: 'Number'},  
11 - {name: 'supplier_id',type: 'Number'},  
12 - {name: 'is_jit',type: 'String'},  
13 - {name: 'is_auditing',type: 'Number'},  
14 - {name: 'stock',type: 'Number'},  
15 - {name: 'gender',type: 'Number'},  
16 - {name: 'max_sort_id',type: 'Number'},  
17 - {name: 'middle_sort_id', type: 'Number'},  
18 - {name: 'small_sort_id', type: 'Number'},  
19 - {name: 'page', type: 'Number'},  
20 - {name: 'size', type: 'Number'}  
21 - ]  
22 - },  
23 - getProductPrice:{  
24 - title:'获得单个变价详情',  
25 - url: '/product/getProductPrice',  
26 - params: [  
27 - {name: 'param', type: 'Number'}  
28 - ]  
29 - },  
30 - updatePrice:{  
31 - title:'单个变价接口',  
32 - url: '/product/getProductPrice',  
33 - params: [  
34 - {name: 'product_skn', type: 'number'},  
35 - {name: 'sales_price', type: 'number'},  
36 - {name: 'vip_discount_type', type: 'number'},  
37 - {name: 'return_coin', type: 'number'},  
38 - {name: 'vip_price', type: 'number'},  
39 - {name: 'vip1_price', type: 'number'},  
40 - {name: 'vip2_price', type: 'number'},  
41 - {name: 'vip3_price', type: 'number'}  
42 - ]  
43 - },  
44 - queryProductPriceListBySkn:{  
45 - title:'变价记录',  
46 - url: '/product/queryProductPriceListBySkn', 2 + namespace:"price",
  3 + apis:{
  4 + queryProductPriceList:{
  5 + title:'代销变价',
  6 + url:'/product/queryProductPriceList',
47 params: [ 7 params: [
48 - {name: 'param', type: 'Number'} 8 + {name: 'product_skn',type: 'Number'},
  9 + {name: 'shop_id',type: 'Number'},
  10 + {name: 'brand_id',type: 'Number'},
  11 + {name: 'supplier_id',type: 'Number'},
  12 + {name: 'is_jit',type: 'String'},
  13 + {name: 'is_auditing',type: 'Number'},
  14 + {name: 'stock',type: 'Number'},
  15 + {name: 'gender',type: 'Number'},
  16 + {name: 'max_sort_id',type: 'Number'},
  17 + {name: 'middle_sort_id', type: 'Number'},
  18 + {name: 'small_sort_id', type: 'Number'},
  19 + {name: 'page', type: 'Number'},
  20 + {name: 'size', type: 'Number'}
49 ] 21 ]
50 }, 22 },
51 - deletePricePlan:{  
52 - title:'删除变价记录',  
53 - url: '/product/deletePricePlan', 23 + getProductPrice:{
  24 + title:'获得单个变价详情',
  25 + url: '/product/getProductPrice',
54 params: [ 26 params: [
55 {name: 'param', type: 'Number'} 27 {name: 'param', type: 'Number'}
56 ] 28 ]
57 }, 29 },
58 - batchUpdateProductPrice:{  
59 - title:'批量变价接口',  
60 - url: '/product/batchUpdateProductPrice',  
61 - params: [  
62 - {name: 'batchList', type: 'String'},  
63 - {name: 'cgpriceStartTime', type: 'String'},  
64 - {name: 'cgpriceEndTime', type: 'String'}  
65 - ]  
66 - },  
67 updateProductPrice:{ 30 updateProductPrice:{
68 - title:'单个变价接口', 31 + title:'单个变价接口',
69 url: '/product/updateProductPrice', 32 url: '/product/updateProductPrice',
70 - params: [ 33 + params: [
71 {name: 'product_skn', type: 'number'}, 34 {name: 'product_skn', type: 'number'},
72 {name: 'sales_price', type: 'number'}, 35 {name: 'sales_price', type: 'number'},
73 {name: 'vip_discount_type', type: 'number'}, 36 {name: 'vip_discount_type', type: 'number'},
@@ -76,29 +39,53 @@ module.exports={ @@ -76,29 +39,53 @@ module.exports={
76 {name: 'vip1_price', type: 'number'}, 39 {name: 'vip1_price', type: 'number'},
77 {name: 'vip2_price', type: 'number'}, 40 {name: 'vip2_price', type: 'number'},
78 {name: 'vip3_price', type: 'number'}, 41 {name: 'vip3_price', type: 'number'},
  42 + {name: 'student_price', type: 'number'},
  43 + {name: 'cgpriceStartTime', type: 'String'},
  44 + {name: 'cgpriceEndTime', type: 'String'}
  45 + ]
  46 + },
  47 + queryProductPriceListBySkn:{
  48 + title:'变价记录',
  49 + url: '/product/queryProductPriceListBySkn',
  50 + params: [
  51 + {name: 'param', type: 'Number'}
  52 + ]
  53 + },
  54 + deletePricePlan:{
  55 + title:'删除变价记录',
  56 + url: '/product/deletePricePlan',
  57 + params: [
  58 + {name: 'param', type: 'Number'}
  59 + ]
  60 + },
  61 + batchUpdateProductPrice:{
  62 + title:'批量变价接口',
  63 + url: '/product/batchUpdateProductPrice',
  64 + params: [
  65 + {name: 'batchList', type: 'String'},
79 {name: 'cgpriceStartTime', type: 'String'}, 66 {name: 'cgpriceStartTime', type: 'String'},
80 {name: 'cgpriceEndTime', type: 'String'} 67 {name: 'cgpriceEndTime', type: 'String'}
81 - ]  
82 - },  
83 - queryBrandCooperationList:{  
84 - title:'品牌合作模式设置列表数据',  
85 - url: '/brandCooperation/queryBrandCooperationList',  
86 - params: [  
87 - {name: 'cooperateTypeId', type: 'Number'},  
88 - {name: 'brandId', type: 'number'},  
89 - {name: 'setFlag', type: 'Number'},  
90 - {name: 'page', type: 'Number'},  
91 - {name: 'size', type: 'Number'}  
92 - ]  
93 - },  
94 - saveBrandCooperation:{  
95 - title:'修改合作模式',  
96 - url: '/brandCooperation/saveBrandCooperation',  
97 - params: [  
98 - {name: 'id', type: 'Number'},  
99 - {name: 'cooperateTypeId', type: 'String'},  
100 - {name: 'brandId', type: 'Number'}  
101 - ]  
102 - }  
103 - } 68 + ]
  69 + },
  70 + queryBrandCooperationList:{
  71 + title:'品牌合作模式设置列表数据',
  72 + url: '/brandCooperation/queryBrandCooperationList',
  73 + params: [
  74 + {name: 'cooperateTypeId', type: 'Number'},
  75 + {name: 'brandId', type: 'number'},
  76 + {name: 'setFlag', type: 'Number'},
  77 + {name: 'page', type: 'Number'},
  78 + {name: 'size', type: 'Number'}
  79 + ]
  80 + },
  81 + saveBrandCooperation:{
  82 + title:'修改合作模式',
  83 + url: '/brandCooperation/saveBrandCooperation',
  84 + params: [
  85 + {name: 'id', type: 'Number'},
  86 + {name: 'cooperateTypeId', type: 'String'},
  87 + {name: 'brandId', type: 'Number'}
  88 + ]
  89 + }
  90 + }
104 } 91 }
@@ -11,20 +11,20 @@ @@ -11,20 +11,20 @@
11 11
12 <div class="panel-col"> 12 <div class="panel-col">
13 <select name="shop" id="shop" tabindex="-1" title="" class="form-control"> 13 <select name="shop" id="shop" tabindex="-1" title="" class="form-control">
14 - <option value="-1">请选择店铺</option>  
15 - </select> 14 + <option value="-1">请选择店铺</option>
  15 + </select>
16 </div> 16 </div>
17 17
18 <div class="panel-col"> 18 <div class="panel-col">
19 <select name="brand" id="brand" tabindex="-1" title="" class="form-control"> 19 <select name="brand" id="brand" tabindex="-1" title="" class="form-control">
20 - <option value="-1">请选择品牌</option>  
21 - </select> 20 + <option value="-1">请选择品牌</option>
  21 + </select>
22 </div> 22 </div>
23 23
24 <div class="panel-col"> 24 <div class="panel-col">
25 <select name="supplier" id="supplier" tabindex="-1" title="" class="form-control"> 25 <select name="supplier" id="supplier" tabindex="-1" title="" class="form-control">
26 - <option value="-1">请选择供应商</option>  
27 - </select> 26 + <option value="-1">请选择供应商</option>
  27 + </select>
28 </div> 28 </div>
29 29
30 <div class="panel-col"> 30 <div class="panel-col">
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 <option value="-1">是否JIT商品</option> 32 <option value="-1">是否JIT商品</option>
33 <option value="Y"></option> 33 <option value="Y"></option>
34 <option value="N"></option> 34 <option value="N"></option>
35 - </select> 35 + </select>
36 </div> 36 </div>
37 37
38 <div class="panel-col"> 38 <div class="panel-col">
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 <option value="-1">上架状态</option> 40 <option value="-1">上架状态</option>
41 <option value="200">上架</option> 41 <option value="200">上架</option>
42 <option value="0">下架</option> 42 <option value="0">下架</option>
43 - </select> 43 + </select>
44 </div> 44 </div>
45 45
46 <div class="panel-col"> 46 <div class="panel-col">
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
48 <option value="-1">库存情况</option> 48 <option value="-1">库存情况</option>
49 <option value="1">有库存</option> 49 <option value="1">有库存</option>
50 <option value="0">无库存</option> 50 <option value="0">无库存</option>
51 - </select> 51 + </select>
52 </div> 52 </div>
53 53
54 <div class="panel-col"> 54 <div class="panel-col">
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 <option value="1"></option> 57 <option value="1"></option>
58 <option value="2"></option> 58 <option value="2"></option>
59 <option value="3">通用</option> 59 <option value="3">通用</option>
60 - </select> 60 + </select>
61 </div> 61 </div>
62 62
63 <div class="panel-col2"> 63 <div class="panel-col2">
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 <td width="120px"><b>说明:</b></td> 95 <td width="120px"><b>说明:</b></td>
96 <td> 96 <td>
97 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br> 97 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br>
98 - 2、Excel表头为:<span style="color: #67D267;">SKN、吊牌价、销售价、VIP折扣类型、VIP价、白金价、金卡价、银卡价</span><br> 98 + 2、Excel表头为:<span style="color: #67D267;">SKN、吊牌价、销售价、学生价、VIP折扣类型、VIP价、白金价、金卡价、银卡价</span><br>
99 3、第一行为表头内容,第二行开始为正式内容<br> 99 3、第一行为表头内容,第二行开始为正式内容<br>
100 4、每个文件控制在2500行以内<br> 100 4、每个文件控制在2500行以内<br>
101 5、<a href="/ajax/link/batchUpdatePrice" style="margin: 0; text-decoration: underline">下载样例.xlsx</a> 101 5、<a href="/ajax/link/batchUpdatePrice" style="margin: 0; text-decoration: underline">下载样例.xlsx</a>
@@ -145,10 +145,8 @@ @@ -145,10 +145,8 @@
145 <tr> 145 <tr>
146 <th style="border-top: 0; border-left: 0">销售价</th> 146 <th style="border-top: 0; border-left: 0">销售价</th>
147 <th style="border-top: 0">VIP折扣类型</th> 147 <th style="border-top: 0">VIP折扣类型</th>
148 - <th style="border-top: 0">VIP</th>  
149 - <th style="border-top: 0">白金价</th>  
150 - <th style="border-top: 0">金卡价</th>  
151 - <th style="border-top: 0">银卡价</th> 148 + <th style="border-top: 0">会员价</th>
  149 + <th style="border-top: 0">学生价</th>
152 <th style="border-top: 0">价格生效时间</th> 150 <th style="border-top: 0">价格生效时间</th>
153 <th style="border-top: 0">进货价</th> 151 <th style="border-top: 0">进货价</th>
154 <th style="border-top: 0">进货折扣</th> 152 <th style="border-top: 0">进货折扣</th>
@@ -169,16 +167,33 @@ @@ -169,16 +167,33 @@
169 </select> 167 </select>
170 </td> 168 </td>
171 <td style="border-bottom: 0"> 169 <td style="border-bottom: 0">
172 - <input class="vip-price form-control" type="text" value="{vip_price}" onkeyup="this.value=this.value.replace(/\D/gi,'')">  
173 - </td>  
174 - <td style="border-bottom: 0">  
175 - <input class="vip3-price form-control" type="text" value="{vip3_price}" disabled>  
176 - </td>  
177 - <td style="border-bottom: 0">  
178 - <input class="vip2-price form-control" type="text" value="{vip2_price}" disabled> 170 + <div class="form-inline" style="margin-bottom: 5px">
  171 + <div class="form-group">
  172 + <label style="width: 60px; text-align: right">VIP价:</label>
  173 + <input class="vip-price form-control" type="text" value="{vip_price}" onkeyup="this.value=this.value.replace(/\D/gi,'')">
  174 + </div>
  175 + </div>
  176 + <div class="form-inline" style="margin-bottom: 5px">
  177 + <div class="form-group">
  178 + <label style="width: 60px; text-align: right">白金价:</label>
  179 + <input class="vip3-price form-control" type="text" value="{vip3_price}" disabled>
  180 + </div>
  181 + </div>
  182 + <div class="form-inline" style="margin-bottom: 5px">
  183 + <div class="form-group">
  184 + <label style="width: 60px; text-align: right">金卡价:</label>
  185 + <input class="vip2-price form-control" type="text" value="{vip2_price}" disabled>
  186 + </div>
  187 + </div>
  188 + <div class="form-inline">
  189 + <div class="form-group">
  190 + <label style="width: 60px; text-align: right">银卡价:</label>
  191 + <input class="vip1-price form-control" type="text" value="{vip1_price}" disabled>
  192 + </div>
  193 + </div>
179 </td> 194 </td>
180 <td style="border-bottom: 0"> 195 <td style="border-bottom: 0">
181 - <input class="vip1-price form-control" type="text" value="{vip1_price}" disabled> 196 + <input class="student_price form-control" type="text" value="{student_price}" onkeyup="this.value=this.value.replace(/\D/gi,'')">
182 </td> 197 </td>
183 <td class="form-inline" style="border-bottom: 0"> 198 <td class="form-inline" style="border-bottom: 0">
184 <input id="start_{product_skn}" jsaction="date:end:end_{product_skn}" class="startDate form-control" type="text" value="{cgpriceStartTime}" placeholder="开始日期" style='background-color:#fff'> 199 <input id="start_{product_skn}" jsaction="date:end:end_{product_skn}" class="startDate form-control" type="text" value="{cgpriceStartTime}" placeholder="开始日期" style='background-color:#fff'>
@@ -207,16 +222,16 @@ @@ -207,16 +222,16 @@
207 </tr> 222 </tr>
208 </thead> 223 </thead>
209 <tbody> 224 <tbody>
210 - <tr>  
211 - <td>[[productSkn]]</td>  
212 - <td>[[goodsName]]</td>  
213 - <td>[[brandName]]</td>  
214 - <td>  
215 - [[maxSortName]]  
216 - [[if midleSortName]]&nbsp;>&nbsp;[[midleSortName]][[/if]]  
217 - [[if smallSortName]]&nbsp;>&nbsp;[[smallSortName]][[/if]]  
218 - </td>  
219 - </tr> 225 + <tr>
  226 + <td>[[productSkn]]</td>
  227 + <td>[[goodsName]]</td>
  228 + <td>[[brandName]]</td>
  229 + <td>
  230 + [[maxSortName]]
  231 + [[if midleSortName]]&nbsp;>&nbsp;[[midleSortName]][[/if]]
  232 + [[if smallSortName]]&nbsp;>&nbsp;[[smallSortName]][[/if]]
  233 + </td>
  234 + </tr>
220 </tbody> 235 </tbody>
221 </table> 236 </table>
222 </div> 237 </div>
@@ -227,6 +242,7 @@ @@ -227,6 +242,7 @@
227 <tr> 242 <tr>
228 <th>吊牌价</th> 243 <th>吊牌价</th>
229 <th>销售价</th> 244 <th>销售价</th>
  245 + <th>学生价</th>
230 <th>价格生效-<font color="green">开始时间</font></th> 246 <th>价格生效-<font color="green">开始时间</font></th>
231 <th>价格生效-<font color="red">结束时间</font></th> 247 <th>价格生效-<font color="red">结束时间</font></th>
232 <th>变价时间</th> 248 <th>变价时间</th>
@@ -235,25 +251,26 @@ @@ -235,25 +251,26 @@
235 </tr> 251 </tr>
236 </thead> 252 </thead>
237 <tbody> 253 <tbody>
238 - [[if list.length > 0]]  
239 - [[each list as item index]]  
240 - <tr>  
241 - <td>[[item.retailPrice]]</td>  
242 - <td>[[item.salesPrice]]</td>  
243 - <td>[[item.effectiveTime]]</td>  
244 - <td>[[item.changePriceEndTime]]</td>  
245 - <td>[[item.createTime]]</td>  
246 - <td>[[item.founderName]]</td>  
247 - <td>  
248 - [[if item.flag && item.flag == 1]]  
249 - <a data-planid="[[item.planId]]" data-skn="[[productSkn]]" href="javascript:;" class="btn btn-danger btn-xs deleteHistory">删除</a>  
250 - [[/if]]  
251 - </td>  
252 - </tr>  
253 - [[/each]]  
254 - [[else]]  
255 - <tr><td colspan="7">没有变价记录!</td></tr>  
256 - [[/if]] 254 + [[if list.length > 0]]
  255 + [[each list as item index]]
  256 + <tr>
  257 + <td>[[item.retailPrice]]</td>
  258 + <td>[[item.salesPrice]]</td>
  259 + <td>[[item.studentPrice]]</td>
  260 + <td>[[item.effectiveTime]]</td>
  261 + <td>[[item.changePriceEndTime]]</td>
  262 + <td>[[item.createTime]]</td>
  263 + <td>[[item.founderName]]</td>
  264 + <td>
  265 + [[if item.flag && item.flag == 1]]
  266 + <a data-planid="[[item.planId]]" data-skn="[[productSkn]]" href="javascript:;" class="btn btn-danger btn-xs deleteHistory">删除</a>
  267 + [[/if]]
  268 + </td>
  269 + </tr>
  270 + [[/each]]
  271 + [[else]]
  272 + <tr><td colspan="7">没有变价记录!</td></tr>
  273 + [[/if]]
257 </tbody> 274 </tbody>
258 </table> 275 </table>
259 </div> 276 </div>
@@ -96,6 +96,7 @@ var g = new common.grid({ @@ -96,6 +96,7 @@ var g = new common.grid({
96 }}, 96 }},
97 {display: '吊牌价', name: 'retail_price'}, 97 {display: '吊牌价', name: 'retail_price'},
98 {display: '销售价', name: 'sales_price'}, 98 {display: '销售价', name: 'sales_price'},
  99 + {display: '学生价', name: 'student_price'},
99 {display: 'VIP折扣类型', render: function(item) { 100 {display: 'VIP折扣类型', render: function(item) {
100 return ENUM.vipType[item.vip_discount_type]; 101 return ENUM.vipType[item.vip_discount_type];
101 }}, 102 }},
@@ -173,6 +174,7 @@ $(document).on('click', '.modify-btn', function() { @@ -173,6 +174,7 @@ $(document).on('click', '.modify-btn', function() {
173 $vip3Price = $wrap.find('.vip3-price'), 174 $vip3Price = $wrap.find('.vip3-price'),
174 $vip2Price = $wrap.find('.vip2-price'), 175 $vip2Price = $wrap.find('.vip2-price'),
175 $vip1Price = $wrap.find('.vip1-price'), 176 $vip1Price = $wrap.find('.vip1-price'),
  177 + $student_price = $wrap.find('.student_price'),
176 $startDate = $wrap.find('.startDate'), 178 $startDate = $wrap.find('.startDate'),
177 $endDate = $wrap.find('.endDate'), 179 $endDate = $wrap.find('.endDate'),
178 $submitBtn = $wrap.find('.sure-modify'); 180 $submitBtn = $wrap.find('.sure-modify');
@@ -200,6 +202,7 @@ $(document).on('click', '.modify-btn', function() { @@ -200,6 +202,7 @@ $(document).on('click', '.modify-btn', function() {
200 vip1_price: $vip1Price.val(), 202 vip1_price: $vip1Price.val(),
201 vip2_price: $vip2Price.val(), 203 vip2_price: $vip2Price.val(),
202 vip3_price: $vip3Price.val(), 204 vip3_price: $vip3Price.val(),
  205 + student_price: $student_price.val(),
203 cgpriceStartTime:$startDate.val(), 206 cgpriceStartTime:$startDate.val(),
204 cgpriceEndTime:$endDate.val() 207 cgpriceEndTime:$endDate.val()
205 } 208 }
@@ -319,6 +322,25 @@ var p = new common.grid({ @@ -319,6 +322,25 @@ var p = new common.grid({
319 } 322 }
320 return newPriceHtml + '<div style="color: #999;">' + item.oldProductPriceBo.sales_price + '</div>'; 323 return newPriceHtml + '<div style="color: #999;">' + item.oldProductPriceBo.sales_price + '</div>';
321 }}, 324 }},
  325 + {display: '学生价', render: function(item) {
  326 + var newPrice = item.newProductPriceBo,
  327 + newPriceHtml = '';
  328 + if (newPrice.student_price) {
  329 + if (newPrice.student_price < (newPrice.retail_price / 2)) {
  330 + newPriceHtml = '<p style="color: red">' + newPrice.student_price + '</p>';
  331 + }else{
  332 + newPriceHtml = '<p>'+newPrice.student_price+'</p>';
  333 + }
  334 + } else {
  335 + newPriceHtml = '<p>-</p>'
  336 + }
  337 + if(item.oldProductPriceBo.student_price){
  338 + newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.student_price + '</div>';
  339 + }else{
  340 + newPriceHtml += '<div>-</div>';
  341 + }
  342 + return newPriceHtml;
  343 + }},
322 {display: 'VIP折扣类型', render: function(item) { 344 {display: 'VIP折扣类型', render: function(item) {
323 return '<p>'+ENUM.vipType[item.newProductPriceBo.vip_discount_type] + '</p>'+ 345 return '<p>'+ENUM.vipType[item.newProductPriceBo.vip_discount_type] + '</p>'+
324 '<div style="color: #999;">' + ENUM.vipType[item.oldProductPriceBo.vip_discount_type] + '</div>'; 346 '<div style="color: #999;">' + ENUM.vipType[item.oldProductPriceBo.vip_discount_type] + '</div>';