diff --git a/src/views/order/activeorder.vue b/src/views/order/activeorder.vue index 988433f..380ccb6 100644 --- a/src/views/order/activeorder.vue +++ b/src/views/order/activeorder.vue @@ -6,15 +6,30 @@
-
- - -
+ +
+ + + + + + + + + + + + + + + +
- + @@ -183,15 +198,29 @@ }, { value: '已过期', id: "3" - }] + }], + type_list: [{ + value: '团体', + id: "1" + }, { + value: '个人', + id: "2" + }], }, tableHeight: 0, clientHeight: 0, //查询条件字段 searchFields: { - name: "" - }, + keyword: "", + start_date: "", + end_date: "", + is_export: 0, + type: "", + activity_name: "", + status: "" + }, + visitRange:null, tableData: [], paginations: { page: 1, @@ -269,6 +298,16 @@ }, mounted() {}, methods: { + searchload() { + if (this.visitRange) { + this.searchFields.start_date = this.visitRange[0] + this.searchFields.end_date = this.visitRange[1] + } else { + this.searchFields.start_date = "" + this.searchFields.end_date = "" + } + this.load() + }, initLoad() { var that = this; var clientHeight = document.documentElement.clientHeight @@ -288,7 +327,8 @@ listactiveorder({ page: this.paginations.page, page_size: this.paginations.page_size, - activity_id: activityId + activity_id: activityId, + ...this.searchFields }).then(res => { this.tableData = res.data; this.paginations.total = res.total @@ -324,3 +364,31 @@ } }; + + diff --git a/src/views/order/activeordervisitor.vue b/src/views/order/activeordervisitor.vue index 490bb4d..e2a06f5 100644 --- a/src/views/order/activeordervisitor.vue +++ b/src/views/order/activeordervisitor.vue @@ -8,24 +8,14 @@
- - - - - - - - - + range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> - + @@ -41,7 +31,7 @@
- + @@ -144,12 +134,9 @@ keyword: "", start_date: "", end_date: "", - order_start_date: "", - order_end_date: "", is_export: 0, type: "", - unit: "", - time: "", + activity_name: "", status: "" }, tableData: [], @@ -160,28 +147,37 @@ }, columns: [{ field: "date", - title: "预约日期", - type: "date", - width: 180, + title: "活动时间", + type: "format", + width: 260, + align: "center", fixed: "left" }, { - field: "person", - title: "预约人", + field: "activity_name", + title: "活动名称", type: "string", - align: "center", - width: 120 + align: "left", + width: 220, + fixed: "left" }, { field: "name", - title: "游客", + title: "参与人", type: "string", align: "center", width: 120 }, { - field: "personmobile", - title: "游客电话", + field: "mobile", + title: "联系电话", + type: "string", + align: "center", + width: 180, + }, + { + field: "idcard", + title: "证件号", type: "string", align: "center", width: 180, @@ -200,13 +196,6 @@ align: "center", width: 120 }, - { - field: "mobile", - title: "联系电话", - type: "string", - align: "center", - width: 180, - }, { field: "unit", title: "单位", @@ -276,10 +265,13 @@ let _data = []; // let result = Object.assign(_data, res.data); for (var m of res.data) { - var mod = {}; - - mod.status = m.status - _data.push(m) + m.date = m.activity_order.activity.start_time + "至" + this.$moment(m.activity_order.activity + .end_time).format("HH:mm:ss"); + m.activity_name = m.activity_order.activity.name; + m.typeName = m.activity_order.type == 1 ? "团体" : "个人" + m.unit = m.activity_order.type == 1 ? m.activity_order.unit : "无" + m.leader = m.activity_order.type == 1 ? m.activity_order.leader : "无" + _data.push(m); } that.tableData = _data; that.paginations.total = res.total @@ -295,13 +287,6 @@ this.searchFields.start_date = "" this.searchFields.end_date = "" } - if (this.orderRange) { - this.searchFields.order_start_date = this.orderRange[0] - this.searchFields.order_end_date = this.orderRange[1] - } else { - this.searchFields.order_start_date = "" - this.searchFields.order_end_date = "" - } this.load() }, resetload() { diff --git a/src/views/order/parkorder.vue b/src/views/order/parkorder.vue index f2c1830..bf4f3a3 100644 --- a/src/views/order/parkorder.vue +++ b/src/views/order/parkorder.vue @@ -34,7 +34,7 @@
- + @@ -191,7 +191,8 @@ columns: [{ field: "time", title: "预约时间", - type: "string", + type: "string", + }, { field: "plate", diff --git a/src/views/order/visitor.vue b/src/views/order/visitor.vue index 814c623..e202277 100644 --- a/src/views/order/visitor.vue +++ b/src/views/order/visitor.vue @@ -41,7 +41,7 @@
- + @@ -162,7 +162,7 @@ field: "date", title: "预约日期", type: "date", - width: 180, + width: 220, fixed: "left" }, { diff --git a/src/views/order/visitorder.vue b/src/views/order/visitorder.vue index 21ccee6..8c59759 100644 --- a/src/views/order/visitorder.vue +++ b/src/views/order/visitorder.vue @@ -31,13 +31,14 @@ - + +
- + @@ -180,6 +181,9 @@ listvisitorder, get } from "../../api/order/visitorder.js"; + import { + getToken + } from '@/utils/auth' export default { components: { LxHeader @@ -250,7 +254,8 @@ date: "", type: "", time: "", - status: "" + status: "", + is_export: 0 }, tableData: [], paginations: { @@ -258,6 +263,7 @@ page_size: 15, total: 0 }, + baseurl: "", form: { date: "", card_type: "", @@ -274,7 +280,14 @@ field: "date", title: "预约日期", type: "date", - width: 180 + width: 210 + }, + { + field: "unit", + title: "预约单位", + type: "string", + align: "left", + width: 200 }, { field: "leader", @@ -310,7 +323,8 @@ field: "created_at", title: "下单时间", type: "string", - align: "center" + align: "center", + width: 210 }, { field: "status", @@ -341,21 +355,39 @@ var paginationHeight = 37; //分页的高度 var topHeight = 50; //页面 头部 let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20; + that.baseurl = location.host; //process.env.VUE_APP_BASE_API that.tableHeight = tableHeight; }, - load() { + load(isExcel) { var that = this; listvisitorder({ page: this.paginations.page, page_size: this.paginations.page_size, ...this.searchFields }).then(res => { + console.log("isExcel", isExcel) + let tokens = getToken(); + if (isExcel) { + var url = "/api/admin/visit/order-index?token=" + tokens + console.log(url) + for (var m in that.searchFields) { + url += "&" + m + "=" + that.searchFields[m] + } + url = that.baseurl + url + window.open("https://" + url, '_blank') + that.searchFields.is_export = 0 + return; + } this.tableData = res.data; this.paginations.total = res.total }).catch(error => { }) }, + exportExcel() { + this.searchFields.is_export = 1; + this.load(true); + }, show(obj) { this.clientHeight = document.documentElement.clientHeight - 84 - 110; this.dialogViewVisible = true; diff --git a/vue.config.js b/vue.config.js index d0296aa..6c769a0 100644 --- a/vue.config.js +++ b/vue.config.js @@ -46,8 +46,8 @@ module.exports = { //before: require('./mock/mock-server.js'), proxy: { [process.env.VUE_APP_BASE_API]: { - target: 'https://dangxingjiaoyujidi.langye.net/', - // target: 'http://leyitest.ali251.langye.net/', + // target: 'https://dangxingjiaoyujidi.langye.net/', + target: 'http://leyitest.ali251.langye.net/', changeOrigin: true, //配置跨域 pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''