|
@@ -8,41 +8,41 @@
|
|
|
<a-form-item label="核销时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
<a-range-picker
|
|
|
v-model="time"
|
|
|
+ id="VerificationRecords-time"
|
|
|
:format="dateFormat"
|
|
|
:placeholder="['开始时间','结束时间']"
|
|
|
:disabledDate="disabledDate"
|
|
|
- @calendarChange="calendarChange"
|
|
|
@change="onChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="核销门店" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-select placeholder="请选择" allowClear v-model="searchForm.usedStoreId">
|
|
|
+ <a-select placeholder="请选择" allowClear v-model="searchForm.usedStoreId" id="VerificationRecords-usedStoreId">
|
|
|
<a-select-option v-for="item in storeOptionData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="客户信息" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-input v-model.trim="searchForm.queryWorld" placeholder="请输入手机号/车牌号" allowClear />
|
|
|
+ <a-input v-model.trim="searchForm.queryWorld" placeholder="请输入手机号/车牌号" allowClear id="VerificationRecords-queryWorld"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="套餐名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-input v-model.trim="searchForm.bundName" placeholder="请输入" allowClear />
|
|
|
+ <a-input v-model.trim="searchForm.bundName" placeholder="请输入" allowClear id="VerificationRecords-bundName"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<a-row :gutter="48">
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="关联订单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-input v-model.trim="searchForm.orderNo" placeholder="请输入" allowClear :maxLength="11" />
|
|
|
+ <a-input v-model.trim="searchForm.orderNo" placeholder="请输入" allowClear id="VerificationRecords-orderNo"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="18">
|
|
|
- <a-button style="margin-right: 10px;" type="primary" @click="handleSearch">查询</a-button>
|
|
|
- <a-button type="" @click="handleRest">重置</a-button>
|
|
|
- <a-button type="" :loading="loading" class="export-btn" @click="handleExport">导出</a-button>
|
|
|
+ <a-button style="margin-right: 10px;" type="primary" @click="handleSearch" id="VerificationRecords-handleSearch">查询</a-button>
|
|
|
+ <a-button type="" @click="handleRest" id="VerificationRecords-handleRest">重置</a-button>
|
|
|
+ <a-button type="" :loading="loading" class="export-btn" @click="handleExport" id="VerificationRecords-handleExport">导出</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -50,8 +50,8 @@
|
|
|
<!-- 合计 -->
|
|
|
<div class="total">
|
|
|
<a-icon type="info-circle" class="iconImg" />
|
|
|
- <strong>总计:</strong><span v-model="orderTotal">{{ orderTotal || 0 }} 单</span><strong style="margin-left: 15px;">结算金额:</strong><span
|
|
|
- v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
|
|
|
+ <strong>总计:</strong><span>{{ orderTotal || 0 }} 单</span><strong style="margin-left: 15px;">结算金额:</strong><span
|
|
|
+ >{{ paymentAmountTotal || 0 }} 元</span>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -61,26 +61,20 @@
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
- <!-- 状态 -->
|
|
|
- <span slot="orderStatus" slot-scope="text">
|
|
|
- {{ $refs.orderStatus.getNameByCode(text) }}
|
|
|
- </span>
|
|
|
- <!-- 实收金额 -->
|
|
|
- <span slot="paymentAmount" slot-scope="text, record">
|
|
|
- <template v-if=" record.payStatus == 'PAID' ">{{ record.paymentAmount }}</template>
|
|
|
- <template v-else-if=" record.payStatus != 'PAID' ">{{ 0 }}</template>
|
|
|
- </span>
|
|
|
- <!-- 优惠 -->
|
|
|
- <span slot="couponAmount" slot-scope="text, record">
|
|
|
- <template v-if=" record.orderStatus != 'CANCELED' ">{{ record.couponAmount }}</template>
|
|
|
- <template v-else-if=" record.orderStatus == 'CANCELED' ">{{ 0 }}</template>
|
|
|
- </span>
|
|
|
- <!-- 操作 -->
|
|
|
- <span slot="action" slot-scope="text, record">
|
|
|
- <a-button type="primary" @click="seeDetail(record)">查看</a-button>
|
|
|
- <!-- 本期暂不做 -->
|
|
|
- <!-- <a-button type="danger" @click="refund(record)">退款</a-button> -->
|
|
|
- </span>
|
|
|
+ <!-- 订单编号 -->
|
|
|
+ <template slot="num" slot-scope="text, record">
|
|
|
+ <p>{{ record.bizNum }}</p>
|
|
|
+ <p>{{ record.orderNo }}</p>
|
|
|
+ </template>
|
|
|
+ <!-- 客户信息 -->
|
|
|
+ <template slot="userInfo" slot-scope="text, record">
|
|
|
+ <!-- <p>{{ text }}<br>{{ record.vehicleNumber ? record.vehicleNumber : '--' }}</p> -->
|
|
|
+ <div>
|
|
|
+ <span v-if="record.custMobile">{{ record.custMobile }}</span>
|
|
|
+ <span v-if="record.vehicleNum">{{ record.vehicleNum }}</span>
|
|
|
+ </div>
|
|
|
+ <span v-if="!record.custMobile && !record.vehicleNum">--</span>
|
|
|
+ </template>
|
|
|
</s-table>
|
|
|
<!-- 查看详情弹窗 -->
|
|
|
<!-- <order-detail-modal :openModal="openDetailModal" :nowId="detailId" @close="openDetailModal=false" /> -->
|
|
@@ -93,17 +87,16 @@ import {
|
|
|
VSelect
|
|
|
} from '@/components'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
+import { completeDate } from '@/libs/tools.js'
|
|
|
import {
|
|
|
- getVerificationRecordsList,getVerificationRecordsListTotal,settlementRecordsExport
|
|
|
+ getVerificationRecordsList, getVerificationRecordsListTotal, settlementRecordsExport, getStoreList
|
|
|
} from '@/api/SetmealSales.js'
|
|
|
-// import OrderDetailModal from './OrderDetailModal.vue'
|
|
|
import moment from 'moment'
|
|
|
export default {
|
|
|
name: 'OrderCenter',
|
|
|
components: {
|
|
|
STable,
|
|
|
VSelect
|
|
|
- // OrderDetailModal
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -111,7 +104,7 @@ export default {
|
|
|
searchForm: {
|
|
|
beginDate: null, // 创建的开始时间
|
|
|
endDate: null, // 创建的结束时间
|
|
|
- usedStoreId: '', // 核销门店
|
|
|
+ usedStoreId: undefined, // 核销门店
|
|
|
orderNo: '', // 单号
|
|
|
queryWorld: '', // 客户信息
|
|
|
bundName: '' // 套餐名称
|
|
@@ -119,57 +112,58 @@ export default {
|
|
|
loading: false, // 导出loading
|
|
|
orderTotal: '', // 合计开单数量
|
|
|
paymentAmountTotal: '', // 合计实收金额
|
|
|
- itemOptionData: [], // 服务项目数据
|
|
|
- storeOptionData: [], // 网点名称数据
|
|
|
- openDetailModal: false, // 查看详情弹窗 默认关闭
|
|
|
- detailId: null, // 初始化id
|
|
|
+ storeOptionData: [], // 门店数据
|
|
|
// 将默认当天时间日期回显在时间选择框中
|
|
|
time: [
|
|
|
moment(getDate.getToday().starttime, this.dateFormat),
|
|
|
moment(getDate.getToday().endtime, this.dateFormat)
|
|
|
],
|
|
|
dateFormat: 'YYYY-MM-DD',
|
|
|
- nowBeginDate: '',
|
|
|
+ nowBeginDate: '',
|
|
|
columns: [{
|
|
|
- title: '序号',
|
|
|
- dataIndex: 'orderNo',
|
|
|
- minWidth: '40',
|
|
|
- align: 'center'
|
|
|
- }, {
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'no',
|
|
|
+ minWidth: '40',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '核销时间',
|
|
|
+ dataIndex: 'usedTime',
|
|
|
+ minWidth: '40',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '核销单号/关联订单号',
|
|
|
- dataIndex: 'orderTime',
|
|
|
+ scopedSlots: { customRender: 'num' },
|
|
|
minWidth: '40',
|
|
|
align: 'center'
|
|
|
},
|
|
|
- // {
|
|
|
- // title: '核销时间',
|
|
|
- // dataIndex: 'orderNo',
|
|
|
- // minWidth: '40',
|
|
|
- // align: 'center'
|
|
|
- // },
|
|
|
{
|
|
|
title: '核销服务名称',
|
|
|
- dataIndex: 'storeName',
|
|
|
+ dataIndex: 'bundName',
|
|
|
minWidth: '40',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '客户信息',
|
|
|
- dataIndex: 'itemName',
|
|
|
+ scopedSlots: { customRender: 'userInfo' },
|
|
|
minWidth: '40',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '套餐名称',
|
|
|
- dataIndex: 'customerMobile',
|
|
|
+ dataIndex: 'bundItemName',
|
|
|
minWidth: '40',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '结算金额(¥)',
|
|
|
- dataIndex: 'payableAmount',
|
|
|
+ dataIndex: 'salesChannelSettleAmount',
|
|
|
minWidth: '40',
|
|
|
- align: 'center'
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return (text || 0) + '元'
|
|
|
+ }
|
|
|
}
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -177,10 +171,13 @@ export default {
|
|
|
this.searchForm.beginDate == null ? this.searchForm.beginDate = getDate.getToday().starttime : null
|
|
|
this.searchForm.endDate == null ? this.searchForm.endDate = getDate.getToday().endtime : null
|
|
|
return getVerificationRecordsList(Object.assign(parameter, this.searchForm)).then(res => {
|
|
|
- // console.log(res,'0000000000000000000')
|
|
|
if (res.status == 200) {
|
|
|
+ const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
+ for (let i = 0; i < res.data.list.length; i++) {
|
|
|
+ const _item = res.data.list[i]
|
|
|
+ _item.no = no + i + 1
|
|
|
+ }
|
|
|
return res.data
|
|
|
- this.getTotal()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -188,33 +185,9 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
moment,
|
|
|
- calendarChange (date, dateStrings) {
|
|
|
- if (date[0]) {
|
|
|
- this.nowBeginDate = date[0].format('YYYY-MM-DD')
|
|
|
- }
|
|
|
- },
|
|
|
// 不可选日期
|
|
|
disabledDate (date, dateStrings) {
|
|
|
- if (this.nowBeginDate) { // 有下单时间开始时间时
|
|
|
- const bVal = this.getThreeMonthsAfter(this.nowBeginDate, -3) // 三个月前时间戳
|
|
|
- const eVal = this.getThreeMonthsAfter(this.nowBeginDate, 3) // 三个月后时间戳
|
|
|
- if (Date.now() < eVal) { // 当前日期距起始日期不足三个月
|
|
|
- return date && date.valueOf() < bVal || date && date.valueOf() > Date.now()
|
|
|
- } else {
|
|
|
- return date && date.valueOf() < bVal || date && date.valueOf() > eVal
|
|
|
- }
|
|
|
- } else {
|
|
|
- return date && date.valueOf() > Date.now()
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取month个月后的时间戳
|
|
|
- getThreeMonthsAfter (dtstr, month) {
|
|
|
- var s = dtstr.split('-')
|
|
|
- var yy = parseInt(s[0])
|
|
|
- var mm = parseInt(s[1])
|
|
|
- var dd = parseInt(s[2])
|
|
|
- var dt = new Date(yy, mm + Number(month) - 1, dd)
|
|
|
- return dt.valueOf()
|
|
|
+ return date && date.valueOf() > Date.now()
|
|
|
},
|
|
|
// 创建时间change
|
|
|
onChange (dates, dateStrings) {
|
|
@@ -222,36 +195,19 @@ export default {
|
|
|
this.searchForm.beginDate = dateStrings[0]
|
|
|
this.searchForm.endDate = dateStrings[1]
|
|
|
}
|
|
|
- console.log(this.searchForm.beginDate, this.searchForm.endDate)
|
|
|
},
|
|
|
- // 获取服务项目数据
|
|
|
- // getItemListData () {
|
|
|
- // itemList({
|
|
|
- // pageNo: 1,
|
|
|
- // pageSize: 1000
|
|
|
- // }).then(res => {
|
|
|
- // // console.log(res, '-----------')
|
|
|
- // if (res.status == 200) {
|
|
|
- // this.itemOptionData = res.data.list || []
|
|
|
- // } else {
|
|
|
- // this.itemOptionData = []
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // // 获取网点名称数据
|
|
|
- // getStoreListData () {
|
|
|
- // storeList({
|
|
|
- // pageNo: 1,
|
|
|
- // pageSize: 1000
|
|
|
- // }).then(res => {
|
|
|
- // // console.log(res, '-----------')
|
|
|
- // if (res.status == 200) {
|
|
|
- // this.storeOptionData = res.data.list || []
|
|
|
- // } else {
|
|
|
- // this.storeOptionData = []
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
+ // 获取门店数据
|
|
|
+ getStoreListData () {
|
|
|
+ getStoreList({
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 1000
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res, '-----------')
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.storeOptionData = res.data.list || []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 合计
|
|
|
getTotal () {
|
|
|
const params = {
|
|
@@ -272,25 +228,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 查看详情--跳转到对应的详情页
|
|
|
- seeDetail (record) {
|
|
|
- // 将当前行的id传递给详情页
|
|
|
- this.openDetailModal = true
|
|
|
- this.detailId = record.id
|
|
|
- },
|
|
|
- // 退款---暂不做
|
|
|
- // refund(row) {
|
|
|
- // const _this = this
|
|
|
- // this.$confirm({
|
|
|
- // title: '警告',
|
|
|
- // content: '确认退款后 款项将通过原渠道退回 且不可撤回,确认退款?',
|
|
|
- // okText: '确定',
|
|
|
- // cancelText: '取消',
|
|
|
- // // onOk() {
|
|
|
- //
|
|
|
- // // }
|
|
|
- // })
|
|
|
- // },
|
|
|
// 查询
|
|
|
handleSearch () {
|
|
|
this.$refs.table.refresh()
|
|
@@ -305,11 +242,8 @@ export default {
|
|
|
moment(getDate.getToday().starttime, this.dateFormat),
|
|
|
moment(getDate.getToday().endtime, this.dateFormat)
|
|
|
]
|
|
|
- this.searchForm.usedStoreId = ''
|
|
|
+ this.searchForm.usedStoreId = undefined
|
|
|
this.searchForm.orderNo = ''
|
|
|
- this.searchForm.customerMobile = ''
|
|
|
- this.searchForm.orderStatus = ''
|
|
|
- // this.$refs.searchForm.resetFields()
|
|
|
this.$refs.table.refresh()
|
|
|
this.getTotal()
|
|
|
},
|
|
@@ -324,6 +258,10 @@ export default {
|
|
|
queryWorld: this.searchForm.queryWorld,
|
|
|
bundName: this.searchForm.bundName
|
|
|
}
|
|
|
+ if (!completeDate(params.beginDate, params.endDate, 3)) {
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
+ return
|
|
|
+ }
|
|
|
settlementRecordsExport(params).then(res => {
|
|
|
console.log(res)
|
|
|
this.loading = false
|
|
@@ -331,19 +269,15 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
download (data) {
|
|
|
- if (!data) {
|
|
|
- return
|
|
|
- }
|
|
|
+ if (!data) { return }
|
|
|
const url = window.URL.createObjectURL(new Blob([data]))
|
|
|
const link = document.createElement('a')
|
|
|
-
|
|
|
link.style.display = 'none'
|
|
|
link.href = url
|
|
|
const a = moment().format('YYYYMMDDhhmmss')
|
|
|
const fname = '核销记录-' + a
|
|
|
console.log(fname, '111111')
|
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
|
-
|
|
|
document.body.appendChild(link)
|
|
|
link.click()
|
|
|
}
|
|
@@ -351,8 +285,8 @@ export default {
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
// vm.getItemListData()
|
|
|
- // vm.handleRest()
|
|
|
- // vm.getStoreListData()
|
|
|
+ vm.handleRest()
|
|
|
+ vm.getStoreListData()
|
|
|
})
|
|
|
}
|
|
|
}
|