yumeng 1 tydzień temu
rodzic
commit
f4a9c968a2

+ 506 - 249
src/views/modules/stockWatch/modules/new-keepManage/group-keepManage.vue

@@ -12,10 +12,11 @@
                         <div class="content-title-acount"></div>
                         <div class="content-title-checkout">
                             <span class="title-checkout-select" style="margin-right: 10px">
-                                <a-select v-model="mediaId" style="width: 100px" @change="selectMediaIdChange">
-                                    <a-select-option value="1">头条</a-select-option>
-                                    <a-select-option value="2">快手</a-select-option>
-                                </a-select>
+                                <a-select v-model="mediaId" style="width: 100px" @change="selectMediaIdChange">
+                                    <a-select-option value="1">头条</a-select-option>
+                                    <a-select-option value="2">快手</a-select-option>
+                                    <a-select-option value="16">腾讯</a-select-option>
+                                </a-select>
                             </span>
                             <span class="title-checkout-select" style="margin-right: 10px">
                                 <a-select v-model="selectValue" style="width: 100px" @change="selectValueChange">
@@ -126,10 +127,11 @@
                                 <a-button @click="exportClick">导 出</a-button>
                             </span>
                             <span>
-                                <a-radio-group v-model="mediaIdDetail" @change="dateMiddleChange">
-                                    <a-radio-button value="2"> 快手 </a-radio-button>
-                                    <a-radio-button value="1"> 头条 </a-radio-button>
-                                </a-radio-group>
+                                <a-radio-group v-model="mediaIdDetail" @change="dateMiddleChange">
+                                    <a-radio-button value="2"> 快手 </a-radio-button>
+                                    <a-radio-button value="1"> 头条 </a-radio-button>
+                                    <a-radio-button value="16"> 腾讯 </a-radio-button>
+                                </a-radio-group>
                             </span>
                         </div>
                     </div>
@@ -182,10 +184,11 @@
                                 <a-button @click="exportClickGroup">导 出</a-button>
                             </span>
                             <span>
-                                <a-radio-group v-model="mediaIdGroup" @change="changeGetGroupList">
-                                    <a-radio-button value="2"> 快手 </a-radio-button>
-                                    <a-radio-button value="1"> 头条 </a-radio-button>
-                                </a-radio-group>
+                                <a-radio-group v-model="mediaIdGroup" @change="changeGetGroupList">
+                                    <a-radio-button value="2"> 快手 </a-radio-button>
+                                    <a-radio-button value="1"> 头条 </a-radio-button>
+                                    <a-radio-button value="16"> 腾讯 </a-radio-button>
+                                </a-radio-group>
                             </span>
                         </div>
                     </div>
@@ -229,12 +232,9 @@
                             > -->
                         </div>
                         <div class="content-title-checkout">
-                            <!-- <span style="margin-right: 20px">
-                                <a-button type="link" @click="customColumn"> 自定义列 </a-button>
-                            </span> -->
-                            <span style="margin-right: 15px">
-                                <a-range-picker
-                                    v-model="dateMiddleProject"
+                            <span style="margin-right: 15px">
+                                <a-range-picker
+                                    v-model="dateMiddleProject"
                                     :ranges="dateRanges"
                                     @change="dateMiddleProjectChange"
                                 />
@@ -243,10 +243,11 @@
                                 导 出
                             </a-button>
                             <span>
-                                <a-radio-group v-model="mediaIdAccount" @change="projectAccountChange">
-                                    <a-radio-button value="2"> 快手 </a-radio-button>
-                                    <a-radio-button value="1"> 头条 </a-radio-button>
-                                </a-radio-group>
+                                <a-radio-group v-model="mediaIdAccount" @change="projectAccountChange">
+                                    <a-radio-button value="2"> 快手 </a-radio-button>
+                                    <a-radio-button value="1"> 头条 </a-radio-button>
+                                    <a-radio-button value="16"> 腾讯 </a-radio-button>
+                                </a-radio-group>
                             </span>
                         </div>
                     </div>
@@ -261,11 +262,11 @@
                         @change="sort"
                         ref="accountTable"
                         :scroll="{ x: scrollX }"
-                    >
-
-
-                        <span slot="yearOnYear" slot-scope="text, records">
-                            {{ text }}
+                    >
+
+
+                        <span slot="yearOnYear" slot-scope="text, records">
+                            {{ text }}
                             <a-icon v-if="text && parseFloat(text) > 0" type="caret-up" style="color: #f00" />
                             <a-icon v-else type="caret-down" style="color: green" />
                         </span>
@@ -340,35 +341,27 @@
                                     : '-'
                             }}
                         </div>
-                        <div slot="inventory" slot-scope="text,record">
-                            <div v-if="text">
-                                <p v-for="(item, index) in text.split(',')" :key="index" style="margin-bottom:0">
-                                    {{ item }}
-                                </p>
-                            </div>
-                            <div v-else>-</div>
-                        </div>
-                    </a-table>
+                        <div slot="inventory" slot-scope="text,record">
+                            <div v-if="text">
+                                <p v-for="(item, index) in text.split(',')" :key="index" style="margin-bottom:0">
+                                    {{ item }}
+                                </p>
+                            </div>
+                            <div v-else>-</div>
+                        </div>
+                        <a slot="accountName" slot-scope="text,record" @click="accountNameClick(record)">{{ text }}</a>
+                        <span slot="accountId" slot-scope="text">{{ text }}</span>
+                    </a-table>
                 </a-card>
             </a-col>
         </a-row>
