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
| layui.define([ 'form', 'laydate', 'table' ], function(exports) {
| var form = layui.form;
| var laydate = layui.laydate;
| var table = layui.table;
| var orderTable = null;
| var data = {};
| laydate.render({
| elem: '#date',
| type: 'datetime',
| format: 'yyyy-MM-dd HH:mm:ss'
| });
| laydate.render({
| elem: '#date1',
| type: 'datetime',
| value: new Date().Format("yyyy-MM-dd")+' 23:59:59',
| format: 'yyyy-MM-dd HH:mm:ss'
| });
| var view ={
| init:function(e){
| data = e;
| this.initTable();
| },
| initTable:function(){
| orderTable = table.render({
| elem : '#orderTable',
| method : 'post',
| url : Common.ctxPath+ '/admin/statis/promoter/promoterOrderDetail.json' //数据接口
| ,page : true //开启分页
| ,limit : 10,
| where: data,
| parseData :function(res){ //res 即为原始返回的数据
| if(res.data.length == 0){
| Common.info('并没有数据');
| }
| return res;
| },
| cols : [ [ //表头
| {
| field: 'orderId',
| title : '订单编号',
| width : 180
| },{
| field: 'relaName',
| title : '客户',
| width : 150,
| },{
| field : 'createTime',
| title : '下单时间',
| width : 180
| }, {
| field : '',
| title : '完成时间',
| width : 180,
| templet: function (data) {
| return '--';
| }
| },
| {
| field : 'nickName',
| title : '回收员',
| width : 120,
| templet: function (d) {
| if (d.nickName == null) {
| return '--';
| } else {
| return $.base64.atob(d.nickName, true);
| }
| }
| },{
| field : 'orderWeightCount',
| title : '订单总重量',
| templet : function (d) {
| if(d.orderWeightCount == null || d.orderWeightCount.length === 0){
| return '--';
| }
| return d.orderWeightCount+"kg";
| }
| },{
| field : 'orderMoneyCount',
| title : '订单总金额',
| templet : function (d) {
| if(d.orderMoneyCount == null || d.orderMoneyCount.length === 0){
| return '--';
| }
| return d.orderMoneyCount + '元';
| }
| }
| ] ]
|
| });
| },
|
| }
|
|
| // 搜索
| $("#search").click(function () {
| data = {
| 'userId':$("#userId").val(),
| 'startTime':$("#date").val(),
| 'endTime':$("#date1").val(),
| 'orderWeightCount':$("#orderWeightCount").val()
| };
| view.init(data);
| });
|
|
| exports('order',view);
|
| });
|
|