|
|
@@ -25,42 +25,32 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- label="分销商名称"
|
|
|
- prop="otaSourceNameList"
|
|
|
- >
|
|
|
+ label="票种"
|
|
|
+ prop="ticketTypeIdList">
|
|
|
<el-select
|
|
|
- v-model="form.otaSourceNameList"
|
|
|
+ filterable
|
|
|
+ v-model="form.ticketTypeIdList"
|
|
|
multiple
|
|
|
clearable
|
|
|
- placeholder="请选择"
|
|
|
- filterable>
|
|
|
- <el-option
|
|
|
- label="全部"
|
|
|
- value="">
|
|
|
- </el-option>
|
|
|
+ placeholder="请选择">
|
|
|
<el-option
|
|
|
- v-for="item in otaList"
|
|
|
+ v-for="item in ticketTypeList"
|
|
|
:key="item.id"
|
|
|
- :label="item.otaSourceName"
|
|
|
- :value="item.otaSourceName">
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.ticketTypeId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- label="票种"
|
|
|
- prop="ticketTypeIdList">
|
|
|
+ label="销售来源"
|
|
|
+ prop="otaSourceNameList">
|
|
|
<el-select
|
|
|
filterable
|
|
|
multiple
|
|
|
- clearable
|
|
|
- v-model="form.ticketTypeIdList"
|
|
|
+ v-model="form.otaSourceNameList"
|
|
|
placeholder="请选择">
|
|
|
<el-option
|
|
|
- label="全部"
|
|
|
- value="">
|
|
|
- </el-option>
|
|
|
- <el-option
|
|
|
- v-for="item in ticketTypeList"
|
|
|
+ v-for="item in otaSourceList"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
:value="item.ticketTypeId">
|
|
|
@@ -69,14 +59,14 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="btn-wrap">
|
|
|
- <el-button @click="reset">重置</el-button>
|
|
|
<el-button
|
|
|
- :loading="exportLoading"
|
|
|
+ @click="reset">重置</el-button>
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
|
- @click="handleExport">导出</el-button>
|
|
|
+ @click="getOrderStatistics($event,true)">搜索</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
- @click="getData">搜索</el-button>
|
|
|
+ @click="handleExport">导出</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -86,15 +76,14 @@
|
|
|
</div>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
- v-loading="loading"
|
|
|
- :row-class-name="totalRowClassName">
|
|
|
+ v-loading="loading">
|
|
|
<el-table-column
|
|
|
prop="otaSourceName"
|
|
|
- label="分销商">
|
|
|
+ label="分销渠道">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="ticketTypeName"
|
|
|
- label="商品名">
|
|
|
+ label="票种">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="unitPrice"
|
|
|
@@ -102,7 +91,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="saleNum"
|
|
|
- label="售票数量">
|
|
|
+ label="售票张数">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="salePrice"
|
|
|
@@ -110,7 +99,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="cancelNum"
|
|
|
- label="退票数量">
|
|
|
+ label="退票张数">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="cancelPrice"
|
|
|
@@ -124,119 +113,196 @@
|
|
|
prop="actualPrice"
|
|
|
label="实售金额">
|
|
|
</el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
+ width="260"
|
|
|
+ fixed="right"
|
|
|
+ label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="showOrderInfo(scope.row)">订单详情</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="$refs.ticketInfo.show(scope.row.tickets)">门票详情</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="showGuestInfo(scope.row)">游客信息</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-if="checkRefundVisible(scope.row)&&canCancel"
|
|
|
+ @click="showOrderInfo(scope.row,'cancel')">退订单</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
|
background
|
|
|
:current-page.sync="form.pageNum"
|
|
|
- @current-change="getData"
|
|
|
+ @current-change="getOrderStatistics"
|
|
|
layout="total, prev, pager, next"
|
|
|
:total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
+
|
|
|
+ <ElDialog
|
|
|
+ :title="type==='cancel'?'退单':'订单详情'"
|
|
|
+ width="760px"
|
|
|
+ v-model="orderDialogVisible"
|
|
|
+ >
|
|
|
+ <OrderDialog
|
|
|
+ :current-item="currentItem"
|
|
|
+ :can-cancel="canCancel"
|
|
|
+ @updateList="getOrderStatistics"
|
|
|
+ :type="type"></OrderDialog>
|
|
|
+ </ElDialog>
|
|
|
+ <ElDialog
|
|
|
+ title="游客信息"
|
|
|
+ width="760px"
|
|
|
+ v-model="guestDialogVisible">
|
|
|
+ <GuestDialog
|
|
|
+ :current-item="currentItem"></GuestDialog>
|
|
|
+ </ElDialog>
|
|
|
+
|
|
|
+ <TicketInfo ref="ticketInfo"></TicketInfo>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
+import { getOrderStatistics, getOtaSourceList } from '@/api/order'
|
|
|
import { getTicketTypeList } from '@/api/ticketType'
|
|
|
-import { getOtaProjectList } from '@/api/ota'
|
|
|
-import { getSaleStatistics } from '@/api/queryReport'
|
|
|
+import ElDialog from '@/components/Dialog'
|
|
|
+import OrderDialog from './orderList/OrderDialog'
|
|
|
+import GuestDialog from './orderList/GuestDialog'
|
|
|
+import TicketInfo from './orderList/TicketInfo'
|
|
|
+import { orderStatus } from '@/const'
|
|
|
import moment from 'moment'
|
|
|
|
|
|
export default {
|
|
|
- name: 'salesReport',
|
|
|
+ name: 'orderList',
|
|
|
+ components: {
|
|
|
+ ElDialog,
|
|
|
+ OrderDialog,
|
|
|
+ GuestDialog,
|
|
|
+ TicketInfo
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
ticketTypeList: [],
|
|
|
- otaList: [],
|
|
|
+ otaSourceList: [],
|
|
|
+ projectName: localStorage.getItem('otaProject'),
|
|
|
+ totalObj: {},
|
|
|
+ type: '', // 操作状态 cancel退订单
|
|
|
form: {
|
|
|
- export: false,
|
|
|
- timeBegin: new Date(moment().startOf('month')),
|
|
|
- timeEnd: new Date(moment().endOf('month')),
|
|
|
- otaSourceNameList: [], // 分销商名称
|
|
|
+ timeBegin: moment().startOf('day'),
|
|
|
+ timeEnd: moment().endOf('day'),
|
|
|
ticketTypeIdList: [], // 票种名称
|
|
|
+ otaSourceNameList: [], // 分销渠道
|
|
|
+ export: false,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10
|
|
|
},
|
|
|
- projectName: localStorage.getItem('otaProject'),
|
|
|
+ orderStatusDic: orderStatus,
|
|
|
+ loading: false,
|
|
|
tableData: [],
|
|
|
total: 0,
|
|
|
- loading: false,
|
|
|
- exportLoading: false
|
|
|
+ currentItem: {},
|
|
|
+ orderDialogVisible: false,
|
|
|
+ guestDialogVisible: false
|
|
|
}
|
|
|
},
|
|
|
+ created () {
|
|
|
+ this.getTicketTypeList()
|
|
|
+ // this.getOtaSourceList()
|
|
|
+ this.getOrderStatistics()
|
|
|
+ },
|
|
|
computed: {
|
|
|
+ canCancel () {
|
|
|
+ return this.$store.state.user.permissionList.includes('orders:cancel')
|
|
|
+ },
|
|
|
queryClear () {
|
|
|
return this.$store.state.user.permissionList.includes('stats:clearwx_query')
|
|
|
+ },
|
|
|
+ otaList () {
|
|
|
+ const list = JSON.parse(localStorage.getItem('otaList'))
|
|
|
+ return this.projectName === 'YINXIANGMAZU' && !this.queryClear ? list.filter(item => item.otaSourceCode !== 'CLEARWX') : list
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
- this.getTicketTypeList()
|
|
|
- this.getProductList()
|
|
|
- this.getData()
|
|
|
- },
|
|
|
methods: {
|
|
|
+ checkRefundVisible (item) {
|
|
|
+ if (item.status !== 'CANCELED') return true
|
|
|
+ if (item.status === 'CANCELED') {
|
|
|
+ if (item.tickets.some(i => i.status !== 'CANCELED')) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
reset () {
|
|
|
this.$refs.form.resetFields()
|
|
|
},
|
|
|
- // 获取票种列表
|
|
|
getTicketTypeList () {
|
|
|
- return getTicketTypeList({
|
|
|
+ getTicketTypeList({
|
|
|
pageNum: 1,
|
|
|
pageSize: -1
|
|
|
}).then(res => {
|
|
|
this.ticketTypeList = res.data.records || []
|
|
|
})
|
|
|
},
|
|
|
- getProductList () {
|
|
|
- return getOtaProjectList({
|
|
|
+ getOtaSourceList () {
|
|
|
+ getOtaSourceList({
|
|
|
pageNum: 1,
|
|
|
pageSize: -1
|
|
|
}).then(res => {
|
|
|
- this.otaList = res.data.records || []
|
|
|
+ this.otaSourceList = res.data || []
|
|
|
})
|
|
|
},
|
|
|
- getData () {
|
|
|
- this.loading = true
|
|
|
- if (this.form.timeBegin) {
|
|
|
- this.form.timeBegin = moment(this.form.timeBegin).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ getOrderStatistics (e, goFirst) {
|
|
|
+ if (goFirst) { this.form.pageNum = 1 }
|
|
|
+
|
|
|
+ if (!this.form.timeBegin || !this.form.timeEnd) {
|
|
|
+ this.$message.error('请选择起始时间和截止时间')
|
|
|
+ return
|
|
|
}
|
|
|
- if (this.form.timeEnd) {
|
|
|
- this.form.timeEnd = moment(this.form.timeEnd).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+
|
|
|
+ this.form.timeBegin = moment(this.form.timeBegin).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ this.form.timeEnd = moment(this.form.timeEnd).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+
|
|
|
+ if (!this.form.ticketTypeIdList) {
|
|
|
+ this.form.ticketTypeIdList = []
|
|
|
}
|
|
|
- if (!this.form.otaSourceNameList || this.form.otaSourceNameList.length === 0) {
|
|
|
+
|
|
|
+ if (!this.form.otaSourceNameList) {
|
|
|
this.form.otaSourceNameList = []
|
|
|
}
|
|
|
- if (!this.form.ticketTypeIdList || this.form.ticketTypeIdList.length === 0) {
|
|
|
- this.form.ticketTypeIdList = []
|
|
|
- }
|
|
|
- getSaleStatistics(this.form).then(res => {
|
|
|
- res.data.forEach(item => {
|
|
|
- if (item.ticketTypeName === '总计') {
|
|
|
- item.otaSourceName = '总计'
|
|
|
- item.ticketTypeName = ''
|
|
|
- item.price = ''
|
|
|
- } else if (item.ticketTypeName === '小计') {
|
|
|
- item.otaSourceName = '小计'
|
|
|
- item.ticketTypeName = ''
|
|
|
- item.price = ''
|
|
|
- }
|
|
|
- })
|
|
|
+ this.loading = true
|
|
|
+ getOrderStatistics(this.form).then(res => {
|
|
|
this.tableData = res.data
|
|
|
this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
})
|
|
|
},
|
|
|
+ showOrderInfo (item, type) {
|
|
|
+ if ((item.otaSourceCode === 'CLEARWX' || item.otaSourceCode === 'CLEARWXDEV') && type === 'cancel') return this.$message.info('自营平台订单请到自营后台办理退票')
|
|
|
+ this.currentItem = item
|
|
|
+ this.type = type
|
|
|
+ this.orderDialogVisible = true
|
|
|
+ },
|
|
|
+ showGuestInfo (item) {
|
|
|
+ this.currentItem = item
|
|
|
+ this.guestDialogVisible = true
|
|
|
+ },
|
|
|
handleExport () {
|
|
|
- this.exportLoading = true
|
|
|
this.form.export = true
|
|
|
- getSaleStatistics(this.form).then(res => {
|
|
|
- this.exportLoading = false
|
|
|
+ getOrderStatistics(this.form).then(res => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
message: '导出成功',
|
|
|
type: 'success'
|
|
|
})
|
|
|
+ }, () => {
|
|
|
+ this.$notify.error({
|
|
|
+ title: '提示',
|
|
|
+ message: '导出失败'
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|