Merge branch 'develop' of git.dev.yoho.cn:platform/yohobuy-portal-fe into develop
Showing
27 changed files
with
437 additions
and
133 deletions
@@ -16,4 +16,11 @@ require('./js/brand/index'); | @@ -16,4 +16,11 @@ require('./js/brand/index'); | ||
16 | require('./js/product/add'); | 16 | require('./js/product/add'); |
17 | require('./js/product/index'); | 17 | require('./js/product/index'); |
18 | 18 | ||
19 | + | ||
20 | +require('./js/store/adminedit'); | ||
21 | +require('./js/store/adminindex'); | ||
22 | +require('./js/store/examine'); | ||
23 | +require('./js/store/indexlist'); | ||
24 | +require('./js/store/info'); | ||
25 | + | ||
19 | module.exports = demo; | 26 | module.exports = demo; |
@@ -3,22 +3,23 @@ var edit=require('../common/edit'); | @@ -3,22 +3,23 @@ var edit=require('../common/edit'); | ||
3 | exports.init = function() { | 3 | exports.init = function() { |
4 | 4 | ||
5 | var e=new edit("#basicForm"); | 5 | var e=new edit("#basicForm"); |
6 | - // e.on("validate",function(){ | ||
7 | - // }); | 6 | + |
8 | e.init(); | 7 | e.init(); |
9 | $("#save_brand").click(function(){ | 8 | $("#save_brand").click(function(){ |
10 | e.submit($("#basicForm").attr("action"),function(option){ | 9 | e.submit($("#basicForm").attr("action"),function(option){ |
11 | option.success=function(res){ | 10 | option.success=function(res){ |
12 | res=res.data; | 11 | res=res.data; |
13 | if(res.code=="200"){ | 12 | if(res.code=="200"){ |
14 | - location.href="/erpproduct/brands/index"; | 13 | + e.$tip("修改成功", function() { |
14 | + location.href="/erpproduct/brands/index" | ||
15 | + }, 'growl-success'); | ||
15 | }else{ | 16 | }else{ |
16 | - e.$tip("提交失败"); | 17 | + e.$tip(res.message); |
17 | } | 18 | } |
18 | return false; | 19 | return false; |
19 | }, | 20 | }, |
20 | option.error=function(res){ | 21 | option.error=function(res){ |
21 | - e.$tip("提交失败"); | 22 | + e.$tip(res.message); |
22 | } | 23 | } |
23 | }); | 24 | }); |
24 | return false; | 25 | return false; |
@@ -26,12 +26,12 @@ exports.init = function() { | @@ -26,12 +26,12 @@ exports.init = function() { | ||
26 | format: 'yyyy-mm-dd' | 26 | format: 'yyyy-mm-dd' |
27 | }); | 27 | }); |
28 | 28 | ||
29 | - | ||
30 | var btnAuthority=JSON.parse($("#btnAuthority").val()); | 29 | var btnAuthority=JSON.parse($("#btnAuthority").val()); |
30 | + | ||
31 | 31 | ||
32 | var g = new grid({ | 32 | var g = new grid({ |
33 | el: '#basicTable', | 33 | el: '#basicTable', |
34 | - size: 50, | 34 | + size: 10, |
35 | parms: function() { | 35 | parms: function() { |
36 | 36 | ||
37 | return { | 37 | return { |
@@ -39,7 +39,7 @@ exports.init = function() { | @@ -39,7 +39,7 @@ exports.init = function() { | ||
39 | status: $.trim($('#status').val()) || '', | 39 | status: $.trim($('#status').val()) || '', |
40 | brandLevel: $.trim($('#brand-level').val()) || '', | 40 | brandLevel: $.trim($('#brand-level').val()) || '', |
41 | startTime: $.trim($('#starttime').val()) || '', | 41 | startTime: $.trim($('#starttime').val()) || '', |
42 | - endTime: $.trim($('#endtime').val()) || '', | 42 | + endTime: $.trim($('#endtime').val()) || '' |
43 | }; | 43 | }; |
44 | }, | 44 | }, |
45 | columns: [ | 45 | columns: [ |
@@ -50,7 +50,11 @@ exports.init = function() { | @@ -50,7 +50,11 @@ exports.init = function() { | ||
50 | {display: '英文名称', name: "brandNameEn"}, | 50 | {display: '英文名称', name: "brandNameEn"}, |
51 | {display: '品牌级别', name: "brandLevel"}, | 51 | {display: '品牌级别', name: "brandLevel"}, |
52 | {display: '调性分', name: "brandTonality"}, | 52 | {display: '调性分', name: "brandTonality"}, |
53 | - {display: '创建时间', name: "createTime"}, | 53 | + {display: '创建时间', name: "createTime", render: function(item) { |
54 | + var date = new Date(item.createTime * 1000); | ||
55 | + return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' | ||
56 | + + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); | ||
57 | + }}, | ||
54 | {display: '操作', name:"status", render: function(items) { | 58 | {display: '操作', name:"status", render: function(items) { |
55 | var HtmArr = []; | 59 | var HtmArr = []; |
56 | 60 | ||
@@ -71,9 +75,16 @@ exports.init = function() { | @@ -71,9 +75,16 @@ exports.init = function() { | ||
71 | g.init($("#gridurl").val()); | 75 | g.init($("#gridurl").val()); |
72 | 76 | ||
73 | $("#filter-btn").click(function(){ | 77 | $("#filter-btn").click(function(){ |
74 | - g.reload(); | 78 | + location.hash = ''; |
79 | + g.reload({ | ||
80 | + page: 1 | ||
81 | + }); | ||
75 | }); | 82 | }); |
76 | 83 | ||
84 | + /*$(window).on('hashchange', function() { | ||
85 | + g.reload(); | ||
86 | + }); | ||
87 | + */ | ||
77 | function operateAjax(options, callback) { | 88 | function operateAjax(options, callback) { |
78 | $.ajax({ | 89 | $.ajax({ |
79 | type: 'POST', | 90 | type: 'POST', |
client/js/commodity/index.js
0 → 100644
1 | +/** | ||
2 | + * Created by wangqianjun on 16/2/2. | ||
3 | + */ | ||
4 | +var grid=require('../common/grid'); | ||
5 | +exports.init = function() { | ||
6 | + var g=new grid({ | ||
7 | + el:"#basicTable", | ||
8 | + //parms:function(){ | ||
9 | + // | ||
10 | + // return { | ||
11 | + // id:!!~$.trim($('#supplier-name').val())?$('#supplier-name').val():"", | ||
12 | + // status:!!~$.trim($('#status').val())?$('#status').val():"", | ||
13 | + // timeSort:!!~$.trim($('#time-sort').val())?$('#time-sort').val():"", | ||
14 | + // isFreeze:!!~$.trim($('#isFreeze').val())?$('#isFreeze').val():"" | ||
15 | + // }; | ||
16 | + //}, | ||
17 | + columns:[ | ||
18 | + {display:"SKN",name:"skn"}, | ||
19 | + {display:"市场价",name:"marketPrice"} | ||
20 | + ] | ||
21 | + }); | ||
22 | + | ||
23 | + // 路由 | ||
24 | + g.init('/erpproduct/price/index1'); | ||
25 | + | ||
26 | +} |
@@ -26,13 +26,12 @@ var grid=function(options){ | @@ -26,13 +26,12 @@ var grid=function(options){ | ||
26 | size:10, | 26 | size:10, |
27 | innerHtml:"<div class='grid'><table class='table table-striped table-bordered responsive dataTable no-footer' role='grid' aria-describedby='basicTable_info'>" | 27 | innerHtml:"<div class='grid'><table class='table table-striped table-bordered responsive dataTable no-footer' role='grid' aria-describedby='basicTable_info'>" |
28 | +"<thead></thead><tbody></tbody></table></div>" | 28 | +"<thead></thead><tbody></tbody></table></div>" |
29 | - +"<nav><ul class='pagination pagination-lg'></ul></nav>" | 29 | + +"<nav><ul class='pagination'></ul></nav>" |
30 | } | 30 | } |
31 | this.options=$.extend({}, defaults, options); | 31 | this.options=$.extend({}, defaults, options); |
32 | this.grid=$(options.el); | 32 | this.grid=$(options.el); |
33 | - | ||
34 | - | ||
35 | } | 33 | } |
34 | + | ||
36 | grid.prototype={ | 35 | grid.prototype={ |
37 | constructor:grid, | 36 | constructor:grid, |
38 | template: function () { | 37 | template: function () { |
@@ -94,13 +93,41 @@ grid.prototype={ | @@ -94,13 +93,41 @@ grid.prototype={ | ||
94 | var g = this, p = this.options; | 93 | var g = this, p = this.options; |
95 | if (!p.page) p.page = 1; | 94 | if (!p.page) p.page = 1; |
96 | var param = {}; | 95 | var param = {}; |
96 | + //urlArr = location.hash.substring(1).split('&&'); | ||
97 | + | ||
97 | if (p.parms) { | 98 | if (p.parms) { |
98 | if (typeof (p.parms) == "function") { | 99 | if (typeof (p.parms) == "function") { |
99 | param = p.parms(); | 100 | param = p.parms(); |
100 | } | 101 | } |
101 | } | 102 | } |
102 | - param.page=p.page; | ||
103 | - param.size=p.size; | 103 | + |
104 | + /*$.each(urlArr, function(i, value){ | ||
105 | + var result = value.split('='), | ||
106 | + key = result[0], | ||
107 | + value = result[1]; | ||
108 | + | ||
109 | + if (key !== '') { | ||
110 | + param[key] = value; | ||
111 | + } | ||
112 | + | ||
113 | + });*/ | ||
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | ||
118 | + | ||
119 | + | ||
120 | + param.page = p.page; | ||
121 | + param.size = p.size; | ||
122 | + console.log(param); | ||
123 | + var html = ''; | ||
124 | + $.each(param, function(key, value) { | ||
125 | + if (value !== '') { | ||
126 | + html += key + '=' + value + '&&'; | ||
127 | + } | ||
128 | + }); | ||
129 | + location.hash = html; | ||
130 | + | ||
104 | return param; | 131 | return param; |
105 | }, | 132 | }, |
106 | __pagination:function(pagination){ | 133 | __pagination:function(pagination){ |
@@ -111,11 +138,11 @@ grid.prototype={ | @@ -111,11 +138,11 @@ grid.prototype={ | ||
111 | pages: pagination.total, | 138 | pages: pagination.total, |
112 | currentPage: pagination.page, | 139 | currentPage: pagination.page, |
113 | edges: 1, | 140 | edges: 1, |
114 | - hrefTextPrefix: '#page-', | 141 | + hrefTextPrefix: '#page=', |
115 | ellipsePageSet: false, | 142 | ellipsePageSet: false, |
116 | onPageClick: function(pageNumber, event) { | 143 | onPageClick: function(pageNumber, event) { |
117 | - p.page=pageNumber; | ||
118 | - g.__bodyload(); | 144 | + p.page = pageNumber; |
145 | + g.renderBody(); | ||
119 | return false; | 146 | return false; |
120 | } | 147 | } |
121 | }); | 148 | }); |
@@ -163,7 +190,7 @@ grid.prototype={ | @@ -163,7 +190,7 @@ grid.prototype={ | ||
163 | }, | 190 | }, |
164 | success: function (res) { | 191 | success: function (res) { |
165 | var data = res.data.data; | 192 | var data = res.data.data; |
166 | - console.log(res); | 193 | + |
167 | g.__pagination({total:data.totalPage,page:data.page}); | 194 | g.__pagination({total:data.totalPage,page:data.page}); |
168 | g.__bodyClomun(data.list); | 195 | g.__bodyClomun(data.list); |
169 | // setpage(res); | 196 | // setpage(res); |
@@ -234,9 +261,17 @@ grid.prototype={ | @@ -234,9 +261,17 @@ grid.prototype={ | ||
234 | } | 261 | } |
235 | return content || ""; | 262 | return content || ""; |
236 | }, | 263 | }, |
237 | - reload:function(){ | 264 | + reload:function(param){ |
238 | var g = this, p = this.options; | 265 | var g = this, p = this.options; |
239 | - p.page=1; | 266 | + |
267 | + if (param) { | ||
268 | + $.each(param, function(key, value) { | ||
269 | + p[key] = value; | ||
270 | + }); | ||
271 | + } | ||
272 | + | ||
273 | + | ||
274 | + //p.page=1; | ||
240 | g.__bodyload(); | 275 | g.__bodyload(); |
241 | } | 276 | } |
242 | 277 |
@@ -41,5 +41,22 @@ var uploader = function(option){ | @@ -41,5 +41,22 @@ var uploader = function(option){ | ||
41 | } | 41 | } |
42 | } | 42 | } |
43 | }); | 43 | }); |
44 | + // $('.js-add-image').fileupload({ | ||
45 | + // url:'http://upload.static.yohobuy.com', | ||
46 | + // dataType: 'html', | ||
47 | + // forceIframeTransport: true, | ||
48 | + // formData:{pid:0, project:'', is_public:'N', tags:'',exporttype:"html"}, | ||
49 | + // acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, | ||
50 | + // autoUpload: false, | ||
51 | + // maxFileSize: 5000000, | ||
52 | + // add: function (e, data) { | ||
53 | + // for(k in data.files){ | ||
54 | + // console.log(data.files[k]); | ||
55 | + // } | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + // } | ||
60 | + // }); | ||
44 | } | 61 | } |
45 | module.exports=uploader; | 62 | module.exports=uploader; |
@@ -72,7 +72,8 @@ exports.init = function() { | @@ -72,7 +72,8 @@ exports.init = function() { | ||
72 | }); | 72 | }); |
73 | 73 | ||
74 | e.on("bind",function(){ | 74 | e.on("bind",function(){ |
75 | - $("input:checkbox[name=promotionInfo-type]").change(function(){ | 75 | + $discount = $("#promotionInfo-action-discount"); |
76 | + $("input:radio[name=promotionInfo-type]").change(function(){ | ||
76 | var $checked=$(this); | 77 | var $checked=$(this); |
77 | if ($checked.prop("name") == "promotionInfo-type") { | 78 | if ($checked.prop("name") == "promotionInfo-type") { |
78 | if ($checked.val() == "3") { | 79 | if ($checked.val() == "3") { |
@@ -131,7 +132,9 @@ exports.init = function() { | @@ -131,7 +132,9 @@ exports.init = function() { | ||
131 | option.success=function(res){ | 132 | option.success=function(res){ |
132 | res=res.data; | 133 | res=res.data; |
133 | if(res.code=="200"){ | 134 | if(res.code=="200"){ |
134 | - location.href="/coupon/index"; | 135 | + e.$tip('修改成功',function(){ |
136 | + location.href="/coupon/index"; | ||
137 | + },'growl-success'); | ||
135 | }else{ | 138 | }else{ |
136 | e.$tip(res.message); | 139 | e.$tip(res.message); |
137 | } | 140 | } |
@@ -89,6 +89,8 @@ exports.init = function() { | @@ -89,6 +89,8 @@ exports.init = function() { | ||
89 | 89 | ||
90 | var btnAuthority = JSON.parse($("#btnAuthority").val()); | 90 | var btnAuthority = JSON.parse($("#btnAuthority").val()); |
91 | 91 | ||
92 | + | ||
93 | + | ||
92 | var g=new grid({ | 94 | var g=new grid({ |
93 | el: '#basicTable', | 95 | el: '#basicTable', |
94 | size: 10, | 96 | size: 10, |
@@ -96,7 +98,7 @@ exports.init = function() { | @@ -96,7 +98,7 @@ exports.init = function() { | ||
96 | 98 | ||
97 | return { | 99 | return { |
98 | batchNo: $.trim($('#filter-id').val()) ||"", | 100 | batchNo: $.trim($('#filter-id').val()) ||"", |
99 | - status: parseInt($('.list-tabs').find('.active').data('status')) ||"", | 101 | + status: parseInt($('.list-tabs').find('.active').data('status')), |
100 | name: $.trim($('#filter-name').val()) ||"", | 102 | name: $.trim($('#filter-name').val()) ||"", |
101 | reqDepartment:$.trim($('#filter-dep').val()) ||"" | 103 | reqDepartment:$.trim($('#filter-dep').val()) ||"" |
102 | }; | 104 | }; |
@@ -109,7 +111,7 @@ exports.init = function() { | @@ -109,7 +111,7 @@ exports.init = function() { | ||
109 | return '<p>名称:' + item.name + '</p><p>次数' + item.limitTimes + '</p><p>部门:' + item.reqDepartment + '</p>'; | 111 | return '<p>名称:' + item.name + '</p><p>次数' + item.limitTimes + '</p><p>部门:' + item.reqDepartment + '</p>'; |
110 | }}, | 112 | }}, |
111 | {display: '使用期限', name: "name", render: function(item) { | 113 | {display: '使用期限', name: "name", render: function(item) { |
112 | - return '<p>' + item.limitDateFrom + '</p><p>' + item.limitDateTo + '</p>' | 114 | + return '<p class="audit-time">' + item.limitDateFrom + '</p><p>' + item.limitDateTo + '</p>' |
113 | }}, | 115 | }}, |
114 | {display: '优惠码说明', name: "describe"}, | 116 | {display: '优惠码说明', name: "describe"}, |
115 | {display: '申请人', name: "staff"}, | 117 | {display: '申请人', name: "staff"}, |
@@ -121,7 +123,6 @@ exports.init = function() { | @@ -121,7 +123,6 @@ exports.init = function() { | ||
121 | return html; | 123 | return html; |
122 | }}, | 124 | }}, |
123 | {display:"操作",name:"operate",render:function(items){ | 125 | {display:"操作",name:"operate",render:function(items){ |
124 | - console.log(this); | ||
125 | var HtmArr=[]; | 126 | var HtmArr=[]; |
126 | if(btnAuthority.look){ | 127 | if(btnAuthority.look){ |
127 | HtmArr.push('<a href="/coupon/info/'+ items.id+'" class="btn btn-info btn-xs">查看详情</a>'); | 128 | HtmArr.push('<a href="/coupon/info/'+ items.id+'" class="btn btn-info btn-xs">查看详情</a>'); |
@@ -150,7 +151,10 @@ exports.init = function() { | @@ -150,7 +151,10 @@ exports.init = function() { | ||
150 | name: $.trim($('#filter-name').val()), | 151 | name: $.trim($('#filter-name').val()), |
151 | reqDepartment:$.trim($('#filter-dep').val()) | 152 | reqDepartment:$.trim($('#filter-dep').val()) |
152 | }, parseInt($('.list-tabs').find('.active').data('status'))) | 153 | }, parseInt($('.list-tabs').find('.active').data('status'))) |
153 | - g.reload(); | 154 | + location.hash = ''; |
155 | + g.reload({ | ||
156 | + page: 1 | ||
157 | + }); | ||
154 | }); | 158 | }); |
155 | 159 | ||
156 | //作废事件 | 160 | //作废事件 |
@@ -213,7 +217,7 @@ exports.init = function() { | @@ -213,7 +217,7 @@ exports.init = function() { | ||
213 | 217 | ||
214 | //发放列表点击事件 | 218 | //发放列表点击事件 |
215 | $listBtn.off('click.sendPromotion').on('click.sendPromotion', function() { | 219 | $listBtn.off('click.sendPromotion').on('click.sendPromotion', function() { |
216 | - var auditTime = $(that).parents('td').siblings('.time').find('p').eq(0).text(); | 220 | + var auditTime = $(that).parents('td').siblings().find('.audit-time').text(); |
217 | 221 | ||
218 | $.ajax({ | 222 | $.ajax({ |
219 | type: 'post', | 223 | type: 'post', |
@@ -223,7 +227,9 @@ exports.init = function() { | @@ -223,7 +227,9 @@ exports.init = function() { | ||
223 | auditTime: auditTime | 227 | auditTime: auditTime |
224 | }, | 228 | }, |
225 | success: function(res) { | 229 | success: function(res) { |
226 | - if (res.data.data.length === 0) { | 230 | + var data = res.data.data.list; |
231 | + | ||
232 | + if (data.length === 0) { | ||
227 | alert('暂无时间交叉的优惠码'); | 233 | alert('暂无时间交叉的优惠码'); |
228 | } else { | 234 | } else { |
229 | $('#send-modal').modal({ | 235 | $('#send-modal').modal({ |
@@ -233,7 +239,7 @@ exports.init = function() { | @@ -233,7 +239,7 @@ exports.init = function() { | ||
233 | var tpl = Handlebars.compile($('#send-tpl').html()); | 239 | var tpl = Handlebars.compile($('#send-tpl').html()); |
234 | 240 | ||
235 | $('#send-modal tbody').html(tpl({ | 241 | $('#send-modal tbody').html(tpl({ |
236 | - data: res.data.data | 242 | + data: data |
237 | })); | 243 | })); |
238 | } | 244 | } |
239 | 245 | ||
@@ -251,8 +257,11 @@ exports.init = function() { | @@ -251,8 +257,11 @@ exports.init = function() { | ||
251 | $('#back-modal').on('click', '.btn-primary', function() { | 257 | $('#back-modal').on('click', '.btn-primary', function() { |
252 | var reason = $('#back-reason').val(); | 258 | var reason = $('#back-reason').val(); |
253 | 259 | ||
260 | + console.log(reason); | ||
261 | + | ||
254 | if (reason === '' || $.trim(reason) === '') { | 262 | if (reason === '' || $.trim(reason) === '') { |
255 | alert('请填写驳回原因'); | 263 | alert('请填写驳回原因'); |
264 | + return; | ||
256 | } | 265 | } |
257 | $.ajax({ | 266 | $.ajax({ |
258 | type: 'post', | 267 | type: 'post', |
@@ -10,12 +10,12 @@ var dropDown = require('../common/dropDown'); | @@ -10,12 +10,12 @@ var dropDown = require('../common/dropDown'); | ||
10 | 10 | ||
11 | var selectOption = | 11 | var selectOption = |
12 | '{{# data}}' + | 12 | '{{# data}}' + |
13 | - '<option value="{{id}}">{{sortName}}</option>' + | 13 | + '<option value="{{id}}" {{# select}}selected{{/ select}}>{{sortName}}</option>' + |
14 | '{{/ data}}'; | 14 | '{{/ data}}'; |
15 | 15 | ||
16 | var optionStr = Handlebars.compile(selectOption); | 16 | var optionStr = Handlebars.compile(selectOption); |
17 | 17 | ||
18 | -function getAllSort(callback) { | 18 | +function getAllSort(callback, selectId) { |
19 | $.ajax({ | 19 | $.ajax({ |
20 | url: '/product/class/queryAllProductSortList', | 20 | url: '/product/class/queryAllProductSortList', |
21 | type: 'POST', | 21 | type: 'POST', |
@@ -26,9 +26,15 @@ function getAllSort(callback) { | @@ -26,9 +26,15 @@ function getAllSort(callback) { | ||
26 | data = d.data.data, | 26 | data = d.data.data, |
27 | sortLen = data.length, | 27 | sortLen = data.length, |
28 | i; | 28 | i; |
29 | + var resData; | ||
29 | 30 | ||
30 | for (i = 0; i < sortLen; i++) { | 31 | for (i = 0; i < sortLen; i++) { |
31 | if (!data[i].child) { | 32 | if (!data[i].child) { |
33 | + | ||
34 | + if (data[i].id === selectId) { | ||
35 | + data[i].select = true; | ||
36 | + } | ||
37 | + | ||
32 | firstSort.push(data[i]); | 38 | firstSort.push(data[i]); |
33 | } | 39 | } |
34 | } | 40 | } |
@@ -37,7 +43,7 @@ function getAllSort(callback) { | @@ -37,7 +43,7 @@ function getAllSort(callback) { | ||
37 | }); | 43 | }); |
38 | } | 44 | } |
39 | 45 | ||
40 | -function getChildSort(id, callback) { | 46 | +function getChildSort(id, callback, selectId) { |
41 | $.ajax({ | 47 | $.ajax({ |
42 | url: '/product/class/queryProductSortList', | 48 | url: '/product/class/queryProductSortList', |
43 | type: 'POST', | 49 | type: 'POST', |
@@ -47,64 +53,161 @@ function getChildSort(id, callback) { | @@ -47,64 +53,161 @@ function getChildSort(id, callback) { | ||
47 | } | 53 | } |
48 | }).then(function (d) { | 54 | }).then(function (d) { |
49 | 55 | ||
50 | - callback(d); | ||
51 | - }); | ||
52 | -} | 56 | + var data = d.data.data; |
57 | + var dataLen = data.length; | ||
58 | + var i; | ||
53 | 59 | ||
60 | + for (i = 0; i < dataLen; i++) { | ||
54 | 61 | ||
55 | -exports.init = function () { | 62 | + if (data[i].id === selectId) { |
63 | + data[i].select = true; | ||
64 | + } | ||
65 | + } | ||
56 | 66 | ||
57 | - new dropDown({ | ||
58 | - el:'.level-select' | 67 | + callback(data); |
59 | }); | 68 | }); |
69 | +} | ||
60 | 70 | ||
61 | - // 页面初始化渲染一级菜单 | 71 | +var $editInput = $('#editId'); |
72 | +var editLevel = $editInput.attr('level'); | ||
73 | +var toNum = 1; | ||
74 | + | ||
75 | +function createLevelOneOption(selectedId, callback) { | ||
62 | getAllSort(function (data) { | 76 | getAllSort(function (data) { |
63 | 77 | ||
64 | $('#parentSortId').after(optionStr({ | 78 | $('#parentSortId').after(optionStr({ |
65 | data: data | 79 | data: data |
66 | })); | 80 | })); |
67 | 81 | ||
68 | - }); | 82 | + new dropDown({ |
83 | + el:'#firstSortId' | ||
84 | + }); | ||
85 | + | ||
86 | + if (callback) { | ||
87 | + callback(); | ||
88 | + } | ||
89 | + | ||
90 | + }, selectedId*toNum); | ||
91 | +} | ||
69 | 92 | ||
70 | - // 选择一\二级菜单时渲染二\三级菜单 | ||
71 | - $('.level-select').change(function () { | 93 | +function createLevelTwoOption(parentId, selectedId) { |
72 | 94 | ||
73 | - var id = $(this).val(); | ||
74 | - var thisChild = $(this).attr('data-child'); | 95 | + getChildSort(parentId*toNum, function (data) { |
96 | + | ||
97 | + $('#secondSortId').find('option:first').after(optionStr({ | ||
98 | + data: data | ||
99 | + })); | ||
100 | + | ||
101 | + new dropDown({ | ||
102 | + el:'#secondSortId' | ||
103 | + }); | ||
75 | 104 | ||
76 | - if (!thisChild) { | ||
77 | - return; | 105 | + }, selectedId*toNum); |
106 | +} | ||
107 | + | ||
108 | +exports.init = function () { | ||
109 | + | ||
110 | + console.log(editLevel); | ||
111 | + | ||
112 | + // 编辑 | ||
113 | + if (editLevel) { | ||
114 | + | ||
115 | + switch (editLevel) { | ||
116 | + case "1": | ||
117 | + createLevelOneOption($editInput.val(), function () { | ||
118 | + getChildSort($editInput.val()*toNum, function (data) { | ||
119 | + $('#secondSortId').find('option:first').after(optionStr({ | ||
120 | + data: data | ||
121 | + })); | ||
122 | + }); | ||
123 | + }); | ||
124 | + new dropDown({ | ||
125 | + el:'#secondSortId' | ||
126 | + }); | ||
127 | + break; | ||
128 | + case "2": | ||
129 | + createLevelOneOption($editInput.attr('pid'), function () { | ||
130 | + createLevelTwoOption($editInput.attr('pid'), $editInput.val()); | ||
131 | + }); | ||
132 | + break; | ||
133 | + default : | ||
134 | + break; | ||
78 | } | 135 | } |
79 | 136 | ||
137 | + } else { | ||
138 | + // 添加 | ||
139 | + getAllSort(function (data) { | ||
140 | + $('#parentSortId').after(optionStr({ | ||
141 | + data: data | ||
142 | + })); | ||
143 | + }); | ||
144 | + | ||
145 | + // 选择一\二级菜单时渲染二 | ||
146 | + $('.level-select').change(function () { | ||
147 | + | ||
148 | + var id = $(this).val()*toNum; | ||
80 | 149 | ||
81 | - getChildSort(id, function (data) { | 150 | + getChildSort(id, function (data) { |
82 | 151 | ||
83 | - $('#' + thisChild).find('option:first').after(optionStr(data.data)); | 152 | + $('#childSortId').after(optionStr({ |
153 | + data: data | ||
154 | + })); | ||
84 | 155 | ||
156 | + }); | ||
85 | }); | 157 | }); |
86 | - }); | 158 | + |
159 | + new dropDown({ | ||
160 | + el:'#firstSortId' | ||
161 | + }); | ||
162 | + new dropDown({ | ||
163 | + el:'#secondSortId' | ||
164 | + }); | ||
165 | + } | ||
87 | 166 | ||
88 | // 添加品类表单验证 | 167 | // 添加品类表单验证 |
89 | var newClassVerification = new edit("#new-class-form"); | 168 | var newClassVerification = new edit("#new-class-form"); |
90 | 169 | ||
170 | + newClassVerification.init(); | ||
171 | + | ||
91 | $(".new-class-btn").click(function(){ | 172 | $(".new-class-btn").click(function(){ |
92 | 173 | ||
93 | var id = $(this).attr('data-id'); | 174 | var id = $(this).attr('data-id'); |
94 | var postUrl; | 175 | var postUrl; |
176 | + var $this = $(this); | ||
177 | + | ||
178 | + var pid = $('#secondSortId').val(); | ||
179 | + var ppid = $('#firstSortId').val(); | ||
180 | + | ||
181 | + if (ppid*toNum) { | ||
182 | + $('#parentId').val(ppid); | ||
183 | + } | ||
184 | + if (pid*toNum) { | ||
185 | + $('#parentId').val(pid); | ||
186 | + } | ||
95 | 187 | ||
96 | if (!!id) { | 188 | if (!!id) { |
97 | - postUrl = '/product/updateProductSort' | 189 | + postUrl = '/product/sort/update' |
98 | } else { | 190 | } else { |
99 | postUrl = $("#new-class-form").attr("action"); | 191 | postUrl = $("#new-class-form").attr("action"); |
100 | } | 192 | } |
101 | 193 | ||
102 | newClassVerification.submit(postUrl, function(option,that) { | 194 | newClassVerification.submit(postUrl, function(option,that) { |
195 | + option.beforeSend = function () { | ||
196 | + $this.attr('disabled', 'disabled'); | ||
197 | + }; | ||
103 | option.success=function(res){ | 198 | option.success=function(res){ |
104 | 199 | ||
105 | console.log(res); | 200 | console.log(res); |
106 | 201 | ||
107 | - window.location.href = '/erpproduct/sort/index'; | 202 | + if (res.data.code === 200) { |
203 | + | ||
204 | + newClassVerification.$tip('提交成功'); | ||
205 | + $this.removeAttr('disabled'); | ||
206 | + | ||
207 | + setTimeout(function () { | ||
208 | + //window.location.href = '/erpproduct/sort/index'; | ||
209 | + }, 1000); | ||
210 | + } | ||
108 | }; | 211 | }; |
109 | option.error=function(res){ | 212 | option.error=function(res){ |
110 | 213 |
@@ -78,14 +78,16 @@ exports.init = function () { | @@ -78,14 +78,16 @@ exports.init = function () { | ||
78 | $.ajax({ | 78 | $.ajax({ |
79 | type: 'POST', | 79 | type: 'POST', |
80 | dataType: 'json', | 80 | dataType: 'json', |
81 | - url: '/product/class/update', | 81 | + url: '/product/sort/update', |
82 | data: { | 82 | data: { |
83 | id: $target.closest('td').attr('data-id'), | 83 | id: $target.closest('td').attr('data-id'), |
84 | status: status | 84 | status: status |
85 | } | 85 | } |
86 | }).then(function (data) { | 86 | }).then(function (data) { |
87 | 87 | ||
88 | - if (data.code === 200) { | 88 | + console.log(data); |
89 | + | ||
90 | + if (data.data.code === 200) { | ||
89 | 91 | ||
90 | $target.attr('data-status', status); | 92 | $target.attr('data-status', status); |
91 | if ($target.hasClass('btn-danger')) { | 93 | if ($target.hasClass('btn-danger')) { |
@@ -105,8 +107,5 @@ exports.init = function () { | @@ -105,8 +107,5 @@ exports.init = function () { | ||
105 | } | 107 | } |
106 | }); | 108 | }); |
107 | 109 | ||
108 | - new dropDown({ | ||
109 | - el:'.level-select' | ||
110 | - }); | ||
111 | 110 | ||
112 | }; | 111 | }; |
@@ -16,8 +16,8 @@ exports.init=function(){ | @@ -16,8 +16,8 @@ exports.init=function(){ | ||
16 | var g=new grid({ | 16 | var g=new grid({ |
17 | el:'#storeadmin_Tabel', | 17 | el:'#storeadmin_Tabel', |
18 | parms:function(){ | 18 | parms:function(){ |
19 | - var supplierid=$('#supplier-name').val(), | ||
20 | - brandId = $('#brand-name').val(); | 19 | + var supplierid=!!~$.trim($('#supplier-name').val())?$('#supplier-name').val():"0", |
20 | + brandId = !!~$.trim($('#brand-name').val())?$('#brand-name').val():"0"; | ||
21 | return { | 21 | return { |
22 | "supplierId":supplierid, | 22 | "supplierId":supplierid, |
23 | "brandId":brandId, | 23 | "brandId":brandId, |
@@ -27,10 +27,10 @@ exports.init = function() { | @@ -27,10 +27,10 @@ exports.init = function() { | ||
27 | $('.Add').eq(type).append(inputAdd); | 27 | $('.Add').eq(type).append(inputAdd); |
28 | }); | 28 | }); |
29 | new dropDown({ | 29 | new dropDown({ |
30 | - el: "#store-type" | 30 | + el: "#shopNature" |
31 | }); | 31 | }); |
32 | new dropDown({ | 32 | new dropDown({ |
33 | - el: "#store-model" | 33 | + el: "#shopsType" |
34 | }); | 34 | }); |
35 | new dropDown({ | 35 | new dropDown({ |
36 | el: "#brand-name", | 36 | el: "#brand-name", |
@@ -44,7 +44,7 @@ exports.init = function() { | @@ -44,7 +44,7 @@ exports.init = function() { | ||
44 | var check = $(this).closest('tr').html(); | 44 | var check = $(this).closest('tr').html(); |
45 | var brand = check.split('<td>')[check.split('<td>').length - 2]; | 45 | var brand = check.split('<td>')[check.split('<td>').length - 2]; |
46 | var supplier = check.split('<td>')[check.split('<td>').length - 1]; | 46 | var supplier = check.split('<td>')[check.split('<td>').length - 1]; |
47 | - var table = '<tr><td>' + brand + '<td>' + supplier + '<td><button type="button" class="btn btn-danger btn-xs">删除</button></td></tr>'; | 47 | + var table = '<tr><td>' + brand + '<td>' + supplier + '<td><button type="button" class="delete btn btn-danger btn-xs">删除</button></td></tr>'; |
48 | $('#updateBrand tbody').append(table); | 48 | $('#updateBrand tbody').append(table); |
49 | } | 49 | } |
50 | }) | 50 | }) |
@@ -54,7 +54,7 @@ exports.init = function() { | @@ -54,7 +54,7 @@ exports.init = function() { | ||
54 | var check = $(this).closest('tr').html(); | 54 | var check = $(this).closest('tr').html(); |
55 | var brand = check.split('<td>')[check.split('<td>').length - 2]; | 55 | var brand = check.split('<td>')[check.split('<td>').length - 2]; |
56 | var supplier = check.split('<td>')[check.split('<td>').length - 1]; | 56 | var supplier = check.split('<td>')[check.split('<td>').length - 1]; |
57 | - var table = '<tr><td>' + brand + '<td>' + supplier + '<td><button type="button" class="btn btn-danger btn-xs">删除</button></td></tr>'; | 57 | + var table = '<tr><td>' + brand + '<td>' + supplier + '<td><button type="button" class="delete btn btn-danger btn-xs">删除</button></td></tr>'; |
58 | $('#updateBrand tbody').append(table); | 58 | $('#updateBrand tbody').append(table); |
59 | } | 59 | } |
60 | }) | 60 | }) |
@@ -198,4 +198,7 @@ exports.init = function() { | @@ -198,4 +198,7 @@ exports.init = function() { | ||
198 | } | 198 | } |
199 | }) | 199 | }) |
200 | }) | 200 | }) |
201 | + $('#updateBrand').on('click','.delete',function(){ | ||
202 | + $(this).parents('tr').parent().remove() | ||
203 | + }) | ||
201 | } | 204 | } |
@@ -126,8 +126,12 @@ exports.init = function() { | @@ -126,8 +126,12 @@ exports.init = function() { | ||
126 | g.init($("#gridurl").val()); | 126 | g.init($("#gridurl").val()); |
127 | 127 | ||
128 | $("#filter-btn").click(function(){ | 128 | $("#filter-btn").click(function(){ |
129 | - g.reload(); | 129 | + location.hash = ''; |
130 | + g.reload({ | ||
131 | + page: 1 | ||
132 | + }); | ||
130 | }); | 133 | }); |
134 | + | ||
131 | $("#all-btn").click(function(){ | 135 | $("#all-btn").click(function(){ |
132 | $('#supplier-name').val("-1").trigger("change"); | 136 | $('#supplier-name').val("-1").trigger("change"); |
133 | $('#status').val("-1").trigger("change"); | 137 | $('#status').val("-1").trigger("change"); |
@@ -11,14 +11,14 @@ var env = process.env.NODE_ENV || 'development'; | @@ -11,14 +11,14 @@ var env = process.env.NODE_ENV || 'development'; | ||
11 | var config = { | 11 | var config = { |
12 | 'development':{ | 12 | 'development':{ |
13 | redis:null, | 13 | redis:null, |
14 | - domain:'http://192.168.102.215:8080/platform' | 14 | + domain:'http://192.168.102.202:8081/platform' |
15 | }, | 15 | }, |
16 | 'test': { | 16 | 'test': { |
17 | redis: { | 17 | redis: { |
18 | port:6379, | 18 | port:6379, |
19 | host:'localhost' | 19 | host:'localhost' |
20 | }, | 20 | }, |
21 | - domain:'http://192.168.102.202:8081/platform' | 21 | + domain:'http://192.168.102.215:8080/platform' |
22 | }, | 22 | }, |
23 | 'preview': { | 23 | 'preview': { |
24 | redis: { | 24 | redis: { |
server/interface/commodity.js
0 → 100644
1 | +/** | ||
2 | + * Created by wangqianjun on 16/2/2. | ||
3 | + */ | ||
4 | +//接口主域 | ||
5 | +var env = process.env.NODE_ENV || 'development'; | ||
6 | +// exports.domain = 'http://192.168.102.205:18025'; | ||
7 | + | ||
8 | +var domain = { | ||
9 | + development:'http://localhost:30012', | ||
10 | + test:'http://192.168.102.205:18025/yoho-adminportal-web', | ||
11 | + preview:'http://192.168.81.13:8189/yoho-admin-portal', | ||
12 | + production:'http://192.168.81.6:8189/yoho-admin-portal' | ||
13 | +}; | ||
14 | + | ||
15 | +exports.domain = domain[env]; | ||
16 | + | ||
17 | +exports.res = [{ | ||
18 | + //创建【商品管理】页面渲染 | ||
19 | + route: '/erpproduct/price/index', | ||
20 | + method: 'GET', | ||
21 | + view: 'pages/commodity/index', | ||
22 | + src:'/commodity/index' | ||
23 | + },{ | ||
24 | + route: '/erpproduct/price/index1', | ||
25 | + method: 'POST', | ||
26 | + url: '/interface/commodity/list', | ||
27 | + isJsonRaw: true | ||
28 | +} | ||
29 | +]; |
@@ -75,7 +75,7 @@ exports.res = [ | @@ -75,7 +75,7 @@ exports.res = [ | ||
75 | name: 'auditTime', | 75 | name: 'auditTime', |
76 | type: 'String' | 76 | type: 'String' |
77 | } | 77 | } |
78 | - ] | 78 | + ] |
79 | }, | 79 | }, |
80 | { | 80 | { |
81 | route: '/auditPromotion', | 81 | route: '/auditPromotion', |
@@ -165,7 +165,10 @@ exports.res = [ | @@ -165,7 +165,10 @@ exports.res = [ | ||
165 | src:'/coupon/edit', | 165 | src:'/coupon/edit', |
166 | data:{ | 166 | data:{ |
167 | type:"info" | 167 | type:"info" |
168 | - } | 168 | + }, |
169 | + params: [ | ||
170 | + {name:"id",type:"String"} | ||
171 | + ] | ||
169 | }, | 172 | }, |
170 | { | 173 | { |
171 | route: '/checkPromotionCode', | 174 | route: '/checkPromotionCode', |
@@ -44,7 +44,7 @@ exports.res = [ | @@ -44,7 +44,7 @@ exports.res = [ | ||
44 | ] | 44 | ] |
45 | },{ | 45 | },{ |
46 | //产品管理>【品类列表ajax更新】 | 46 | //产品管理>【品类列表ajax更新】 |
47 | - route: '/product/class/update', | 47 | + route: '/product/sort/update', |
48 | method: 'POST', | 48 | method: 'POST', |
49 | url: '/product/updateProductSort', | 49 | url: '/product/updateProductSort', |
50 | isJsonRaw:true, | 50 | isJsonRaw:true, |
@@ -59,14 +59,8 @@ exports.res = [ | @@ -59,14 +59,8 @@ exports.res = [ | ||
59 | name: 'sortInitials', | 59 | name: 'sortInitials', |
60 | type: 'String' | 60 | type: 'String' |
61 | },{ | 61 | },{ |
62 | - name:'firstSortId', | ||
63 | - type: 'String' | ||
64 | - },{ | ||
65 | - name: 'secondSortId', | ||
66 | - type: 'String' | ||
67 | - },{ | ||
68 | - name: 'thirdSortId', | ||
69 | - type: 'String' | 62 | + name:'parentId', |
63 | + type: 'Number' | ||
70 | },{ | 64 | },{ |
71 | name: 'orderBy', | 65 | name: 'orderBy', |
72 | type: 'Number' | 66 | type: 'Number' |
@@ -81,10 +75,15 @@ exports.res = [ | @@ -81,10 +75,15 @@ exports.res = [ | ||
81 | method: 'GET', | 75 | method: 'GET', |
82 | view: 'pages/product/new-class', | 76 | view: 'pages/product/new-class', |
83 | noApi:true, | 77 | noApi:true, |
84 | - src: '/product/add' | 78 | + src: '/product/add', |
79 | + data: { | ||
80 | + data: { | ||
81 | + status: 1 | ||
82 | + } | ||
83 | + } | ||
85 | },{ | 84 | },{ |
86 | //产品管理>【添加品类】ajax请求接口 | 85 | //产品管理>【添加品类】ajax请求接口 |
87 | - route: '/product/class/addProductSort', | 86 | + route: '/product/sort/addProductSort', |
88 | method: 'POST', | 87 | method: 'POST', |
89 | url: '/product/addProductSort', | 88 | url: '/product/addProductSort', |
90 | isJsonRaw:true, | 89 | isJsonRaw:true, |
@@ -99,14 +98,8 @@ exports.res = [ | @@ -99,14 +98,8 @@ exports.res = [ | ||
99 | name: 'sortInitials', | 98 | name: 'sortInitials', |
100 | type: 'String' | 99 | type: 'String' |
101 | },{ | 100 | },{ |
102 | - name:'firstSortId', | ||
103 | - type: 'String' | ||
104 | - },{ | ||
105 | - name: 'secondSortId', | ||
106 | - type: 'String' | ||
107 | - },{ | ||
108 | - name: 'thirdSortId', | ||
109 | - type: 'String' | 101 | + name:'parentId', |
102 | + type: 'Number' | ||
110 | },{ | 103 | },{ |
111 | name: 'orderBy', | 104 | name: 'orderBy', |
112 | type: 'Number' | 105 | type: 'Number' |
1 | -//接口主域 | ||
2 | -var env = process.env.NODE_ENV || 'development'; | ||
3 | -// exports.domain = 'http://192.168.102.205:18025'; | ||
4 | - | ||
5 | -var domain = { | ||
6 | - // development:'http://localhost:30011', | ||
7 | - // development:'http://172.16.6.246:8081/platform', | ||
8 | - development:'http://192.168.102.215:8080/platform', | ||
9 | - test:'http://192.168.102.205:18025/yoho-adminportal-web', | ||
10 | - preview:'http://192.168.81.13:8189/yoho-admin-portal', | ||
11 | - production:'http://192.168.81.6:8189/yoho-admin-portal' | ||
12 | -}; | ||
13 | - | ||
14 | -exports.domain = domain[env]; | ||
15 | - | ||
16 | - | 1 | +exports.domain = require('../config/common.js').domain; |
17 | //路由配置 | 2 | //路由配置 |
18 | exports.res = [{ | 3 | exports.res = [{ |
19 | // 创建店铺页面渲染 | 4 | // 创建店铺页面渲染 |
@@ -250,8 +235,6 @@ exports.res = [{ | @@ -250,8 +235,6 @@ exports.res = [{ | ||
250 | method: 'POST', | 235 | method: 'POST', |
251 | url:"/ShopsAdminRest/getUsersByIdentity", | 236 | url:"/ShopsAdminRest/getUsersByIdentity", |
252 | isJsonRaw:true, | 237 | isJsonRaw:true, |
253 | - url:'/ShopsAdminRest/getAdminRelationDetailById', | ||
254 | - src:'/store/index', | ||
255 | src:'/store/adminedit', | 238 | src:'/store/adminedit', |
256 | params:[ | 239 | params:[ |
257 | {name:"identity",type:"Number"} | 240 | {name:"identity",type:"Number"} |
server/stub/config/commodity.js
0 → 100644
1 | +/** | ||
2 | + * Created by wangqianjun on 16/2/2. | ||
3 | + */ | ||
4 | +module.exports = { | ||
5 | + //供应商查看,修改数据 | ||
6 | + '/interface/commodity/list':function(req, res){ | ||
7 | + res.json({ | ||
8 | + code: 200, | ||
9 | + message:'请求成功', | ||
10 | + data: { | ||
11 | + list: [ | ||
12 | + { | ||
13 | + "skn":"1", | ||
14 | + //公司名称 | ||
15 | + "marketPrice":"123.00", | ||
16 | + | ||
17 | + } | ||
18 | + ], | ||
19 | + page: 1, | ||
20 | + totalpage: 142, | ||
21 | + size: 50, | ||
22 | + total:1000 | ||
23 | + } | ||
24 | + }) | ||
25 | + } | ||
26 | +} |
@@ -217,7 +217,7 @@ | @@ -217,7 +217,7 @@ | ||
217 | <div class="form-group"> | 217 | <div class="form-group"> |
218 | <label class="col-sm-2 control-label">调性指数</label> | 218 | <label class="col-sm-2 control-label">调性指数</label> |
219 | <div class="col-sm-2"> | 219 | <div class="col-sm-2"> |
220 | - <input type="text" id="brandTonality" name="brandTonality" class="form-control" placeholder="调性指数" value="{{brandTonality}}"> | 220 | + <input type="text" id="brandTonality" name="brandTonality" class="form-control" pattern="/^((?!0)\d{1,2}|100)$/" placeholder="调性指数(范围:1-100)" value="{{brandTonality}}"> |
221 | </div> | 221 | </div> |
222 | </div> | 222 | </div> |
223 | 223 | ||
@@ -228,7 +228,7 @@ | @@ -228,7 +228,7 @@ | ||
228 | <div class="panel-footer"> | 228 | <div class="panel-footer"> |
229 | <div class="row"> | 229 | <div class="row"> |
230 | <div class="col-sm-8 col-sm-offset-2"> | 230 | <div class="col-sm-8 col-sm-offset-2"> |
231 | - <a href="/erpproduct/brands/index" class="btn btn-default">取消</a> | 231 | + <a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a> |
232 | <button id="save_brand" type="submit" data-loading-text="保存中..." class="btn btn-primary">保存</button> | 232 | <button id="save_brand" type="submit" data-loading-text="保存中..." class="btn btn-primary">保存</button> |
233 | </div> | 233 | </div> |
234 | </div> | 234 | </div> |
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | </select> | 44 | </select> |
45 | <input type="text" id="starttime" class="form-control panel-input hasDatepicker" name="start_time" placeholder="开始时间" value=""> | 45 | <input type="text" id="starttime" class="form-control panel-input hasDatepicker" name="start_time" placeholder="开始时间" value=""> |
46 | <input type="text" id="endtime" class="form-control panel-input hasDatepicker" name="end_time" placeholder="结束时间" value=""> | 46 | <input type="text" id="endtime" class="form-control panel-input hasDatepicker" name="end_time" placeholder="结束时间" value=""> |
47 | - <a id="filter-btn" href="#page1" class="btn btn-info">筛选</a> | 47 | + <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> |
48 | <a id="filter-all" href="/erpproduct/brands/index" class="btn btn-info">全部</a> | 48 | <a id="filter-all" href="/erpproduct/brands/index" class="btn btn-info">全部</a> |
49 | </div> | 49 | </div> |
50 | </div> | 50 | </div> |
server/views/pages/commodity/index.html
0 → 100644
1 | +<div class="pageheader"> | ||
2 | + <div class="media"> | ||
3 | + <div class="pageicon pull-left"> | ||
4 | + <i class="fa fa-th-list"></i> | ||
5 | + </div> | ||
6 | + <div class="media-body"> | ||
7 | + <ul class="breadcrumb"> | ||
8 | + <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> | ||
9 | + <li><a href="">供应商管理</a></li> | ||
10 | + <li>{{pageTitle}}</li> | ||
11 | + </ul> | ||
12 | + | ||
13 | + <div> | ||
14 | + <div style="width: 30%;float: left;"> | ||
15 | + <h4>{{pageTitle}}</h4> | ||
16 | + </div> | ||
17 | + </div> | ||
18 | + </div> | ||
19 | + </div> | ||
20 | +</div> | ||
21 | + | ||
22 | +<div class="contentpanel"> | ||
23 | + <div class="panel panel-default" style="margin-bottom:10px;"> | ||
24 | + <div class="panel-body"> | ||
25 | + <div class="row"> | ||
26 | + | ||
27 | + <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> | ||
28 | + <a id="all-btn" href="javascript:;" class="btn btn-info">全部</a> | ||
29 | + </div> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + <div class="panel panel-primary-head"> | ||
33 | + <div class="dataTables_wrapper no-footer" id="basicTable"> | ||
34 | + </div> | ||
35 | + </div> | ||
36 | +</div> |
@@ -200,7 +200,7 @@ | @@ -200,7 +200,7 @@ | ||
200 | <div class="panel-footer"> | 200 | <div class="panel-footer"> |
201 | <div class="row"> | 201 | <div class="row"> |
202 | <div class="col-sm-8 col-sm-offset-2"> | 202 | <div class="col-sm-8 col-sm-offset-2"> |
203 | - <a href="#" class="btn btn-default">取消</a> | 203 | + <a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a> |
204 | <button id="save_brand" type="submit" data-loading-text="保存中..." class="btn btn-primary">保存</button> | 204 | <button id="save_brand" type="submit" data-loading-text="保存中..." class="btn btn-primary">保存</button> |
205 | </div> | 205 | </div> |
206 | </div> | 206 | </div> |
@@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
93 | <div class="modal-body"> | 93 | <div class="modal-body"> |
94 | <p>您确定要驳回该申请吗?</p> | 94 | <p>您确定要驳回该申请吗?</p> |
95 | <label class="col-sm-3 control-label">*请填写原因</label> | 95 | <label class="col-sm-3 control-label">*请填写原因</label> |
96 | - <input id="cancel-reason" type="text" class="form-control" name="agreement-code" style="width:280px;"> | 96 | + <input id="back-reason" type="text" class="form-control" name="agreement-code" style="width:280px;"> |
97 | </div> | 97 | </div> |
98 | <div class="modal-footer"> | 98 | <div class="modal-footer"> |
99 | <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | 99 | <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> |
@@ -123,7 +123,7 @@ | @@ -123,7 +123,7 @@ | ||
123 | </div> | 123 | </div> |
124 | 124 | ||
125 | <div class="modal fade" id="send-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | 125 | <div class="modal fade" id="send-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> |
126 | - <div class="modal-dialog" role="document"> | 126 | + <div class="modal-dialog modal-lg" role="document"> |
127 | <div class="modal-content"> | 127 | <div class="modal-content"> |
128 | <div class="modal-header"> | 128 | <div class="modal-header"> |
129 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | 129 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
@@ -131,7 +131,7 @@ | @@ -131,7 +131,7 @@ | ||
131 | </div> | 131 | </div> |
132 | <div class="modal-body"> | 132 | <div class="modal-body"> |
133 | <div class="send-list"> | 133 | <div class="send-list"> |
134 | - <table class="coupon-send-table am-table am-table-bordered am-table-radius"> | 134 | + <table style="width:100%;" class="coupon-send-table am-table am-table-bordered am-table-radius"> |
135 | <thead> | 135 | <thead> |
136 | <tr class="am-primary"> | 136 | <tr class="am-primary"> |
137 | <th>批次号</th> | 137 | <th>批次号</th> |
@@ -155,21 +155,20 @@ | @@ -155,21 +155,20 @@ | ||
155 | <script id="send-tpl" type="x-tmpl-handlebars"> | 155 | <script id="send-tpl" type="x-tmpl-handlebars"> |
156 | \{{# data}} | 156 | \{{# data}} |
157 | <tr> | 157 | <tr> |
158 | - <td class="id"><a href="/couponinfo/\{{id}}">\{{batchNo}}</a></td> | ||
159 | - <td class="info"> | 158 | + <td class="id" style="width: 20%;"><a href="/coupon/info/\{{id}}">\{{batchNo}}</a></td> |
159 | + <td class="info" style="width: 30%;"> | ||
160 | <p>名称:\{{name}}</p> | 160 | <p>名称:\{{name}}</p> |
161 | <p>次数:\{{limitTimes}}</p> | 161 | <p>次数:\{{limitTimes}}</p> |
162 | <p>部门:\{{reqDepartment}}</p> | 162 | <p>部门:\{{reqDepartment}}</p> |
163 | </td> | 163 | </td> |
164 | - <td class="time"> | 164 | + <td class="time" style="width: 20%;"> |
165 | <p>\{{limitDateFrom}}</p> | 165 | <p>\{{limitDateFrom}}</p> |
166 | - 至 | ||
167 | <p>\{{limitDateTo}}</p> | 166 | <p>\{{limitDateTo}}</p> |
168 | </td> | 167 | </td> |
169 | - <td class="describe"> | 168 | + <td class="describe" style="width: 22%;"> |
170 | <p>\{{describe}}</p> | 169 | <p>\{{describe}}</p> |
171 | </td> | 170 | </td> |
172 | - <td class="staff">\{{staff}}</td> | 171 | + <td class="staff" style="width: 8%;">\{{staff}}</td> |
173 | </tr> | 172 | </tr> |
174 | \{{/ data}} | 173 | \{{/ data}} |
175 | </script> | 174 | </script> |
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | 27 | ||
28 | <div class="panel-body nopadding"> | 28 | <div class="panel-body nopadding"> |
29 | 29 | ||
30 | - <form id="new-class-form" class="form-horizontal form-bordered" method="post" action="/product/class/addProductSort"> | 30 | + <form id="new-class-form" class="form-horizontal form-bordered" method="post" action="/product/sort/addProductSort"> |
31 | <div class="form-group"> | 31 | <div class="form-group"> |
32 | <label class="col-md-1 control-label"> | 32 | <label class="col-md-1 control-label"> |
33 | 物理类目<i>*</i> | 33 | 物理类目<i>*</i> |
@@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
54 | </label> | 54 | </label> |
55 | 55 | ||
56 | <div class="col-md-5"> | 56 | <div class="col-md-5"> |
57 | - <select id="firstSortId" class="level-select width300" required data-child="secondSortId" data-placeholder=""> | 57 | + <select id="firstSortId" class="level-select width300" data-placeholder=""> |
58 | <option id="parentSortId" value="0">请选择</option> | 58 | <option id="parentSortId" value="0">请选择</option> |
59 | </select> | 59 | </select> |
60 | </div> | 60 | </div> |
@@ -66,13 +66,13 @@ | @@ -66,13 +66,13 @@ | ||
66 | </label> | 66 | </label> |
67 | 67 | ||
68 | <div class="col-md-5"> | 68 | <div class="col-md-5"> |
69 | - <select id="secondSortId" class="level-select width300" required data-child="thirdSortId" data-placeholder=""> | ||
70 | - <option value="0">请选择</option> | 69 | + <select id="secondSortId" class="level-select width300" data-placeholder=""> |
70 | + <option id="childSortId" value="0">请选择</option> | ||
71 | </select> | 71 | </select> |
72 | </div> | 72 | </div> |
73 | </div> | 73 | </div> |
74 | 74 | ||
75 | - <div class="form-group"> | 75 | + <!--<div class="form-group"> |
76 | <label class="col-md-1 control-label"> | 76 | <label class="col-md-1 control-label"> |
77 | 三级分类 | 77 | 三级分类 |
78 | </label> | 78 | </label> |
@@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
82 | <option value="0">请选择</option> | 82 | <option value="0">请选择</option> |
83 | </select> | 83 | </select> |
84 | </div> | 84 | </div> |
85 | - </div> | 85 | + </div>--> |
86 | 86 | ||
87 | <div class="form-group"> | 87 | <div class="form-group"> |
88 | <label class="col-md-1 control-label">排序</label> | 88 | <label class="col-md-1 control-label">排序</label> |
@@ -96,20 +96,37 @@ | @@ -96,20 +96,37 @@ | ||
96 | <label class="col-md-1 control-label">状态</label> | 96 | <label class="col-md-1 control-label">状态</label> |
97 | <div class="col-md-5"> | 97 | <div class="col-md-5"> |
98 | <div class="radio"> | 98 | <div class="radio"> |
99 | - <label><input type="radio" value="1" name="status">关闭</label> | 99 | + <label><input type="radio" value="1" name="status">开启</label> |
100 | </div> | 100 | </div> |
101 | <div class="radio"> | 101 | <div class="radio"> |
102 | - <label><input type="radio" value="0" name="status">开启</label> | 102 | + <label><input type="radio" value="0" name="status">关闭</label> |
103 | </div> | 103 | </div> |
104 | <input id="status" type="hidden" value="{{data.status}}" for="radio"> | 104 | <input id="status" type="hidden" value="{{data.status}}" for="radio"> |
105 | </div> | 105 | </div> |
106 | </div> | 106 | </div> |
107 | + | ||
108 | + <!--隐藏值--> | ||
109 | + <div class="form-group hidden"> | ||
110 | + <label class="col-md-1 control-label">ID</label> | ||
111 | + | ||
112 | + <div class="col-md-5"> | ||
113 | + <input id="editId" class="form-control" value="{{data.id}}" level="{{data.sortLevel}}" pid="{{data.parentId}}" type="text"> | ||
114 | + </div> | ||
115 | + </div> | ||
116 | + | ||
117 | + <div class="form-group hidden"> | ||
118 | + <label class="col-md-1 control-label">parentID</label> | ||
119 | + | ||
120 | + <div class="col-md-5"> | ||
121 | + <input id="parentId" class="form-control" value="" type="text"> | ||
122 | + </div> | ||
123 | + </div> | ||
107 | </form> | 124 | </form> |
108 | </div> | 125 | </div> |
109 | 126 | ||
110 | <div class="panel-footer"> | 127 | <div class="panel-footer"> |
111 | <button type="submit" class="btn btn-info btn-xs new-class-btn" data-id="{{data.id}}">保存</button> | 128 | <button type="submit" class="btn btn-info btn-xs new-class-btn" data-id="{{data.id}}">保存</button> |
112 | - <a href="/product/class/index" class="btn btn-default btn-xs">取消</a> | 129 | + <a href="/erpproduct/sort/index" class="btn btn-default btn-xs">取消</a> |
113 | </div> | 130 | </div> |
114 | </div> | 131 | </div> |
115 | </div> | 132 | </div> |
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | <div class="col-sm-6"> | 56 | <div class="col-sm-6"> |
57 | <div class="input-group"> | 57 | <div class="input-group"> |
58 | <input type="text" form="storeForm" name="shopDomain" id="shopDomain" class="form-control" value="{{ shopDomain}}" placeholder="店铺域名" aria-describedby="basic-addon2"> | 58 | <input type="text" form="storeForm" name="shopDomain" id="shopDomain" class="form-control" value="{{ shopDomain}}" placeholder="店铺域名" aria-describedby="basic-addon2"> |
59 | - <span class="input-group-addon" id="basic-addon2">@example.com</span> | 59 | + <span class="input-group-addon" id="basic-addon2">.yohobuy.com</span> |
60 | </div> | 60 | </div> |
61 | </div> | 61 | </div> |
62 | </div> | 62 | </div> |
@@ -55,12 +55,12 @@ | @@ -55,12 +55,12 @@ | ||
55 | 55 | ||
56 | 56 | ||
57 | <div class="form-group"> | 57 | <div class="form-group"> |
58 | - <label class="col-sm-2 control-label">营业期限</label> | 58 | + <label class="col-sm-2 control-label">营业期限<span class="red">*</span></label> |
59 | <div class="col-sm-3"> | 59 | <div class="col-sm-3"> |
60 | - <input type="text" class="form-control" jsaction="date:end:endOperateTime" id="beginOperateTime" placeholder="开始时间" value="{{beginOperateTime}}" readonly> | 60 | + <input type="text" class="form-control" jsaction="date:end:endOperateTime" id="beginOperateTime" required placeholder="营业期限开始时间" value="{{beginOperateTime}}" readonly> |
61 | </div> | 61 | </div> |
62 | <div class="col-sm-3"> | 62 | <div class="col-sm-3"> |
63 | - <input type="text" class="form-control" jsaction="date:start:beginOperateTime" id="endOperateTime" placeholder="结束时间" value="{{endOperateTime}}" readonly > | 63 | + <input type="text" class="form-control" jsaction="date:start:beginOperateTime" id="endOperateTime" required placeholder="营业期限结束时间" value="{{endOperateTime}}" readonly > |
64 | </div> | 64 | </div> |
65 | <!-- readonly require--> | 65 | <!-- readonly require--> |
66 | </div> | 66 | </div> |
@@ -156,7 +156,7 @@ | @@ -156,7 +156,7 @@ | ||
156 | <div class="form-group"> | 156 | <div class="form-group"> |
157 | <label class="col-sm-2 control-label">公司联系电话 <span class="red">*</span></label> | 157 | <label class="col-sm-2 control-label">公司联系电话 <span class="red">*</span></label> |
158 | <div class="col-sm-8"> | 158 | <div class="col-sm-8"> |
159 | - <input type="text" id="contactPhone" placeholder="请填写公司联系电话" class="form-control" required value="{{contactPhone}}"> | 159 | + <input type="text" id="contactPhone" placeholder="请填写公司联系电话" class="form-control" required value="{{contactPhone}}" pattern="/^13[0-9]{9}$/"> |
160 | </div> | 160 | </div> |
161 | </div> | 161 | </div> |
162 | 162 | ||
@@ -226,7 +226,7 @@ | @@ -226,7 +226,7 @@ | ||
226 | <div class="panel-footer"> | 226 | <div class="panel-footer"> |
227 | <div class="row"> | 227 | <div class="row"> |
228 | <div class="col-sm-8 col-sm-offset-2"> | 228 | <div class="col-sm-8 col-sm-offset-2"> |
229 | - <a href="#" class="btn btn-default" onclick="javascript:history.go(-1);">取消</a> | 229 | + <a href="javascript:;" class="btn btn-default" onclick="javascript:history.go(-1);">取消</a> |
230 | {{# add}} | 230 | {{# add}} |
231 | <button type="submit" class="btn btn-info" data-loading-text="暂存中..." id="btnTemporary">暂存</button> | 231 | <button type="submit" class="btn btn-info" data-loading-text="暂存中..." id="btnTemporary">暂存</button> |
232 | {{/ add}} | 232 | {{/ add}} |
-
Please register or login to post a comment