瀏覽代碼

代码提交

zhang song 6 年之前
父節點
當前提交
7c5ec2b0b4
共有 3 個文件被更改,包括 34 次插入17 次删除
  1. 1 1
      dist/index.html
  2. 31 14
      src/components/order.vue
  3. 2 2
      src/utils/server.js

+ 1 - 1
dist/index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>经销商管理系统</title><link rel="shortcut icon" href=https://dealer.jetour.com.cn/favicon.ico><link href=./static/css/app.78c102a52d1558e63ca3a35cbf457a8c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.e6b663e54a83ee863b4a.js></script><script type=text/javascript src=./static/js/app.1587739b56832ac08c9d.js></script></body><script src="http://pv.sohu.com/cityjson?ie=utf-8"></script><script type=text/javascript>sessionStorage.setItem('ip', returnCitySN["cip"]);</script><script>var _hmt = _hmt || [];
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>经销商管理系统</title><link rel="shortcut icon" href=https://dealer.jetour.com.cn/favicon.ico><link href=./static/css/app.34c1b0604b834d3d4661f3abd50ffc71.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.e6b663e54a83ee863b4a.js></script><script type=text/javascript src=./static/js/app.996c758ac5339223d83a.js></script></body><script src="http://pv.sohu.com/cityjson?ie=utf-8"></script><script type=text/javascript>sessionStorage.setItem('ip', returnCitySN["cip"]);</script><script>var _hmt = _hmt || [];
     (function() {
       var hm = document.createElement("script");
       hm.src = "https://hm.baidu.com/hm.js?95c45f55b7586b2c20d8c8b813693103";

+ 31 - 14
src/components/order.vue

@@ -27,6 +27,8 @@
                 </el-date-picker>
                 <el-button type="primary" @click="getRows">搜索</el-button>
                 <el-button type="warning" @click="refreshTable">清空</el-button>
+                <el-button type="warning" @click="excelReport">导出</el-button>
+
             </el-col>
         </el-row>
         <el-table :data="tableData" ref="table" :height="autoHeight" border stripe v-loading="loading"
@@ -155,9 +157,7 @@
 </template>
 
 <script>
-    import {utils} from "../utils/config";
     import * as Api from "../utils/server"
-    import {Message} from "element-ui"
 
     export default {
         name: "",
@@ -177,8 +177,8 @@
                     downPaymentRate: ''  // 比例
                 },
                 queryData: {
-                    skuName:'',
-                    searchDate:'',
+                    skuName: '',
+                    searchDate: '',
                     status: '',//订单状态
                     orderCode: '', //订单号
                     customerMobile: '', //注册手机号
@@ -334,11 +334,25 @@
             sessionStorage.removeItem('imgUrls');
         },
         methods: {
+            excelReport() {
+                let baseUrlStr = Api.api;
+                if (typeof (this.queryData.searchDate) != "undefined") {
+                    window.location.href = baseUrlStr + "/" + "business/Order/excel?" +
+                        "skuName=" + this.queryData.skuName + "&startTime=" + this.queryData.searchDate[0] + "&endTime=" + this.queryData.searchDate[1] +
+                        "&orderCode=" + this.queryData.orderCode + "&receiptMobile=" + this.queryData.receiptMobile + "&receiptName=" + this.queryData.receiptName + "&status=" + this.queryData.status;
+
+                } else {
+                    window.location.href = baseUrlStr + "/" + "business/Order/excel?" +
+                        "skuName=" + this.queryData.skuName +
+                        "&orderCode=" + this.queryData.orderCode + "&receiptMobile=" + this.queryData.receiptMobile + "&receiptName=" + this.queryData.receiptName + "&status=" + this.queryData.status;
+                }
+
+            },
             getRows() {
                 let data;
-                if (typeof(this.queryData.searchDate) != "undefined"){
-                     data = {
-                         skuName:this.queryData.skuName,
+                if (typeof (this.queryData.searchDate) != "undefined") {
+                    data = {
+                        skuName: this.queryData.skuName,
                         startTime: this.queryData.searchDate[0],
                         endTime: this.queryData.searchDate[1],
                         orderCode: this.queryData.orderCode,
@@ -349,10 +363,9 @@
                         currentPage: this.currentPage,
                         pageNumber: this.pageSize
                     };
-                }else {
+                } else {
                     data = {
-                        skuName:this.queryData.skuName,
-
+                        skuName: this.queryData.skuName,
                         orderCode: this.queryData.orderCode,
                         customerName: this.queryData.customerName,
                         receiptMobile: this.queryData.receiptMobile,
@@ -374,9 +387,6 @@
                             this.$message.error("服务器连接异常");
                         }
                     },
-                    response => {
-                        this.$message.error("服务器连接异常");
-                    }
                 );
             },
             checkWriteOffVirtual() {
@@ -413,7 +423,14 @@
                 this.$router.push({path: '/home/orderDetails', query: {id: id}})
             },
             refreshTable() {
-                this.queryData = {};
+                this.queryData = {
+                    skuName:'',
+                    orderCode:'',
+                    customerName:'',
+                    receiptMobile:'',
+                    receiptName:'',
+                    status:''
+                };
                 this.getRows();
             },
             pageChange: function (page) {

+ 2 - 2
src/utils/server.js

@@ -1,6 +1,6 @@
 module.exports = {
-    // api: 'http://dealerbackapi.jetour.com.cn',
-    api: 'http://127.0.0.1:8888',
+    api: 'http://dealerbackapi.jetour.com.cn',
+    // api: 'http://127.0.0.1:8888',
 
     imgUrl: 'http://dealerbackapi.jetour.com.cn/youpai/uploadFile'
 }