|
@@ -31,13 +31,24 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
- <a-form-item label="状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <a-form-item label="单据状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
<v-select
|
|
|
- v-model="searchForm.refundFlag"
|
|
|
- ref="refundFlag"
|
|
|
+ v-model="searchForm.orderFlag"
|
|
|
+ ref="orderFlag"
|
|
|
id="purchasedSetmeal-status"
|
|
|
- code="REFUND_STATUS"
|
|
|
- placeholder="请选择状态"
|
|
|
+ code="ORDER_TYPE"
|
|
|
+ placeholder="请选择单据状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="结算状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <v-select
|
|
|
+ v-model="searchForm.salesChannelSettleStatus"
|
|
|
+ ref="salesChannelSettleStatus"
|
|
|
+ id="purchasedSetmeal-status"
|
|
|
+ code="SETTLE_STATUS_ALL"
|
|
|
+ placeholder="请选择结算状态"
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -55,9 +66,7 @@
|
|
|
<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 style="margin-left: 15px;">优惠:</strong><span v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
|
|
|
- <strong style="margin-left: 15px;">实收:</strong><span v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
|
|
|
+ <strong style="margin-left: 15px;">收款金额:</strong><span v-model="totalAmounts">{{ totalAmounts || 0 }} 元</span>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -67,10 +76,15 @@
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
- <!-- 状态 -->
|
|
|
- <span slot="refundFlag" slot-scope="text">
|
|
|
- {{ $refs.refundFlag.getNameByCode(text) }}
|
|
|
- </span>
|
|
|
+ <!-- 客户信息 -->
|
|
|
+ <p slot="custInfo" slot-scope="text, record">
|
|
|
+ <span v-if="record.custMobile || record.vehicleNumber">{{ record.custMobile }} / {{ record.vehicleNumber }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </p>
|
|
|
+ <!-- 单据状态 -->
|
|
|
+ <span slot="orderFlag" slot-scope="text">{{ $refs.orderFlag.getNameByCode(text) }}</span>
|
|
|
+ <!-- 结算状态 -->
|
|
|
+ <span slot="salesChannelSettleStatus" slot-scope="text">{{ $refs.salesChannelSettleStatus.getNameByCode(text) }}</span>
|
|
|
<!-- 操作 -->
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<a-button type="primary" id="purchasedSetmeal-look" @click="seeDetail(record)">详情</a-button>
|
|
@@ -87,7 +101,7 @@ import getDate from '@/libs/getDate.js'
|
|
|
import { completeDate } from '@/libs/tools.js'
|
|
|
import moment from 'moment'
|
|
|
import SetmealDetailModal from './SetmealDetailModal.vue'
|
|
|
-import { listCustomerBundle } from '@/api/customerBundle.js'
|
|
|
+import { listCustomerBundle, exportBundle, countListBundle } from '@/api/customerBundle.js'
|
|
|
export default {
|
|
|
name: 'PurchasedSetmeal',
|
|
|
components: { STable, VSelect, SetmealDetailModal },
|
|
@@ -100,11 +114,12 @@ export default {
|
|
|
bundleName: '', // 套餐名称
|
|
|
number: '', // 订单号
|
|
|
queryWord: '', // 客户信息
|
|
|
- refundFlag: '' // 状态
|
|
|
+ orderFlag: '', // 单据状态
|
|
|
+ salesChannelSettleStatus: '' // 结算状态
|
|
|
},
|
|
|
loading: false, // 导出loading
|
|
|
orderTotal: '', // 合计开单数量
|
|
|
- paymentAmountTotal: '', // 合计实收金额
|
|
|
+ totalAmounts: '', // 合计收款金额
|
|
|
openDetailModal: false, // 查看详情弹窗 默认关闭
|
|
|
detailId: null, // 初始化id
|
|
|
// 将默认当天时间日期回显在时间选择框中
|
|
@@ -118,9 +133,10 @@ export default {
|
|
|
{ title: '订单号', dataIndex: 'number', width: 100, align: 'center' },
|
|
|
{ title: '下单时间', dataIndex: 'orderDate', width: 100, align: 'center' },
|
|
|
{ title: '套餐名称', dataIndex: 'bundleName', width: 100, align: 'center' },
|
|
|
- { title: '客户信息', dataIndex: 'customerMobile', width: 100, align: 'center' },
|
|
|
- { title: '应收金额(¥)', dataIndex: 'payedAmount', width: 80, align: 'center' },
|
|
|
- { title: '单据状态', scopedSlots: { customRender: 'refundFlag' }, width: 80, align: 'center' },
|
|
|
+ { title: '客户信息', scopedSlots: { customRender: 'custInfo' }, width: 100, align: 'center' },
|
|
|
+ { title: '收款金额(¥)', dataIndex: 'payedAmount', width: 80, align: 'center' },
|
|
|
+ { title: '单据状态', scopedSlots: { customRender: 'orderFlag' }, width: 80, align: 'center' },
|
|
|
+ { title: '结算状态', scopedSlots: { customRender: 'salesChannelSettleStatus' }, width: 80, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -166,17 +182,25 @@ export default {
|
|
|
bundleName: this.searchForm.bundleName,
|
|
|
number: this.searchForm.number,
|
|
|
queryWord: this.searchForm.queryWord,
|
|
|
- refundFlag: this.searchForm.refundFlag
|
|
|
+ orderFlag: this.searchForm.orderFlag,
|
|
|
+ salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
|
|
|
}
|
|
|
params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
|
|
|
params.endDate == null ? params.endDate = getDate.getToday().endtime : null
|
|
|
- // orderTotal(params).then(res => {
|
|
|
- // console.log(res, '--------')
|
|
|
- // if (res.status == 200) {
|
|
|
- // this.orderTotal = res.data.orderNum || 0
|
|
|
- // this.paymentAmountTotal = res.data.paymentAmount || 0
|
|
|
- // }
|
|
|
- // })
|
|
|
+ countListBundle(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ if (res.data) {
|
|
|
+ this.orderTotal = res.data.cnt || 0
|
|
|
+ this.totalAmounts = res.data.totalAmounts || 0
|
|
|
+ } else {
|
|
|
+ this.orderTotal = 0
|
|
|
+ this.totalAmounts = 0
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.orderTotal = 0
|
|
|
+ this.totalAmounts = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 查看详情--跳转到对应的详情页
|
|
|
seeDetail (record) {
|
|
@@ -187,7 +211,6 @@ export default {
|
|
|
// 查询
|
|
|
handleSearch () {
|
|
|
this.$refs.table.refresh()
|
|
|
- this.getTotal()
|
|
|
},
|
|
|
// 重置
|
|
|
handleReset () {
|
|
@@ -200,28 +223,28 @@ export default {
|
|
|
this.searchForm.bundleName = ''
|
|
|
this.searchForm.number = ''
|
|
|
this.searchForm.queryWord = ''
|
|
|
- this.searchForm.refundFlag = null
|
|
|
+ this.searchForm.orderFlag = null
|
|
|
+ this.searchForm.salesChannelSettleStatus = null
|
|
|
this.$refs.table.refresh(true)
|
|
|
- this.getTotal()
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
|
- // this.loading = true
|
|
|
const params = {
|
|
|
beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
|
|
|
endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
|
|
|
bundleName: this.searchForm.bundleName,
|
|
|
number: this.searchForm.number,
|
|
|
queryWord: this.searchForm.queryWord,
|
|
|
- refundFlag: this.searchForm.refundFlag
|
|
|
+ orderFlag: this.searchForm.orderFlag,
|
|
|
+ salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
|
|
|
}
|
|
|
// 判断两个时间段是否相差m个月
|
|
|
if (!completeDate(params.beginDate, params.endDate, 3)) {
|
|
|
this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
return
|
|
|
}
|
|
|
- exportOrder(params).then(res => {
|
|
|
- console.log(res)
|
|
|
+ this.loading = true
|
|
|
+ exportBundle(params).then(res => {
|
|
|
this.loading = false
|
|
|
this.download(res)
|
|
|
})
|
|
@@ -234,7 +257,6 @@ export default {
|
|
|
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()
|