|
@@ -3,8 +3,8 @@ |
|
@@ -3,8 +3,8 @@ |
3
|
*/
|
3
|
*/
|
4
|
|
4
|
|
5
|
'use strict';
|
5
|
'use strict';
|
6
|
-var $ = require('jquery'),
|
|
|
7
|
- common = require('../../../common/common');
|
6
|
+var $ = require('jquery'), common = require('../../../common/common');
|
|
|
7
|
+var artTemplate = common.artTemplate;
|
8
|
/**
|
8
|
/**
|
9
|
* 全局变量
|
9
|
* 全局变量
|
10
|
* couponTypes 优惠券类型
|
10
|
* couponTypes 优惠券类型
|
|
@@ -18,12 +18,14 @@ var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"]; |
|
@@ -18,12 +18,14 @@ var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"]; |
18
|
// var customTypes = ["新客户", "银卡会员", "金卡会员", "白金卡会员", "普通用户(不含新客)"];
|
18
|
// var customTypes = ["新客户", "银卡会员", "金卡会员", "白金卡会员", "普通用户(不含新客)"];
|
19
|
var customTypes={1:"新客户",2:"银卡会员", 3:"金卡会员", 4:"白金卡会员", 5:"普通用户(不含新客)",9:"学生"};
|
19
|
var customTypes={1:"新客户",2:"银卡会员", 3:"金卡会员", 4:"白金卡会员", 5:"普通用户(不含新客)",9:"学生"};
|
20
|
var shopPriceLimitsTable={1:"成交价低于吊牌价三折",2:"限量商品"};
|
20
|
var shopPriceLimitsTable={1:"成交价低于吊牌价三折",2:"限量商品"};
|
|
|
21
|
+var thirdTypeEnum={1:"微信", 2:"支付宝", 3: "微薄"};
|
21
|
|
22
|
|
22
|
var ENUM = {
|
23
|
var ENUM = {
|
23
|
status: {0: '待审核', 1: '审核通过', 2: '驳回', '-1': '过期', 3: '作废'},//全部
|
24
|
status: {0: '待审核', 1: '审核通过', 2: '驳回', '-1': '过期', 3: '作废'},//全部
|
24
|
tips: {"0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "all": 0}
|
25
|
tips: {"0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "all": 0}
|
25
|
};
|
26
|
};
|
26
|
var columnname = "all";
|
27
|
var columnname = "all";
|
|
|
28
|
+
|
27
|
/**
|
29
|
/**
|
28
|
* 初始化下拉框
|
30
|
* 初始化下拉框
|
29
|
*/
|
31
|
*/
|
|
@@ -121,6 +123,9 @@ var g = new common.grid({ |
|
@@ -121,6 +123,9 @@ var g = new common.grid({ |
121
|
arr.push("<p>优惠结果:" + item.couponAmount + "</p>");
|
123
|
arr.push("<p>优惠结果:" + item.couponAmount + "</p>");
|
122
|
arr.push("<p>数量:" + item.couponNum + "</p>");
|
124
|
arr.push("<p>数量:" + item.couponNum + "</p>");
|
123
|
arr.push("<p>部门:" + item.departmentName + "</p>");
|
125
|
arr.push("<p>部门:" + item.departmentName + "</p>");
|
|
|
126
|
+ if (item.couponsUseRuleVo && item.couponsUseRuleVo.thirdType) {
|
|
|
127
|
+ arr.push("<p>第三方(" + thirdTypeEnum[item.couponsUseRuleVo.thirdType] + "): " + item.couponsUseRuleVo.thirdId+ "</p>");
|
|
|
128
|
+ }
|
124
|
return arr.join('');
|
129
|
return arr.join('');
|
125
|
}
|
130
|
}
|
126
|
},
|
131
|
},
|
|
@@ -236,6 +241,8 @@ var Bll = { |
|
@@ -236,6 +241,8 @@ var Bll = { |
236
|
btns.push(buttons[array[i]])
|
241
|
btns.push(buttons[array[i]])
|
237
|
}
|
242
|
}
|
238
|
|
243
|
|
|
|
244
|
+ // 绑定第三方 id
|
|
|
245
|
+ btns.push('<a class="btn btn-warning btn-xs operation-third" data-coupon-id="' + id + '" data-index="' + index + '">绑定三方</a>');
|
239
|
// 增加查看操作记录按钮
|
246
|
// 增加查看操作记录按钮
|
240
|
btns.push('<a class="btn btn-primary btn-xs operation-records" data-coupon-id="' + id + '">操作记录</a>');
|
247
|
btns.push('<a class="btn btn-primary btn-xs operation-records" data-coupon-id="' + id + '">操作记录</a>');
|
241
|
return btns;
|
248
|
return btns;
|
|
@@ -359,6 +366,47 @@ $(document).on('click', '.coupon-info', function () { |
|
@@ -359,6 +366,47 @@ $(document).on('click', '.coupon-info', function () { |
359
|
|
366
|
|
360
|
Bll.toastInfo(item1, '优惠券详情');
|
367
|
Bll.toastInfo(item1, '优惠券详情');
|
361
|
});
|
368
|
});
|
|
|
369
|
+// 绑定第三方
|
|
|
370
|
+$(document).on('click', '.operation-third', function() {
|
|
|
371
|
+
|
|
|
372
|
+ var item = g.rows[$(this).data("index")];
|
|
|
373
|
+ var obj = {};
|
|
|
374
|
+ if (item.couponsUseRuleVo && item.couponsUseRuleVo.thirdType) {
|
|
|
375
|
+ obj = item.couponsUseRuleVo;
|
|
|
376
|
+ }
|
|
|
377
|
+ obj["couponId"] = item.id;
|
|
|
378
|
+
|
|
|
379
|
+ var e = new common.edit("#baseform");
|
|
|
380
|
+
|
|
|
381
|
+ var url = "/coupon/updateCouponsUseRule";
|
|
|
382
|
+
|
|
|
383
|
+ var dialog = common.dialog.confirm("绑定第三方 ID", artTemplate("third-template", obj), function() {
|
|
|
384
|
+
|
|
|
385
|
+ e.submit(url, function (option) {
|
|
|
386
|
+
|
|
|
387
|
+ console.log(option.data);
|
|
|
388
|
+
|
|
|
389
|
+ option.success=function() {
|
|
|
390
|
+ dialog.close();
|
|
|
391
|
+ g.reload();
|
|
|
392
|
+ };
|
|
|
393
|
+ option.error=function(){};
|
|
|
394
|
+ });
|
|
|
395
|
+
|
|
|
396
|
+ return false;
|
|
|
397
|
+ });
|
|
|
398
|
+
|
|
|
399
|
+ // e.on("validate", function() {
|
|
|
400
|
+ // var thirdId = $("#baseform").find("#thirdId").val();
|
|
|
401
|
+ // if ($.trim(thirdId).length == 0) {
|
|
|
402
|
+ // return "请输入第三方 ID";
|
|
|
403
|
+ // }
|
|
|
404
|
+ // });
|
|
|
405
|
+
|
|
|
406
|
+ e.init();
|
|
|
407
|
+
|
|
|
408
|
+ new common.dropDown({ el: "#thirdType" });
|
|
|
409
|
+});
|
362
|
|
410
|
|
363
|
// 查看操作记录
|
411
|
// 查看操作记录
|
364
|
$(document).on('click', '.operation-records', function() {
|
412
|
$(document).on('click', '.operation-records', function() {
|