Commit c48ade89 by chenwq

ui改版-会员中心

1 parent 967dc2a7
<template> <template>
<div class="live-room marketing"> <div class="live-room marketing">
<div class="live-room container"> <div class="live-room container">
<div class="flex"> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- <div class="flex">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right"> <el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row> <el-row>
<el-form-item size="small" label="订单编号"> <el-form-item size="small" label="订单编号">
...@@ -43,27 +44,26 @@ ...@@ -43,27 +44,26 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
</div> </div> -->
<div class="choseRow m-b-10"> <div class="choseRow m-b-10">
<div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index + 1)"> <div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index + 1)">
{{ item }} {{ item }}
</div> </div>
</div> </div>
<GLTable ref="memberOrderRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="memberOrderRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="orderType" slot-scope="scope"> <div slot="orderType" slot-scope="scope" style="width: 200px">
<template v-if="scope.scope.orderType == 1"> <template v-if="scope.scope.orderType == 1">
<span>{{ scope.scope.packageType == 1 ? '门店套餐' : '集团套餐' }}</span> <span>{{ scope.scope.packageType == 1 ? '门店套餐' : '集团套餐' }}</span>
</template> </template>
<template v-else> <template v-else>
<span>会员卡</span> <span>会员卡</span>
</template> </template>
</template> </div>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope"> <span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <el-button type="text" @click="handleDetail(scope.scope)" v-if="scope.scope.orderType == 1">详情</el-button> <!-- <GLButton @click="handleDetail(scope.scope)" fn="订单详情" type="text" v-if="scope.scope.orderType == 1">详情</GLButton>
<el-button type="text" style="color:#eee" v-else>详情</el-button> -->
<GLButton @click="handleDetail(scope.scope)" fn="订单详情" type="text" v-if="scope.scope.orderType == 1">详情</GLButton>
<GLButton style="color: #eee" fn="订单详情" type="text" v-else>详情</GLButton> <GLButton style="color: #eee" fn="订单详情" type="text" v-else>详情</GLButton>
<GLButton fn="退款" v-if="scope.scope.refundFlag == 1" type="text" @click="handleRefund(scope.scope)">退款</GLButton> <GLButton fn="退款" v-if="scope.scope.refundFlag == 1" type="text" @click="handleRefund(scope.scope)">退款</GLButton> -->
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</span> </span>
</GLTable> </GLTable>
</div> </div>
...@@ -90,11 +90,6 @@ export default { ...@@ -90,11 +90,6 @@ export default {
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店 accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
url: url, url: url,
isReload: true, isReload: true,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
},
size: 'small', size: 'small',
searchForm: { searchForm: {
orderStatus: '', //默认查询全部 orderStatus: '', //默认查询全部
...@@ -102,21 +97,82 @@ export default { ...@@ -102,21 +97,82 @@ export default {
// daterange:'' // daterange:''
orderType: '' orderType: ''
}, },
// 搜索
searchFormData: [
{
label: '订单编号',
name: 'orderCode',
type: 'input',
maxlength: 100
},
{
label: '名称',
name: 'packageName',
type: 'input',
maxlength: 100
},
{
label: '类型',
name: 'orderType',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'orderTypeList'
},
{
label: '用户信息',
name: 'userInfo',
type: 'input',
placeholder: '请输入用户名或手机号',
maxlength: 100
},
{
label: '下单时间',
name: 'daterange',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '开通门店',
name: 'merchantName',
type: 'input',
maxlength: 100
}
],
choseList: ['全部', '待收货', '已完成', '退款|售后'], choseList: ['全部', '待收货', '已完成', '退款|售后'],
currentIndex: 1, currentIndex: 1,
searchFormTable: {}, searchFormTable: {},
orderTypeList: [ // 表格按钮
tableButtonList: [
{ {
dictValue: '', type: 'GLButton',
dictLabel: '全部' name: '详情',
}, attrs: {
{ type: 'text',
dictValue: 1, fn: '订单详情',
dictLabel: '套餐' disabled: row => {
return row.orderType != 1
}
},
listeners: {
click: this.handleDetail
}
}, },
{ {
dictValue: 2, type: 'GLButton',
dictLabel: '会员卡' name: '退款',
attrs: {
type: 'text',
fn: '退款'
},
condition: row => {
return row.refundFlag == 1
},
listeners: {
click: this.handleRefund
}
} }
], ],
// 表格组件 // 表格组件
...@@ -137,7 +193,7 @@ export default { ...@@ -137,7 +193,7 @@ export default {
prop: 'orderType', prop: 'orderType',
addHtml: 'orderType' addHtml: 'orderType'
// formatter: cellValue => { // formatter: cellValue => {
// return this.baseDataList.orderTypesList.find(item => item.confId == cellValue.orderType).confName // return this.baseData.orderTypesList.find(item => item.confId == cellValue.orderType).confName
// } // }
}, },
{ {
...@@ -154,18 +210,18 @@ export default { ...@@ -154,18 +210,18 @@ export default {
prop: 'orderStatus', prop: 'orderStatus',
width: '80', width: '80',
formatter: cellValue => { formatter: cellValue => {
return this.baseDataList.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName return this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName
} }
}, },
{ {
label: '下单时间', label: '下单时间',
prop: 'createDate', prop: 'createDate',
width: 160 width: 200
}, },
{ {
label: '开通门店', label: '开通门店',
prop: 'merchantName', prop: 'merchantName',
width: '180' width: 220
}, },
{ {
label: '推荐人', label: '推荐人',
...@@ -178,6 +234,7 @@ export default { ...@@ -178,6 +234,7 @@ export default {
{ {
label: '用户信息', label: '用户信息',
prop: 'accountName', prop: 'accountName',
width: 220,
formatter: cellValue => { formatter: cellValue => {
return cellValue.accountName + ' ' + cellValue.mobile return cellValue.accountName + ' ' + cellValue.mobile
} }
...@@ -185,13 +242,23 @@ export default { ...@@ -185,13 +242,23 @@ export default {
{ {
label: '订单号', label: '订单号',
prop: 'orderCode', prop: 'orderCode',
width: 190 width: 200
} }
] ]
}, },
baseDataList: { baseData: {
orderTypesList: orderTypesList, orderTypesList: orderTypesList,
orderStatusList: orderStatusList orderStatusList: orderStatusList,
orderTypeList: [
{
dictValue: 1,
dictLabel: '套餐'
},
{
dictValue: 2,
dictLabel: '会员卡'
}
],
} }
} }
}, },
...@@ -205,8 +272,36 @@ export default { ...@@ -205,8 +272,36 @@ export default {
this.tableParams.tableColumns.splice(idx, 1) this.tableParams.tableColumns.splice(idx, 1)
} }
}, },
mounted() { }, mounted() {
this.getOptionsList('searchFormData')
},
methods: { methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
tabClick(index) { tabClick(index) {
this.currentIndex = index this.currentIndex = index
switch (index) { switch (index) {
...@@ -241,10 +336,8 @@ export default { ...@@ -241,10 +336,8 @@ export default {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) { if (params.daterange) {
params.startTime = this.searchForm.daterange[0] + ' 00:00:00' params.startTime = new Date(this.searchForm.daterange[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = this.searchForm.daterange[1] + ' 23:59:59' params.endTime = new Date(this.searchForm.daterange[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
} }
delete params.daterange delete params.daterange
return params return params
...@@ -311,9 +404,10 @@ export default { ...@@ -311,9 +404,10 @@ export default {
handleReset() { handleReset() {
this.isReload = false this.isReload = false
this.currentIndex = 1 this.currentIndex = 1
this.searchForm = {} this.searchForm = {
this.searchForm.orderStatus = '' //默认查询全部 orderStatus: '',
this.searchForm.orderType = '' orderType: ''
}
// this.handleSearch() // this.handleSearch()
this.$nextTick(() => { this.$nextTick(() => {
this.isReload = true this.isReload = true
...@@ -324,9 +418,9 @@ export default { ...@@ -324,9 +418,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-input--small .el-input__inner { // /deep/.el-input--small .el-input__inner {
width: 215px; // width: 215px;
} // }
.el-range-editor.is-active, .el-range-editor.is-active,
.el-range-editor.is-active:hover { .el-range-editor.is-active:hover {
border-color: #5850ff; border-color: #5850ff;
......
<template> <template>
<div class="marketing"> <div class="marketing">
<div class="btnWrap"> <div class="btnWrap">
<!-- <el-button :size="size" type="primary" @click="handleCreate" icon="el-icon-plus">创建套餐</el-button> -->
<GLButton type="primary" @click="handleCreate" size="small" icon="el-icon-plus" fn="创建套餐" mode="el-button">创建套餐</GLButton> <GLButton type="primary" @click="handleCreate" size="small" icon="el-icon-plus" fn="创建套餐" mode="el-button">创建套餐</GLButton>
<!-- <el-button :size="size" @click="showViewer = true">查看示例效果</el-button> --> <!-- <el-button :size="size" @click="showViewer = true">查看示例效果</el-button> -->
<el-image-viewer <el-image-viewer v-if="showViewer" :on-close="
v-if="showViewer"
:on-close="
() => { () => {
showViewer = false showViewer = false
} }
" " :url-list="srcList" style="padding:4%;" />
:url-list="srcList"
style="padding:4%;"
/>
</div> </div>
<tip-panel class="list-panel" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel> <tip-panel class="list-panel" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<template v-if="accountLevel == 4 && merchantModel == 1"> <template v-if="accountLevel == 4 && merchantModel == 1">
...@@ -36,30 +30,23 @@ ...@@ -36,30 +30,23 @@
<span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope"> <span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope">
<template v-if="!(accountLevel == 4 && activetab == 1)"> <template v-if="!(accountLevel == 4 && activetab == 1)">
<template v-if="scope.scope.state === 0"> <!-- <template v-if="scope.scope.state === 0">
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton> <GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton> <GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton> <GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template> </template>
<template v-else-if="scope.scope.state === 1"> <template v-else-if="scope.scope.state === 1">
<!-- <el-button type="text" @click="handleDownOption(scope.scope)">下架</el-button>
<el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button> -->
<GLButton type="text" @click="handleDownOption(scope.scope)" fn="下架">下架</GLButton> <GLButton type="text" @click="handleDownOption(scope.scope)" fn="下架">下架</GLButton>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton> <GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
</template> </template>
<template v-else> <template v-else>
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton> <GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton> <GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton> <GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template> </template>
<GLButton type="text" @click="handleUpdateToTop(scope.scope)" v-if="scope.scope.topFlag == 2 && accountLevel != 4" fn="置顶推荐">置顶推荐</GLButton> <GLButton type="text" @click="handleUpdateToTop(scope.scope)" v-if="scope.scope.topFlag == 2 && accountLevel != 4" fn="置顶推荐">置顶推荐</GLButton>
<el-button type="text" v-if="scope.scope.topFlag == 1 && accountLevel != 4">已置顶推荐</el-button> <el-button type="text" v-if="scope.scope.topFlag == 1 && accountLevel != 4">已置顶推荐</el-button> -->
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</template> </template>
</span> </span>
</GLTable> </GLTable>
...@@ -125,6 +112,86 @@ export default { ...@@ -125,6 +112,86 @@ export default {
} }
], ],
activetab: 0, activetab: 0,
// 表格按钮
tableButtonList: [
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑套餐'
},
listeners: {
click: this.handleEdit
}
},
{
type: 'GLButton',
name: '上架',
attrs: {
type: 'text',
fn: '上架'
},
condition: row => {
return row.state != 1
},
listeners: {
click: this.handleUpOption
}
},
{
type: 'GLButton',
name: '下架',
attrs: {
type: 'text',
fn: '下架'
},
condition: row => {
return row.state == 1
},
listeners: {
click: this.handleDownOption
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
condition: row => {
return row.state != 1
},
listeners: {
click: this.handleDelete
}
},
{
type: 'GLButton',
name: '置顶推荐',
attrs: {
type: 'text',
fn: '置顶推荐'
},
condition: row => {
return row.topFlag == 2 && this.accountLevel != 4
},
listeners: {
click: this.handleUpdateToTop
}
},
{
type: 'el-button',
name: '已置顶推荐',
attrs: {
type: 'text'
},
condition: row => {
return row.topFlag == 1 && this.accountLevel != 4
}
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -146,7 +213,8 @@ export default { ...@@ -146,7 +213,8 @@ export default {
}, },
{ {
label: '套餐售价/元', label: '套餐售价/元',
prop: 'packagePrice' prop: 'packagePrice',
width: 180
}, },
{ {
label: '说明', label: '说明',
...@@ -212,7 +280,7 @@ export default { ...@@ -212,7 +280,7 @@ export default {
this.dynamicFile() this.dynamicFile()
this.getLoginCountFun() this.getLoginCountFun()
}, },
mounted() {}, mounted() { },
methods: { methods: {
dynamicFile() { dynamicFile() {
let { activetab, accountLevel } = this let { activetab, accountLevel } = this
...@@ -333,7 +401,7 @@ export default { ...@@ -333,7 +401,7 @@ export default {
}) })
}, },
// 查看示例效果 // 查看示例效果
handleLook(row) {}, handleLook(row) { },
handleDelete(row) { handleDelete(row) {
this.$messageBox.confirm('是否删除该套餐?', '删除', { this.$messageBox.confirm('是否删除该套餐?', '删除', {
confirmButtonText: '确定', confirmButtonText: '确定',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!