diff --git a/.env.production b/.env.production
index 8994f69..b5a6546 100644
--- a/.env.production
+++ b/.env.production
@@ -2,5 +2,4 @@
ENV = 'production'
# base api
-VUE_APP_BASE_API = ''
-
+VUE_APP_BASE_API = 'https://dangxingjiaoyujidi.langye.net/'
diff --git a/src/views/order/visitor.vue b/src/views/order/visitor.vue
index 84228b1..7a3616f 100644
--- a/src/views/order/visitor.vue
+++ b/src/views/order/visitor.vue
@@ -34,7 +34,7 @@
-
+
@@ -76,7 +76,10 @@
import LxHeader from "@/components/LxHeader/index.vue";
import {
listvisitor
- } from "../../api/order/visitorder.js";
+ } from "../../api/order/visitorder.js";
+ import {
+ getToken
+ } from '@/utils/auth'
export default {
components: {
LxHeader
@@ -108,15 +111,17 @@
tableHeight: 0,
clientHeight:0,
//查询条件字段
- visitRange:[],
- orderRange:[],
+ visitRange:['',''],
+ orderRange:['',''],
+ tokens:"",
+ baseurl:"",
searchFields: {
keyword: "",
start_date:"",
end_date:"",
order_start_date:"",
order_end_date:"",
- // is_export:0,
+ is_export:0,
type:"",
unit:""
},
@@ -214,7 +219,10 @@
var paginationHeight = 37; //分页的高度
var topHeight = 50; //页面 头部
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
- that.tableHeight = tableHeight;
+ that.tableHeight = tableHeight;
+ that.tokens = getToken()
+ that.baseurl = process.env.VUE_APP_BASE_API
+ console.log("aa",process.env)
},
load() {
var that = this;
@@ -223,18 +231,28 @@
page_size: this.paginations.page_size,
keyword:this.searchFields.keyword,
start_date:this.searchFields.start_date,
+ is_export:this.searchFields.is_export,
end_date:this.searchFields.end_date,
order_start_date:this.searchFields.order_start_date,
order_end_date:this.searchFields.order_end_date,
type:this.searchFields.type,
unit:this.searchFields.unit
}).then(res => {
+ if(that.searchFields.is_export==1){
+ var url = "api/admin/visit/order-detail-index?token="+that.tokens
+ for(var m in that.searchFields){
+ url +="&"+m+"="+that.searchFields[m]
+ }
+ url = that.baseurl + url
+ console.log(url)
+ window.open(url, '_blank')
+ that.searchFields.is_export=0
+ return;
+ }
let _data = [];
- console.log(res)
// let result = Object.assign(_data, res.data);
for(var m of res.data){
var mod ={};
-
mod.date = m.visit_order.date +" "+ m.visit_order.time
mod.leader = m.visit_order.type==1 ? m.visit_order.leader : m.name
mod.mobile = m.visit_order.mobile
@@ -281,17 +299,14 @@
type:"",
unit:""
},
- this.visitRange = []
- this.orderRange = []
+ this.visitRange = ['','']
+ this.orderRange = ['','']
this.load()
},
exportExcel(){
this.searchFields.is_export = 1
- listvisitor({
- is_export:this.searchFields.is_export
- }).then(res => {
- console.log(res)
- })
+ this.load()
+
},
handleCurrentChange(page) {
this.paginations.page = page;