|
@@ -3,54 +3,44 @@
|
|
|
<div class="userManageList-searchForm">
|
|
|
<a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="refresh">
|
|
|
<a-row :gutter="20">
|
|
|
- <a-col :span="5">
|
|
|
- <a-form-item label="投递时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="注册时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-range-picker
|
|
|
id="network-time"
|
|
|
- v-model="time"
|
|
|
+ v-model="registerTime"
|
|
|
:format="dateFormat"
|
|
|
:placeholder="['开始时间','结束时间']"
|
|
|
:disabledDate="disabledDate"
|
|
|
- @change="onChange" />
|
|
|
+ @change="onChangeregisterTime" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="5">
|
|
|
+ <a-col :span="6">
|
|
|
<a-form-item label="最后投递时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-range-picker
|
|
|
id="network-time"
|
|
|
- v-model="time"
|
|
|
+ v-model="lastDeliverTime"
|
|
|
:format="dateFormat"
|
|
|
:placeholder="['开始时间','结束时间']"
|
|
|
:disabledDate="disabledDate"
|
|
|
- @change="onChange" />
|
|
|
+ @change="onChangelastDeliverTime" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="5">
|
|
|
+ <a-col :span="6">
|
|
|
<a-form-item label="用户手机" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-input id="releaseRecordList-mobile" allowClear :maxLength="11" v-model="queryParam.mobile" placeholder="请输入用户手机" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="5">
|
|
|
+ <a-col :span="6">
|
|
|
<a-form-item label="乐豆余额" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<div class="input-number">
|
|
|
- <a-input-number id="releaseRecordList-inputNumber" v-model="queryParam.currentGoldMin" :max="999999999" @change="onChange" />-
|
|
|
- <a-input-number id="inputNumber" v-model="queryParam.currentGoldMax" :max="999999999" @change="onChange" />
|
|
|
+ <a-input-number id="releaseRecordList-inputNumber" v-model="queryParam.currentGoldMin" :max="999999999" />-
|
|
|
+ <a-input-number id="inputNumber" v-model="queryParam.currentGoldMax" :max="999999999" />
|
|
|
</div>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="4">
|
|
|
- <a-button class="handle-btn serach-btn" id="releaseRecordList-btn-serach" type="primary" @click="refresh">查询</a-button>
|
|
|
- <a-button class="handle-btn" type="" id="releaseRecordList-btn-reset" @click="handleReset">重置</a-button>
|
|
|
- <a-button
|
|
|
- class="export-btn"
|
|
|
- id="releaseRecordList-btn-export"
|
|
|
- :loading="loading"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermission="'B_user_userManage_export'">导出</a-button>
|
|
|
- </a-col>
|
|
|
</a-row>
|
|
|
<a-row :gutter="20">
|
|
|
- <a-col :span="5">
|
|
|
+ <a-col :span="6">
|
|
|
<a-form-item label="账户状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<v-select
|
|
|
v-model="queryParam.state"
|
|
@@ -60,7 +50,7 @@
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="5">
|
|
|
+ <a-col :span="6">
|
|
|
<a-form-item label="用户身份" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<v-select
|
|
|
v-model="queryParam.customerRole"
|
|
@@ -70,6 +60,16 @@
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-button class="handle-btn serach-btn" id="releaseRecordList-btn-serach" type="primary" @click="refresh">查询</a-button>
|
|
|
+ <a-button class="handle-btn" type="" id="releaseRecordList-btn-reset" @click="handleReset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ class="export-btn"
|
|
|
+ id="releaseRecordList-btn-export"
|
|
|
+ :loading="loading"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermission="'B_user_userManage_export'">导出</a-button>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
|
|
|
</a-form>
|
|
@@ -113,6 +113,7 @@ import {
|
|
|
changeStatus,
|
|
|
customeExport
|
|
|
} from '@/api/userInfo.js'
|
|
|
+import moment from 'moment'
|
|
|
export default {
|
|
|
name: 'UserManageList',
|
|
|
components: {
|
|
@@ -123,13 +124,14 @@ export default {
|
|
|
return {
|
|
|
formItemLayout: {
|
|
|
labelCol: {
|
|
|
- span: 8
|
|
|
+ span: 7
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
- span: 16
|
|
|
+ span: 17
|
|
|
}
|
|
|
},
|
|
|
- time: [],
|
|
|
+ registerTime: [], // 注册时间
|
|
|
+ lastDeliverTime: [], // 最后投递时间
|
|
|
dateFormat: 'YYYY-MM-DD',
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
@@ -137,7 +139,11 @@ export default {
|
|
|
state: '', // 账户状态
|
|
|
customerRole: '', // 用户身份
|
|
|
currentGoldMin: '', // 乐豆余额最小值
|
|
|
- currentGoldMax: '' // 乐豆余额最大值
|
|
|
+ currentGoldMax: '', // 乐豆余额最大值
|
|
|
+ beginDate: null, // 最后投递时间的开始时间
|
|
|
+ endDate: null, // 最后投递时间的结束时间
|
|
|
+ beginRegisterTime: null, // 注册时间最小值
|
|
|
+ endRegisterTime: null // 注册时间最大值
|
|
|
},
|
|
|
loading: false, // 导出loading
|
|
|
// 表头
|
|
@@ -153,12 +159,12 @@ export default {
|
|
|
width: 100,
|
|
|
align: 'center'
|
|
|
},
|
|
|
- {
|
|
|
- title: '用户身份',
|
|
|
- dataIndex: 'customerRoleDictValue',
|
|
|
- width: 100,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
+ {
|
|
|
+ title: '用户身份',
|
|
|
+ dataIndex: 'customerRoleDictValue',
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
{
|
|
|
title: '乐豆余额',
|
|
|
dataIndex: 'currentGold',
|
|
@@ -183,7 +189,7 @@ export default {
|
|
|
width: 200,
|
|
|
align: 'center',
|
|
|
customRender: (text) => {
|
|
|
- return text || '--'
|
|
|
+ return text || '--'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -192,7 +198,7 @@ export default {
|
|
|
width: 200,
|
|
|
align: 'center',
|
|
|
customRender: (text) => {
|
|
|
- return text || '--'
|
|
|
+ return text || '--'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -201,7 +207,7 @@ export default {
|
|
|
width: 200,
|
|
|
align: 'center',
|
|
|
customRender: (text) => {
|
|
|
- return text || '--'
|
|
|
+ return text || '--'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -224,7 +230,22 @@ export default {
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- return customerList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ const searchData = Object.assign(parameter, this.queryParam)
|
|
|
+ if (this.registerTime && this.registerTime.length) {
|
|
|
+ searchData.beginRegisterTime = moment(this.registerTime[0])
|
|
|
+ searchData.endRegisterTime = moment(this.registerTime[1])
|
|
|
+ } else {
|
|
|
+ searchData.beginRegisterTime = null
|
|
|
+ searchData.endRegisterTime = null
|
|
|
+ }
|
|
|
+ if (this.lastDeliverTime && this.lastDeliverTime.length) {
|
|
|
+ searchData.beginDate = moment(this.lastDeliverTime[0])
|
|
|
+ searchData.endDate = moment(this.lastDeliverTime[1])
|
|
|
+ } else {
|
|
|
+ searchData.beginDate = null
|
|
|
+ searchData.endDate = null
|
|
|
+ }
|
|
|
+ return customerList(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++) {
|
|
@@ -244,17 +265,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- // 不可选日期
|
|
|
- disabledDate (date, dateStrings) {
|
|
|
- return date && date.valueOf() > Date.now()
|
|
|
- },
|
|
|
- // 创建时间change
|
|
|
- onChange (dates, dateStrings) {
|
|
|
- if ((dates, dateStrings)) {
|
|
|
- this.queryParam.beginDate = dateStrings[0]
|
|
|
- this.queryParam.endDate = dateStrings[1]
|
|
|
- }
|
|
|
- },
|
|
|
+ // 不可选日期
|
|
|
+ disabledDate (date, dateStrings) {
|
|
|
+ return date && date.valueOf() > Date.now()
|
|
|
+ },
|
|
|
+ // 注册时间change
|
|
|
+ onChangeregisterTime (dates, dateStrings) {
|
|
|
+ if ((dates, dateStrings)) {
|
|
|
+ this.queryParam.beginRegisterTime = dateStrings[0]
|
|
|
+ this.queryParam.endRegisterTime = dateStrings[1]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 最后投递时间change
|
|
|
+ onChangelastDeliverTime (dates, dateStrings) {
|
|
|
+ if ((dates, dateStrings)) {
|
|
|
+ this.queryParam.beginDate = dateStrings[0]
|
|
|
+ this.queryParam.endDate = dateStrings[1]
|
|
|
+ }
|
|
|
+ },
|
|
|
refresh () {
|
|
|
const isONull = this.queryParam.currentGoldMin === null
|
|
|
const isOEmpty = this.queryParam.currentGoldMin === ''
|
|
@@ -289,18 +317,14 @@ export default {
|
|
|
},
|
|
|
// 查看乐豆详情
|
|
|
handleLd (row) {
|
|
|
- this.$router.push({
|
|
|
- // name: 'ledouDetail',
|
|
|
- // params: {
|
|
|
- // customerNo: row.customerNo,
|
|
|
- // mobile: row.mobile,
|
|
|
- // currentGold: row.currentGold,
|
|
|
- // id: row.id
|
|
|
- // }
|
|
|
- path: '/userInfo/userManageList_Ld/detail', query: { customerNo: row.customerNo, id: row.id }
|
|
|
- })
|
|
|
+ this.$router.push({
|
|
|
+ path: '/userInfo/userManageList_Ld/detail',
|
|
|
+ query: {
|
|
|
+ customerNo: row.customerNo,
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- // 启用禁用
|
|
|
// 更改启用禁用状态
|
|
|
changeFlagHandle (text, record) {
|
|
|
const _this = this
|
|
@@ -319,22 +343,88 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
handleReset () {
|
|
|
- this.queryParam.mobile = ''
|
|
|
- this.queryParam.currentGoldMin = ''
|
|
|
- this.queryParam.currentGoldMax = ''
|
|
|
- this.queryParam.state = ''
|
|
|
- this.queryParam.customerRole = ''
|
|
|
+ this.queryParam.mobile = '' // 用户手机
|
|
|
+ this.queryParam.currentGoldMin = '' // 乐豆余额最小值
|
|
|
+ this.queryParam.currentGoldMax = '' // 乐豆余额最大值
|
|
|
+ this.queryParam.state = '' // 账户状态
|
|
|
+ this.queryParam.customerRole = '' // 用户身份
|
|
|
+ this.queryParam.beginDate = null // 最后投递时间的开始时间
|
|
|
+ this.queryParam.endDate = null // 最后投递时间的结束时间
|
|
|
+ this.queryParam.beginRegisterTime = null // 注册时间最小值
|
|
|
+ this.queryParam.endRegisterTime = null // 注册时间最大值
|
|
|
+ this.registerTime = [],
|
|
|
+ this.lastDeliverTime = [],
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
|
- const params = {
|
|
|
- mobile: this.queryParam.mobile,
|
|
|
- customerRole: this.queryParam.customerRole,
|
|
|
- currentGoldMin: this.queryParam.currentGoldMin,
|
|
|
- currentGoldMax: this.queryParam.currentGoldMax,
|
|
|
- state: this.queryParam.state = ''
|
|
|
+ const params = this.queryParam
|
|
|
+ // 情况1 导出只选择注册时间段 没有选择最后投递时间段
|
|
|
+ if ((this.registerTime && this.registerTime.length) && (params.beginDate == null && params.endDate == null)) {
|
|
|
+ params.beginRegisterTime = moment(this.registerTime[0])
|
|
|
+ params.endRegisterTime = moment(this.registerTime[1])
|
|
|
}
|
|
|
+ // 判断两个时间段是否相差m个月 第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
|
|
|
+ if (moment(params.endRegisterTime).diff(moment(params.beginRegisterTime), 'months', true) > 3) {
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小注册时间区间后再进行导出!')
|
|
|
+ }
|
|
|
+ // 情况2 导出只选择最后投递时间段 没有注册时间段
|
|
|
+ if ((this.lastDeliverTime && this.lastDeliverTime.length) && (params.beginRegisterTime == null && params.endRegisterTime == null)) {
|
|
|
+ params.beginDate = moment(this.lastDeliverTime[0])
|
|
|
+ params.endDate = moment(this.lastDeliverTime[1])
|
|
|
+ }
|
|
|
+ if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小最后投递时间区间后再进行导出!')
|
|
|
+ }
|
|
|
+ // 情况3 导出未选择任何时间段
|
|
|
+ if ((params.beginRegisterTime == null && params.endRegisterTime == null) && (params.beginDate == null && params.endDate == null)) {
|
|
|
+ this.$message.error('请先选择需要导出的注册时间区间或最后投递时间区间再进行导出(3个月以内)!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 情况4 注册时间与最后投递时间都选择
|
|
|
+ if (!((params.beginRegisterTime == null && params.endRegisterTime == null) && (params.beginDate == null && params.endDate == null))) {
|
|
|
+ params.beginRegisterTime = moment(this.registerTime[0])
|
|
|
+ params.endRegisterTime = moment(this.registerTime[1])
|
|
|
+ params.beginDate = moment(this.lastDeliverTime[0])
|
|
|
+ params.endDate = moment(this.lastDeliverTime[1])
|
|
|
+ }
|
|
|
+ if (moment(params.endRegisterTime).diff(moment(params.beginRegisterTime), 'months', true) > 3) {
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小注册时间区间后再进行导出!')
|
|
|
+ }
|
|
|
+ if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小最后投递时间区间后再进行导出!')
|
|
|
+ }
|
|
|
+ // // 导出注册时间范围判断
|
|
|
+ // // if (this.registerTime && this.registerTime.length) {
|
|
|
+ // // params.beginRegisterTime = moment(this.registerTime[0]).format('YYYY-MM-DD')
|
|
|
+ // // params.endRegisterTime = moment(this.registerTime[1]).format('YYYY-MM-DD')
|
|
|
+ // // } else {
|
|
|
+ // // params.beginRegisterTime = null
|
|
|
+ // // params.endRegisterTime = null
|
|
|
+ // // }
|
|
|
+ // // if (!params.beginRegisterTime && !params.endRegisterTime) {
|
|
|
+ // // this.$message.error('请先选择需要导出的注册时间区间再进行导出!')
|
|
|
+ // // }
|
|
|
+ // // // 判断两个时间段是否相差m个月 第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
|
|
|
+ // // if (moment(params.endRegisterTime).diff(moment(params.beginRegisterTime), 'months', true) > 3) {
|
|
|
+ // // this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
+ // // }
|
|
|
+ // // // 导出最后投递时间范围判断哪
|
|
|
+ // // if (this.lastDeliverTime && this.lastDeliverTime.length) {
|
|
|
+ // // params.beginDate = moment(this.lastDeliverTime[0]).format('YYYY-MM-DD')
|
|
|
+ // // params.endDate = moment(this.lastDeliverTime[1]).format('YYYY-MM-DD')
|
|
|
+ // // } else {
|
|
|
+ // // params.beginDate = null
|
|
|
+ // // params.endDate = null
|
|
|
+ // // }
|
|
|
+ // // if (!params.beginDate && !params.endDate) {
|
|
|
+ // // this.$message.error('请先选择需要导出的注册时间区间再进行导出!')
|
|
|
+ // // }
|
|
|
+ // // // 判断两个时间段是否相差m个月 第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
|
|
|
+ // // if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
|
|
|
+ // // this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
+ // // }
|
|
|
+ // console.log(params.beginRegisterTime, params.endRegisterTime, params.beginDate, params.endDate, '--------------导出参数')
|
|
|
this.loading = true
|
|
|
customeExport(params).then(res => {
|
|
|
this.loading = false
|