Authored by chenchao

resume good version

@@ -2,23 +2,6 @@ var $ = require('jquery'), @@ -2,23 +2,6 @@ var $ = require('jquery'),
2 common = require('../../../../common/common'); 2 common = require('../../../../common/common');
3 3
4 var promotionEdit={ 4 var promotionEdit={
5 - /*batchId:[],  
6 -  
7 - buildCheckboxHtml:function(_class,_data_index,_checked){  
8 - var _checkBox="<input type='checkbox'";  
9 - var _end="/>";  
10 - if(_class){  
11 - _checkBox+=" class='"+_class+"'";  
12 - }  
13 - if(_data_index){  
14 - _checkBox+=" data-index='"+_data_index+"'";  
15 - }  
16 - if(_checked){  
17 - _checkBox+=" checked='"+_checked+"'";  
18 - }  
19 - _checkBox+=_end;  
20 - return _checkBox;  
21 - },*/  
22 getParam:function(){ 5 getParam:function(){
23 var param={ 6 var param={
24 el: '#basicTable_promotion', 7 el: '#basicTable_promotion',
@@ -29,77 +12,52 @@ var promotionEdit={ @@ -29,77 +12,52 @@ var promotionEdit={
29 endTime:common.util.__input("endTime") 12 endTime:common.util.__input("endTime")
30 }; 13 };
31 }, 14 },
32 - columns: [  
33 - /*  
34 - {  
35 - display: '',  
36 - type: 'checkbox',  
37 - render: function (item) {  
38 - var htmlContent = "";  
39 - var _class="wqt_checkbox";  
40 - if(this.batchId.length == 0 ){  
41 - htmlContent = "<input type='checkbox' class='wqt_checkbox' data-index='"+item.__index+"'>";  
42 - //htmlContent = this.buildCheckboxHtml(_class,item.__index);  
43 - }else{  
44 - $.each(this.batchId,function(n,value) {  
45 - if(item.id == value){  
46 - htmlContent = "<input type='checkbox' checked='checked' class='wqt_checkbox' data-index='"+item.__index+"'>";  
47 - //htmlContent = this.buildCheckboxHtml(_class,item.__index,"checked");  
48 - return false  
49 - }else{  
50 - htmlContent = "<input type='checkbox' class='wqt_checkbox' data-index='"+item.__index+"'>";  
51 - //htmlContent = this.buildCheckboxHtml(_class,item.__index);  
52 - }  
53 - })  
54 - }  
55 - return htmlContent; 15 + columns: [{
  16 + display: "ID",
  17 + name: "id"
  18 + }, {
  19 + display: "促销名称",
  20 + name: "title"
  21 + }, {
  22 + display: '优先级',
  23 + name: "priority"
  24 + }, {
  25 + display: '开始时间',
  26 + name: "startTime",
  27 + render: function(item) {
  28 + var date = new Date(item.startTime * 1000);
  29 + return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
  30 + }
  31 + }, {
  32 + display: '结束时间',
  33 + name: "endTime",
  34 + render: function(item) {
  35 + var date = new Date(item.endTime * 1000);
  36 + return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
  37 + }
  38 + }, {
  39 + display: '是否启用',
  40 + name: "status",
  41 + render: function(item) {
  42 + if(item.status==1){
  43 + var name ="已启用" ;
  44 + }else {
  45 + var name ="未启用" ;
56 } 46 }
57 - },*/{  
58 - display: "ID",  
59 - name: "id"  
60 - }, {  
61 - display: "促销名称",  
62 - name: "title"  
63 - }, {  
64 - display: '优先级',  
65 - name: "priority"  
66 - }, {  
67 - display: '开始时间',  
68 - name: "startTime",  
69 - render: function(item) {  
70 - var date = new Date(item.startTime * 1000);  
71 - return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); 47 + return name;
  48 + }
  49 + }, {
  50 + display: '优惠券限制使用',
  51 + name: "status",
  52 + render: function(item) {
  53 + if(item.status==1){
  54 + var name ="是" ;
  55 + }else {
  56 + var name ="否" ;
72 } 57 }
73 - }, {  
74 - display: '结束时间',  
75 - name: "endTime",  
76 - render: function(item) {  
77 - var date = new Date(item.endTime * 1000);  
78 - return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();  
79 - }  
80 - }, {  
81 - display: '是否启用',  
82 - name: "status",  
83 - render: function(item) {  
84 - if(item.status==1){  
85 - var name ="已启用" ;  
86 - }else {  
87 - var name ="未启用" ;  
88 - }  
89 - return name;  
90 - }  
91 - }, {  
92 - display: '优惠券限制使用',  
93 - name: "status",  
94 - render: function(item) {  
95 - if(item.status==1){  
96 - var name ="是" ;  
97 - }else {  
98 - var name ="否" ;  
99 - }  
100 - return name;  
101 - }  
102 - }] 58 + return name;
  59 + }
  60 + }]
103 }; 61 };
104 return param; 62 return param;
105 }, 63 },