Browse Source

提交代码

zhuxinbo 5 năm trước cách đây
mục cha
commit
50a95bdf62

+ 70 - 63
src/views/modules/Statistics/projectDetail.vue

@@ -12,13 +12,17 @@
             size="middle"
             :pagination="false"
           >
-            <span slot-scope="text" slot="url">
-              <video class="video" :src="text" controls="controls" style="height:200px">
-                您的浏览器不支持 video 标签。
-              </video>
+            <span slot-scope="text" slot="mediaId">
+              {{ text == 1 ? '头条' : '快手' }}
             </span>
-            <span slot="videoRoleCode" slot-scope="text">
-              {{ text | roleName }}
+            <span slot="quarter" slot-scope="text, record">
+              {{ record.year + '年第' + record.quarter + '季度' }}
+            </span>
+            <span slot="startDate" slot-scope="text, record">
+              {{ record.startDate + '~' + record.endDate }}
+            </span>
+            <span slot="action" slot-scope="text, record">
+              <a :disabled="record.cost == 0 || record.cost == null" @click="toDetail(record)">查看详情</a>
             </span>
           </a-table>
         </a-card>
@@ -56,74 +60,68 @@ for (let i = 0; i < 12; i += 1) {
 
 const columns = [
   {
-    title: '视频',
-    dataIndex: 'url',
-    key: 'url',
-    align: 'center',
-    scopedSlots: {
-      customRender: 'url'
-    },
-    width: 200
-  },
-  {
-    title: '素材名称',
-    dataIndex: 'materialName',
-    key: 'materialName',
+    title: '项目名称',
+    dataIndex: 'projectName',
+    key: 'projectName',
     align: 'center'
   },
   {
-    title: '本职角色',
-    dataIndex: 'originRoleName',
-    key: 'originRoleName',
+    title: '账户id',
+    dataIndex: 'accountId',
+    key: 'accountId',
     align: 'center'
   },
   {
-    title: '担任角色',
-    dataIndex: 'videoRoleCode',
-    key: 'videoRoleCode',
-    scopedSlots: {
-      customRender: 'videoRoleCode'
-    },
+    title: '账户运营',
+    dataIndex: 'userName',
+    key: 'userName',
     align: 'center'
   },
   {
-    title: '设计师',
-    dataIndex: 'realname',
-    key: 'realname',
-    align: 'center'
-  }
-]
-// 账户名、项目名、优化师姓名、当季消耗、授权名称
-const columnsYou = [
-  {
-    title: '账户',
+    title: '广告主名称',
     dataIndex: 'advertiserName',
     key: 'advertiserName',
     align: 'center'
   },
   {
-    title: '项目',
-    dataIndex: 'projectName',
-    key: 'projectName',
+    title: '授权名称',
+    dataIndex: 'authName',
+    key: 'authName',
     align: 'center'
   },
   {
-    title: '优化师',
-    dataIndex: 'userName',
-    key: 'userName',
+    title: '季度消耗',
+    dataIndex: 'cost',
+    key: 'cost',
     align: 'center'
   },
   {
-    title: '当季消耗',
-    dataIndex: 'totalCost',
-    key: 'totalCost',
-    align: 'center'
+    title: '媒体类型',
+    dataIndex: 'mediaId',
+    key: 'mediaId',
+    align: 'center',
+    scopedSlots: { customRender: 'mediaId' }
   },
   {
-    title: '授权名称',
-    dataIndex: 'authName',
-    key: 'authName',
-    align: 'center'
+    title: '绩效年度',
+    dataIndex: 'quarter',
+    key: 'quarter',
+    align: 'center',
+    scopedSlots: { customRender: 'quarter' }
+  },
+  {
+    title: '运营所属时间段',
+    dataIndex: 'startDate',
+    key: 'startDate',
+    align: 'center',
+    scopedSlots: { customRender: 'startDate' }
+  },
+  {
+    title: '视频详情',
+    dataIndex: 'action',
+    key: 'action',
+    align: 'center',
+    scopedSlots: { customRender: 'action' }
   }
 ]
 export default {
@@ -159,7 +157,17 @@ export default {
     }
   },
   methods: {
-    ...mapGetters(['nickname', 'avatar', 'userInfo'])
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    toDetail(item) {
+      localStorage.setItem('videoAccountId', item.accountId)
+      localStorage.setItem('videoAppType', item.mediaId)
+      localStorage.setItem('videoYear', item.year)
+      localStorage.setItem('videoQuarter', item.quarter)
+
+      this.$router.replace({
+        path: '/Statistics/projectVideo'
+      })
+    }
   },
   filters: {
     roleName: function(value) {
@@ -173,17 +181,16 @@ export default {
     }
   },
   created() {
-    var userId = localStorage.getItem('detailUserId')
-    var appType = localStorage.getItem('appType') == 'kuaishou' ? 2 : 1
-    var type = localStorage.getItem('roleData')
-    var weekDate = localStorage.getItem('weekDate').split('~')
-    var typeAll = localStorage.getItem('typeAll')
-    //
+    var userId = localStorage.getItem('projectStatisticsId')
+    var appType = localStorage.getItem('projectAppType') == 'kuaishou' ? 2 : 1
+    var type = localStorage.getItem('projectYear')
+    var weekDate = localStorage.getItem('projectQuarter')
+
     postAction('/ctop/performance2/getQuarterAccountDetail', {
-      year: 2020,
-      quarter: 1,
-      appType: 2,
-      projectId: 47
+      year: type,
+      quarter: weekDate,
+      appType: appType,
+      projectId: userId
     }).then(res => {
       if (res.success) {
         this.dataList = res.result.map((item, index) => {

+ 11 - 1
src/views/modules/Statistics/projectStatistics.vue

@@ -170,7 +170,17 @@ export default {
       this.columns = columns
       this[type] = key
     },
-    toDetail(item) {},
+    toDetail(item) {
+      // {"year":2020,"quarter":1,"appType":2,"projectId":47}
+      localStorage.setItem('projectStatisticsId', item.projectId)
+      localStorage.setItem('projectAppType', this.noTitleKey)
+      localStorage.setItem('projectYear', this.year)
+      localStorage.setItem('projectQuarter', this.dateRange)
+
+      this.$router.replace({
+        path: '/Statistics/projectDetail'
+      })
+    },
     getKuaishouList() {
       var params = {}
       params.year = this.year

+ 230 - 0
src/views/modules/Statistics/projectVideo.vue

@@ -0,0 +1,230 @@
+<style></style>
+<template>
+  <div class="admin-detail">
+    <a-row :gutter="10" style="margin-top:10px">
+      <a-col :span="24">
+        <a-card style="width:100%;">
+          <h3 style="margin:20px 0">当前账户总消耗为:{{ sumAll }}</h3>
+
+          <a-table
+            :columns="columns"
+            :dataSource="dataList"
+            bordered
+            :loading="loading"
+            size="middle"
+            :pagination="true"
+          >
+            <span slot-scope="text" slot="creativeUrl">
+              <video class="video" :src="text" controls="controls" style="height:200px" v-if="text">
+                您的浏览器不支持 video 标签。
+              </video>
+              <div v-else>
+                暂无视频
+              </div>
+            </span>
+            <span slot="shot" slot-scope="text">{{ text ? text : '-' }}</span>
+            <span slot="plan" slot-scope="text">{{ text ? text : '-' }}</span>
+            <span slot="plane" slot-scope="text">{{ text ? text : '-' }}</span>
+            <span slot="clip" slot-scope="text">{{ text ? text : '-' }}</span>
+          </a-table>
+        </a-card>
+      </a-col>
+    </a-row>
+  </div>
+</template>
+
+<script>
+import ChartCard from '@/components/ChartCard'
+import ACol from 'ant-design-vue/es/grid/Col'
+import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
+import MiniArea from '@/components/chart/MiniArea'
+import MiniBar from '@/components/chart/MiniBar'
+import MiniProgress from '@/components/chart/MiniProgress'
+import RankList from '@/components/chart/RankList'
+import Bar from '@/components/chart/Bar'
+import LineChartMultid from '@/components/chart/LineChartMultid'
+import HeadInfo from '@/components/tools/HeadInfo.vue'
+
+import Trend from '@/components/Trend'
+
+import { getAction, postAction } from '@/api/manage'
+import { mapGetters } from 'vuex'
+
+import qs from 'qs'
+
+const barData = []
+for (let i = 0; i < 12; i += 1) {
+  barData.push({
+    x: `${i + 1}月`,
+    y: Math.floor(Math.random() * 1000) + 200
+  })
+}
+
+const columns = [
+  {
+    title: '视频',
+    dataIndex: 'creativeUrl',
+    key: 'creativeUrl',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'creativeUrl'
+    },
+    width: 200
+  },
+  {
+    title: '账户消耗',
+    dataIndex: 'charge',
+    key: 'charge',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'charge'
+    }
+  },
+  {
+    title: '拍摄',
+    dataIndex: 'shot',
+    key: 'shot',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'shot'
+    }
+  },
+  {
+    title: '编导',
+    dataIndex: 'plan',
+    key: 'plan',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'plan'
+    }
+  },
+  {
+    title: '平面',
+    dataIndex: 'plane',
+    key: 'plane',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'plane'
+    }
+  },
+  {
+    title: '剪辑',
+    dataIndex: 'clip',
+    key: 'clip',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'clip'
+    }
+  }
+]
+function sum(arr) {
+  var len = arr.length
+  if (len == 0) {
+    return 0
+  } else if (len == 1) {
+    return arr[0]
+  } else {
+    return arr[0] + sum(arr.slice(1))
+  }
+}
+export default {
+  name: 'admin-info',
+  components: {
+    ATooltip,
+    ACol
+  },
+
+  data: function() {
+    return {
+      title: '工作台',
+      loginfo: {},
+      barData,
+      visitInfo: [],
+      visitFields: ['ip', 'visit'],
+      loading: false,
+      rankList: [],
+      tabListNoTitle: [
+        {
+          key: 'kuaishou',
+          tab: '快手'
+        },
+        {
+          key: 'toutiao',
+          tab: '头条'
+        }
+      ],
+      noTitleKey: 'kuaishou',
+      a: '',
+      columns: columns,
+      dataList: [],
+      sumAll: null
+    }
+  },
+  methods: {
+    ...mapGetters(['nickname', 'avatar', 'userInfo'])
+  },
+  filters: {
+    roleName: function(value) {
+      var status = {
+        clip: '剪辑',
+        shot: '拍摄',
+        plan: '策划',
+        plane: '平面'
+      }
+      return status[value]
+    }
+  },
+  created() {
+    var userId = localStorage.getItem('videoAccountId')
+    var appType = localStorage.getItem('videoAppType')
+    //  == 'kuaishou' ? 2 : 1
+    var type = localStorage.getItem('videoYear')
+    var weekDate = localStorage.getItem('videoQuarter')
+    if (appType == '2') {
+      // /ctop/performance2/getKuaishouQuarterVideoInfoByAccountId
+      postAction('/ctop/performance2/getKuaishouQuarterVideoInfoByAccountId', {
+        year: type,
+        quarter: weekDate,
+        accountId: userId
+      }).then(res => {
+        if (res.success) {
+          this.dataList = res.result.map((item, index) => {
+            return {
+              ...item,
+              key: index
+            }
+          })
+
+          var sumAll = this.dataList.map(item => {
+            return item.charge
+          })
+          this.sumAll = sum(sumAll)
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    } else {
+      postAction('/ctop/performance2/getToutiaoQuarterVideoInfoByAccountId', {
+        year: type,
+        quarter: weekDate,
+        accountId: userId
+      }).then(res => {
+        if (res.success) {
+          this.dataList = res.result.map((item, index) => {
+            return {
+              ...item,
+              key: index
+            }
+          })
+          var sumAll = this.dataList.map(item => {
+            return item.charge
+          })
+          this.sumAll = sum(sumAll)
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>

+ 203 - 0
src/views/modules/Statistics/quarterDetail.vue

@@ -0,0 +1,203 @@
+<style></style>
+<template>
+  <div class="admin-detail">
+    <a-row :gutter="10" style="margin-top:10px">
+      <a-col :span="24">
+        <a-card style="width:100%;">
+          <h3 style="margin:20px 0">当前账户总消耗为:{{ sumAll }}</h3>
+
+          <a-table
+            :columns="columns"
+            :dataSource="dataList"
+            bordered
+            :loading="loading"
+            size="middle"
+            :pagination="true"
+          >
+            <span slot-scope="text" slot="creativeUrl">
+              <video class="video" :src="text" controls="controls" style="height:200px" v-if="text">
+                您的浏览器不支持 video 标签。
+              </video>
+              <div v-else>
+                暂无视频
+              </div>
+            </span>
+            <span slot="shot" slot-scope="text">{{ text ? text : '-' }}</span>
+            <span slot="plan" slot-scope="text">{{ text ? text : '-' }}</span>
+            <span slot="plane" slot-scope="text">{{ text ? text : '-' }}</span>
+            <span slot="clip" slot-scope="text">{{ text ? text : '-' }}</span>
+          </a-table>
+        </a-card>
+      </a-col>
+    </a-row>
+  </div>
+</template>
+
+<script>
+import ChartCard from '@/components/ChartCard'
+import ACol from 'ant-design-vue/es/grid/Col'
+import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
+import MiniArea from '@/components/chart/MiniArea'
+import MiniBar from '@/components/chart/MiniBar'
+import MiniProgress from '@/components/chart/MiniProgress'
+import RankList from '@/components/chart/RankList'
+import Bar from '@/components/chart/Bar'
+import LineChartMultid from '@/components/chart/LineChartMultid'
+import HeadInfo from '@/components/tools/HeadInfo.vue'
+
+import Trend from '@/components/Trend'
+
+import { getAction, postAction } from '@/api/manage'
+import { mapGetters } from 'vuex'
+
+import qs from 'qs'
+
+const barData = []
+for (let i = 0; i < 12; i += 1) {
+  barData.push({
+    x: `${i + 1}月`,
+    y: Math.floor(Math.random() * 1000) + 200
+  })
+}
+
+const columns = [
+  {
+    title: '视频',
+    dataIndex: 'creativeUrl',
+    key: 'creativeUrl',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'creativeUrl'
+    },
+    width: 200
+  },
+  {
+    title: '账户消耗',
+    dataIndex: 'charge',
+    key: 'charge',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'charge'
+    }
+  },
+  {
+    title: '拍摄',
+    dataIndex: 'shot',
+    key: 'shot',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'shot'
+    }
+  },
+  {
+    title: '编导',
+    dataIndex: 'plan',
+    key: 'plan',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'plan'
+    }
+  },
+  {
+    title: '平面',
+    dataIndex: 'plane',
+    key: 'plane',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'plane'
+    }
+  },
+  {
+    title: '剪辑',
+    dataIndex: 'clip',
+    key: 'clip',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'clip'
+    }
+  }
+]
+function sum(arr) {
+  var len = arr.length
+  if (len == 0) {
+    return 0
+  } else if (len == 1) {
+    return arr[0]
+  } else {
+    return arr[0] + sum(arr.slice(1))
+  }
+}
+export default {
+  name: 'admin-info',
+  components: {
+    ATooltip,
+    ACol
+  },
+
+  data: function() {
+    return {
+      title: '工作台',
+      loginfo: {},
+      barData,
+      visitInfo: [],
+      visitFields: ['ip', 'visit'],
+      loading: false,
+      rankList: [],
+      tabListNoTitle: [
+        {
+          key: 'kuaishou',
+          tab: '快手'
+        },
+        {
+          key: 'toutiao',
+          tab: '头条'
+        }
+      ],
+      noTitleKey: 'kuaishou',
+      a: '',
+      columns: columns,
+      dataList: [],
+      sumAll: null
+    }
+  },
+  methods: {
+    ...mapGetters(['nickname', 'avatar', 'userInfo'])
+  },
+  filters: {
+    roleName: function(value) {
+      var status = {
+        clip: '剪辑',
+        shot: '拍摄',
+        plan: '策划',
+        plane: '平面'
+      }
+      return status[value]
+    }
+  },
+  created() {
+    var userId = localStorage.getItem('detailUserId')
+    var appType = localStorage.getItem('appType') == 'kuaishou' ? 2 : 1
+    var type = localStorage.getItem('roleData')
+    var weekDate = localStorage.getItem('weekDate').split('~')
+    var typeAll = localStorage.getItem('typeAll')
+
+    postAction('/ctop/performance2/getYunyingQuarterDetailByUserId', {
+      year: type,
+      quarter: weekDate,
+      appType: appType,
+      projectId: userId
+    }).then(res => {
+      if (res.success) {
+        this.dataList = res.result.map((item, index) => {
+          return {
+            ...item,
+            key: index
+          }
+        })
+      } else {
+        this.$message.error(res.message)
+      }
+    })
+  }
+}
+</script>

+ 17 - 17
src/views/modules/Statistics/quarterStatistics.vue

@@ -42,9 +42,9 @@
                 您的浏览器不支持 video 标签。
               </video>
             </span>
-            <!-- <span slot="action" slot-scope="text,record">
-              <a :disabled="record.effiVideoCount == 0" @click="toDetail(record)">查看详情</a>
-            </span> -->
+            <span slot="action" slot-scope="text, record">
+              <a @click="toDetail(record)">查看详情</a>
+            </span>
           </a-table>
         </a-card>
       </a-col>
@@ -148,16 +148,16 @@ const columnsYou = [
     dataIndex: 'effiRate',
     key: 'effiRate',
     align: 'center'
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    key: 'action',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'action'
+    }
   }
-  // {
-  //   title: '操作',
-  //   dataIndex: 'action',
-  //   key: 'action',
-  //   align: 'center',
-  //   scopedSlots: {
-  //     customRender: 'action'
-  //   },
-  // },
 ]
 
 export default {
@@ -236,12 +236,12 @@ export default {
       this[type] = key
     },
     toDetail(item) {
-      localStorage.setItem('detailUserId', item.userId)
-      localStorage.setItem('appType', this.noTitleKey)
-      localStorage.setItem('roleData', this.type)
-      localStorage.setItem('weekDate', this.dateRange)
+      localStorage.setItem('quarterUserId', item.userId)
+      localStorage.setItem('quarterAppType', this.noTitleKey)
+      localStorage.setItem('quarterYear', this.year)
+      localStorage.setItem('quarterNow', this.dateRange)
       this.$router.replace({
-        path: '/Statistics/allDetail'
+        path: '/Statistics/quarterDetail'
       })
     },
     getKuaishouList() {