-
-        <customColumnProject
-            :visible="visible"
-            :listNum="listNum"
-            :fiexColumn="columnsFixd"
-            :mediaType="2"
-            @closeCustomColumn="closeCustomColumn"
-            @changeColumn="changeColumn"
-        />
-    </div>
-</template>
-
-<script>
-import customColumnProject from './customColumnProject.vue'
-import keepPersonData from './new-keep-data.js'
-import moment from 'moment'
-import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
+    </div>
+</template>
+
+<script>
+import keepPersonData from './new-keep-data.js'
+import moment from 'moment'
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
 // 引入基本模板
 var echarts = require('echarts')
 // 引入折线图组件
@@ -380,9 +373,8 @@ require('echarts/lib/component/graphic')
 require('echarts/lib/component/toolbox')
 require('echarts/lib/component/legend')
 import { mapGetters } from 'vuex'
-export default {
-    components: { customColumnProject },
-    data() {
+export default {
+    data() {
         return {
             spinning: false,
             spinningGroup: false,
@@ -446,7 +438,7 @@ export default {
                     this.echartsIpaginationProject.pageSize = pageSize
                 },
             },
-            columnsprojectoperate: [
+            columnsprojectoperateDefault: [
                 {
                     title: '运营人员',
                     align: 'center',
@@ -491,8 +483,39 @@ export default {
                     sorter: (a, b) => a.newUnitNum - b.newUnitNum,
                     scopedSlots: { customRender: 'newUnitNum' },
                 },
-            ],
-            groupList: [],
+            ],
+            columnsprojectoperateTencent: [
+                {
+                    title: '运营人员',
+                    align: 'center',
+                    dataIndex: 'userName',
+                    scopedSlots: { customRender: 'userName' },
+                },
+                {
+                    title: '项目数量',
+                    align: 'center',
+                    dataIndex: 'projectNum',
+                },
+                {
+                    title: '账户数量',
+                    align: 'center',
+                    dataIndex: 'accountNum',
+                },
+                {
+                    title: '花费',
+                    align: 'center',
+                    dataIndex: 'totalCost',
+                    sorter: true,
+                    sorter: (a, b) => a.totalCost - b.totalCost,
+                },
+                {
+                    title: '花费环比',
+                    align: 'center',
+                    dataIndex: 'rate',
+                },
+            ],
+            columnsprojectoperate: [],
+            groupList: [],
             groupLoading: false,
             groupIpagination: {
                 current: 1,
@@ -513,7 +536,7 @@ export default {
                     this.getGroupList()
                 },
             },
-            columnGroup: [
+            columnGroupDefault: [
                 {
                     title: '运营经理',
                     align: 'center',
@@ -571,8 +594,62 @@ export default {
                     dataIndex: 'unitNum',
                     scopedSlots: { customRender: 'unitNum' },
                 },
-            ],
-            columnsProject: keepPersonData.setNoDeleteColumns(),
+            ],
+            columnGroupTencent: [
+                {
+                    title: '运营经理',
+                    align: 'center',
+                    dataIndex: 'realname',
+                    scopedSlots: { customRender: 'realname' },
+                },
+                {
+                    title: '运营数量',
+                    align: 'center',
+                    dataIndex: 'operationNum',
+                },
+                {
+                    title: '日均消耗',
+                    align: 'center',
+                    dataIndex: 'averageDayCost',
+                },
+                {
+                    title: '人均消耗',
+                    align: 'center',
+                    dataIndex: 'averagePeopleCost',
+                },
+                {
+                    title: '花费',
+                    align: 'center',
+                    dataIndex: 'totalCost',
+                    sorter: true,
+                    sorter: (a, b) => a.totalCost - b.totalCost,
+                },
+                {
+                    title: '花费环比',
+                    align: 'center',
+                    dataIndex: 'yearOnYearCost',
+                },
+                {
+                    title: '项目数',
+                    align: 'center',
+                    dataIndex: 'projectNum',
+                    scopedSlots: { customRender: 'projectNum' },
+                },
+                {
+                    title: '账户数',
+                    align: 'center',
+                    dataIndex: 'accountNum',
+                    scopedSlots: { customRender: 'accountNum' },
+                },
+                {
+                    title: '平均账户消耗',
+                    align: 'center',
+                    dataIndex: 'averageAccountCost',
+                    scopedSlots: { customRender: 'averageAccountCost' },
+                },
+            ],
+            columnGroup: [],
+            columnsProject: keepPersonData.setNoDeleteColumns(),
             echartsData: [],
             timeData: [],
             lengthData: [],
@@ -643,10 +720,191 @@ export default {
             this.clientWidth = document.documentElement.clientWidth - 224
         })
     },
-    methods: {
-        ...mapGetters(['userInfo']),
-        exportExcel(exportType) {
-            this.visibleLoading = true
+    methods: {
+        ...mapGetters(['userInfo']),
+        isTencentMedia(mediaId) {
+            return String(mediaId) === '16'
+        },
+        getExportColumns(columns) {
+            return (columns || []).filter((item) => item && item.dataIndex)
+        },
+        formatExportValue(value) {
+            if (value === null || value === undefined) {
+                return ''
+            }
+            if (Array.isArray(value)) {
+                return value.map((item) => this.formatExportValue(item)).join(' / ')
+            }
+            if (typeof value === 'object') {
+                return JSON.stringify(value)
+            }
+            return String(value)
+        },
+        hasValue(value) {
+            return value !== undefined && value !== null && value !== ''
+        },
+        buildOperatePersonalSeries(result) {
+            return (result || []).map((item) => {
+                return {
+                    name: item.userName,
+                    type: 'line',
+                    smooth: true,
+                    symbol: 'circle',
+                    data: (item.data || []).map((i) => {
+                        return i.totalCost
+                    }),
+                }
+            })
+        },
+        getOperatePersonalXAxis(result) {
+            const firstRow = (result || [])[0]
+            const firstData = firstRow && firstRow.data ? firstRow.data : []
+            return firstData.map((element) => {
+                if (element.hour) {
+                    return element.hour
+                }
+                return element.dateTime
+            })
+        },
+        renderOperatePersonalChart(result) {
+            this.lengthData = (result || []).map((i) => {
+                return i.userName
+            })
+            this.timeData = this.getOperatePersonalXAxis(result)
+            const series = this.buildOperatePersonalSeries(result)
+            this.initEchart('acctowecharts', this.acctowecharts(this.lengthData, this.timeData, series))
+        },
+        downloadCsv(filename, columns, rows) {
+            const exportColumns = this.getExportColumns(columns)
+            const header = exportColumns.map((item) => `"${String(item.title || '').replace(/"/g, '""')}"`).join(',')
+            const body = (rows || [])
+                .map((row) => {
+                    return exportColumns
+                        .map((column) => {
+                            const rawValue = row[column.dataIndex]
+                            const value = this.formatExportValue(rawValue).replace(/"/g, '""')
+                            return `"${value}"`
+                        })
+                        .join(',')
+                })
+                .join('\n')
+            const content = '\ufeff' + header + '\n' + body
+            const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' })
+            const link = document.createElement('a')
+            const href = window.URL.createObjectURL(blob)
+            link.href = href
+            link.download = filename
+            document.body.appendChild(link)
+            link.click()
+            document.body.removeChild(link)
+            window.URL.revokeObjectURL(href)
+        },
+        async exportTencentOperateDetails() {
+            const params = {
+                startTime: this.dateMiddle[0].format('YYYY-MM-DD'),
+                endTime: this.dateMiddle[1].format('YYYY-MM-DD'),
+                userId: this.userInfo().id,
+                pageNum: 1,
+                pageSize: 10000,
+                mediaType: this.mediaIdDetail,
+            }
+            const res = await this.getAction(
+                process.env.VUE_APP_BASE_STARE_URL +
+                    '/kuaiShouOpreate/kuaiShouMaterialStareController/getKuaiShouOperateInfo',
+                params
+            )
+            if (res.code == 0) {
+                this.downloadCsv(
+                    `腾讯运营数据详情_${params.startTime}_${params.endTime}.csv`,
+                    this.columnsprojectoperateTencent,
+                    res.result.list || []
+                )
+            }
+        },
+        async exportTencentGroupList() {
+            const params = {
+                startTime: this.dateMiddleGroup[0].format('YYYY-MM-DD'),
+                endTime: this.dateMiddleGroup[1].format('YYYY-MM-DD'),
+                userId: this.userInfo().id,
+                pageNum: 1,
+                pageSize: 10000,
+                mediaType: this.mediaIdGroup,
+            }
+            const res = await this.getAction(
+                process.env.VUE_APP_BASE_STARE_URL +
+                    '/kuaiShouOpreate/kuaiShouMaterialStareController/getOperationGroupData',
+                params
+            )
+            if (res.code == 0) {
+                this.downloadCsv(
+                    `腾讯运营组数据_${params.startTime}_${params.endTime}.csv`,
+                    this.columnGroupTencent,
+                    res.result.list || []
+                )
+            }
+        },
+        async exportTencentProjectList() {
+            let rows = []
+            let columns = this.columnsProject
+            if (this.projectAccount === 'b') {
+                const params = {
+                    startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
+                    endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
+                    userId: this.userInfo().id,
+                    mediaType: this.mediaIdAccount,
+                    pageNum: 1,
+                    pageSize: 10000,
+                    projectId: this.projectId,
+                }
+                const res = await this.getAction(
+                    process.env.VUE_APP_BASE_STARE_URL +
+                        '/kuaiShouOpreate/kuaiShouMaterialStareController/getKuaiShouOperateAccountInfo',
+                    params
+                )
+                if (res.code == 0) {
+                    rows = res.result.list || []
+                    columns = keepPersonData.setNoDeleteProjectColumns()
+                }
+            } else {
+                const params = {
+                    mediaId: '16',
+                    startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
+                    endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
+                    userId: this.userInfo().id,
+                    pageNo: 1,
+                    pageSize: 10000,
+                    sortCode: 'cost',
+                    order: 'DESC',
+                }
+                const res = await this.getAction(
+                    process.env.VUE_APP_BASE_STARE_URL + '/summary/report/getProjectReport',
+                    params
+                )
+                if (res.success) {
+                    rows = (res.result.list || []).map((item) => ({
+                        ...item,
+                        totalCost: item.cost,
+                        yearOnYear: item.rio,
+                        equallyRate: '-',
+                        userNum: item.operaterNum,
+                    }))
+                    columns = keepPersonData.setNoTencentDeleteColumns()
+                }
+            }
+            this.downloadCsv(
+                `腾讯${this.projectAccount === 'b' ? '账户列表' : '项目列表'}_${this.dateMiddleProject[0].format(
+                    'YYYY-MM-DD'
+                )}_${this.dateMiddleProject[1].format('YYYY-MM-DD')}.csv`,
+                columns,
+                rows
+            )
+        },
+        exportExcel(exportType) {
+            if (this.isTencentMedia(this.mediaIdAccount)) {
+                this.exportTencentProjectList()
+                return
+            }
+            this.visibleLoading = true
 
             var getUrl = ''
             var params = {}
@@ -688,11 +946,46 @@ export default {
             })
         },
         // 项目列表
-        getItemList() {
-            this.echartsLoading = true
-            let params = {
-                startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
-                endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
+        getItemList() {
+            this.echartsLoading = true
+            if (this.mediaIdAccount == '16') {
+                const params = {
+                    mediaId: '16',
+                    startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
+                    endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
+                    userId: this.userInfo().id,
+                    pageNo: this.echartsIpaginationProject.current,
+                    pageSize: this.echartsIpaginationProject.pageSize,
+                    sortCode: 'cost',
+                    order: 'DESC',
+                }
+                this.getAction(process.env.VUE_APP_BASE_STARE_URL + '/summary/report/getProjectReport', params)
+                    .then((res) => {
+                        this.echartsLoading = false
+                        if (res.success) {
+                            this.echartsDataProject = (res.result.list || []).map((item) => ({
+                                ...item,
+                                totalCost: item.cost,
+                                yearOnYear: item.rio,
+                                equallyRate: '-',
+                                userNum: item.operaterNum,
+                            }))
+                            this.echartsIpaginationProject.total = res.result.total
+                        } else {
+                            this.echartsDataProject = []
+                            this.echartsIpaginationProject.total = 0
+                        }
+                    })
+                    .catch(() => {
+                        this.echartsLoading = false
+                        this.echartsDataProject = []
+                        this.echartsIpaginationProject.total = 0
+                    })
+                return
+            }
+            let params = {
+                startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
+                endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
                 userId: this.userInfo().id,
                 mediaType: this.mediaIdAccount,
                 pageNum: this.echartsIpaginationProject.current,
@@ -735,11 +1028,34 @@ export default {
             //     this.getAccountData()
             // }
         },
-        getAccountData() {
-            this.echartsLoading = true
-            let params = {
-                startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
-                endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
+        getAccountData() {
+            this.echartsLoading = true
+            if (this.mediaIdAccount == '16') {
+                let params = {
+                    startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
+                    endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
+                    userId: this.userInfo().id,
+                    mediaType: this.mediaIdAccount,
+                    pageNum: this.echartsIpaginationProject.current,
+                    pageSize: this.echartsIpaginationProject.pageSize,
+                    projectId: this.projectId,
+                }
+                this.getAction(
+                    process.env.VUE_APP_BASE_STARE_URL +
+                        '/kuaiShouOpreate/kuaiShouMaterialStareController/getKuaiShouOperateAccountInfo',
+                    params
+                ).then((res) => {
+                    this.echartsLoading = false
+                    if (res.code == 0) {
+                        this.echartsDataProject = res.result.list
+                        this.echartsIpaginationProject.total = res.result.total
+                    }
+                })
+                return
+            }
+            let params = {
+                startTime: this.dateMiddleProject[0].format('YYYY-MM-DD'),
+                endTime: this.dateMiddleProject[1].format('YYYY-MM-DD'),
                 userId: this.userInfo().id,
                 mediaType: this.mediaIdAccount,
                 pageNum: this.echartsIpaginationProject.current,
@@ -775,15 +1091,18 @@ export default {
             this.groupIpagination.current = 1
             this.getGroupList()
         },
-        projectAccountChange(ent) {
-            if (this.mediaIdAccount == 2) {
-                this.scrollX = 1500
-                this.columnsProject = keepPersonData.setNoDeleteColumns()
-            } else {
-                this.scrollX = 0
-                this.columnsProject = keepPersonData.setNoTtDeleteColumns()
-            }
-            this.echartsIpaginationProject.current = 1
+        projectAccountChange(ent) {
+            if (this.mediaIdAccount == 2 || this.mediaIdAccount == '2') {
+                this.scrollX = 1500
+                this.columnsProject = keepPersonData.setNoDeleteColumns()
+            } else if (this.mediaIdAccount == 16 || this.mediaIdAccount == '16') {
+                this.scrollX = 0
+                this.columnsProject = keepPersonData.setNoTencentDeleteColumns()
+            } else {
+                this.scrollX = 0
+                this.columnsProject = keepPersonData.setNoTtDeleteColumns()
+            }
+            this.echartsIpaginationProject.current = 1
             this.getItemList()
             // this.echartsLoading = true
             // if (ent.target.value == 'a') {
@@ -816,12 +1135,11 @@ export default {
             sessionStorage.setItem('personalUserId', row.userId)
             this.$router.push({ path: '/modules/stockWatch/modules/new-keepManage/personal-keepManage' })
         },
-        // 运营组数据
-        getOperationGroupData() {
-            this.cancel()
-            this.spinningGroup = true
-            let params = {
-                startTime: this.dateEchart[0].format('YYYY-MM-DD'),
+        // 运营组数据
+        getOperationGroupData() {
+            this.spinningGroup = true
+            let params = {
+                startTime: this.dateEchart[0].format('YYYY-MM-DD'),
                 endTime: this.dateEchart[1].format('YYYY-MM-DD'),
                 mediaType: this.mediaId,
                 userId: this.userInfo().id,
@@ -830,44 +1148,46 @@ export default {
                 process.env.VUE_APP_BASE_STARE_URL +
                     '/kuaiShouOpreate/kuaiShouMaterialStareController/kuaiShouOperateDateTotal',
                 params
-            ).then((res) => {
-                this.spinningGroup = false
-                if (res.code == 0) {
-                    if (res.result.todayCost) {
-                        this.todayCost = res.result.todayCost
-                    } else {
-                        this.todayCost = '暂无数据'
-                    }
-
-                    this.compare = res.result.compare
-                    if (res.result.sectionCost) {
-                        this.sectionCost = res.result.sectionCost
-                    } else {
-                        this.sectionCost = '暂无数据'
-                    }
-                    if (res.result.userAverageAccount) {
-                        this.userAverageAccount = res.result.userAverageAccount
-                    } else {
-                        this.userAverageAccount = '暂无数据'
-                    }
-                    if (res.result.userAveragecost) {
-                        this.userAveragecost = res.result.userAveragecost
-                    } else {
-                        this.userAveragecost = '暂无数据'
-                    }
-                    if (res.result.projectNum) {
-                        this.projectNum = res.result.projectNum
-                    } else {
-                        this.projectNum = '暂无数据'
-                    }
-                }
+            ).then((res) => {
+                this.spinningGroup = false
+                if (res.code == 0) {
+                    if (this.hasValue(res.result.todayCost)) {
+                        this.todayCost = res.result.todayCost
+                    } else {
+                        this.todayCost = '暂无数据'
+                    }
+
+                    this.compare = res.result.compare
+                    if (this.hasValue(res.result.sectionCost)) {
+                        this.sectionCost = res.result.sectionCost
+                    } else {
+                        this.sectionCost = '暂无数据'
+                    }
+                    if (this.hasValue(res.result.userAverageAccount)) {
+                        this.userAverageAccount = res.result.userAverageAccount
+                    } else {
+                        this.userAverageAccount = '暂无数据'
+                    }
+                    if (this.hasValue(res.result.userAveragecost)) {
+                        this.userAveragecost = res.result.userAveragecost
+                    } else {
+                        this.userAveragecost = '暂无数据'
+                    }
+                    if (this.hasValue(res.result.projectNum)) {
+                        this.projectNum = res.result.projectNum
+                    } else {
+                        this.projectNum = '暂无数据'
+                    }
+                }
             })
         },
         // 运营数据详情
-        getOperateDetails() {
-            let params = {
-                startTime: this.dateMiddle[0].format('YYYY-MM-DD'),
-                endTime: this.dateMiddle[1].format('YYYY-MM-DD'),
+        getOperateDetails() {
+            this.columnsprojectoperate =
+                this.mediaIdDetail == '16' ? this.columnsprojectoperateTencent : this.columnsprojectoperateDefault
+            let params = {
+                startTime: this.dateMiddle[0].format('YYYY-MM-DD'),
+                endTime: this.dateMiddle[1].format('YYYY-MM-DD'),
                 userId: this.userInfo().id,
                 pageNum: this.echartsIpagination.current,
                 pageSize: this.echartsIpagination.pageSize,
@@ -887,12 +1207,13 @@ export default {
         },
 
         // 运营组数据
-        getGroupList() {
-            this.groupLoading = true
-            this.groupList = []
-            let params = {
-                startTime: this.dateMiddleGroup[0].format('YYYY-MM-DD'),
-                endTime: this.dateMiddleGroup[1].format('YYYY-MM-DD'),
+        getGroupList() {
+            this.groupLoading = true
+            this.groupList = []
+            this.columnGroup = this.mediaIdGroup == '16' ? this.columnGroupTencent : this.columnGroupDefault
+            let params = {
+                startTime: this.dateMiddleGroup[0].format('YYYY-MM-DD'),
+                endTime: this.dateMiddleGroup[1].format('YYYY-MM-DD'),
                 mediaType: this.mediaIdGroup,
                 userId: this.userInfo().id,
                 pageNum: this.groupIpagination.current,
@@ -933,8 +1254,12 @@ export default {
             this.getGroupList()
         },
         // 导出
-        exportClick() {
-            let params = {
+        exportClick() {
+            if (this.isTencentMedia(this.mediaIdDetail)) {
+                this.exportTencentOperateDetails()
+                return
+            }
+            let params = {
                 startTime: this.dateMiddle[0].format('YYYY-MM-DD'),
                 endTime: this.dateMiddle[1].format('YYYY-MM-DD'),
                 userId: this.userInfo().id,
@@ -948,8 +1273,12 @@ export default {
                 params.startTime
             }&endTime=${params.endTime}&userId=${params.userId}&pageNum=${params.pageNum}&pageSize=${params.pageSize}&mediaType=${params.mediaType}`
         },
-        exportClickGroup() {
-            let params = {
+        exportClickGroup() {
+            if (this.isTencentMedia(this.mediaIdGroup)) {
+                this.exportTencentGroupList()
+                return
+            }
+            let params = {
                 startTime: this.dateMiddleGroup[0].format('YYYY-MM-DD'),
                 endTime: this.dateMiddleGroup[1].format('YYYY-MM-DD'),
                 userId: this.userInfo().id,
@@ -965,23 +1294,41 @@ export default {
                 params.pageSize
             }&mediaType=${params.mediaType}`
         },
-        getQueryNewlyData() {
-            this.spinning = true
-            let params = {
+        getQueryNewlyData() {
+            this.spinning = true
+            let params = {
                 startTime: this.dateEchart[0].format('YYYY-MM-DD'),
                 endTime: this.dateEchart[1].format('YYYY-MM-DD'),
                 mediaType: this.mediaId,
                 type: this.selectValue,
                 userId: this.userInfo().id,
             }
-            this.getAction(
-                process.env.VUE_APP_BASE_STARE_URL + '/kuaiShouOpreate/kuaiShouMaterialStareController/kuaiShousumData',
-                params
-            ).then((res) => {
-                this.spinning = false
-                if (res.code == 0) {
-                    this.updateAccountEchart = res.timestamp
-                    if (this.selectValue == '1') {
+            this.getAction(
+                process.env.VUE_APP_BASE_STARE_URL + '/kuaiShouOpreate/kuaiShouMaterialStareController/kuaiShousumData',
+                params
+            ).then((res) => {
+                this.spinning = false
+                if (res.code == 0) {
+                    this.updateAccountEchart = res.timestamp
+                    if (this.mediaId == '16' && this.selectValue == '1') {
+                        this.todayList = (res.result.todayList || []).map((item) => item.totalCost)
+                        this.yesterdayList = (res.result.yesterdayList || []).map((item) => item.totalCost)
+                        this.timeData = (res.result.todayList || res.result.yesterdayList || []).map((item) => item.hour)
+                        this.lengthData = ['今天', '昨天']
+                        this.initEchart(
+                            'accountIndexEchart',
+                            this.initAccountIndexEchart(
+                                this.todayList,
+                                this.yesterdayList,
+                                [],
+                                this.timeData,
+                                this.lengthData,
+                                this.yestadyNum
+                            )
+                        )
+                        return
+                    }
+                    if (this.selectValue == '1') {
                         this.todayList = res.result.todayList.map((item) => {
                             return item.totalCost
                         })
@@ -1041,108 +1388,18 @@ export default {
                                 this.yestadyNum
                             )
                         )
-                    } else if (this.selectValue == '2') {
-                        this.lengthData = res.result.map((i) => {
-                            return i.userName
-                        })
-                        this.timeData = [
-                            '0:00',
-                            '2:00',
-                            '4:00',
-                            '6:00',
-                            '8:00',
-                            '10:00',
-                            '12:00',
-                            '14:00',
-                            '16:00',
-                            '18:00',
-                            '20:00',
-                            '22:00',
-                        ]
-                        let series = []
-                        let array = []
-                        this.timeData = res.result[0].data.map((element) => {
-                            if (element.hour) {
-                                return element.hour
-                            } else {
-                                return element.dateTime
-                            }
-                        })
-                        console.log(this.timeData)
-                        series = res.result.map((item) => {
-                            return {
-                                name: item.userName,
-                                type: 'line',
-                                smooth: true,
-                                symbol: 'circle',
-                                data: item.data.map((i) => {
-                                    return i.totalCost
-                                }),
-                            }
-                        })
-                        this.initEchart('acctowecharts', this.acctowecharts(this.lengthData, this.timeData, series))
-                    } else {
-                        this.lengthData = res.result.map((i) => {
-                            return i.userName
-                        })
-                        res.result.map((o) => {
-                            this.timeData = o.data.map((tt) => {
-                                return tt.dateTime
-                            })
-                        })
-                        console.log(this.timeData)
-                        let series = []
-                        let array = []
-                        series = res.result.map((item) => {
-                            return {
-                                name: item.userName,
-                                type: 'line',
-                                smooth: true,
-                                symbol: 'circle',
-                                data: item.data.map((i) => {
-                                    return i.totalCost
-                                }),
-                            }
-                        })
-                        // res.result.forEach(element => {
-                        //     element.data.forEach(item => {
-
-                        //         array.push(item.totalCost)
-                        //         series.push({
-                        //             name: element.userName,
-                        //             type: 'line',
-                        //             smooth: true,
-                        //             symbol: 'circle',
-                        //             data: array,
-                        //             lineStyle: {
-                        //             color: '#00BFFF',
-                        //             width: 2,
-                        //             },
-                        //             itemStyle:{
-                        //             color:'#00BFFF',
-                        //             borderWidth:2,
-                        //             borderColor:'#00BFFF'
-                        //             },
-                        //         })
-                        //     });
-                        // });
-
-                        //     for(var i=0; i<series.length; i++){
-                        //     for(var j=i+1; j<series.length; j++){
-                        //         if(series[i].name==series[j].name){         //第一个等同于第二个,splice方法删除第二个
-                        //             series.splice(j,1);
-                        //             j--;
-                        //         }
-                        //     }
-                        // }
-                        this.initEchart('acctowecharts', this.acctowecharts(this.lengthData, this.timeData, series))
-                    }
-                }
-            })
-        },
-        selectMediaIdChange() {
-            this.dateEchartChange()
-        },
+                    } else if (this.selectValue == '2') {
+                        this.renderOperatePersonalChart(res.result || [])
+                    } else {
+                        this.renderOperatePersonalChart(res.result || [])
+                    }
+                }
+            })
+        },
+        selectMediaIdChange() {
+            this.spinning = true
+            this.dateEchartChange()
+        },
         selectValueChange() {
             if (this.selectValue == 1) {
                 this.yestadyNum = 1

+ 43 - 14
src/views/modules/stockWatch/modules/new-keepManage/new-keep-data.js

@@ -227,6 +227,49 @@ class keepPersonServer {
         ]
     }
 
+    setNoTencentDeleteColumns() {
+        return [
+            {
+                title: '项目名称',
+                dataIndex: 'projectName',
+                scopedSlots: { customRender: 'projectName' },
+                align: 'center',
+                key: 'date',
+            },
+            {
+                title: '账户数量',
+                dataIndex: 'accountNum',
+                align: 'center',
+            },
+            {
+                title: '运营人员',
+                dataIndex: 'userNum',
+                scopedSlots: { customRender: 'userNum' },
+                align: 'center',
+            },
+            {
+                title: '消耗(元)',
+                dataIndex: 'totalCost',
+                align: 'center',
+                sorter: (a, b) => a.totalCost - b.totalCost,
+            },
+            {
+                title: '花费环比',
+                dataIndex: 'yearOnYear',
+                tip: '',
+                align: 'center',
+                scopedSlots: { customRender: 'yearOnYear' },
+            },
+            {
+                title: '花费同比',
+                dataIndex: 'equallyRate',
+                tip: '',
+                align: 'center',
+                scopedSlots: { customRender: 'equallyRate' },
+            },
+        ]
+    }
+
     setNoDeleteProjectColumns() {
         return [
             {
@@ -281,20 +324,6 @@ class keepPersonServer {
                 align: 'center',
                 width: 100,
                 fixed: 'left',
-            }, {
-                title: '预算',
-                dataIndex: 'warningAmount',
-                scopedSlots: { customRender: 'warningAmount' },
-                align: 'center',
-                width: 100,
-                fixed: 'left',
-            }, {
-                title: '余额',
-                dataIndex: 'balance',
-                scopedSlots: { customRender: 'balance' },
-                align: 'center',
-                width: 100,
-                fixed: 'left',
             },
             {
                 title: '运营人员',

+ 7 - 174
src/views/modules/stockWatch/modules/new-keepManage/personal-keepManage.vue

@@ -123,11 +123,6 @@
                         <div class="content-title-acount"></div>
                         <div class="content-title-checkout">
                             <span style="margin-right: 20px;">
-                                <a-button type="link" @click="customColumn">
-                                    自定义列
-                                  </a-button>
-                            </span>
-                            <span style="margin-right: 20px;">
                                 <a-range-picker
                                     v-model="dateMiddleProject"
                                     :ranges="dateRanges"
@@ -162,26 +157,18 @@
                         <span slot="leave" slot-scope="leave">{{ leave | removalPercentage }}</span>
                         <a slot="projectName" slot-scope="text,record" @click="projectNameClick(record)">{{ text }}</a>
                         <a slot="accountName" slot-scope="text,record" @click="accountNameClick(record)">{{ text }}</a>
+                        <span slot="accountId" slot-scope="text">{{ text }}</span>
                     </a-table>
 
                 </a-card>
             </a-col>
         </a-row>
-        <customColumnProject
-            :visible="visible"
-            :listNum="listNum"
-            :fiexColumn="columnsFixd"
-            :mediaType="2"
-            @closeCustomColumn="closeCustomColumn"
-            @changeColumn="changeColumn"
-        />
     </div>
 </template>
 
 
 <script>
 import keepPersonData from './new-keep-data.js';
-import customColumnProject from './customColumnProject.vue'
 import moment from 'moment';
 // 引入基本模板
 var echarts = require('echarts');
@@ -196,17 +183,13 @@ require('echarts/lib/component/legend');
 import {mapGetters} from 'vuex'
 
 export default {
-    components: {customColumnProject},
     data() {
         return {
-            visible: false,
             updateAccountEchart: '2021-12-22 8:00:00',
             dateEchart: [moment(), moment()],
             scrollX: 1500,
             dateRanges: keepPersonData.setTimeRange(),
             personData: 0,
-            columnsFixd: keepPersonData.setNoDeleteColumns(),
-            listNum: [],
             dateMiddleProject: [moment(), moment()],
             echartsDataProject: [],
             queryUserId: '',
@@ -261,7 +244,7 @@ export default {
                 }, {
                     title: '花费环比',
                     align: "center",
-                    dataIndex: 'rate'
+                    dataIndex: 'yearOnYear'
                 }, {
                     title: '花费同比',
                     align: "center",
@@ -286,18 +269,6 @@ export default {
                     title: '爆款素材数',
                     align: "center",
                     dataIndex: 'newHotNum'
-                }, {
-                    title: '激活数',
-                    align: "center",
-                    dataIndex: 'activation'
-                }, {
-                    title: '激活单价',
-                    align: "center",
-                    dataIndex: 'activationPrice'
-                }, {
-                    title: '行为数',
-                    align: "center",
-                    dataIndex: 'keyActionCost'
                 },
             ],
             todayCost: '',
@@ -328,7 +299,6 @@ export default {
             this.queryUserId = sessionStorage.getItem('personalUserId')
         }
         this.clientWidth = document.documentElement.clientWidth - 224
-        this.showColumn()
         this.getQueryNewlyData();
         this.personalData();
         this.getItemList();
@@ -466,8 +436,6 @@ export default {
         projectNameClick(row) {
             this.titleName = '账户列表'
             this.echartsLoading = true;
-            this.columnsFixd = keepPersonData.setNoActionProjectColumns();
-            this.listNum = keepPersonData.setNoActionProjectColumns();
             this.columnsProject = [
                 {
                     title: '账户名称',
@@ -484,11 +452,6 @@ export default {
                     align: "center",
                     dataIndex: 'userName'
                 }, {
-                    title: '余额',
-                    dataIndex: 'balance',
-                    scopedSlots: {customRender: 'balance'},
-                    align: 'center',
-                }, {
                     title: '消耗(元)',
                     align: "center",
                     dataIndex: 'totalCost'
@@ -512,7 +475,6 @@ export default {
             this.echartsIpaginationProject.current = 1;
             this.getAccountData();
             this.projectAccount = 'b';
-            this.showColumn();
         },
         accountNameClick(row) {
             sessionStorage.setItem("personalaccountId", row.accountId)
@@ -551,8 +513,6 @@ export default {
             this.echartsLoading = true;
             if (ent.target.value == 'a') {
                 this.titleName = '项目列表'
-                this.columnsFixd = keepPersonData.setNoDeleteColumns();
-                this.listNum = keepPersonData.setNoDeleteColumns();
                 this.projectId = '';
                 this.columnsProject = [
                     {
@@ -598,28 +558,12 @@ export default {
                         title: '有效素材数',
                         align: "center",
                         dataIndex: 'newEffectNum',
-                    }, {
-                        title: '激活数',
-                        align: "center",
-                        dataIndex: 'activation',
-                    },
-                    {
-                        title: '激活单价',
-                        align: "center",
-                        dataIndex: 'activationPrice',
-                    }, {
-                        title: '行为数',
-                        align: "center",
-                        dataIndex: 'keyActionCost'
                     },
                 ],
                     this.echartsIpaginationProject.current = 1;
                 this.getItemList()
             } else {
                 this.titleName = '账户列表';
-                this.columnsFixd = keepPersonData.setNoActionProjectColumns();
-                this.listNum = keepPersonData.setNoActionProjectColumns();
-                console.log(this.columnsFixd);
                 this.columnsProject = [
                     {
                         title: '账户名称',
@@ -627,15 +571,15 @@ export default {
                         dataIndex: 'accountName',
                         scopedSlots: {customRender: 'accountName'},
                     }, {
+                        title: '账户ID',
+                        dataIndex: 'accountId',
+                        scopedSlots: {customRender: 'accountId'},
+                        align: 'center',
+                    }, {
                         title: '运营人员名称',
                         align: "center",
                         dataIndex: 'userName'
                     }, {
-                        title: '余额',
-                        dataIndex: 'balance',
-                        scopedSlots: {customRender: 'balance'},
-                        align: 'center',
-                    }, {
                         title: '消耗(元)',
                         align: "center",
                         dataIndex: 'totalCost'
@@ -658,117 +602,6 @@ export default {
                     this.echartsIpaginationProject.current = 1;
                 this.getAccountData();
             }
-            this.showColumn();
-        },
-        // 自定义列
-        customColumn() {
-            this.visible = true;
-            this.listNum = [...this.columnsProject]
-        },
-        //自定义列相关
-        closeCustomColumn() {
-            this.visible = false
-        },
-        showColumn() {
-            this.postDataAction('/toutiao/videoReportDaily/getColumnJson', {
-                columnType: this.projectAccount === 'a' ? 104 : 105,
-            }).then((res) => {
-                // console.log(res)
-                if (res.success) {
-                    // console.log(JSON.parse(res.result))
-                    if (res.result) {
-                        let columns = JSON.parse(res.result)
-                        console.log(columns);
-                        if (columns.length) {
-                            if (columns.length >= this.columnsFixd.length) {
-                                columns.map((item, index) => {
-                                    if (index > this.columnsFixd.length - 1) {
-                                        item.sorter = function (a, b) {
-                                        }
-                                    }
-                                })
-                                columns = columns.slice(this.columnsFixd.length)
-                                this.columnsProject = [...this.columnsFixd, ...columns]
-                            }
-                            var obj = {};
-                            this.columnsProject = this.columnsProject.reduce(function (item, next) {
-                                obj[next.dataIndex] ? '' : obj[next.dataIndex] = true && item.push(next);
-                                return item;
-                            }, []);
-                            // console.log(this.columns)
-                            this.changeColumn(this.columnsProject)
-                        }
-                    } else {
-                        this.changeColumn()
-                    }
-
-
-                }
-            })
-        },
-        changeColumn(val) {
-            this.columnsProject = [...val]
-            if (this.columnsProject.length > this.columnsFixd.length && this.columnsProject.length < 8) {
-                this.columnsProject.forEach((element, index) => {
-                    if (index < this.columnsProject.length - 1) {
-
-                        element.width = 'auto'
-                        element.fixed = false
-
-                    }
-                })
-
-                this.scrollX = 0
-            } else if (this.columnsProject.length > 8) {
-                this.columnsProject.forEach((element, index) => {
-                    if (index < this.columnsFixd.length) {
-                        if (element.dataIndex == 'accountNum') {
-                            element.width = 100
-                            element.fixed = 'left'
-                        } else if (element.dataIndex == 'userNum') {
-                            element.width = 100
-                            element.fixed = 'left'
-                        } else if (element.dataIndex == 'yearOnYear') {
-                            element.width = 100
-                            element.fixed = 'left'
-                        } else if (element.dataIndex == 'equallyRate') {
-                            element.width = 100
-                            element.fixed = 'left'
-                        } else {
-                            element.width = 150
-                            element.fixed = 'left'
-                        }
-
-                    } else if (this.columnsProject.length == this.columnsFixd.length) {
-                        this.columnsProject.forEach((element, index) => {
-                            element.width = 'auto';
-                            element.fixed = false;
-                        })
-                        this.scrollX = false
-                    } else {
-                        element.width = 'auto';
-                        element.fixed = false
-                    }
-                })
-
-                this.scrollX = 1000 + 150 * (this.columnsProject.length - this.columnsFixd.length)
-            } else {
-                this.scrollX = 0
-                this.columnsProject.forEach((element) => {
-
-                    element.width = 'auto'
-                    element.fixed = false
-
-                })
-            }
-
-            let arr = JSON.stringify(this.columnsProject)
-            this.postDataAction('/toutiao/videoReportDaily/saveOrUpdateColumnJson', {
-                json: arr,
-                columnType: this.projectAccount === 'a' ? 104 : 105,
-            }).then((res) => {
-                // console.log(res)
-            })
         },
         getQueryNewlyData() {
             let params = {