| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484 |
- <style></style>
- <template>
- <div class="data-refuse-statistics">
- <a-row class="image-list-heading vm-panel">
- <a-row type="flex" align="middle" justify="space-between" class="panel-body">
- <div class="search-bar" style="width:100%;display:flex">
- <span style="line-height:35px;margin-left:15px">账户选择:</span>
- <treeselect :appId.sync="appId" :multiple="false" />
- <a-button type="primary" style="margin-left:10px" @click="(ipagination.current=1);addUser()">搜索</a-button>
- </div>
- </a-row>
- </a-row>
- <a-row :gutter="10" style="margin-top:10px">
- <a-col :span="24">
- <a-card style="width:100%;">
- <!-- <div style="display:flex;margin:0 0 20px 0">
- <a-input placeholder="请输出要查找的创意名称" style="width:300px;" v-model="keyWord" />
- <a-button type="primary" style="margin-left:10px" @click="addUserKey">搜索</a-button>
- <a-button type="primary" style="margin-left:10px" @click="clickAgain" v-if="selectedRowKeys.length>0"
- :loading="loadingList">一键重提
- </a-button>
- </div> -->
- <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading" size="middle"
- :pagination="ipagination" :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
- <!-- <div slot="videoUrl" slot-scope="videoUrl">
- <video class="video" :src="videoUrl" controls="controls" style="height:200px;width:112.5px">
- 您的浏览器不支持 video 标签。
- </video>
- </div> -->
- <template slot="campaignName" slot-scope="text, record">
- <div style="display:flex;justify-content: center;">
- <a @click="toDetail(record)" class="count" v-show="!record.editName">{{ text }}</a>
- </div>
- </template>
- <span slot="campaignType" slot-scope="text">
- {{ text | typeStatus }}
- </span>
- <span slot="status" slot-scope="text">
- {{ text | status }}
- </span>
- <span slot="putStatus" slot-scope="text">
- {{ text | putStatus }}
- </span>
- <span slot="createChannel" slot-scope="text">
- {{ text | createChannel }}
- </span>
- <template slot="dayBudget" slot-scope="text, record">
- <div style="display:flex;justify-content: center;">
- <span class="count">{{ text ? (text / 1000).toFixed(2) : '不限制预算' }}</span>
- </div>
- </template>
- <div slot="coverUrl" slot-scope="coverUrl">
- <img :src="coverUrl" controls="controls" style="height:200px;width:112.5px" />
- </div>
- <template slot="creativeName" slot-scope="text, record">
- <div>
- {{ text }}
- <a-icon type="edit" style="cursor: pointer;" @click="onCellChange(record, 'creativeName')" />
- </div>
- </template>
- <template slot="description" slot-scope="text, record">
- <div>
- {{ text }}
- <a-icon type="edit" style="cursor: pointer;" @click="onCellChange(record, 'description')" />
- </div>
- </template>
- </a-table>
- </a-card>
- </a-col>
- </a-row>
- <a-modal :title="editTitle" :visible="visible" @ok="handleOk" :confirmLoading="confirmLoading"
- @cancel="handleCancel">
- <a-textarea v-model="editWord" autosize />
- </a-modal>
- <a-modal v-model="visibleFail" title="重提信息" :footer="null">
- <div v-if="fail">
- 修改成功条数:{{ fail.successCount }} 失败条数:{{
- fail.failCount
- }}
- <div style="margin-top:20px">
- <p v-for="(item, index) of fail.failInfo" :key="index">
- <span>名称:{{ item.campaignName?item.campaignName:item.unitName }}</span><br />
- <span>错误信息:{{ item.message }}</span>
- </p>
- </div>
- </div>
- </a-modal>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import {
- getRefuseCreative,
- updateCreative,
- selectByCreateName
- } from '@api/statistics'
- import axios from 'axios'
- import EditableCell from './components/EditableCell'
- import {
- mapGetters
- } from 'vuex'
- import {
- deleteAction,
- getAction,
- postAction
- } from '@/api/manage'
- import Treeselect from './components/Treeselect.vue'
- import {
- stopOtherVideo,
- closeAllVideoFun
- } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
- const columns = [{
- title: '账号Id',
- dataIndex: 'accountId',
- key: 'accountId',
- align: 'center'
- },
- {
- title: '计划Id',
- dataIndex: 'campaignId',
- key: 'campaignId',
- align: 'center'
- },
- {
- title: '广告组id',
- dataIndex: 'unitId',
- key: 'unitId',
- align: 'center'
- },
- {
- title: '创意id',
- dataIndex: 'creativeId',
- key: 'photoClick',
- align: 'center'
- },
- {
- title: '创意名称',
- dataIndex: 'creativeName',
- key: 'creativeName',
- align: 'left',
- scopedSlots: {
- customRender: 'creativeName'
- }
- },
- // {
- // title: '视频',
- // dataIndex: 'videoUrl',
- // key: 'videoUrl',
- // align: 'center',
- // scopedSlots: {
- // customRender: 'videoUrl'
- // }
- // },
- {
- title: '封面',
- dataIndex: 'coverUrl',
- key: 'coverUrl',
- align: 'center',
- scopedSlots: {
- customRender: 'coverUrl'
- }
- },
- {
- title: '拒绝原因',
- dataIndex: 'reviewDetail',
- key: 'reviewDetail',
- align: 'left'
- },
- {
- title: '广告语',
- dataIndex: 'description',
- key: 'description',
- align: 'left',
- scopedSlots: {
- customRender: 'description'
- }
- }
- ]
- var columnsCam = [{
- title: '广告计划名称',
- align: 'center',
- dataIndex: 'campaignName',
- fixed: 'left',
- width: 300,
- scopedSlots: {
- customRender: 'campaignName'
- }
- },
- {
- title: '计划单日预算金额',
- align: 'center',
- dataIndex: 'dayBudget',
- scopedSlots: {
- customRender: 'dayBudget'
- },
- width: 200
- },
- {
- title: '计划状态',
- align: 'center',
- dataIndex: 'status',
- scopedSlots: {
- customRender: 'status'
- }
- },
- {
- title: '计划类型',
- align: 'center',
- dataIndex: 'campaignType',
- scopedSlots: {
- customRender: 'campaignType'
- }
- },
- {
- title: '渠道',
- align: 'center',
- dataIndex: 'createChannel',
- scopedSlots: {
- customRender: 'createChannel'
- }
- },
- {
- title: '投放状态',
- align: 'center',
- dataIndex: 'putStatus',
- scopedSlots: {
- customRender: 'putStatus'
- },
- filters: [{
- text: '投放中',
- value: '1'
- },
- {
- text: '暂停',
- value: '2'
- }
- ],
- onFilter: (value, record) =>
- record.putStatus
- .toString()
- .toLowerCase()
- .includes(value.toLowerCase()),
- },
- {
- title: '创建时间',
- align: 'center',
- dataIndex: 'putCreateTime'
- },
- {
- title: '更新时间',
- align: 'center',
- dataIndex: 'putUpdateTime'
- }
- ]
- export default {
- name: 'refuse-data',
- components: {
- EditableCell,
- Treeselect
- },
- data: function () {
- return {
- title: '被拒创意列表',
- visibleFail: false,
- fail: null,
- appId: null,
- loading: false,
- columns: columnsCam,
- dataList: [],
- keyWord: '',
- editTitle: '',
- confirmLoading: false,
- visible: false,
- editWord: '',
- nowData: null,
- selectedRowKeys: [],
- selectedRowKeysValue: [],
- loadingList: false,
- ipagination: {
- current: 1,
- pageSize: 50,
- showTotal: (total, range) => {
- return range[0] + '-' + range[1] + ' 共' + total + '条'
- },
- showQuickJumper: true,
- // showSizeChanger: true,
- total: 0,
- onChange: current => {
- // 切换分页时的回调,
- // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
- this.ipagination.current = current
- this.selectedRowKeys = []
- this.selectedRowKeysValue = []
- this.addUser()
- }
- }
- }
- },
- filters: {
- typeStatus(type) {
- // 2 - 提升应用安装;
- // 3 - 获取电商下单;
- // 4 - 推广品牌活动;
- // 5 - 收集销售线索;
- var data = ['', '', '提升应用安装', '获取电商下单', '推广品牌活动', '收集销售线索']
- return data[type]
- },
- status(sta) {
- var data = {
- '-1': '不限',
- 1: '已暂停',
- 3: '计划超预算',
- 4: '有效',
- 6: '余额不足'
- }
- return data[sta]
- },
- putStatus(sta) {
- var data = {
- 1: '投放中',
- 2: '暂停'
- }
- return data[sta]
- },
- createChannel(sta) {
- var data = {
- 0: '投放后台',
- 1: '汇创助手'
- }
- return data[sta]
- }
- },
- watch: {
- appId(n, o) {
- console.log(n, o)
- if (n != o) {
- this.ipagination.current = 1
- }
- }
- },
- methods: {
- toDetail(record) {
- localStorage.setItem('accountIdCreat', record.campaignId)
- localStorage.setItem('accountIdCreatNow', this.appId)
- this.$router.replace({
- path: '/Statistics/refuseDataCreat'
- })
- },
- clickAgain() {
- this.loadingList = true
- var params = {}
- params.accountId = this.appId + ''
- params.creativeArr = this.selectedRowKeysValue
- postAction('/MaterialRefuse/batchUpdateCreative', params).then(res => {
- if (res.success) {
- this.loadingList = false
- this.selectedRowKeysValue = []
- this.selectedRowKeys = []
- this.visibleFail = true
- this.fail = res.result
- this.addUser()
- } else {
- this.loadingList = false
- this.visibleFail = true
- this.fail = res.result
- this.$message.error(res.message)
- }
- })
- },
- onSelectChange(selectedRowKeys, selectionRows) {
- this.selectedRowKeys = selectedRowKeys
- this.selectedRowKeysValue = selectionRows.map(item => {
- return {
- description: item.description,
- creativeId: item.creativeId
- }
- })
- // this.selectedRowKeysValue.length > 0 ? this.selectedRowKeysValue :
- },
- handleOk(e) {
- this.confirmLoading = true
- var params = {}
- params.accountId = this.nowData.accountId
- params.campaignId = this.nowData.campaignId
- params.unitId = this.nowData.unitId
- params.creativeId = this.nowData.creativeId
- params.creativeName = this.editTitle == '创意名称修改' ? this.editWord : this.nowData.creativeName
- params.description = this.editTitle == '广告语修改' ? this.editWord : this.nowData.description
- updateCreative(params).then(res => {
- if (res.code == 0) {
- this.addUser()
- this.visible = false
- this.confirmLoading = false
- } else {
- this.$message.error(res.message)
- this.visible = false
- this.confirmLoading = false
- }
- })
- },
- handleCancel(e) {
- this.visible = false
- },
- onCellChange(item, dataIndex) {
- this.editWord = item[dataIndex]
- this.editTitle = dataIndex == 'creativeName' ? '创意名称修改' : '广告语修改'
- this.nowData = item
- this.visible = true
- },
- moment,
- ...mapGetters(['nickname', 'avatar', 'userInfo']),
- addUser() {
- this.loading = true
- var params = {}
- params.accountId = this.appId + ''
- params.pageSize = this.ipagination.pageSize
- params.pageNo = this.ipagination.current
- if (this.appId) {
- getAction('/kuaishou/kuaiShouCampaign/list', params).then(res => {
- if (res.code == 0) {
- this.dataList = res.result.records.map((v, index) => {
- return {
- ...v,
- key: index
- }
- })
- this.list = this.dataList
- this.loading = false
- this.ipagination.total = res.result.total
- }
- })
- // getAction('/MaterialRefuse/getRefuseCreative', params).then(res => {
- // if (res.code == 0) {
- // this.dataList = res.result.records.map((v, index) => {
- // return {
- // ...v,
- // key: index
- // }
- // })
- // this.list = this.dataList
- // this.loading = false
- // this.ipagination.total = res.result.total
- // }
- // })
- } else {
- this.$message.error('请选择账户')
- }
- },
- addUserKey() {
- this.dataList = this.list.filter(item => {
- return item.creativeName.toLowerCase().indexOf(this.keyWord.toLowerCase()) > -1
- })
- }
- },
- watch: {},
- distoryed() {},
- updated() {
- stopOtherVideo()
- },
- mounted: function () {
- this.$nextTick(() => {})
- }
- }
- </script>
|