Commit b9a7865d by chenwq

订单管理,数据看板

1 parent 67fa86e6
...@@ -3,33 +3,14 @@ ...@@ -3,33 +3,14 @@
<div class="data-board-box"> <div class="data-board-box">
<p class="edit-title">数据看板</p> <p class="edit-title">数据看板</p>
<div class="p-20"> <div class="p-20">
<GLCombiForm <GLCombiForm ref="dataRef" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch"></GLCombiForm>
ref="dataRef"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
></GLCombiForm>
<div class="data-view"> <div class="data-view">
<template v-for="(item,index) in dataList"> <template v-for="(item,index) in dataList">
<div <div :key="index" class="item">
:key="index"
class="item"
>
<div class="name"> <div class="name">
{{item.name}} {{item.name}}
<el-popover <el-popover class="tips" placement="top" width="260" trigger="hover" :content="item.tips">
class="tips" <img slot="reference" class="tips-icon" src="@/components/glsx-combi-form/images/icon-tip.png" />
placement="top"
width="260"
trigger="hover"
:content="item.tips"
>
<img
slot="reference"
class="tips-icon"
src="@/components/glsx-combi-form/images/icon-tip.png"
/>
</el-popover> </el-popover>
</div> </div>
<div class="value">{{dataBoard[item.key] || 0}}</div> <div class="value">{{dataBoard[item.key] || 0}}</div>
...@@ -51,54 +32,17 @@ ...@@ -51,54 +32,17 @@
<div class="data-board-box"> <div class="data-board-box">
<p class="edit-title">员工排行榜</p> <p class="edit-title">员工排行榜</p>
<div class="p-20"> <div class="p-20">
<GLCombiForm <GLCombiForm ref="rankRef" :rowNumber="1" :formObj="searchRankForm" :formData="searchFormRankData" @handleOk="handleSearchRank"></GLCombiForm>
ref="rankRef"
:rowNumber="1"
:formObj="searchRankForm"
:formData="searchFormRankData"
@handleOk="handleSearchRank"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button <el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div> </div>
<GLTable <GLTable ref="dataTableRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" :hasNum="false">
ref="dataTableRef" <div slot="shareName" class="flex-align" slot-scope="scope">
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
:hasNum="false"
>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar"> <template v-if="scope.scope.shareAvatar">
<el-popover <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
placement="top" <img class="table-popover-img" :src="scope.scope.shareAvatar" />
width="160" <img class="img-36 pointer" slot="reference" :src="scope.scope.shareAvatar" />
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover> </el-popover>
</template> </template>
...@@ -133,12 +77,13 @@ const dataList = [ ...@@ -133,12 +77,13 @@ const dataList = [
export default { export default {
name: 'ScrmMicroMarketingDataBoard', name: 'ScrmMicroMarketingDataBoard',
data () { data() {
return { return {
url, url,
dataList, dataList,
searchForm: { searchForm: {
statDate: dayjs().format('YYYY-MM-DD') statDate: dayjs().format('YYYY-MM-DD'),
shareName: ''
}, },
searchFormData: [ searchFormData: [
{ {
...@@ -162,6 +107,12 @@ export default { ...@@ -162,6 +107,12 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'statusList' optionsName: 'statusList'
},
{
label: '员工名称',
name: 'shareName',
type: 'input',
maxlength: 100
} }
], ],
getListApi: this.$apis.seckillActivity.getRankListApi, getListApi: this.$apis.seckillActivity.getRankListApi,
...@@ -209,11 +160,11 @@ export default { ...@@ -209,11 +160,11 @@ export default {
dataBoard: {} dataBoard: {}
} }
}, },
created () { created() {
this.getDataBoardApi() this.getDataBoardApi()
}, },
mounted () { mounted() {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'), let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'),
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default') [rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none' if (dataResetBtn) dataResetBtn.style.display = 'none'
...@@ -221,38 +172,38 @@ export default { ...@@ -221,38 +172,38 @@ export default {
}, },
methods: { methods: {
getDataBoardApi () { getDataBoardApi() {
let { activityId } = this.$route.query, let { activityId } = this.$route.query,
{ statDate } = this.searchForm { statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => { this.$apis.seckillActivity.getDataBoardApi({ activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => {
this.dataBoard = res || {} this.dataBoard = res || {}
}) })
}, },
getParams () { getParams() {
let { activityId } = this.$route.query, let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm)) params = JSON.parse(JSON.stringify(this.searchRankForm))
params.activityId = activityId params.activityId = activityId
return params return params
}, },
handleSearch () { handleSearch() {
this.getDataBoardApi() this.getDataBoardApi()
}, },
handleSearchRank () { handleSearchRank() {
this.$refs.dataTableRef.refreshTable() this.$refs.dataTableRef.refreshTable()
}, },
handleExport () { handleExport() {
let params = this.getParams() let params = this.getParams()
this.$apis.seckillActivity.exportRankListApi(params).then(res => { this.$apis.seckillActivity.exportRankListApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
resolve() resolve()
}) })
}, },
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.dataTableRef.data.length ? (this.$refs.dataTableRef.tableHeightValues = '') : this.$refs.dataTableRef.setTableHeightFun() this.$refs.dataTableRef.data.length ? (this.$refs.dataTableRef.tableHeightValues = '') : this.$refs.dataTableRef.setTableHeightFun()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!