Showing
8 changed files
with
64 additions
and
23 deletions
@@ -123,6 +123,7 @@ var Bll={ | @@ -123,6 +123,7 @@ var Bll={ | ||
123 | }); | 123 | }); |
124 | }, | 124 | }, |
125 | definetoast:function(content,fn,fn1){ | 125 | definetoast:function(content,fn,fn1){ |
126 | + | ||
126 | common.dialog({ | 127 | common.dialog({ |
127 | title:"温馨提示", | 128 | title:"温馨提示", |
128 | content:content, | 129 | content:content, |
@@ -131,19 +132,19 @@ var Bll={ | @@ -131,19 +132,19 @@ var Bll={ | ||
131 | {value:"确定" ,callback: function(){ | 132 | {value:"确定" ,callback: function(){ |
132 | common.util.__ajax({ | 133 | common.util.__ajax({ |
133 | url:'/market/coupon/auditPromotion', | 134 | url:'/market/coupon/auditPromotion', |
134 | - data:fn() | 135 | + data: fn() |
135 | },function(){ | 136 | },function(){ |
136 | g.reload(); | 137 | g.reload(); |
137 | }); | 138 | }); |
138 | }}, | 139 | }}, |
139 | - {value:"发放列表" ,callback: function(){ | 140 | + {value:"发放列表", callback: function(){ |
140 | common.dialog({ | 141 | common.dialog({ |
141 | title:"发放列表", | 142 | title:"发放列表", |
142 | content:'<div id="faGrid"></div>' | 143 | content:'<div id="faGrid"></div>' |
143 | }); | 144 | }); |
144 | new common.grid({ | 145 | new common.grid({ |
145 | el:"#faGrid", | 146 | el:"#faGrid", |
146 | - parms:fn1(), | 147 | + parms: fn1, |
147 | columns:[ | 148 | columns:[ |
148 | {display:"批次号", name:"batchNo", render: function(item) { | 149 | {display:"批次号", name:"batchNo", render: function(item) { |
149 | return '<a href="/market/coupon/info/' + item.id + '">' + item.batchNo + '</a>'; | 150 | return '<a href="/market/coupon/info/' + item.id + '">' + item.batchNo + '</a>'; |
@@ -208,7 +209,7 @@ $('#basicTable').on('click', '.apply-success', function() { | @@ -208,7 +209,7 @@ $('#basicTable').on('click', '.apply-success', function() { | ||
208 | }; | 209 | }; |
209 | } | 210 | } |
210 | Bll.definetoast("您确定要通过该申请吗?",data,function(){ | 211 | Bll.definetoast("您确定要通过该申请吗?",data,function(){ |
211 | - return {auditTime:item.limitDateFrom}; | 212 | + return {auditTime: item.limitDateFrom}; |
212 | }); | 213 | }); |
213 | }); | 214 | }); |
214 | 215 |
@@ -69,7 +69,6 @@ $('body').on('click', '#videoDialog', function() { | @@ -69,7 +69,6 @@ $('body').on('click', '#videoDialog', function() { | ||
69 | var limitAddForm = new common.edit("#limit-add-form"); | 69 | var limitAddForm = new common.edit("#limit-add-form"); |
70 | limitAddForm.init(); | 70 | limitAddForm.init(); |
71 | 71 | ||
72 | - | ||
73 | limitAddForm.on("validate", function(){ | 72 | limitAddForm.on("validate", function(){ |
74 | var param = { | 73 | var param = { |
75 | batchNo: $('#batchNo').val() | 74 | batchNo: $('#batchNo').val() |
@@ -77,27 +76,45 @@ limitAddForm.on("validate", function(){ | @@ -77,27 +76,45 @@ limitAddForm.on("validate", function(){ | ||
77 | if (type == 'update') { | 76 | if (type == 'update') { |
78 | param.id = $('#batchNo').data('id'); | 77 | param.id = $('#batchNo').data('id'); |
79 | } | 78 | } |
80 | - common.util.__ajax2({ | ||
81 | - url:'/limit/checkBatch', | ||
82 | - async: false, | ||
83 | - data: param | ||
84 | - }); | 79 | + /*common.util.__ajax2({ |
80 | + | ||
81 | + });*/ | ||
82 | + | ||
83 | + | ||
85 | }); | 84 | }); |
86 | 85 | ||
87 | //表单提交 | 86 | //表单提交 |
88 | $('.limit-add-btn').click(function () { | 87 | $('.limit-add-btn').click(function () { |
89 | var $this = $(this); | 88 | var $this = $(this); |
89 | + var param = { | ||
90 | + batchNo: $('#batchNo').val() | ||
91 | + } | ||
92 | + if (type == 'update') { | ||
93 | + param.id = $('#batchNo').data('id'); | ||
94 | + } | ||
90 | 95 | ||
96 | + common.util.__ajax2({ | ||
97 | + url:'/limit/checkBatch', | ||
98 | + data: param | ||
99 | + }, function(res) { | ||
100 | + if (res.code == 200) { | ||
91 | limitAddForm.submit($('#limit-add-form').attr('action'), function(option, that) { | 101 | limitAddForm.submit($('#limit-add-form').attr('action'), function(option, that) { |
92 | option.beforeSend = function () { | 102 | option.beforeSend = function () { |
93 | $this.attr('disabled', 'disabled'); | 103 | $this.attr('disabled', 'disabled'); |
104 | + var param = { | ||
105 | + batchNo: $('#batchNo').val() | ||
106 | + } | ||
107 | + if (type == 'update') { | ||
108 | + param.id = $('#batchNo').data('id'); | ||
109 | + } | ||
110 | + | ||
94 | }; | 111 | }; |
95 | 112 | ||
96 | option.success=function(res){ | 113 | option.success=function(res){ |
97 | if (res.data.code == 200) { | 114 | if (res.data.code == 200) { |
98 | //成功返回列表页 | 115 | //成功返回列表页 |
99 | limitAddForm.$tip('提交成功',function(){ | 116 | limitAddForm.$tip('提交成功',function(){ |
100 | - window.location.href = '/limit/product/index'; | 117 | + //window.location.href = '/limit/product/index'; |
101 | }, 'growl-success'); | 118 | }, 'growl-success'); |
102 | $this.removeAttr('disabled'); | 119 | $this.removeAttr('disabled'); |
103 | } else { | 120 | } else { |
@@ -149,6 +166,10 @@ $('.limit-add-btn').click(function () { | @@ -149,6 +166,10 @@ $('.limit-add-btn').click(function () { | ||
149 | console.log(option.data); | 166 | console.log(option.data); |
150 | 167 | ||
151 | }); | 168 | }); |
169 | + } | ||
170 | + }); | ||
171 | + | ||
172 | + | ||
152 | }); | 173 | }); |
153 | 174 | ||
154 | //编辑页,时间戳转换 | 175 | //编辑页,时间戳转换 |
@@ -248,7 +248,7 @@ exports.res = [ | @@ -248,7 +248,7 @@ exports.res = [ | ||
248 | reqDepartment: "零售运营部/平台运营", | 248 | reqDepartment: "零售运营部/平台运营", |
249 | limitTimes: 1, | 249 | limitTimes: 1, |
250 | userUseLimit: 1, | 250 | userUseLimit: 1, |
251 | - userTypeLimit: '1|2|3|4|5|6|7' | 251 | + userTypeLimit: '1|2|3|4|5|6' |
252 | } | 252 | } |
253 | }, | 253 | }, |
254 | src:'/market/limitcode-edit' | 254 | src:'/market/limitcode-edit' |
@@ -28,13 +28,27 @@ | @@ -28,13 +28,27 @@ | ||
28 | <div class="panel-col2"> | 28 | <div class="panel-col2"> |
29 | <input id="skn" class="form-control panel-input" type="text" placeholder="请输入SKN"> | 29 | <input id="skn" class="form-control panel-input" type="text" placeholder="请输入SKN"> |
30 | </div> | 30 | </div> |
31 | - <div class="panel-col2"> | 31 | + <div class="panel-col"> |
32 | <label class="control-label pull-left">是否开启:</label> | 32 | <label class="control-label pull-left">是否开启:</label> |
33 | <div class="label-leading pull-left"> | 33 | <div class="label-leading pull-left"> |
34 | <label class="radio-inline"><input type="radio" name="showFlag" value="1">是</label> | 34 | <label class="radio-inline"><input type="radio" name="showFlag" value="1">是</label> |
35 | <label class="radio-inline"><input type="radio" name="showFlag" value="0">否</label> | 35 | <label class="radio-inline"><input type="radio" name="showFlag" value="0">否</label> |
36 | </div> | 36 | </div> |
37 | </div> | 37 | </div> |
38 | + <!-- <div class="panel-col"> | ||
39 | + <label class="control-label pull-left">热门:</label> | ||
40 | + <div class="label-leading pull-left"> | ||
41 | + <label class="radio-inline"><input type="radio" name="hotFlag" value="1">是</label> | ||
42 | + <label class="radio-inline"><input type="radio" name="hotFlag" value="0">否</label> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + <div class="panel-col"> | ||
46 | + <label class="control-label pull-left">是否发售:</label> | ||
47 | + <div class="label-leading pull-left"> | ||
48 | + <label class="radio-inline"><input type="radio" name="saleFlag" value="1">是</label> | ||
49 | + <label class="radio-inline"><input type="radio" name="saleFlag" value="0">否</label> | ||
50 | + </div> | ||
51 | + </div> --> | ||
38 | <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> | 52 | <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> |
39 | <a id="all-btn" href="" class="btn btn-info">全部</a> | 53 | <a id="all-btn" href="" class="btn btn-info">全部</a> |
40 | </div> | 54 | </div> |
@@ -24,12 +24,7 @@ | @@ -24,12 +24,7 @@ | ||
24 | <!--required pattern="^[0-9]+$"--> | 24 | <!--required pattern="^[0-9]+$"--> |
25 | </div> | 25 | </div> |
26 | 26 | ||
27 | - <div class="form-group"> | ||
28 | - <label for="userUseLimit" class="col-sm-2 control-label">使用次数<i class="red">*</i></label> | ||
29 | - <div class="col-sm-8"> | ||
30 | - <input type="text" id="userUseLimit" placeholder="0 表示不限制" class="form-control" required pattern="^[0-9]+$" value="{{userUseLimit}}"> | ||
31 | - </div> | ||
32 | - </div> | 27 | + |
33 | 28 | ||
34 | 29 | ||
35 | <div class="form-group"> | 30 | <div class="form-group"> |
@@ -65,10 +60,10 @@ | @@ -65,10 +60,10 @@ | ||
65 | <label><input name="limitTimeType" type="radio" value="1">指定时间</label> | 60 | <label><input name="limitTimeType" type="radio" value="1">指定时间</label> |
66 | </div> --> | 61 | </div> --> |
67 | <div class="col-sm-6"> | 62 | <div class="col-sm-6"> |
68 | - <input type="text" class="form-control" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="{{limitDateFrom}}" readonly > | 63 | + <input type="text" class="form-control" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="{{limitDateFrom}}" readonly required> |
69 | </div> | 64 | </div> |
70 | <div class="col-sm-6"> | 65 | <div class="col-sm-6"> |
71 | - <input type="text" class="form-control" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="结束时间" value="{{limitDateTo}}" readonly > | 66 | + <input type="text" class="form-control" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="结束时间" value="{{limitDateTo}}" readonly required> |
72 | </div> | 67 | </div> |
73 | <!-- <div class="col-sm-6"> | 68 | <!-- <div class="col-sm-6"> |
74 | <label id="no-limit-time"><input name="limitTimeType" type="radio" value="2">不指定</label> | 69 | <label id="no-limit-time"><input name="limitTimeType" type="radio" value="2">不指定</label> |
@@ -140,12 +135,19 @@ | @@ -140,12 +135,19 @@ | ||
140 | <input type="checkbox" value="7" name="userTypeLimit"> 指定用户 | 135 | <input type="checkbox" value="7" name="userTypeLimit"> 指定用户 |
141 | </label> | 136 | </label> |
142 | </div> | 137 | </div> |
138 | + | ||
143 | <div class="col-sm-2"> | 139 | <div class="col-sm-2"> |
144 | <input type="text" class="form-control" id="UID" placeholder="UID"> | 140 | <input type="text" class="form-control" id="UID" placeholder="UID"> |
145 | </div> | 141 | </div> |
146 | 142 | ||
147 | <input type="hidden" value="{{userTypeLimit}}" id="userTypeLimit" for="checkbox" required placeholder="会员身份"> | 143 | <input type="hidden" value="{{userTypeLimit}}" id="userTypeLimit" for="checkbox" required placeholder="会员身份"> |
148 | </div> | 144 | </div> |
145 | + <div class="form-group"> | ||
146 | + <label for="userUseLimit" class="col-sm-2 control-label">限用次数<i class="red">*</i></label> | ||
147 | + <div class="col-sm-8"> | ||
148 | + <input type="text" id="userUseLimit" placeholder="0 表示不限制" class="form-control" required pattern="^[0-9]+$" value="{{userUseLimit}}"> | ||
149 | + </div> | ||
150 | + </div> | ||
149 | 151 | ||
150 | <div class="form-group"> | 152 | <div class="form-group"> |
151 | <label for="name" class="col-sm-2 control-label">指定商品</label> | 153 | <label for="name" class="col-sm-2 control-label">指定商品</label> |
-
Please register or login to post a comment