|
@@ -5,7 +5,7 @@
|
|
<a-row :gutter="48">
|
|
<a-row :gutter="48">
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
<a-form-item label="用户手机" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
<a-form-item label="用户手机" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
- <a-input id="releaseRecordList-contactPhone" allowClear :maxLength="11" v-model="queryParam.contactPhone" placeholder="请输入用户手机" />
|
|
|
|
|
|
+ <a-input id="releaseRecordList-mobile" allowClear :maxLength="11" v-model="queryParam.mobile" placeholder="请输入用户手机" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
@@ -53,14 +53,6 @@
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
bordered>
|
|
bordered>
|
|
- <!-- 订单状态 -->
|
|
|
|
- <template slot="orderStatus" slot-scope="text, record">
|
|
|
|
- <span>{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
|
|
|
|
- </template>
|
|
|
|
- <!-- 订单总额 -->
|
|
|
|
- <template slot="orderPrice" slot-scope="text, record">
|
|
|
|
- <span>{{ record.orderPrice || 0 }}乐豆</span>
|
|
|
|
- </template>
|
|
|
|
<!--启用禁用 -->
|
|
<!--启用禁用 -->
|
|
<span slot="state" slot-scope="text, record">
|
|
<span slot="state" slot-scope="text, record">
|
|
<a-switch
|
|
<a-switch
|
|
@@ -82,10 +74,9 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import getDate from '@/libs/getDate.js'
|
|
|
|
-import moment from 'moment'
|
|
|
|
|
|
+import { customerList, changeStatus, customeExport } from '@/api/userInfo.js'
|
|
export default {
|
|
export default {
|
|
- name: 'ShopOrder',
|
|
|
|
|
|
+ name: 'UserManageList',
|
|
components: { STable, VSelect },
|
|
components: { STable, VSelect },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -95,10 +86,7 @@ export default {
|
|
},
|
|
},
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParam: {
|
|
queryParam: {
|
|
- beginDate: null, // 开始时间
|
|
|
|
- endDate: null, // 结束时间
|
|
|
|
- contactPhone: '', // 用户手机
|
|
|
|
- orderNo: '', // 订单编号
|
|
|
|
|
|
+ mobile: '', // 用户手机
|
|
orderStatus: null, // 订单状态
|
|
orderStatus: null, // 订单状态
|
|
value1: '',
|
|
value1: '',
|
|
value2: ''
|
|
value2: ''
|
|
@@ -107,14 +95,14 @@ export default {
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
- { title: '用户手机', dataIndex: 'userMoblie', width: 200, align: 'center' },
|
|
|
|
- { title: '乐豆余额', dataIndex: 'orderDate', width: 200, align: 'center' },
|
|
|
|
- { title: '累计乐豆', dataIndex: 'orderNo', width: 200, align: 'center' },
|
|
|
|
- { title: '注册时间', scopedSlots: { customRender: 'orderStatus' }, width: 200, align: 'center' },
|
|
|
|
- { title: '最后登录时间', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
|
|
|
|
- { title: '最后投递时间', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
|
|
|
|
|
|
+ { title: '用户手机', dataIndex: 'mobile', width: 100, align: 'center' },
|
|
|
|
+ { title: '乐豆余额', dataIndex: 'currentGold', width: 100, align: 'center' },
|
|
|
|
+ { title: '累计乐豆', dataIndex: 'totalCarbon', width: 100, align: 'center' },
|
|
|
|
+ { title: '注册时间', dataIndex: 'registerTime', width: 200, align: 'center' },
|
|
|
|
+ { title: '最后登录时间', dataIndex: 'lastLoginTime', width: 200, align: 'center' },
|
|
|
|
+ { title: '最后投递时间', dataIndex: 'lastDeliveryTime', width: 200, align: 'center' },
|
|
{ title: '状态', width: 100, dataIndex: 'state', align: 'center', scopedSlots: { customRender: 'state' } },
|
|
{ title: '状态', width: 100, dataIndex: 'state', align: 'center', scopedSlots: { customRender: 'state' } },
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
|
|
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
@@ -131,7 +119,7 @@ export default {
|
|
// }
|
|
// }
|
|
// return
|
|
// return
|
|
// }
|
|
// }
|
|
- // return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
|
|
+ // return customerList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
// if (res.status == 200) {
|
|
// if (res.status == 200) {
|
|
// const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
// const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
// for (let i = 0; i < res.data.list.length; i++) {
|
|
// for (let i = 0; i < res.data.list.length; i++) {
|
|
@@ -142,24 +130,18 @@ export default {
|
|
// return res.data
|
|
// return res.data
|
|
// }
|
|
// }
|
|
// })
|
|
// })
|
|
- return new Promise((resolve) => {
|
|
|
|
- const data = [
|
|
|
|
- { no: 1, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
|
- { no: 2, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
|
|
|
|
- { no: 3, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
|
- { no: 4, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
|
|
|
|
- { no: 5, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
|
|
|
|
- { no: 6, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' }
|
|
|
|
- ]
|
|
|
|
- resolve(data)
|
|
|
|
|
|
+ return customerList({ pageNo: '1', pageSize: '10' }).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
|
|
|
|
+ _item.status = _item.status + '' === '1'
|
|
|
|
+ }
|
|
|
|
+ return res.data
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- },
|
|
|
|
- // 将默认当天时间日期回显在时间选择框中
|
|
|
|
- time: [
|
|
|
|
- moment(getDate.getToday().starttime, this.dateFormat),
|
|
|
|
- moment(getDate.getToday().endtime, this.dateFormat)
|
|
|
|
- ],
|
|
|
|
- dateFormat: 'YYYY-MM-DD'
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
@@ -168,25 +150,33 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- moment,
|
|
|
|
- // 不可选日期
|
|
|
|
- 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]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ // 查询条件change
|
|
|
|
+ onChange () {},
|
|
// 查看用户详情
|
|
// 查看用户详情
|
|
handleUser (row) {
|
|
handleUser (row) {
|
|
this.$router.push({ path: `/userInfo/userManageList_user/detail/${row.id}` })
|
|
this.$router.push({ path: `/userInfo/userManageList_user/detail/${row.id}` })
|
|
},
|
|
},
|
|
// 查看乐豆详情
|
|
// 查看乐豆详情
|
|
handleLd (row) {
|
|
handleLd (row) {
|
|
- this.$router.push({ path: `/userInfo/userManageList_Ld/detail/${row.id}` })
|
|
|
|
|
|
+ this.$router.push({ path: `/userInfo/userManageList_Ld/detail/${row.customerNo}` })
|
|
|
|
+ },
|
|
|
|
+ // 启用禁用
|
|
|
|
+ // 更改启用禁用状态
|
|
|
|
+ changeFlagHandle (text, record) {
|
|
|
|
+ console.log(text)
|
|
|
|
+ const _this = this
|
|
|
|
+ const _data = {
|
|
|
|
+ id: record.id,
|
|
|
|
+ state: record.state == 1 ? '0' : '1'
|
|
|
|
+ }
|
|
|
|
+ changeStatus(_data).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ } else {
|
|
|
|
+ record.state = !record.state
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
handleReset () {
|
|
handleReset () {
|
|
@@ -205,25 +195,15 @@ export default {
|
|
// 导出
|
|
// 导出
|
|
handleExport () {
|
|
handleExport () {
|
|
const params = {
|
|
const params = {
|
|
- beginDate: this.queryParam.beginDate == null ? getDate.getToday().starttime : this.queryParam.beginDate,
|
|
|
|
- endDate: this.queryParam.endDate == null ? getDate.getToday().endtime : this.queryParam.endDate,
|
|
|
|
contactPhone: this.queryParam.contactPhone,
|
|
contactPhone: this.queryParam.contactPhone,
|
|
orderNo: this.queryParam.orderNo,
|
|
orderNo: this.queryParam.orderNo,
|
|
orderStatus: this.queryParam.orderStatus
|
|
orderStatus: this.queryParam.orderStatus
|
|
}
|
|
}
|
|
- 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
|
|
|
|
- // exportBundle(params).then(res => {
|
|
|
|
- // this.loading = false
|
|
|
|
- // this.download(res)
|
|
|
|
- // })
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
+ customeExport(params).then(res => {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.download(res)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
download (data) {
|
|
download (data) {
|
|
if (!data) { return }
|
|
if (!data) { return }
|
|
@@ -231,8 +211,8 @@ export default {
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
link.href = url
|
|
link.href = url
|
|
- const a = moment().format('YYYYMMDDhhmmss')
|
|
|
|
- const fname = '订单记录-' + a
|
|
|
|
|
|
+ // const a = moment().format('YYYYMMDDhhmmss')
|
|
|
|
+ const fname = '用户列表'
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
link.click()
|
|
link.click()
|