Blame view

assets/pages/scripts/managereport/tollaudit.js 10.8 KB
10646c94   Andy   add
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
  $(function () {
    $("[data-toggle='tooltip']").tooltip();
  });
  var fun = {
    init:function () {
      commSelect.area_Pl_BA_LinkedSelect("#select_block","#select_park","#select_area");
      fun.chargerSelectInit();
      fun.monthdateInit();
      fun.queryChargerIncomeDiffForSummary();
      fun.createTableData();
    },
    //收费员下拉框
      chargerSelectInit:function () {
          var data = fun.getChargerMsg();
          var htmls = '';
          var html = '';
          var chargerCodes = [];
          for (var i = 0; i < data.length; i++) {
  //          chargerCodes.push(data[i].chargerCode);
              html += "<option value='[\"" + data[i].chargerCode + "\"]'>" + data[i].chargerCode + "-" + data[i].chargerName + "</option>";
          }
          var chargerCodesStr = JSON.stringify(chargerCodes);
          htmls = '<option value=' + chargerCodesStr + ' selected>所有收费员</option>' + html;
      
          $("#select_charger").empty();
          $("#select_charger").append(htmls);
          $('#select_charger').selectpicker('render');
      },
    //获取接口收费员信息
      getChargerMsg: function () {
          var plNo = "";
          var chargers = "";
          var req = {
              baseRequest: {pageNum: 1, pageSize: 0},
              plNo: plNo,
              parkAreaCode: "",
              groupCode: "",
              onduty: "",
              status: "",
              nameOrNo: "",
              orgId:fn.getOrgId(),
              sysCode: sysComm.sysCode
          };
          var opt = {
              async: false,
              data: JSON.stringify(req),
              method: "POST",
              url: dataUrl.util.queryCashierListInfo(),
              success: function (res) {
                  if (res.code == '8888') {
                      chargers = JSON.stringify(res.data.rows);
                  }
              }
          }
          sysAjax(opt);
          return JSON.parse(chargers);
      },
    monthdateInit:function () {
      /** 月 时间初始化 **/
      $('#recon-monthdaterange-btnsta').val(moment().subtract('day', 1).format('YYYY-MM-DD'));
      $('#recon-monthdaterange-btnend').val(moment().subtract('day', 1).format('YYYY-MM-DD'));
      //开始日期
      $("#recon-monthdaterange-btnsta").datetimepicker({
        endDate: moment().subtract('days', 1).format('YYYY-MM-DD'),
        format: 'yyyy-mm-dd',
        autoclose: true,
        startView: 2,
        minView: 2,
        forceParse: false,
        locale: "zh-CN",
        language: 'zh-CN',
        pickerPosition: "bottom-right"
      })
      //结束日期
      $("#recon-monthdaterange-btnend").datetimepicker({
        endDate: moment().subtract('days', 1).format('YYYY-MM-DD'),
        format: 'yyyy-mm-dd',
        autoclose: true,
        startView: 2,
        minView: 2,
        forceParse: false,
        locale: "zh-CN",
        language: 'zh-CN',
        pickerPosition: "bottom-right"
      })
    },
    /*获取查询参数*/
    getQueryParam: function () {
      var beginTime;
      var endTime;
      beginTime = $("#recon-monthdaterange-btnsta").val()+" 00:00:00";
      endTime = $("#recon-monthdaterange-btnend").val()+" 23:59:59";
      beginTime = new Date(beginTime.replace(new RegExp(/-/gm) ,"/"));
      endTime = new Date(endTime.replace(new RegExp(/-/gm) ,"/"));
      var plNos = JSON.parse($("#select_park").val());
      if (plNos == null || plNos == undefined || plNos.length < 1) {
          plNos.push("-1X");
      }
      var berthRangeNos = JSON.parse($("#select_area").val());
      if (berthRangeNos == null || berthRangeNos == undefined || berthRangeNos.length < 1) {
          berthRangeNos.push("-1X");
      }
      var chargerCodes = JSON.parse($("#select_charger").val());
      var chargerCode = null;
      if (chargerCodes == null || chargerCodes == undefined || chargerCodes.length < 1) {
          chargerCode = null;
      }else{
          chargerCode = chargerCodes[0];
      }
  
      var req = {
        sysCode: sysComm.sysCode,
        plNos: plNos,
        berthRangeNos:berthRangeNos,
        chargerCode:chargerCode,
        orgId: fn.getOrgId(),
        startDate:beginTime,
        endDate:endTime,
  
      };
  
      return req;
  
    },
    //数据初始化
    initDatas:function(){
      $("[id$='Fee']").text(commonObj.moneyFormatter(0));
      $("[id$='Num']").text(commonObj.numberFormatter(0));
      $("[id$='Rate']").text('0.00%');
    },
    queryChargerIncomeDiffForSummary:function(){
      fun.initDatas();
      var req = fun.getQueryParam();
      var opt = {
        method: 'post',
        url: dataUrl.util.queryChargerIncomeDiffForSummary(),
        data: JSON.stringify(req),
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        success: function (res) {
          //console.log(res);
          if (res.code == '8888' && res.data != null) {
            var data = res.data;
            $('#parkNum').text(commonObj.numberFormatter(data.parkNum));
            $('#chargerCodeNum').text(commonObj.numberFormatter(data.chargerCodeNum));
            $('#berthNum').text(commonObj.numberFormatter(data.berthNum));
            $('#eqpNum').text(commonObj.numberFormatter(data.eqpNum));
  
            $('#orderTotalFee').text(commonObj.moneyFormatter(data.orderTotalFee));
            $('#eqpTotalFee').text(commonObj.moneyFormatter(data.eqpTotalFee));
            $('#diffTotalFee').text(commonObj.moneyFormatter(data.orderTotalFee - data.eqpTotalFee));
            $('#diffRate').text(fun.rateFormatter(data.orderTotalFee - data.eqpTotalFee,data.orderTotalFee)+'%');
  
          }
        }
      };
      sysAjax(opt);
    },
    //默认数据 table 全部
    createTableData: function () {
      $('#recordtable').bootstrapTable('destroy').bootstrapTable({
        striped: true, //表格显示条纹
        pagination: true, //启动分页
        pageNumber: 1, //当前第几页
        // showColumns: true,
        pageSize: 10, //每页显示的记录数
        pageList: [10, 15, 20], //记录数可选列表
        sidePagination: 'server', //表示服务端分页
        queryParamsType: 'limit',
        method: 'POST', //请求方法
        paginationPreText: '<',
        paginationNextText: '>',
        ajax: tableLoadRequest, //自定义ajax加载数据
        uniqueId: 'id',
        columns: [
          [
  
            {
              field: 'staticDate',
              title: '统计日期',
              width: '15%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+  commonObj.timeOneFormatter(value)+'</div>'
              }
            },
            {
              field: 'chargerName',
              title: '收费员',
              width: '15%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+  commonObj.replacenull(value)+'</div>'
              }
            },
            {
              field: 'plName',
              title: '停车场',
              width: '15%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.replacenull(value)+'</div>';
              }
            },
            {
              field: 'berthRangeName',
              title: '泊位区间',
              width: '8%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.replacenull(value)+'</div>';
              }
            },
            {
              field: 'berthRangeBerthNum',
              title: '泊位数量',
              width: '8%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.numberFormatter(value)+'</div>';
              }
            },
            {
              field: 'berthRangeEqpNum',
              title: '地磁数量',
              width: '15%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.numberFormatter(value)+'</div>';
              }
            },
            {
              field: 'pdaEqpParkFee',
              title: '实际应收',
              width: '15%',
              align: "left",
              formatter: function (value, row, index) {
  
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.moneyFormatter(value)+'</div>';
              }
            },
            {
              field: 'eqpTotalFee',
              title: '理论应收',
              width: '8%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.moneyFormatter(value)+'</div>';
              }
            },
  
  
            {
              field: 'parkAndEqpDiffFee',
              title: '费用差异',
              width: '15%',
              align: "left",
              formatter: function (value, row, index) {
                return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.moneyFormatter(value)+'</div>'
              }
            },
            {
              field: 'parkAndEqpDiffRate',
              title: '差异率',
              width: '15%',
              align: "left",
              formatter: function (value, row, index) {
                  if(value == null || value == '' || value == '-'){
                      return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.replacenull(value)+'</div>';
                  }else{
                      return '<div class="ITD-common-fontsize12 ITD-common-color070" >'+commonObj.replacenull(value)+'%</div>';
                  }
                
              }
            }
  
          ],
  
        ]
      });
  
    },
  
    //数量处理
    rateFormatter: function (value1,value2) {
      if (value2 == 0 || value2 == undefined || value2 == null) {
        return 0;
      } else {
        return (value1*100/value2).toFixed(1);
      }
    },
  
  
    //弹窗 table数据
  };
  fun.init();
  //查询
  documentBindFunc.on('click', '#recon-queryBtn', function () {
    fun.queryChargerIncomeDiffForSummary();
    fun.createTableData();
  });
  
  
  
  /**
   * 自定义table AJAX请求
   * @param {Object} params
   */
  function tableLoadRequest(params) {
    var req = fun.getQueryParam();
    //设置请求参数
    var pageNum = (params.data.offset / params.data.limit) + 1;
  
    //条件查询
    req.baseRequest = {
      pageNum: pageNum,
      pageSize: params.data.limit
    };
  
    var opt = {
      method: 'post',
      url: dataUrl.util.queryChargerIncomeDiffForPage(),
      data: JSON.stringify(req),
      contentType: 'application/json; charset=utf-8',
      dataType: 'json',
      success: function (res) {
        //console.log(res);
        if (res.code == '8888') {
          params.success(res.data);
        }
      }
    };
    sysAjax(opt);
  }
  
  
  //切换 搜索部分 是否生效
  documentBindFunc.on('click', "#recon-toptab div.ITD-graynav-topbar", function () {
    var index = $(this).index();
    $(this).addClass('ITD-graynav-topbaractive').siblings('div').removeClass('ITD-graynav-topbaractive');
    //console.log(index);
  
  
  });