goods.specialgoods.Index.js
5.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
webpackJsonp([54],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Created by yoho on 2016/6/28.
*/
/**
* Created by wangqianjun on 16/4/12.
*/
'use strict';
var $ = __webpack_require__(1);
var common = __webpack_require__(2);
var Bll = {
Status: ["不允许退换货", "允许退换货", "超过七天不允许退换货"],
toast: function (hint, url, data) {
common.dialog.confirm("警告",
hint,
function () {
common.util.__ajax({
url: url,
data: data
}, function () {
g.reload();
}, true);
});
}
};
/*下拉选择*/
new common.dropDown({
el: "#brandId",
ajax: "brand",
hash: true,
params:function(){
return {userLimitFlag:true};
}
});
new common.dropDown({
el: "#productSkn",
ajax: "queryRefundExchangeProductSkn"
});
new common.dropDown({
el: "#isPayDelivery"
});
var g = new common.grid({
el: '#basicTable',
parms: function () {
return {
brandId: common.util.__input("brandId"),
isRefundExchange: common.util.__input("isRefundExchange"),
productSkn: common.util.__input("productSkn")
};
},
columns: [
{
display: 'SKN',
name: 'productSkn'
}, {
display: '品牌',
name: 'brandName'
},
{
display: "退换货类型",
render: function (item) {
var html = [];
html.push("<p>" + Bll.Status[item.isRefundExchange] + "</p>");
return html.join('');
}
},
{
display: "操作",
align: "center",
render: function (item) {
var html = [];
if (item.isRefundExchange == 0) {
html.push(' <lable for="btn-item-close"><input type="radio" data-index="' + item.__index + '" checked href="JavaScript:;" id="btn-item-close" name="isRefundExchange' + item.__index + '" data-type="close">不允许退换货</lable>');
html.push('<lable for="btn-item-open"><input type="radio" data-index="' + item.__index + '" href="JavaScript:;" id="btn-item-open" name="isRefundExchange' + item.__index + '" data-type="open">允许退换货</lable>');
html.push(' <lable for="btn-item-open2"><input type="radio" data-index="' + item.__index + '" href="JavaScript:;" id="btn-item-open2" name="isRefundExchange' + item.__index + '" data-type="open2">超过7天不允许退换货</lable>');
} else if (item.isRefundExchange == 1) {
html.push(' <lable for="btn-item-close"><input type="radio" data-index="' + item.__index + '" href="JavaScript:;" id="btn-item-close" name="isRefundExchange' + item.__index + '" data-type="close">不允许退换货</lable>');
html.push('<lable for="btn-item-open"><input type="radio" data-index="' + item.__index + '" checked href="JavaScript:;" id="btn-item-open" name="isRefundExchange' + item.__index + '" data-type="open">允许退换货</lable>');
html.push(' <lable for="btn-item-open2"><input type="radio" data-index="' + item.__index + '" href="JavaScript:;" id="btn-item-open2" name="isRefundExchange' + item.__index + '" data-type="open2">超过7天不允许退换货</lable>');
} else {
html.push(' <lable for="btn-item-close"><input type="radio" data-index="' + item.__index + '" href="JavaScript:;" id="btn-item-close" name="isRefundExchange' + item.__index + '" data-type="close">不允许退换货</lable>');
html.push('<lable for="btn-item-open"><input type="radio" data-index="' + item.__index + '" href="JavaScript:;" id="btn-item-open" name="isRefundExchange' + item.__index + '" data-type="open">允许退换货</lable>');
html.push(' <lable for="btn-item-open2"><input type="radio" data-index="' + item.__index + '" checked href="JavaScript:;" id="btn-item-open2" name="isRefundExchange' + item.__index + '" data-type="open2">超过7天不允许退换货</lable>');
}
return html.join('');
}
}
]
});
g.init('/refundExchangeAttribute/queryRefundExchangeList');
// 筛选
$(document).on('click', "#filter-btn", function () {
g.reload(1);
});
$(document).on('click', "#btn-item-open", function () {
var item = g.rows[$(this).data("index")];
item = {
productSkn: item.productSkn,
isRefundExchange: 1
};
Bll.toast("确认允许退换货吗?", "/refundExchangeAttribute/modifyRefundExchangeStatus", item);
});
$(document).on('click', "#btn-item-open2", function () {
var item = g.rows[$(this).data("index")];
item = {
productSkn: item.productSkn,
isRefundExchange: 2
};
Bll.toast("确认超过7天不允许退换货吗?", "/refundExchangeAttribute/modifyRefundExchangeStatus", item);
});
$(document).on('click', "#btn-item-close", function () {
var item = g.rows[$(this).data("index")];
item = {
productSkn: item.productSkn,
isRefundExchange: 0
};
Bll.toast("确认不允许退换货吗?", "/refundExchangeAttribute/modifyRefundExchangeStatus", item);
});
$('#export-btn').on('click', function () {
window.open("/ajax/down?queryConf=" + JSON.stringify(g.options.parms()) + "&type=productRefundExchangeExport");
});
/***/ }
]);