Commit 70162590 by cwq0219

订单列表;升级状态

1 parent afaf4515
......@@ -134,7 +134,7 @@
prop="upgradeFlag"
>
<template slot-scope="scope">
<span>{{scope.row.upgradeFlag === 'Y' ? '已升级' : '未升级'}}</span>
<span>{{!scope.row.upgradeFlag ? '待升级' : (scope.row.upgradeFlag === 'Y' ? '已升级' : '未升级')}}</span>
</template>
</el-table-column>
<el-table-column
......@@ -340,7 +340,10 @@ export default {
confLabel: '已升级'
}, {
confId: 'N',
confLabel: '未升级'
confLabel: '不升级'
}, {
confId: 'R',
confLabel: '待升级'
}],
sourceList: [{
confId: 1,
......
......@@ -110,10 +110,12 @@
import { Util } from '@/common/util'
import { getList, exportFile } from '@api/order'
import { mapActions } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer'
export default {
name: 'orderList',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
statusOpts: {
1: '待升级',
2: '未升级',
......@@ -124,9 +126,67 @@ export default {
},
showFormData: [{
label: '订单状态',
name: 'orderStatus',
name: 'status',
type: 'select',
optionList: [{
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'orderStatusList'
}, {
label: '升级状态',
name: 'upgradeFinishFlag',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'upgradeList'
}, {
label: '商品名称',
name: 'orderGoodsName',
type: 'input'
}, {
label: '客户姓名',
name: 'customerName',
type: 'input'
}, {
label: '服务门店',
name: 'yqMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'parkServiceList',
changeAttr: (value, targetItem) => {
if (value) {
this.getServiceStore(value)
} else {
this.baseData.storeIdList = []
}
this.searchForm.merchantId = ''
this.getOptionsList()
}
}, {
label: '流量来源',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'storeIdList'
}, {
label: '下单日期',
name: 'orderTime',
type: 'datePicker',
pickerOptions: 'rangePickerOptions'
}],
searchForm: {
status: '',
customerName: '',
orderTime: '',
merchantId: ''
},
baseData: {
orderStatusList: [{
confId: 1,
confLabel: '待升级'
}, {
......@@ -142,26 +202,18 @@ export default {
confId: 6,
confLabel: '已完成'
}],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'orderStatusList'
}, {
label: '姓名',
name: 'name',
type: 'input'
}, {
label: '下单日期',
name: 'orderTime',
type: 'datePicker',
pickerOptions: 'rangePickerOptions'
}],
searchForm: {
orderStatus: '',
name: '',
orderTime: ''
},
baseData: {
upgradeList: [{
confId: 'Y',
confLabel: '已升级'
}, {
confId: 'N',
confLabel: '不升级'
}, {
confId: 'R',
confLabel: '待升级'
}],
parkServiceList: [],
storeIdList: []
},
tableData: [],
total: 0,
......@@ -173,6 +225,15 @@ export default {
},
mounted() {
if (this.userInfo.beSuper) {
getParkStore({}).then(res => {
this.baseData.parkServiceList = res
this.getOptionsList()
})
} else {
this.showFormData = this.showFormData.filter(item => item.name !== 'yqMerchantId')
this.getServiceStore(this.userInfo.detail.merchantId)
}
this.getList()
},
......@@ -180,25 +241,43 @@ export default {
...mapActions({ close: 'd2admin/page/close' }),
handleReset() {
this.searchForm = {
orderStatus: '',
name: '',
orderTime: ''
status: '',
customerName: '',
orderTime: '',
merchantId: ''
}
this.baseData.storeIdList = []
this.getOptionsList()
},
getServiceStore(merchantId) {
getServiceStore({
yqMerchantId: merchantId
}).then(res => {
this.baseData.storeIdList = res || []
this.getOptionsList()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
getParams() {
const params = {}
const params = _.cloneDeep(this.searchForm)
const form = this.searchForm
if (form.name) {
params.customerName = form.name
}
if (form.orderTime && form.orderTime.length) {
params.placeOrderStartDateStr = Util.dateFormate(form.orderTime[0], 'YYYY-MM-DD HH:mm:ss')
params.placeOrderEndDateStr = Util.dateFormate(form.orderTime[1], 'YYYY-MM-DD') + ' 23:59:59'
}
if (form.orderStatus) {
params.status = form.orderStatus
}
return params
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!