Authored by xuhongyun

build

@@ -64,29 +64,29 @@ webpackJsonp([71],[ @@ -64,29 +64,29 @@ webpackJsonp([71],[
64 el: "#basicTab", 64 el: "#basicTab",
65 click: function () { 65 click: function () {
66 columnname = $(this).find('a').attr('columnname'); 66 columnname = $(this).find('a').attr('columnname');
  67 + g.options.columns[5].hidden = true;
67 g.options.columns[6].hidden = true; 68 g.options.columns[6].hidden = true;
68 - g.options.columns[7].hidden = true;  
69 switch (columnname) { 69 switch (columnname) {
70 case "1": 70 case "1":
71 { 71 {
72 - g.options.columns[8].hidden = true; 72 + g.options.columns[7].hidden = true;
73 } 73 }
74 break; 74 break;
75 case "2": 75 case "2":
76 { 76 {
77 - g.options.columns[6].hidden = false;  
78 - g.options.columns[8].hidden = true; 77 + g.options.columns[5].hidden = false;
  78 + g.options.columns[7].hidden = true;
79 } 79 }
80 break; 80 break;
81 case "3": 81 case "3":
82 { 82 {
83 - g.options.columns[7].hidden = false;  
84 - g.options.columns[8].hidden = true; 83 + g.options.columns[6].hidden = false;
  84 + g.options.columns[7].hidden = true;
85 } 85 }
86 break; 86 break;
87 case "all": 87 case "all":
88 { 88 {
89 - g.options.columns[8].hidden = false; 89 + g.options.columns[7].hidden = false;
90 } 90 }
91 break; 91 break;
92 } 92 }
@@ -147,7 +147,6 @@ webpackJsonp([71],[ @@ -147,7 +147,6 @@ webpackJsonp([71],[
147 } 147 }
148 }, 148 },
149 {display: "优惠券说明", name: "explains"}, 149 {display: "优惠券说明", name: "explains"},
150 - {display: "申请人", name: "proposer"},  
151 { 150 {
152 display: "驳回理由", hidden: true, name: "rejectReason", render: function (item) { 151 display: "驳回理由", hidden: true, name: "rejectReason", render: function (item) {
153 return "<p style='color: red'>" + item.rejectReason + "</p>" 152 return "<p style='color: red'>" + item.rejectReason + "</p>"
@@ -240,6 +239,9 @@ webpackJsonp([71],[ @@ -240,6 +239,9 @@ webpackJsonp([71],[
240 for (var i = 0; i < array.length; i++) { 239 for (var i = 0; i < array.length; i++) {
241 btns.push(buttons[array[i]]) 240 btns.push(buttons[array[i]])
242 } 241 }
  242 +
  243 + // 增加查看操作记录按钮
  244 + btns.push('<a class="btn btn-primary btn-xs operation-records" data-coupon-id="' + id + '">操作记录</a>');
243 return btns; 245 return btns;
244 } 246 }
245 }; 247 };
@@ -362,7 +364,45 @@ webpackJsonp([71],[ @@ -362,7 +364,45 @@ webpackJsonp([71],[
362 Bll.toastInfo(item1, '优惠券详情'); 364 Bll.toastInfo(item1, '优惠券详情');
363 }); 365 });
364 366
  367 + // 查看操作记录
  368 + $(document).on('click', '.operation-records', function() {
  369 + var couponId = $(this).data('coupon-id');
  370 + var option = {
  371 + title:'操作记录详情',
  372 + content:"<div class='historyDetail'>加载操作记录...</div>",
  373 + width:'70%',
  374 + button:[{value:"关闭", css:"btn-primary"}]
  375 + };
  376 + new common.dialog(option);
  377 +
  378 + getOperationRecords(couponId);
  379 + });
  380 +
  381 + function getOperationRecords(couponId) {
  382 + common.util.__ajax({
  383 + url: '/coupon/getOperationRecords',
  384 + data: {
  385 + couponsId: couponId
  386 + }
  387 + }, function(resp) {
  388 + if(resp.code == 200) {
  389 + var data = resp.data;
  390 + covertOperationRecord(data)
  391 + $('.historyDetail').html(common.util.__template2($('#operation-record-template').html(), {list: data}));
  392 + }
  393 + }, true);
  394 + }
365 395
  396 + // 转化操作类型,操作时间
  397 + function covertOperationRecord(data) {
  398 + var TYPE = {0: "新增", 1: "修改", 2: "作废"}
  399 + if(data && data.length > 0) {
  400 + $.each(data, function(index, item) {
  401 + item.operationType = TYPE[item.operationType];
  402 + item.createTime = Bll.getTime(item.createTime);
  403 + })
  404 + }
  405 + }
366 406
367 407
368 /***/ } 408 /***/ }
@@ -55,4 +55,6 @@ module.exports = function (app) { @@ -55,4 +55,6 @@ module.exports = function (app) {
55 //作废 55 //作废
56 app.post("/coupon/invalid", "CouponList_invalid"); 56 app.post("/coupon/invalid", "CouponList_invalid");
57 57
  58 + // 查询优惠券操作记录
  59 + app.post("/coupon/getOperationRecords", "CouponList_getOperationRecords");
58 }; 60 };
@@ -74,6 +74,13 @@ module.exports = { @@ -74,6 +74,13 @@ module.exports = {
74 couponId: {type: Number}, 74 couponId: {type: Number},
75 invalidReason: {type: String} 75 invalidReason: {type: String}
76 } 76 }
  77 + },
  78 + getOperationRecords: {
  79 + title: "查询优惠券操作记录",
  80 + url: "/coupon/queryOperationRecord",
  81 + params: {
  82 + couponsId: {type: Number}
  83 + }
77 } 84 }
78 } 85 }
79 }; 86 };
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 </div> 91 </div>
92 92
93 <div class="form-group"> 93 <div class="form-group">
94 - <label class="col-sm-2 control-label">申请部门<i class="red">*</i></label> 94 + <label class="col-sm-2 control-label">费用承担部门<i class="red">*</i></label>
95 95
96 <div class="col-sm-8" id="departments"> 96 <div class="col-sm-8" id="departments">
97 97
@@ -207,6 +207,32 @@ @@ -207,6 +207,32 @@
207 207
208 </div> 208 </div>
209 </script> 209 </script>
  210 +<script type="text/template" id="operation-record-template">
  211 + <div class="historyList">
  212 + <table class="table table-striped table-bordered">
  213 + <thead>
  214 + <tr>
  215 + <th>操作类型</th>
  216 + <th>操作人</th>
  217 + <th>执行时间</th>
  218 + </tr>
  219 + </thead>
  220 + <tbody>
  221 + [[if list.length > 0]]
  222 + [[each list as item index]]
  223 + <tr>
  224 + <td>[[item.operationType]]</td>
  225 + <td>[[item.operator]]</td>
  226 + <td>[[item.createTime]]</td>
  227 + </tr>
  228 + [[/each]]
  229 + [[else]]
  230 + <tr><td colspan="7">没有操作记录!</td></tr>
  231 + [[/if]]
  232 + </tbody>
  233 + </table>
  234 + </div>
  235 +</script>
210 <%include '../../common/__ui/footer'%> 236 <%include '../../common/__ui/footer'%>
211 237
212 238