Showing
6 changed files
with
713 additions
and
3 deletions
code/apps/operations/controllers/limit.js
0 → 100644
1 | +/** | ||
2 | + * Created by ty on 2016/6/22. | ||
3 | + * 限售商品管理 | ||
4 | + */ | ||
5 | + | ||
6 | +module.exports=function(app) { | ||
7 | + | ||
8 | + /*【限购商品】页面渲染*/ | ||
9 | + app.get("/limit/product/index","operations.limit.Index", function () { | ||
10 | + this.$extend = { | ||
11 | + moduleName: "运营管理", | ||
12 | + pageName: "限购商品管理" | ||
13 | + } | ||
14 | + }); | ||
15 | + | ||
16 | + /*【限购商品】添加页面渲染*/ | ||
17 | + app.get("/limit/product/add","operations.limit.Edit", function () { | ||
18 | + this.$extend = { | ||
19 | + moduleName: "运营管理", | ||
20 | + pageName: "限购商品管理", | ||
21 | + data: { | ||
22 | + limitProductType:"1", | ||
23 | + hotFlag:"0" | ||
24 | + }, | ||
25 | + action: '/limitProduct/addLimitProduct', | ||
26 | + } | ||
27 | + }); | ||
28 | + | ||
29 | + /*【限购商品】编辑页面渲染*/ | ||
30 | + app.get("/limit/edit/:id","operations.limit.Edit","limit_getLimitProduct", function (response) { | ||
31 | + this.$extend = { | ||
32 | + moduleName: "运营管理", | ||
33 | + pageName: "限购商品管理", | ||
34 | + action: "/limitProduct/updateLimitProduct", | ||
35 | + type: "update", | ||
36 | + data: response.data | ||
37 | + } | ||
38 | + }); | ||
39 | + | ||
40 | + /*列表*/ | ||
41 | + app.post("/limitProduct/getLimitProductList","limit_getLimitProductList"); | ||
42 | + | ||
43 | + /*添加*/ | ||
44 | + app.post("/limitProduct/addLimitProduct","limit_addLimitProduct"); | ||
45 | + | ||
46 | + /*编辑*/ | ||
47 | + app.post("/limitProduct/updateLimitProduct","limit_updateLimitProduct"); | ||
48 | + | ||
49 | + /*获取各状态数量*/ | ||
50 | + app.post("/limitProduct/getCountByStatus","limit_getCountByStatus"); | ||
51 | + | ||
52 | + /*更改商品状态*/ | ||
53 | + app.post("/limitProduct/auditLimitProduct","limit_auditLimitProduct"); | ||
54 | + | ||
55 | + /*删除限购商品*/ | ||
56 | + app.post("/limitProduct/deleteLimitProduct","limit_deleteLimitProduct"); | ||
57 | + | ||
58 | + /*检查batchNo是否存在*/ | ||
59 | + app.post("/limitProduct/checkBatchNoExist","limit_checkBatchNoExist"); | ||
60 | + | ||
61 | + /*根据BatchNo检查限购码是否正确*/ | ||
62 | + app.post("/limitCode/checkLimitCodeByBatchNo","limit_checkLimitCodeByBatchNo"); | ||
63 | + | ||
64 | + /*导出*/ | ||
65 | + app.post("/limit/batch/export","limit_export"); | ||
66 | + | ||
67 | + /*检查活动是否存在*/ | ||
68 | + app.post("/DrawlineActivityRest/checkActivityIdExists","limit_checkActivityIdExists"); | ||
69 | + | ||
70 | + /*检查活动是否存在*/ | ||
71 | + app.post("/limitProduct/checkActivityIdNoExist","limit_checkActivityIdNoExist"); | ||
72 | + | ||
73 | + /*根据id获取限购商品*/ | ||
74 | + app.post("/limitProduct/checkActivityIdNoExist","limit_checkActivityIdNoExist"); | ||
75 | +} |
code/apps/operations/interfaces/limit.js
0 → 100644
1 | +/** | ||
2 | + * Created by ty on 2016/6/22. | ||
3 | + * 限售商品管理 | ||
4 | + */ | ||
5 | + | ||
6 | +module.exports={ | ||
7 | + namespace:"limit", | ||
8 | + apis:{ | ||
9 | + getLimitProductList:{ | ||
10 | + title: "【限购商品】ajax分页", | ||
11 | + url: '/limitProduct/getLimitProductList', | ||
12 | + params: [ | ||
13 | + {name: 'hotFlag', type: 'Number'}, | ||
14 | + {name: 'saleFlag', type: 'Number'}, | ||
15 | + {name: 'showFlag', type: 'Number'}, | ||
16 | + {name: 'productName', type: 'String'}, | ||
17 | + {name: 'productSkn', type: 'String'}, | ||
18 | + {name: 'page', type: 'Number'}, | ||
19 | + {name: 'size', type: 'Number'} | ||
20 | + ] | ||
21 | + }, | ||
22 | + addLimitProduct:{ | ||
23 | + title: "【限购商品】ajax添加", | ||
24 | + url: '/limitProduct/addLimitProduct', | ||
25 | + params: [ | ||
26 | + {name: 'productName', type: 'String'}, | ||
27 | + {name: 'attachmentContent', type: 'String'}, | ||
28 | + {name: 'batchNo', type: 'Number'}, | ||
29 | + {name: 'dayFlag', type: 'Number'}, | ||
30 | + {name: 'saleTimeStr', type: 'String'}, | ||
31 | + {name: 'hotFlag', type: 'Number'}, | ||
32 | + {name: 'orderBy', type: 'Number'}, | ||
33 | + {name: 'notSaleOrderBy', type: 'Number'}, | ||
34 | + {name: 'limitProductType', type: 'Number'}, | ||
35 | + {name: 'activityId', type: 'Number'} | ||
36 | + ] | ||
37 | + }, | ||
38 | + updateLimitProduct:{ | ||
39 | + title: "【限购商品】ajax修改", | ||
40 | + url: '/limitProduct/updateLimitProduct', | ||
41 | + params: [ | ||
42 | + {name: 'id', type: 'Number'}, | ||
43 | + {name: 'productName', type: 'String'}, | ||
44 | + {name: 'attachmentContent', type: 'String'}, | ||
45 | + {name: 'batchNo', type: 'String'}, | ||
46 | + {name: 'saleTimeStr', type: 'String'}, | ||
47 | + {name: 'hotFlag', type: 'Number'}, | ||
48 | + {name: 'orderBy', type: 'Number'}, | ||
49 | + {name: 'notSaleOrderBy', type: 'Number'}, | ||
50 | + {name: 'dayFlag', type: 'Number'}, | ||
51 | + {name: 'showFlag', type: 'Number'}, | ||
52 | + {name: 'status', type: 'Number'}, | ||
53 | + {name: 'limitProductType', type: 'Number'}, | ||
54 | + {name: 'activityId', type: 'Number'} | ||
55 | + ] | ||
56 | + }, | ||
57 | + getCountByStatus:{ | ||
58 | + title: "获取各状态数量", | ||
59 | + url: '/limitProduct/getCountByStatus', | ||
60 | + params: [ | ||
61 | + {name: 'hotFlag', type: 'Number'}, | ||
62 | + {name: 'saleFlag', type: 'Number'}, | ||
63 | + {name: 'showFlag', type: 'Number'}, | ||
64 | + {name: 'productName', type: 'String'}, | ||
65 | + {name: 'productSkn', type: 'String'} | ||
66 | + ] | ||
67 | + }, | ||
68 | + auditLimitProduct:{ | ||
69 | + title: "更改商品状态", | ||
70 | + url: '/limitProduct/auditLimitProduct', | ||
71 | + params: [ | ||
72 | + {name: 'id', type: 'Number'}, | ||
73 | + {name: 'showFlag', type: 'Number'}, | ||
74 | + {name: 'hotFlag', type: 'Number'}, | ||
75 | + {name: 'orderBy', type: 'Number'}, | ||
76 | + {name: 'notSaleOrderBy', type: 'Number'} | ||
77 | + ] | ||
78 | + }, | ||
79 | + deleteLimitProduct:{ | ||
80 | + title: "删除限购商品", | ||
81 | + url: '/limitProduct/deleteLimitProduct', | ||
82 | + params: [ | ||
83 | + {name: 'id', type: 'Number'} | ||
84 | + ] | ||
85 | + }, | ||
86 | + checkBatchNoExist:{ | ||
87 | + title: "检查BatchNo是否存在", | ||
88 | + url: '/limitProduct/checkBatchNoExist', | ||
89 | + params: [ | ||
90 | + {name: 'batchNo', type: 'Number'}, | ||
91 | + {name: 'id', type: 'Number'} | ||
92 | + ] | ||
93 | + }, | ||
94 | + checkLimitCodeByBatchNo:{ | ||
95 | + title: "根据BatchNo检查限购码是否正确", | ||
96 | + url:'/limitCode/checkLimitCodeByBatchNo', | ||
97 | + params:[ | ||
98 | + {name:"batchNo",type:'Number'}, | ||
99 | + {name:"id",type:"Number"} | ||
100 | + ] | ||
101 | + }, | ||
102 | + export:{ | ||
103 | + title: "导出", | ||
104 | + url: '/batch/export', | ||
105 | + params: [ | ||
106 | + {name: 'queryConf', type: 'String'}, | ||
107 | + {name: 'type', type: 'String'} | ||
108 | + ] | ||
109 | + }, | ||
110 | + checkActivityIdExists:{ | ||
111 | + title: "检查活动是否存在", | ||
112 | + url:'/DrawlineActivityRest/checkActivityIdExists', | ||
113 | + params:[ | ||
114 | + {name:"activityId",type:"Number"} | ||
115 | + ] | ||
116 | + }, | ||
117 | + checkActivityIdNoExist:{ | ||
118 | + title: "检查活动是否存在", | ||
119 | + url:'/limitProduct/checkActivityIdNoExist', | ||
120 | + params:[ | ||
121 | + {name:"activityId",type:"Number"}, | ||
122 | + {name:"id",type:"Number"} | ||
123 | + ] | ||
124 | + }, | ||
125 | + getLimitProduct:{ | ||
126 | + title: "根据id获取限购商品", | ||
127 | + url: '/limitProduct/getLimitProduct', | ||
128 | + params: [ | ||
129 | + {name: "id", type: "String"} | ||
130 | + ] | ||
131 | + } | ||
132 | + } | ||
133 | +} |
code/apps/operations/views/limit/Edit.html
0 → 100644
1 | +<%include '../../../common/views/__ui/header'%> | ||
2 | +<%include '../../../common/views/__partail/ListHeader'%> | ||
3 | + | ||
4 | +<div class="contentpanel"> | ||
5 | + | ||
6 | + <form id="limit-add-form" class="form-horizontal form-bordered" type="<%type%>" action="<%action%>"> | ||
7 | + <div class="panel-group"> | ||
8 | + <div class="panel-group" id="editor-group"> | ||
9 | + <input type="hidden" id="id" value="<%data.id%>"> | ||
10 | + <input type="hidden" id="showFlag" value="<%data.showFlag%>"> | ||
11 | + <input type="hidden" id="status" value="<%data.status%>"> | ||
12 | + <div class="pannel"> | ||
13 | + <div class="panel-heading"> | ||
14 | + <h4>限购商品基本信息</h4> | ||
15 | + </div> | ||
16 | + <div class="panel-body"> | ||
17 | + <div class="row"> | ||
18 | + <div class="form-group"> | ||
19 | + <label class="col-sm-2 control-label">商品名称<span class="red">*</span>:</label> | ||
20 | + <div class="col-sm-8"> | ||
21 | + <input type="text" id="productName" placeholder="商品名称" class="form-control" required value="<%data.productName%>"> | ||
22 | + </div> | ||
23 | + </div> | ||
24 | + <div class="form-group"> | ||
25 | + <label class="col-sm-2 control-label"></label> | ||
26 | + <div class="col-sm-8"> | ||
27 | + <label class="radio-inline"><input type="radio" name="limitProductType" value="1" checked="checked">分享得限购码</label> | ||
28 | + <label class="radio-inline"><input type="radio" name="limitProductType" value="2">排队得限购码</label> | ||
29 | + <input type="hidden" value="<%data.limitProductType%>" id="limitProductType" for="radio"> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + | ||
33 | + <div class="form-group limitProductType" id="limitProductType_2" style="display: none;"> | ||
34 | + <label class="col-sm-2 control-label">排队限购ID:<span class="red">*</span></label> | ||
35 | + <div class="col-sm-8"> | ||
36 | + <input id="activityId" type="text" class="form-control" value="<%data.activityId%>" placeholder="排队限购ID" /> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + | ||
40 | + <div class="form-group limitProductType" id="limitProductType_1"> | ||
41 | + <label class="col-sm-2 control-label">限购码批次<span class="red">*</span>:</label> | ||
42 | + <div class="col-sm-8"> | ||
43 | + <input type="text" id="batchNo" placeholder="限购码批次" class="form-control" maxlength="30" value="<%data.batchNo%>" required> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | + | ||
47 | + | ||
48 | + <div class="form-group"> | ||
49 | + <label class="col-sm-2 control-label">发售日期<span class="red">*</span>:</label> | ||
50 | + <div class="col-sm-4"> | ||
51 | + <input id="saleTimeStr" data-time="" value="<%data.saleTimeStr%>" type="text" class="form-control" jsaction="time" placeholder="发售日期" readonly required> | ||
52 | + </div> | ||
53 | + <div class="col-md-3"> | ||
54 | + <label>是否显示日期:</label> | ||
55 | + <label class="radio-inline"><input type="radio" name="dayFlag" value="1">是</label> | ||
56 | + <label class="radio-inline"><input type="radio" name="dayFlag" value="0">否</label> | ||
57 | + <input type="hidden" value="<%data.dayFlag%>" id="dayFlag" for="radio"> | ||
58 | + </div> | ||
59 | + </div> | ||
60 | + </div> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + | ||
64 | + <div class="pannel"> | ||
65 | + <div class="panel-heading"> | ||
66 | + <h4>限购商品排序</h4> | ||
67 | + </div> | ||
68 | + <div class="panel-body"> | ||
69 | + <div class="row"> | ||
70 | + <div class="col-md-3"> | ||
71 | + <label>是否热门:</label> | ||
72 | + <label class="radio-inline"><input type="radio" name="hotFlag" value="1">是</label> | ||
73 | + <label class="radio-inline"><input type="radio" name="hotFlag" value="0">否</label> | ||
74 | + <input type="hidden" value="<%data.hotFlag%>" id="hotFlag" for="radio"> | ||
75 | + </div> | ||
76 | + | ||
77 | + <div class="col-md-3 height60 order-by"> | ||
78 | + <label>排序<span class="red" style="display: none;">*</span>:</label> | ||
79 | + <label><input id="orderBy" value="<%data.orderBy%>" type="text" class="form-control" placeholder="排序"></label> | ||
80 | + <p>(提示:数字越大越靠前)</p> | ||
81 | + </div> | ||
82 | + </div> | ||
83 | + </div> | ||
84 | + </div> | ||
85 | + </div> | ||
86 | + | ||
87 | + <div class="pannel"> | ||
88 | + <div class="panel-heading"> | ||
89 | + <h4>限量详情内容</h4> | ||
90 | + </div> | ||
91 | + <div id="baseTable"></div> | ||
92 | + <input type="hidden" value="<%data.attachmentContent%>" id="attachmentContent" /> | ||
93 | + <div class="row"> | ||
94 | + <div class="col-md-12"> | ||
95 | + <button class="btn btn-info mr5" id="textDialog">文本</button> | ||
96 | + <button class="btn btn-info mr5" id="picDialog">图片</button> | ||
97 | + <button class="btn btn-info mr5" id="videoDialog">视频</button> | ||
98 | + </div> | ||
99 | + </div> | ||
100 | + </div> | ||
101 | + | ||
102 | + | ||
103 | + <div class="pannel"> | ||
104 | + <div class="col-md-10"></div> | ||
105 | + <div class="col-md-2"> | ||
106 | + <input id="limit-add-btn" class="btn btn-success limit-add-btn" type="button" value="保存"></input> | ||
107 | + </div> | ||
108 | + </div> | ||
109 | + </div> | ||
110 | + </form> | ||
111 | +</div> | ||
112 | + | ||
113 | + | ||
114 | +<script type="text/template" id="picDialogTemp"> | ||
115 | + <div class="row"> | ||
116 | + <div id="upload-wrapper" class="col-md-3"> | ||
117 | + <input id="imgfile" name="imgfile" type="file" class="btn btn-primary ml10" value="{attachUrl}"> | ||
118 | + </div> | ||
119 | + <div class="col-md-9"> | ||
120 | + <div class="row"> | ||
121 | + <label class="pull-left control-label height40">图片链接</label> | ||
122 | + <div class="pull-left ml10"> | ||
123 | + <input class="form-control" id="imgText" type="text" placeholder="图片链接" value="{attachUrl}" required> | ||
124 | + </div> | ||
125 | + | ||
126 | + </div> | ||
127 | + <div class="row"> | ||
128 | + <label class="pull-left control-label height40">图片描述</label> | ||
129 | + <div class="pull-left ml10"> | ||
130 | + <input class="form-control" type="text" id="attachName" value="{attachName}" placeholder="图片描述"> | ||
131 | + </div> | ||
132 | + </div> | ||
133 | + </div> | ||
134 | + </div> | ||
135 | +</script> | ||
136 | + | ||
137 | +<script type="text/template" id="vidioDialogTemp"> | ||
138 | + | ||
139 | +<!-- Mov, avi ,rmvb ,mp4 --> | ||
140 | + <div class="row"> | ||
141 | + <div id="upload-wrapper1" class="col-md-3"> | ||
142 | + <input id="videofile" name="videofile" type="file" bucket="goodsvideo" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10" value="{attachUrl}"> | ||
143 | + </div> | ||
144 | + <div class="col-md-9"> | ||
145 | + <div class="row"> | ||
146 | + <label class="pull-left control-label height40">视频链接</label> | ||
147 | + <div class="pull-left ml10"> | ||
148 | + <input class="form-control" id="videoText" type="text" placeholder="视频链接" value="{attachUrl}" required> | ||
149 | + </div> | ||
150 | + | ||
151 | + </div> | ||
152 | + <div class="row"> | ||
153 | + <label class="pull-left control-label height40">视频描述</label> | ||
154 | + <div class="pull-left ml10"> | ||
155 | + <input class="form-control" type="text" id="attachName" value="{attachName}" placeholder="视频描述"> | ||
156 | + </div> | ||
157 | + </div> | ||
158 | + </div> | ||
159 | + </div> | ||
160 | + <div class="row"> | ||
161 | + <div id="upload-wrapper2" class="col-md-3"> | ||
162 | + <input id="imgfile" name="imgfile" type="file" class="btn btn-primary ml10" value="{intro}"> | ||
163 | + </div> | ||
164 | + <div class="col-md-9"> | ||
165 | + <div class="row"> | ||
166 | + <label class="pull-left control-label height40">图片链接</label> | ||
167 | + <div class="pull-left ml10"> | ||
168 | + <input class="form-control" id="imgText" type="text" placeholder="图片链接" value="{intro}" required> | ||
169 | + </div> | ||
170 | + | ||
171 | + </div> | ||
172 | + </div> | ||
173 | + </div> | ||
174 | +</script> |
1 | var $ = require('jquery'), | 1 | var $ = require('jquery'), |
2 | - common = require('../common/common'); | 2 | + common = require('../../../common/common'); |
3 | 3 | ||
4 | // require('../common/bootstrap-wysihtml5'); | 4 | // require('../common/bootstrap-wysihtml5'); |
5 | // require('../util/datepicker'); | 5 | // require('../util/datepicker'); |
@@ -277,7 +277,6 @@ $('.limit-add-btn').click(function(option) { | @@ -277,7 +277,6 @@ $('.limit-add-btn').click(function(option) { | ||
277 | $('#limit-add-btn').addClass('disabled'); | 277 | $('#limit-add-btn').addClass('disabled'); |
278 | }; | 278 | }; |
279 | option.success = function(res) { | 279 | option.success = function(res) { |
280 | - res = res.data; | ||
281 | 280 | ||
282 | if (res.code == "200") { | 281 | if (res.code == "200") { |
283 | e.$tip('提交成功', function() { | 282 | e.$tip('提交成功', function() { |
1 | +/** | ||
2 | + * Created by jiangmin on 2016/5/9. | ||
3 | + * 反馈管理 | ||
4 | + */ | ||
5 | +var $ = require('jquery'); | ||
6 | +common = require('../../../common/common'); | ||
7 | +datepicker = require('../../../common/util/datepicker'); | ||
8 | + | ||
9 | +var ENUM = { | ||
10 | + //发送状态 | ||
11 | + StatusEnum1: { | ||
12 | + '0': '未发送', | ||
13 | + '1': '未发送', | ||
14 | + '2': '已发送' | ||
15 | + }, | ||
16 | + //状态 | ||
17 | + StatusEnum2: { | ||
18 | + '0': '未回复', | ||
19 | + '1': '已回复', | ||
20 | + '2': '已回复' | ||
21 | + } | ||
22 | +}; | ||
23 | +/** | ||
24 | + * 下拉框 | ||
25 | + */ | ||
26 | +new common.dropDown({ | ||
27 | + el: "#isHot-filter" | ||
28 | +}); | ||
29 | +new common.dropDown({ | ||
30 | + el: "#status-filter" | ||
31 | +}); | ||
32 | +new common.dropDown({ | ||
33 | + el: "#clientType-filter" | ||
34 | +}); | ||
35 | +/** | ||
36 | + * 日期插件 | ||
37 | + */ | ||
38 | +$('.hasDatepicker').fdatepicker({ | ||
39 | + format: 'yyyy-mm-dd' | ||
40 | +}); | ||
41 | +var appVersion = {}; | ||
42 | +var replyPersonName = {}; | ||
43 | +var quick_select = {}; | ||
44 | +var status = "-1"; | ||
45 | +/** | ||
46 | + * 列表 | ||
47 | + * @type {common.grid} | ||
48 | + */ | ||
49 | +var g = new common.grid({ | ||
50 | + el: '#content-list', | ||
51 | + callback: function (data) { | ||
52 | + if (data && data.data) { | ||
53 | + quick_select = { | ||
54 | + replyTotal: data.data.replyTotal, | ||
55 | + unReplyTotal: data.data.unReplyTotal, | ||
56 | + status: status | ||
57 | + }; | ||
58 | + } | ||
59 | + $("#quick").html(common.util.__template2($("#quick-search").html(), {quick_select: quick_select})); | ||
60 | + return data.data; | ||
61 | + }, | ||
62 | + parms: function () { | ||
63 | + if (common.util.__input('status-filter')) { | ||
64 | + status = common.util.__input('status-filter'); | ||
65 | + } | ||
66 | + return { | ||
67 | + uid: common.util.__input('uid-filter'), | ||
68 | + startTime: common.util.__input('startTime'), | ||
69 | + endTime: common.util.__input('endTime'), | ||
70 | + isHot: common.util.__input('isHot-filter'), | ||
71 | + status: status, | ||
72 | + clientType: common.util.__input('clientType-filter'), | ||
73 | + appVersion: common.util.__input('choose-appVersion'), | ||
74 | + replyPersonId: common.util.__input('choose-replyPersonName') | ||
75 | + }; | ||
76 | + }, | ||
77 | + columns: [ | ||
78 | + { | ||
79 | + display: '', | ||
80 | + type: 'checkbox' | ||
81 | + }, { | ||
82 | + display: "UID", | ||
83 | + name: "uid" | ||
84 | + }, { | ||
85 | + display: "来源", | ||
86 | + name: "clientType" | ||
87 | + }, { | ||
88 | + display: '版本号', | ||
89 | + name: "appVersion" | ||
90 | + }, { | ||
91 | + display: '图片', | ||
92 | + render: function (item) { | ||
93 | + var a = item.imageUrl.split('?'); | ||
94 | + return '<a href="' + a[0] + '" target="_blank"><img src="' + item.imageUrl + '"></a>' | ||
95 | + } | ||
96 | + }, { | ||
97 | + display: '反馈内容', | ||
98 | + name: "content", | ||
99 | + style:"width:20%;word-break:break-all;" | ||
100 | + }, { | ||
101 | + display: '回复内容', | ||
102 | + name: "replyContent", | ||
103 | + style:"width:20%; word-break:break-all;" | ||
104 | + }, { | ||
105 | + display: '回复人', | ||
106 | + name: "replyPersonName", | ||
107 | + render: function (item) { | ||
108 | + if (item.status == '0') { | ||
109 | + return ""; | ||
110 | + } | ||
111 | + else { | ||
112 | + return item.replyPersonName | ||
113 | + } | ||
114 | + } | ||
115 | + }, { | ||
116 | + display: '时间', | ||
117 | + name: "createTime" | ||
118 | + }, { | ||
119 | + display: "发送状态", | ||
120 | + render: function (item) { | ||
121 | + return "<p>" + ENUM.StatusEnum1[item.status] + "</p>"; | ||
122 | + } | ||
123 | + }, { | ||
124 | + display: "回复状态", | ||
125 | + name: 'status', | ||
126 | + render: function (item) { | ||
127 | + return "<p>" + ENUM.StatusEnum2[item.status] + "</p>"; | ||
128 | + } | ||
129 | + }, { | ||
130 | + display: '操作', | ||
131 | + render: function (item) { | ||
132 | + var HtmArr = []; | ||
133 | + //已发送,已回复,uid为0,则不可再“回”、“发” | ||
134 | + if (item.status == 2 || item.uid == '0') { | ||
135 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs reply" disabled="true">回</a>'); | ||
136 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-success btn-xs publish" disabled="true">发</a>'); | ||
137 | + } | ||
138 | + else if (item.status == 0) { | ||
139 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs reply">回</a>'); | ||
140 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-success btn-xs publish" disabled="true">发</a>'); | ||
141 | + } | ||
142 | + else { | ||
143 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs reply">回</a>'); | ||
144 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-success btn-xs publish">发</a>'); | ||
145 | + } | ||
146 | + if (item.isHot == 1) { | ||
147 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs setHot" disabled="false">热</a>'); | ||
148 | + } | ||
149 | + else { | ||
150 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs setHot">热</a>'); | ||
151 | + } | ||
152 | + HtmArr.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn btn-dark btn-xs delete">删</a>'); | ||
153 | + return HtmArr.join(''); | ||
154 | + } | ||
155 | + }] | ||
156 | +}); | ||
157 | +g.init('/suggest/suggest/getSuggestList'); | ||
158 | + | ||
159 | +$(document).on("click", "input[name='quick_select']", function () { | ||
160 | + status = $(this).val(); | ||
161 | + g.reload(); | ||
162 | + $(this).attr("checked", ""); | ||
163 | + $(this).parent().siblings().find("input[name='quick_select']").removeAttr('checked'); | ||
164 | +}); | ||
165 | +var Bll = { | ||
166 | + dropDown: function (url, title, data) { | ||
167 | + common.util.__ajax({ | ||
168 | + url: url,//获取所有版本号 | ||
169 | + data: {} | ||
170 | + }, function (res) { | ||
171 | + $("#" + title + "-content").html(common.util.__template2($("#search-" + title).html(), res)); | ||
172 | + new common.dropDown({el: "#choose-" + title}); | ||
173 | + data = res.data; | ||
174 | + }, true); | ||
175 | + }, | ||
176 | + toast: function (url, item, content) { | ||
177 | + common.dialog.confirm("", | ||
178 | + content, | ||
179 | + function () { | ||
180 | + common.util.__ajax({ | ||
181 | + url: url, | ||
182 | + data: item | ||
183 | + }, function () { | ||
184 | + g.reload(); | ||
185 | + }); | ||
186 | + }); | ||
187 | + }, | ||
188 | + toastBatch: function (url, id, content) { | ||
189 | + common.dialog.confirm("", content, | ||
190 | + function () { | ||
191 | + common.util.__ajax({ | ||
192 | + url: url, | ||
193 | + data: { | ||
194 | + id: id | ||
195 | + } | ||
196 | + }, function (res) { | ||
197 | + //console.log(res); | ||
198 | + g.reload(1); | ||
199 | + }); | ||
200 | + }); | ||
201 | + } | ||
202 | +}; | ||
203 | +Bll.dropDown("/suggest/suggest/getAllAppVersions", "appVersion", appVersion); | ||
204 | +Bll.dropDown("/suggest/suggest/findAllReplyInfo", "replyPersonName", replyPersonName); | ||
205 | +/** | ||
206 | + * 查询按钮点击时间 | ||
207 | + */ | ||
208 | +$("#filter-btn").click(function () { | ||
209 | + g.reload(1); | ||
210 | +}); | ||
211 | +/** | ||
212 | + * 回 | ||
213 | + */ | ||
214 | +$(document).on('click', '.reply', function () { | ||
215 | + var item = g.rows[$(this).data("index")]; | ||
216 | + common.dialog({ | ||
217 | + title: "回答反馈内容", | ||
218 | + content: common.util.__template2($("#replyTemplate").html(), item), | ||
219 | + button: [ | ||
220 | + { | ||
221 | + value: "保存", | ||
222 | + callback: function () { | ||
223 | + common.util.__ajax({ | ||
224 | + url: "/suggest/suggest/replySuggest", | ||
225 | + data: { | ||
226 | + id: item.id, | ||
227 | + replyContent: $("#replyContent").val() | ||
228 | + } | ||
229 | + }, function (res) { | ||
230 | + if (res.code == '200') { | ||
231 | + g.reload(); | ||
232 | + } | ||
233 | + }) | ||
234 | + }, | ||
235 | + css: "btn btn-info" | ||
236 | + }, { | ||
237 | + value: "取消" | ||
238 | + } | ||
239 | + ] | ||
240 | + }); | ||
241 | +}); | ||
242 | +/** | ||
243 | + * 发 | ||
244 | + */ | ||
245 | +$(document).on('click', '.publish', function () { | ||
246 | + var item = g.rows[$(this).data("index")]; | ||
247 | + item = { | ||
248 | + id: item.id | ||
249 | + }; | ||
250 | + Bll.toast('/suggest/suggest/publishSuggest', item, "是否确认发送?"); | ||
251 | +}); | ||
252 | +/** | ||
253 | + * 热 | ||
254 | + */ | ||
255 | +$(document).on('click', '.setHot', function () { | ||
256 | + var item = g.rows[$(this).data("index")]; | ||
257 | + item = { | ||
258 | + id: item.id, | ||
259 | + isHot: 1 | ||
260 | + }; | ||
261 | + Bll.toast('/suggest/suggest/setHotSuggest', item, "是否确认设置热门?"); | ||
262 | +}); | ||
263 | +/** | ||
264 | + * 删除 | ||
265 | + */ | ||
266 | +$(document).on('click', '.delete', function () { | ||
267 | + var item = g.rows[$(this).data("index")]; | ||
268 | + Bll.toast('/suggest/suggest/deleteSuggest', item, "是否确认删除?"); | ||
269 | +}); | ||
270 | + | ||
271 | +//批量发送 | ||
272 | +$(document).on('click', '#batchPublish', function () { | ||
273 | + var selectedArr = g.selected, | ||
274 | + len = selectedArr.length, | ||
275 | + idList = [], | ||
276 | + idstatus0 = [], | ||
277 | + idstatus2 = []; | ||
278 | + var msg = ""; | ||
279 | + var msgs = []; | ||
280 | + if (len <= 0) { | ||
281 | + common.util.__tip('请选择反馈', 'warning'); | ||
282 | + return; | ||
283 | + } | ||
284 | + $.each(selectedArr, function (i, value) { | ||
285 | + idList.push(value['id']); | ||
286 | + if (value['status'] == 0) { | ||
287 | + idstatus0.push(value['uid']); | ||
288 | + } | ||
289 | + if (value['status'] == 2) { | ||
290 | + idstatus2.push(value['uid']); | ||
291 | + } | ||
292 | + }); | ||
293 | + var msg1 = idstatus0.length + '条反馈还没有回复,不可发送!'; | ||
294 | + var msg2 = idstatus2.length + '条反馈已发送,不可重复发送!'; | ||
295 | + if (idstatus0.length > 0) { | ||
296 | + msgs.push(msg1); | ||
297 | + } | ||
298 | + if (idstatus2.length > 0) { | ||
299 | + msgs.push(msg2); | ||
300 | + } | ||
301 | + if (msgs.length > 0) { | ||
302 | + for (var i = 0; i < msgs.length; i++) { | ||
303 | + msg = msg + '<p>' + msgs[i] + '</p>' | ||
304 | + } | ||
305 | + common.util.__tip(msg, 'warning'); | ||
306 | + return; | ||
307 | + } | ||
308 | + Bll.toastBatch("/suggest/suggest/batchPublishSuggest", idList.join(","), "确定批量发送吗?"); | ||
309 | + | ||
310 | +}); | ||
311 | +/** | ||
312 | + * 批量导出 | ||
313 | + */ | ||
314 | +$(document).on('click', '#batchExport', function () { | ||
315 | + var selectedArr = g.selected, | ||
316 | + len = selectedArr.length, | ||
317 | + idList = []; | ||
318 | + if (len <= 0) { | ||
319 | + common.util.__tip('请选择反馈', 'warning'); | ||
320 | + return; | ||
321 | + } | ||
322 | + $.each(selectedArr, function (i, value) { | ||
323 | + idList.push(value['id']); | ||
324 | + }); | ||
325 | + var data = { | ||
326 | + id: idList.join(",") | ||
327 | + }; | ||
328 | + window.open("/ajax/down?queryConf=" + JSON.stringify(data) + "&type=suggestExport"); | ||
329 | +}); |
-
Please register or login to post a comment