123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- <template>
- <a-card :bordered="false">
- <!-- 查询区域 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline">
- <a-row :gutter="24">
- <a-col :md="6" :sm="8">
- <a-form-item label="项目名称">
- <a-input placeholder="请输入项目名称" v-model="queryParam.projectName"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="广告主名称">
- <!-- <a-input placeholder="请输入广告主名称" v-model="queryParam.advertiserName"></a-input> -->
- <a-select
- optionFilterProp="children"
- showSearch
- :filterOption="filterOption"
- v-model="queryParam.advertiserId"
- placeholder="请选择广告主名称"
- >
- <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">
- {{ item.name }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <template>
- <a-col :md="6" :sm="8">
- <a-form-item label="运营负责人">
- <!-- <a-input placeholder="请输入负责人" v-model="queryParam.responsible"></a-input> -->
- <a-select
- placeholder="请选择运营负责人"
- showSearch
- optionFilterProp="children"
- style="width: 100%"
- :filterOption="filterOption"
- v-model="queryParam.responsibleId"
- @search="search"
- @focus="getAllUserList"
- >
- <a-select-option
- v-for="appModel in options"
- :key="appModel.userId + new Date().getTime()"
- :value="appModel.userId"
- >{{ appModel.realName }}  {{ appModel.roleName }}</a-select-option
- >
- </a-select>
- </a-form-item>
- </a-col>
- </template>
- <template>
- <a-col :md="6" :sm="8">
- <a-form-item label="设计负责人">
- <!-- <a-input placeholder="请输入负责人" v-model="queryParam.responsible"></a-input> -->
- <a-select
- placeholder="请选择设计负责人"
- showSearch
- optionFilterProp="children"
- style="width: 100%"
- :filterOption="filterOption"
- v-model="queryParam.designResponsibleId"
- @search="search"
- @focus="getAllUserList"
- >
- <a-select-option
- v-for="appModel in options"
- :key="appModel.userId + new Date().getTime()"
- :value="appModel.userId"
- >{{ appModel.realName }}  {{ appModel.roleName }}</a-select-option
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="6">
- <a-form-item label="行业">
- <j-tree-select
- v-model="queryParam.industryId"
- ref="treeSelect"
- placeholder="请选择行业"
- dict="sys_category,name,id"
- pidField="pid"
- pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
- ></j-tree-select>
- </a-form-item>
- </a-col>
- </template>
- <a-col :md="6" :sm="8">
- <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
- <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
- {{ toggleSearchStatus ? '收起' : '展开' }}
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
- </a>-->
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- 操作按钮区域 -->
- <!-- <div class="table-operator">
- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
- </div>-->
- <!-- table区域-begin -->
- <!-- 供应商 -->
- <div>
- <a-table
- ref="table"
- size="middle"
- bordered
- rowKey="id"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="ipagination"
- :loading="loading"
- @change="handleTableChange"
- >
- <span slot="maxBid" slot-scope="text,record">{{ record.maxBid == 0? '-': record.maxBid / 1000 }}</span>
- <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span>
- <span slot="ocpxActionType" slot-scope="text,record">
- <div v-if="!!record.ocpxActionTypeArray&&record.ocpxActionTypeArray.length>0">
- <span v-for="(item, index) in record.ocpxActionTypeArray" :key="index"
- >{{item.ocpxName}}({{(item.maxValue / 1000).toFixed(2)}})<br></span
- >
- </div>
- <div v-else>-</div>
- <!-- {{ text | ocpxActionType }} -->
- </span>
- <span slot="deepConversionType" slot-scope="text,record">
- <div v-if="!!record.deepConversionTypeArray&&record.deepConversionTypeArray.length != 0">
- <span v-for="(item, index) in record.deepConversionTypeArray" :key="index"
- >{{item.deepName}}({{(item.deepValue / 1000).toFixed(2)}})<br></span
- >
- </div>
- <div v-else>-</div>
- <!-- {{ text | ocpxActionType }} -->
- </span>
- <span slot="bidType" slot-scope="text">
- <div v-if="text && JSON.parse(text).length > 0">
- <span v-for="(item, index) of JSON.parse(text)" :key="index"
- >{{ item | bidType }}{{ index == JSON.parse(text).length - 1 ? '' : '、' }}</span
- >
- </div>
- <div v-else>-</div>
- </span>
- <span slot="mediaId" slot-scope="text">
- {{ text == '1' || text == '3' ? '头条' : '快手' }}
- </span>
- <span slot="action" slot-scope="text, record">
- <a @click="handleEdit(record)">编辑</a>
- <a-divider type="vertical" />
- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
- <a>删除</a>
- </a-popconfirm>
- <!-- /ctop/project/edit -->
- </span>
- <span slot="materialShare" slot-scope="text, record">
- <a-switch :checked='text==0' @change="onChange(text,record)" :loading="spinning"/>
- </span>
- </a-table>
- </div>
- <!-- table区域-end -->
- <!-- 表单区域 -->
- <project-modal ref="modalForm" @ok="modalFormOk"></project-modal>
- </a-card>
- </template>
- <script>
- import ProjectModal from './modules/projectListModal'
- import JTreeSelect from '@/components/jeecg/JTreeSelect'
- import { httpAction, getAction } from '@/api/manage'
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import { mapActions, mapGetters } from 'vuex'
- export default {
- name: 'ProjectList',
- mixins: [JeecgListMixin],
- components: {
- ProjectModal,
- JTreeSelect,
- },
- data() {
- return {
- description: '项目管理页面',
- // 表头
- columns: [
- {
- title: '项目名称',
- align: 'center',
- dataIndex: 'projectName',
- },
- {
- title: '广告主名称',
- align: 'center',
- dataIndex: 'advertiserId_dictText',
- },
- {
- title: '最高出价',
- align: 'center',
- dataIndex: 'maxBid',
- scopedSlots: {
- customRender: 'maxBid',
- },
- },
- {
- title: '最高转化出价',
- align: 'center',
- dataIndex: 'maxDeepCpaBid',
- scopedSlots: {
- customRender: 'maxDeepCpaBid',
- },
- },
- {
- title: '优化目标',
- align: 'center',
- dataIndex: 'bidType',
- scopedSlots: {
- customRender: 'bidType',
- },
- },
- {
- title: '转化目标(出价/元)',
- align: 'center',
- dataIndex: 'ocpxActionType',
- scopedSlots: {
- customRender: 'ocpxActionType',
- },
- },
- {
- title: '深度转化目标(出价)',
- align: 'center',
- dataIndex: 'deepConversionType',
- scopedSlots: {
- customRender: 'deepConversionType',
- },
- },
- {
- title: '供应商',
- align: 'center',
- dataIndex: 'supplierCode_dictText',
- },
- {
- title: '销售',
- align: 'center',
- dataIndex: 'saleId_dictText',
- },
- {
- title: '运营负责人',
- align: 'center',
- dataIndex: 'responsibleId_dictText',
- },
- {
- title: '设计负责人',
- align: 'center',
- dataIndex: 'designResponsibleId_dictText',
- },
- {
- title: '媒体',
- align: 'center',
- dataIndex: 'mediaId',
- scopedSlots: {
- customRender: 'mediaId',
- },
- },
- {
- title: '是否共享素材',
- align: 'center',
- dataIndex: 'materialShare',
- scopedSlots: {
- customRender: 'materialShare',
- },
- },
- {
- title: '操作',
- dataIndex: 'action',
- align: 'center',
- scopedSlots: {
- customRender: 'action',
- },
- },
- ],
- url: {
- list: '/ctop/project/list',
- delete: '/ctop/project/delete',
- deleteBatch: '/ctop/project/deleteBatch',
- exportXlsUrl: 'ctop/project/exportXls',
- importExcelUrl: 'ctop/project/importExcel',
- },
- list: [],
- options: [],
- spinning: false
- }
- },
- filters: {
- bidType(sta) {
- var data = {
- null: '-',
- 1: 'CPM',
- 2: 'CPC',
- 6: 'OCPC',
- 10: 'OCPM',
- 12: "最大转化"
- }
- return data[sta]
- },
- },
- computed: {
- importExcelUrl: function () {
- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
- },
- },
- methods: {
- onChange(text,record) {
- this.spinning=true;
- console.log(text,record)
- let materialShare=text==1?0:1;
- httpAction(`/ctop/project/edit`,{
- id:record.id,
- materialShare
- },'put').then((res)=>{
-
- if(res.success) {
- this.spinning=false;
- this.$message.success('修改成功')
- this.modalFormOk()
- }else {
- this.spinning=false;
- this.$message.success(res.message)
- this.modalFormOk()
- }
- })
- },
- ...mapGetters(['nickname', 'avatar', 'userInfo']),
- getList() {
- var params = {}
- // params.userId = this.userInfo().id
- params.pageSize = 1000
- params.pageNo = 1
- params.userId = this.userInfo().id
- getAction('/ctop/advertiser/list', params)
- .then((res) => {
- if (res.success) {
- this.list = res.result.records
- } else {
- this.$message.warning(res.message)
- }
- })
- .finally(() => {})
- },
- filterOption(input, option) {
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- },
- getAllUserList(value) {
- this.options = []
- getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: value }).then((res) => {
- if (res.success) {
- this.options = res.result.list
- }
- })
- },
- search(value) {
- this.options = []
- if (value != '') {
- // this.options = this.list.filter(item => {
- // var data = item.realName + ' ' + item.roleName
- // return data.toLowerCase().indexOf(value.toLowerCase()) > -1
- // })
- // this.options = [...this.options]
- this.getAllUserList(value)
- } else {
- this.getAllUserList()
- }
- },
- },
- mounted() {
- this.getAllUserList()
- this.getList()
- // getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: '' }).then((res) => {
- // if (res.success) {
- // this.options = res.result.list
- // }
- // })
- },
- }
- </script>
- <style scoped>
- @import '~@assets/less/common.less';
- </style>
|