From d388e2788b7ef088d7cd40f901b0acdcec460bc3 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Thu, 01 Apr 2021 00:19:23 +0800
Subject: [PATCH] modify

---
 zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html |   72 +++++++++++++++++++++++++++---------
 1 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html
index e959806..130f97d 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html
@@ -41,7 +41,7 @@
 <div class="panel-body" id="app">
 
     <el-row class="buttonPanel">
-            <el-button type="primary" >导出</el-button>
+            <el-button @click="exportExcel" type="primary" >导出</el-button>
     </el-row>
 
     <el-row class="rowPanel"  >
@@ -98,7 +98,7 @@
 
     <el-row class="table-style"  >
 
-        <el-table id="proj" :data="table.rows"  :height="height" stripe>
+        <el-table id="proj" :data="table.rows"  :height="height" stripe @sort-change="sortChange">
             <el-table-column
                     prop="orderNo"
                     label="订单号"
@@ -112,16 +112,19 @@
             </el-table-column>
             <el-table-column
                     prop="createTime"
+                    sortable="custom"
                     label="交易时间"
                     show-overflow-tooltip
                     width="180">
             </el-table-column>
             <el-table-column
                     prop="flowType"
+                    sortable="custom"
                     label="交易类型">
             </el-table-column>
             <el-table-column
                     prop="amount"
+                    sortable="custom"
                     label="交易金额">
             </el-table-column>
             <el-table-column
@@ -130,6 +133,7 @@
             </el-table-column>
             <el-table-column
                     prop="payMethod"
+                    sortable="custom"
                     label="支付方式">
             </el-table-column>
             <el-table-column
@@ -146,7 +150,7 @@
             </el-table-column>
             <el-table-column label="操作">
                 <template slot-scope="scope">
-                    <el-button type="text" size="small">有效</el-button>
+                    <el-button type="text" @click="openOrder(scope.$index, scope.row)" size="small">订单详情</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -191,6 +195,8 @@
                 orderNo:'',
                 oprationMan:'',
                 queryKey:'',
+                order:'',
+                sort:''
             },
             height:'calc(100vh - 240px)',
             flowTypeList:[
@@ -226,29 +232,47 @@
             resetForm(formName) {
                 this.$refs[formName].resetFields();
             },
+            sortChange:function (column){
+                if(column.order){
+                    if(column.order.indexOf("desc")){
+                        this.form.order="desc";
+                    }else{
+                        this.form.order="asc";
+                    }
+                    this.form.sort=column.prop;
+                    this.loadData();
+                }
+            },
             loadData:function(){
                 let _this = this;
-                //获取用户列表
+                let data=_this.getRequestParam();
+                data.limit=_this.table.pageSize;
+                data.offset=_this.table.pageSize*(_this.table.currentPage-1);
                 AjaxProxy.requst({
                     app: _this,
-                    data:{
-                      limit:_this.table.pageSize,
-                      offset:_this.table.pageSize*(_this.table.currentPage-1),
-                        name:_this.form.name,
-                        payMethod:_this.form.payMethod,
-                        flowType:_this.form.flowType,
-                        orderNo:_this.form.orderNo,
-                        oprationMan:_this.form.oprationMan,
-                        queryKey:_this.form.queryKey,
-                        startTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'',
-                        endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'',
-                    },
-                    url: basePath + '/admin/orderFlow/findSumDailyInfoNew',
+                    data:data,
+                    url: basePath + '/admin/orderFlow/findOrderFlow',
                     callback: function (data) {
                         _this.table.rows = data.rows;
                         _this.table.total=data.total;
                     }
                 });
+            },
+            getRequestParam(){
+                let _this = this;
+                return   {
+                    name:_this.form.name,
+                    payMethod:_this.form.payMethod,
+                    flowType:_this.form.flowType,
+                    orderNo:_this.form.orderNo,
+                    oprationMan:_this.form.oprationMan,
+                    queryKey:_this.form.queryKey,
+                    startTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'',
+                    endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'',
+                    shopId:_this.form.shopId,
+                    order:_this.form.order,
+                    sort:_this.form.sort,
+                }
             },
             search:function(){
                 this.table.currentPage=1;
@@ -258,8 +282,20 @@
                 if(evt.keyCode==13) {
                     this.search();
                 }
-            }
+            },
 
+            openOrder(index,row){
+                layer.full(layer.open({
+                    type : 2,
+                    title : "订单详情",
+                    maxmin : true,
+                    content : [ basePath + '/admin/order/orderItem?id=' + row.orderId ]
+                }));
+            },
+            //导出
+          exportExcel(){
+            window.location.href=basePath+"/admin/orderFlow/exportOrderFlowExcel?"+MTools.jsonToUrlParam(this.getRequestParam());
+        }
 
         }
     });

--
Gitblit v1.9.1