Merge branch 'dev_学生价列表' into grey
Showing
5 changed files
with
220 additions
and
8 deletions
@@ -109,14 +109,7 @@ module.exports=function(app) { | @@ -109,14 +109,7 @@ module.exports=function(app) { | ||
109 | } | 109 | } |
110 | }); | 110 | }); |
111 | 111 | ||
112 | - /*批量修改学生价格*/ | ||
113 | - app.get("/supplier/baseproduct/batchUpdateStudentPrice","goods.batchUpdateStudentPrice.Batch",function(){ | ||
114 | - this.$extend={ | ||
115 | - moduleName:"基础商品", | ||
116 | - pageName:"批量修改学生价", | ||
117 | - isPL:true | ||
118 | - } | ||
119 | - }); | 112 | + |
120 | 113 | ||
121 | /*通过任务ID查看任务是否被执行完 学生价变价*/ | 114 | /*通过任务ID查看任务是否被执行完 学生价变价*/ |
122 | app.post("/product/queryBatchImportStudentPriceResult","basegoods_queryBatchUpdateStudentPriceResult"); | 115 | app.post("/product/queryBatchImportStudentPriceResult","basegoods_queryBatchUpdateStudentPriceResult"); |
@@ -21,4 +21,27 @@ module.exports=function(app) { | @@ -21,4 +21,27 @@ module.exports=function(app) { | ||
21 | /*驳回*/ | 21 | /*驳回*/ |
22 | app.post("/goods/price/reject","price_auditRejectProductPrice"); | 22 | app.post("/goods/price/reject","price_auditRejectProductPrice"); |
23 | 23 | ||
24 | + | ||
25 | + /*批量修改学生价格*/ | ||
26 | + app.get("/supplier/baseproduct/batchUpdateStudentPrice","goods.batchUpdateStudentPrice.Batch",function(){ | ||
27 | + this.$extend={ | ||
28 | + moduleName:"基础商品", | ||
29 | + pageName:"批量修改学生价", | ||
30 | + isPL:true | ||
31 | + } | ||
32 | + }); | ||
33 | + | ||
34 | + /*学生价格列表页*/ | ||
35 | + app.get("/goods/studentPrice/index","goods.studentPrice.Index",function(){ | ||
36 | + this.$extend={ | ||
37 | + moduleName:"基础商品", | ||
38 | + pageName:"学生价管理", | ||
39 | + isPL:true | ||
40 | + } | ||
41 | + }); | ||
42 | + | ||
43 | + /*学生价列表数据*/ | ||
44 | + app.post("/goods/studentPrice/list","price_queryStudentPriceList"); | ||
45 | + | ||
46 | + | ||
24 | } | 47 | } |
@@ -93,6 +93,21 @@ module.exports={ | @@ -93,6 +93,21 @@ module.exports={ | ||
93 | {name: 'cooperateTypeId', type: 'String'}, | 93 | {name: 'cooperateTypeId', type: 'String'}, |
94 | {name: 'brandId', type: 'Number'} | 94 | {name: 'brandId', type: 'Number'} |
95 | ] | 95 | ] |
96 | + }, | ||
97 | + queryStudentPriceList:{ | ||
98 | + title:'学生价管理', | ||
99 | + url:'/product/queryStudentPriceList', | ||
100 | + params: [ | ||
101 | + {name: 'product_skn',type: 'Number'}, | ||
102 | + {name: 'shop_id',type: 'Number'}, | ||
103 | + {name: 'brand_id',type: 'Number'}, | ||
104 | + {name: 'studentPriceValScope',type: 'Number'}, | ||
105 | + {name: 'max_sort_id',type: 'Number'}, | ||
106 | + {name: 'middle_sort_id', type: 'Number'}, | ||
107 | + {name: 'small_sort_id', type: 'Number'}, | ||
108 | + {name: 'page', type: 'Number'}, | ||
109 | + {name: 'size', type: 'Number'} | ||
110 | + ] | ||
96 | } | 111 | } |
97 | } | 112 | } |
98 | } | 113 | } |
1 | +<%include '../../../common/views/__ui/header'%> | ||
2 | +<%include '../../../common/views/__partail/ListHeader'%> | ||
3 | + | ||
4 | +<div class="contentpanel"> | ||
5 | + <div class="panel panel-default" id="studentPriceSearch" style="margin-bottom:10px;"> | ||
6 | + <div class="panel-body"> | ||
7 | + <div class="row"> | ||
8 | + <div class="panel-col"> | ||
9 | + <input id="skn" class="form-control panel-input height40" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')"> | ||
10 | + </div> | ||
11 | + <div class="panel-col"> | ||
12 | + <div id="sortTree" class="form-control height40" style="border: 0px; padding: 0px;"></div> | ||
13 | + </div> | ||
14 | + <div class="panel-col"> | ||
15 | + <select name="shop" id="shop" tabindex="-1" title="" class="form-control"> | ||
16 | + <option value="-1">请选择店铺</option> | ||
17 | + </select> | ||
18 | + </div> | ||
19 | + <div class="panel-col"> | ||
20 | + <select name="brand" id="brand" tabindex="-1" title="" class="form-control"> | ||
21 | + <option value="-1">请选择品牌</option> | ||
22 | + </select> | ||
23 | + </div> | ||
24 | + <div class="panel-col"> | ||
25 | + <select name="studentPriceValScope" id="studentPriceValScope" tabindex="-1" title="" class="form-control"> | ||
26 | + <option value="3">全部</option> | ||
27 | + <option value="1">有学生价</option> | ||
28 | + <option value="2">无学生价</option> | ||
29 | + </select> | ||
30 | + </div> | ||
31 | + <div class="panel-col"> | ||
32 | + <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> | ||
33 | + <a id="all-btn" href="" class="btn btn-info">全部</a> | ||
34 | + </div> | ||
35 | + <div class="panel-col" style="margin: 0 0 0 -5px;"> | ||
36 | + <a id="import-btn" href="/supplier/baseproduct/batchUpdateStudentPrice" class="btn btn-primary">批量导入</a> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + <div class="panel panel-primary-head"> | ||
42 | + <div class="dataTab_wrapper" id="basicTable"></div> | ||
43 | + </div> | ||
44 | +</div> | ||
45 | +<%include '../../../common/views/__ui/footer'%> |
1 | +'use strict'; | ||
2 | +var $ = require('jquery'), | ||
3 | + common = require('../../../common/common'); | ||
4 | + | ||
5 | +/***********************变价列表***********************/ | ||
6 | + | ||
7 | +new common.dropDown({ | ||
8 | + el: '#shop', | ||
9 | + ajax: 'shopsRest' | ||
10 | +}); | ||
11 | + | ||
12 | +new common.dropDown({ | ||
13 | + el: '#brand', | ||
14 | + ajax: 'brand', | ||
15 | + params:function(){ | ||
16 | + return {userLimitFlag:true}; | ||
17 | + } | ||
18 | +}); | ||
19 | + | ||
20 | + | ||
21 | +var ENUM = { | ||
22 | + gender: { | ||
23 | + 1: '男', | ||
24 | + 2: '女', | ||
25 | + 3: '通用' | ||
26 | + }, | ||
27 | + vipType: { | ||
28 | + 1: '正常折扣', | ||
29 | + 2: '统一折扣', | ||
30 | + 3: '无折扣', | ||
31 | + 4: '固定折扣', | ||
32 | + 5: '自定义折扣' | ||
33 | + } | ||
34 | +}; | ||
35 | + | ||
36 | +// 对float数字进行精度控制,保留小数点后4位 | ||
37 | +// 暂只支持字符串 | ||
38 | +var formatFloat = function(num) { | ||
39 | + var number = parseFloat(num); | ||
40 | + if (isNaN(number)) | ||
41 | + return ""; | ||
42 | + return Math.round(number * 10000) / 10000; | ||
43 | +} | ||
44 | +var tabTree = new common.tabTree("#sortTree"); | ||
45 | +tabTree.init(); | ||
46 | + | ||
47 | + | ||
48 | +var g = new common.grid({ | ||
49 | + el: "#basicTable", | ||
50 | + usepagesize:true, | ||
51 | + parms: function() { | ||
52 | + var studentPriceValScope = $("#studentPriceValScope").val(); | ||
53 | + return { | ||
54 | + product_skn: common.util.__input("skn"), | ||
55 | + max_sort_id: tabTree.selected[0] ? tabTree.selected[0].id : "", | ||
56 | + middle_sort_id: tabTree.selected[1] ? tabTree.selected[1].id : "", | ||
57 | + small_sort_id: tabTree.selected[2] ? tabTree.selected[2].id : "", | ||
58 | + shop_id: common.util.__input("shop"), | ||
59 | + brand_id: common.util.__input("brand"), | ||
60 | + studentPriceValScope: studentPriceValScope | ||
61 | + } | ||
62 | + }, | ||
63 | + columns: [ | ||
64 | + {display: '商品信息', render: function(item) { | ||
65 | + var html = '<p>SKN:'+item.product_skn +'</p><p>名称:' + item.product_name + '</p><p>品牌:' + item.brand_name + '</p>' + | ||
66 | + '<div>类目:'+'<br>'+ item.max_sort_name; | ||
67 | + if(item.middle_sort_name) {html += ' > ' + item.middle_sort_name;} | ||
68 | + if(item.small_sort_name) {html += ' > ' + item.small_sort_name;} | ||
69 | + html += "</div><p>"; | ||
70 | + html += '<p>性别:'+ENUM.gender[item.gender]+'</p>'; | ||
71 | + return html; | ||
72 | + }}, | ||
73 | + {display: '供应商/店铺', render: function(item) { | ||
74 | + var html = ''; | ||
75 | + if (item.supplier_name) { | ||
76 | + html += item.supplier_name; | ||
77 | + if (item.shop_name) {html += '/';} | ||
78 | + } | ||
79 | + if (item.shop_name) {html += item.shop_name;} | ||
80 | + return html; | ||
81 | + }}, | ||
82 | + {display: '当前售价', render: function(item) { | ||
83 | + var html = '<p>吊牌价:'+item.retail_price +'</p>'; | ||
84 | + html += '<p>销售价:'+item.sales_price +'</p>'; | ||
85 | + if (item.student_price) {html += '<p>学生价:'+item.student_price +'</p>';} | ||
86 | + return html; | ||
87 | + }}, | ||
88 | + {display: 'VIP折扣类型', render: function(item) { | ||
89 | + return ENUM.vipType[item.vip_discount_type]; | ||
90 | + }}, | ||
91 | + {display: '会员价', render: function(item) { | ||
92 | + var html = '<p>VIP价:'; | ||
93 | + if(item.vip_price) html += item.vip_price +'</p>'; | ||
94 | + else html += '</p>'; | ||
95 | + html += '<p>白金:'+'<br>'; | ||
96 | + if(item.vip3_price) html += item.vip3_price +'</p>'; | ||
97 | + else html += '</p>'; | ||
98 | + html += '<p>金卡:'+'<br>'; | ||
99 | + if(item.vip2_price) html += item.vip2_price +'</p>'; | ||
100 | + else html += '</p>'; | ||
101 | + html += '<p>银卡:'+'<br>'; | ||
102 | + if(item.vip1_price) html += item.vip1_price +'</p>'; | ||
103 | + else html += '</p>'; | ||
104 | + return html; | ||
105 | + }} | ||
106 | + ] | ||
107 | +}); | ||
108 | + | ||
109 | +g.init('/goods/studentPrice/list'); | ||
110 | + | ||
111 | + | ||
112 | + | ||
113 | +//筛选 | ||
114 | +$(document).on('click', '#filter-btn', function () { | ||
115 | + g.reload(1); | ||
116 | +}); | ||
117 | +//回车筛选 | ||
118 | +$(document).on('keyup', 'body', function (event) { | ||
119 | + if (event.keyCode == 13) { | ||
120 | + $("#filter-btn").trigger('click'); | ||
121 | + } | ||
122 | +}); | ||
123 | +//全部 | ||
124 | +$(document).on('click', '#all-btn', function () { | ||
125 | + location.href = ''; | ||
126 | +}); | ||
127 | + | ||
128 | + | ||
129 | +/***********************批量功能***********************/ | ||
130 | +//批量导入按钮点击事件 | ||
131 | +$(document).ready(function() { | ||
132 | + $("#import-btn").attr('target', '_blank'); | ||
133 | +}); | ||
134 | +//$(document).on('click', '#import-btn', function () { | ||
135 | + //location.href="/supplier/baseproduct/batchUpdateStudentPrice"; | ||
136 | +//}); |
-
Please register or login to post a comment