|
@@ -16,13 +16,13 @@
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="商户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-input id="releaseRecordList-customerMobile" allowClear :maxLength="11" v-model=" queryParam.customerMobile" placeholder="请输入商户名称" />
|
|
|
+ <a-input id="releaseRecordList-officialPartnerName" allowClear :maxLength="11" v-model=" queryParam.officialPartnerName" placeholder="请输入商户名称" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-button class="handle-btn serach-btn" id="releaseRecordList-serach" type="primary" @click="refresh">查询</a-button>
|
|
|
<a-button class="handle-btn" id="releaseRecordList-reset" @click="handleReset">重置</a-button>
|
|
|
- <a-button class="handle-btn export-btn" id="releaseRecordList-export" @click="handleExport">导出</a-button>
|
|
|
+ <a-button class="handle-btn export-btn" id="releaseRecordList-export" :loading="loading" @click="handleExport">导出</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -45,13 +45,14 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import { getDeliveryLogList, getDeliveryLogTotal, stationList } from '@/api/releaseRecord.js'
|
|
|
+import { getOffPartnerGoldLog, exportOffPartnerGoldLog } from '@/api/offPartnerGoldLog.js'
|
|
|
import moment from 'moment'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
export default {
|
|
|
components: { STable, VSelect },
|
|
|
data () {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
form: this.$form.createForm(this),
|
|
|
formItemLayout: {
|
|
|
labelCol: { span: 4 },
|
|
@@ -67,7 +68,7 @@ export default {
|
|
|
queryParam: {
|
|
|
beginDate: null, // 开始时间
|
|
|
endDate: null, // 结束时间
|
|
|
- customerMobile: '' // 用户手机
|
|
|
+ officialPartnerName: '' // 用户手机
|
|
|
},
|
|
|
optionData: [],
|
|
|
orderTotal: 0, // 总单数
|
|
@@ -75,8 +76,9 @@ export default {
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '商户名称', dataIndex: 'stationName', width: 200, align: 'center' },
|
|
|
- { title: '收取乐豆个数', dataIndex: 'stationName', width: 200, align: 'center' }
|
|
|
+ { title: '商户名称', dataIndex: 'officialPartnerName', align: 'center' },
|
|
|
+ { title: '收取乐豆个数', dataIndex: 'changeNum', width: 200, align: 'center' },
|
|
|
+ { title: '交易时间', dataIndex: 'createDate', width: 200, align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -88,14 +90,14 @@ export default {
|
|
|
searchData.beginDate = ''
|
|
|
searchData.endDate = ''
|
|
|
}
|
|
|
- return getDeliveryLogList(searchData).then(res => {
|
|
|
+ return getOffPartnerGoldLog(searchData).then(res => {
|
|
|
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
|
|
|
}
|
|
|
- this.getListTotal()
|
|
|
+ // this.getListTotal()
|
|
|
return res.data
|
|
|
}
|
|
|
})
|
|
@@ -115,7 +117,41 @@ export default {
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
|
-
|
|
|
+ const params = {
|
|
|
+ officialPartnerName: this.queryParam.officialPartnerName
|
|
|
+ }
|
|
|
+ if (this.queryOrderDate && this.queryOrderDate.length) {
|
|
|
+ params.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
|
|
|
+ params.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
|
|
|
+ } else {
|
|
|
+ params.beginDate = ''
|
|
|
+ params.endDate = ''
|
|
|
+ }
|
|
|
+ if (!params.beginDate && !params.endDate) {
|
|
|
+ this.$message.error('请先选择需要导出的交易时间区间再进行导出!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断两个时间段是否相差m个月 第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
|
|
|
+ if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ exportOffPartnerGoldLog(params).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ this.download(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ download (data) {
|
|
|
+ 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
|
|
|
+ link.setAttribute('download', fname + '.xlsx')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
},
|
|
|
// 查询
|
|
|
refresh () {
|
|
@@ -124,7 +160,7 @@ export default {
|
|
|
// 合计
|
|
|
getListTotal () {
|
|
|
const params = {
|
|
|
- customerMobile: this.queryParam.customerMobile,
|
|
|
+ officialPartnerName: this.queryParam.officialPartnerName,
|
|
|
beginDate: this.queryParam.beginDate,
|
|
|
endDate: this.queryParam.endDate
|
|
|
}
|
|
@@ -153,7 +189,7 @@ export default {
|
|
|
moment(getDate.getRecentday().starttime, this.dateFormat),
|
|
|
moment(getDate.getRecentday().endtime, this.dateFormat)
|
|
|
]
|
|
|
- this.queryParam.customerMobile = ''
|
|
|
+ this.queryParam.officialPartnerName = ''
|
|
|
this.$refs.table.refresh(true)
|
|
|
}
|
|
|
}
|