master
lion 4 years ago
parent 7b75f2e48d
commit 3d160a1618

@ -2,5 +2,4 @@
ENV = 'production' ENV = 'production'
# base api # base api
VUE_APP_BASE_API = '' VUE_APP_BASE_API = 'https://dangxingjiaoyujidi.langye.net/'

@ -34,7 +34,7 @@
<Input class="inputwrap" v-model="searchFields.unit" placeholder="请输入单位" /> <Input class="inputwrap" v-model="searchFields.unit" placeholder="请输入单位" />
<Button type="primary" style="margin-right:10px" @click="searchload"></Button> <Button type="primary" style="margin-right:10px" @click="searchload"></Button>
<Button type="primary" style="margin-right:10px" @click="resetload"></Button> <Button type="primary" style="margin-right:10px" @click="resetload"></Button>
<!-- <Button type="primary" @click="exportExcel"></Button> --> <Button type="primary" @click="exportExcel"></Button>
<!-- <Button type="primary" @click="searchload"></Button> --> <!-- <Button type="primary" @click="searchload"></Button> -->
</div> </div>
</slot> </slot>
@ -76,7 +76,10 @@
import LxHeader from "@/components/LxHeader/index.vue"; import LxHeader from "@/components/LxHeader/index.vue";
import { import {
listvisitor listvisitor
} from "../../api/order/visitorder.js"; } from "../../api/order/visitorder.js";
import {
getToken
} from '@/utils/auth'
export default { export default {
components: { components: {
LxHeader LxHeader
@ -108,15 +111,17 @@
tableHeight: 0, tableHeight: 0,
clientHeight:0, clientHeight:0,
// //
visitRange:[], visitRange:['',''],
orderRange:[], orderRange:['',''],
tokens:"",
baseurl:"",
searchFields: { searchFields: {
keyword: "", keyword: "",
start_date:"", start_date:"",
end_date:"", end_date:"",
order_start_date:"", order_start_date:"",
order_end_date:"", order_end_date:"",
// is_export:0, is_export:0,
type:"", type:"",
unit:"" unit:""
}, },
@ -214,7 +219,10 @@
var paginationHeight = 37; // var paginationHeight = 37; //
var topHeight = 50; // var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20; 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() { load() {
var that = this; var that = this;
@ -223,18 +231,28 @@
page_size: this.paginations.page_size, page_size: this.paginations.page_size,
keyword:this.searchFields.keyword, keyword:this.searchFields.keyword,
start_date:this.searchFields.start_date, start_date:this.searchFields.start_date,
is_export:this.searchFields.is_export,
end_date:this.searchFields.end_date, end_date:this.searchFields.end_date,
order_start_date:this.searchFields.order_start_date, order_start_date:this.searchFields.order_start_date,
order_end_date:this.searchFields.order_end_date, order_end_date:this.searchFields.order_end_date,
type:this.searchFields.type, type:this.searchFields.type,
unit:this.searchFields.unit unit:this.searchFields.unit
}).then(res => { }).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 = []; let _data = [];
console.log(res)
// let result = Object.assign(_data, res.data); // let result = Object.assign(_data, res.data);
for(var m of res.data){ for(var m of res.data){
var mod ={}; var mod ={};
mod.date = m.visit_order.date +" "+ m.visit_order.time mod.date = m.visit_order.date +" "+ m.visit_order.time
mod.leader = m.visit_order.type==1 ? m.visit_order.leader : m.name mod.leader = m.visit_order.type==1 ? m.visit_order.leader : m.name
mod.mobile = m.visit_order.mobile mod.mobile = m.visit_order.mobile
@ -281,17 +299,14 @@
type:"", type:"",
unit:"" unit:""
}, },
this.visitRange = [] this.visitRange = ['','']
this.orderRange = [] this.orderRange = ['','']
this.load() this.load()
}, },
exportExcel(){ exportExcel(){
this.searchFields.is_export = 1 this.searchFields.is_export = 1
listvisitor({ this.load()
is_export:this.searchFields.is_export
}).then(res => {
console.log(res)
})
}, },
handleCurrentChange(page) { handleCurrentChange(page) {
this.paginations.page = page; this.paginations.page = page;

Loading…
Cancel
Save