Commit b9a7865d by chenwq

订单管理,数据看板

1 parent 67fa86e6
......@@ -3,33 +3,14 @@
<div class="data-board-box">
<p class="edit-title">数据看板</p>
<div class="p-20">
<GLCombiForm
ref="dataRef"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
></GLCombiForm>
<GLCombiForm ref="dataRef" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch"></GLCombiForm>
<div class="data-view">
<template v-for="(item,index) in dataList">
<div
:key="index"
class="item"
>
<div :key="index" class="item">
<div class="name">
{{item.name}}
<el-popover
class="tips"
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 class="tips" 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>
</div>
<div class="value">{{dataBoard[item.key] || 0}}</div>
......@@ -51,54 +32,17 @@
<div class="data-board-box">
<p class="edit-title">员工排行榜</p>
<div class="p-20">
<GLCombiForm
ref="rankRef"
:rowNumber="1"
:formObj="searchRankForm"
:formData="searchFormRankData"
@handleOk="handleSearchRank"
></GLCombiForm>
<GLCombiForm ref="rankRef" :rowNumber="1" :formObj="searchRankForm" :formData="searchFormRankData" @handleOk="handleSearchRank"></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
</div>
<GLTable
ref="dataTableRef"
: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"
>
<GLTable ref="dataTableRef" :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">
<el-popover
placement="top"
width="160"
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 placement="top" width="160" 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>
</template>
......@@ -133,12 +77,13 @@ const dataList = [
export default {
name: 'ScrmMicroMarketingDataBoard',
data () {
data() {
return {
url,
dataList,
searchForm: {
statDate: dayjs().format('YYYY-MM-DD')
statDate: dayjs().format('YYYY-MM-DD'),
shareName: ''
},
searchFormData: [
{
......@@ -162,6 +107,12 @@ export default {
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
},
{
label: '员工名称',
name: 'shareName',
type: 'input',
maxlength: 100
}
],
getListApi: this.$apis.seckillActivity.getRankListApi,
......@@ -209,11 +160,11 @@ export default {
dataBoard: {}
}
},
created () {
created() {
this.getDataBoardApi()
},
mounted () {
mounted() {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'),
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none'
......@@ -221,38 +172,38 @@ export default {
},
methods: {
getDataBoardApi () {
getDataBoardApi() {
let { activityId } = this.$route.query,
{ statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => {
this.dataBoard = res || {}
})
},
getParams () {
getParams() {
let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm))
params.activityId = activityId
return params
},
handleSearch () {
handleSearch() {
this.getDataBoardApi()
},
handleSearchRank () {
handleSearchRank() {
this.$refs.dataTableRef.refreshTable()
},
handleExport () {
handleExport() {
let params = this.getParams()
this.$apis.seckillActivity.exportRankListApi(params).then(res => {
exportFn(res)
})
},
beforeSearchFn () {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
setTableFinishFun () {
setTableFinishFun() {
//接收到的数据为空
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!