12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007 |
- <style>
- .my-project .ant-tabs-nav-scroll {
- display: flex;
- justify-content: center;
- }
- .close-account-my-project .ant-modal-footer .ant-btn-primary {
- display: none;
- }
- .only .ant-badge-count {
- right: -16px;
- }
- </style>
- <template>
- <a-card
- :bordered="false"
- :tabList="tabListNoTitle"
- :activeTabKey="noTitleKey"
- @tabChange="(key) => onTabChange(key, 'noTitleKey')"
- class="my-project"
- >
- <!-- 查询区域 -->
- <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="keyWord"></a-input>
- </a-form-item>
- </a-col>
- <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>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- table区域-begin -->
- <div>
- <a-table
- ref="table"
- size="middle"
- bordered
- rowKey="id"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="ipagination"
- :loading="loading"
- >
- <span slot="maxBid" slot-scope="maxBid">{{ maxBid / 1000 }}</span>
- <span slot="mediaId" slot-scope="mediaId">{{
- mediaId == 1 ? '头条' : mediaId == 2 ? '快手' : mediaId == 3 ? '头条内广' : '快手内广'
- }}</span>
- <span slot="action" slot-scope="text, record">
- <a @click="handleEdit(record)">{{ noTitleKey == 'myProject' ? '查看成员' : '账号绑定' }}</a>
- <a-divider type="vertical" />
- <a @click="addParams(record)">{{ noTitleKey == 'myProject' ? '新增人员' : '查看账户' }}</a>
- <a-divider type="vertical" v-if="noTitleKey == 'myProject'" />
- <a-badge :count="record.needExamine" class="only">
- <a
- @click="projectLook(record)"
- v-if="noTitleKey == 'myProject'"
- :disabled="record.needExamine == 0 || record.needExamine == null"
- >待办事项</a
- >
- </a-badge>
- </span>
- </a-table>
- </div>
- <!-- table区域-end -->
- <!-- 查看项目成员 -->
- <a-modal
- :maskClosable="false"
- :title="title"
- v-model="visible"
- @ok="handleOk"
- width="800px"
- class="close-account-my-project"
- >
- <div style="display: flex; line-height: 50px; flex-wrap: wrap">
- <div style="width: 25%; text-align: center" v-for="(item, index) of memberList" :key="index">
- <a-tag color="#2db7f5" @close="log(item.id)" closable>
- {{ item.userName }}
- <a-divider type="vertical" />
- {{ item.roleCode | roleCode }}
- </a-tag>
- </div>
- </div>
- </a-modal>
- <!-- 添加项目成员 -->
- <a-modal
- :maskClosable="false"
- title="添加项目成员"
- v-model="visibleAdd"
- @ok="handleOkAdd"
- :confirmLoading="confirmLoading"
- >
- <!-- /sys/user/getAllUserList -->
- <a-select
- v-model="appId"
- showSearch
- allowClear
- mode="multiple"
- placeholder="请选择成员"
- optionFilterProp="children"
- style="width: 100%"
- @focus="handleFocus"
- @blur="handleBlur"
- @change="handleChange"
- :filterOption="true"
- @search="search"
- :maxTagCount="1"
- >
- <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-modal>
- <!-- 账号绑定 -->
- <a-modal
- :maskClosable="false"
- title="账号绑定"
- v-model="visibleBind"
- @ok="handleSubmit"
- @cancel="handleCancel"
- :width="800"
- :okButtonProps="{ props: { disabled: false } }"
- :cancelButtonProps="{ props: { disabled: false } }"
- >
- <a-form :form="formEdit">
- <a-form-item
- label="选择方式"
- :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <a-radio-group buttonStyle="solid" v-model="mode" @change="onChageLogin">
- <a-radio-button value="authorization">授权</a-radio-button>
- <a-radio-button value="login">登录</a-radio-button>
- </a-radio-group>
- </a-form-item>
- <div v-if="mode == 'authorization'">
- <a-form-item
- label="媒体:"
- :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <a-radio-group buttonStyle="outline" v-model="loginType">
- <a-radio-button value="kuaishou">快手</a-radio-button>
- <a-radio-button value="bytedance">头条</a-radio-button>
- </a-radio-group>
- <br />
- <span style="color: red" v-if="loginType == 'bytedance'"
- >*重要:如存在一户多开情况,请勾选所有子账号进行授权!!!</span
- >
- </a-form-item>
- <a-form-item
- label="授权时间:"
- :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <a-date-picker
- v-model="dateValue"
- style="width: 180px;"
- :allowClear="false"
- format="YYYY-MM-DD"
- :disabled-date="disabledDate"
- @change="handleCostTimeChange"
- />
- </a-form-item>
- <a-form-item
- label="开户代理商:"
- :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
- v-if="loginType == 'kuaishou'"
- >
- <a-radio-group buttonStyle="outline" v-model="id">
- <!-- <a-radio-button value="0">否</a-radio-button>
- <a-radio-button value="1">是</a-radio-button> -->
- <a-radio-button v-for="item in authConfigList" :key="item.id" :value="item.id">{{
- item.agentName
- }}</a-radio-button>
- </a-radio-group>
- </a-form-item>
- <a-form-item
- label="系统类型:"
- :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <a-radio-group buttonStyle="outline" v-model="systemType">
- <a-radio-button value="不限">不限</a-radio-button>
- <a-radio-button value="ios">ios</a-radio-button>
- <a-radio-button value="android">android</a-radio-button>
- <a-radio-button value="4">其他</a-radio-button>
- </a-radio-group>
- <a-input v-model="systemTypeName" v-if="systemType == '4'" placeholder="请输入系统类型" />
- </a-form-item>
- <a-form-item
- label="预警金额"
- :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <!-- <a-input v-decorator="['warningAmount', { rules: [{ required: true, message: '请输入预警金额' }] }]" /> -->
- <a-input-number
- style="width: 50%"
- v-decorator="[
- 'warningAmount',
- { rules: [{ required: true, message: '请输入预警金额' }], initialValue: 5000 },
- ]"
- />
- </a-form-item>
- <a-form-item
- label="预警比例"
- :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <a-input-number
- :step="0.1"
- style="width: 50%"
- v-decorator="[
- 'warningProportion',
- { rules: [{ required: true, message: '请输入预警比例' }], initialValue: 1.5 },
- ]"
- />
- </a-form-item>
- </div>
- <div v-else>
- <a-form-item
- label="媒体:"
- :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <a-radio-group buttonStyle="outline" v-model="loginType">
- <a-radio-button value="pangolin">穿山甲</a-radio-button>
- </a-radio-group>
- </a-form-item>
- <a-form-item
- label="账号:"
- :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
- v-show="mode == 'login'"
- >
- <a-input v-model="accountName" placeholder="请输入账户名" />
- </a-form-item>
- <a-form-item
- label="密码:"
- :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
- v-show="mode == 'login'"
- >
- <a-input type="password" v-model="password" placeholder="请输入密码" />
- </a-form-item>
- </div>
- <a-form-item
- label="自动投放"
- :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <a-radio-group
- buttonStyle="outline"
- v-decorator="[
- 'autoDelivery',
- { rules: [{ required: true, message: '请选择是否自动投放' }], initialValue: 1 },
- ]"
- >
- <a-radio-button :value="1">允许</a-radio-button>
- <a-radio-button :value="3">禁止</a-radio-button>
- </a-radio-group>
- </a-form-item>
- <a-form-item
- label="物料同步"
- :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
- :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
- >
- <checkBoxGroup
- :options="[
- { label: '不同步', value: 0 },
- { label: '应用包', value: 1 },
- { label: '人群包', value: 2, disabled:true},
- { label: '定向包', value: 3, disabled:true },
- ]"
- v-decorator="['materialType', { rules: [{ required: true, message: '请选择同步物料' }], initialValue: [0] }]"
- @change="changeData"
- />
- </a-form-item>
- </a-form>
- </a-modal>
- <!-- 查看项目下的账号 -->
- <a-modal
- :maskClosable="false"
- :title="titleAccount"
- v-model="visibleAccount"
- @ok="handleOk"
- width="800px"
- class="close-account-my-project"
- >
- <a-table
- ref="table"
- size="middle"
- bordered
- rowKey="id"
- :columns="columnsAccount"
- :dataSource="dataAccount"
- :pagination="ipaginationAccount"
- :loading="loadingAccount"
- >
- <span slot="createTime" slot-scope="createTime">{{ createTime | getDate }}</span>
- </a-table>
- </a-modal>
- <!-- 待办事件审核 -->
- <a-modal
- :maskClosable="false"
- title="待办事件审核"
- v-model="projectVisible"
- @ok="handleOkProject"
- width="800px"
- class="close-account-my-project"
- :footer="null"
- >
- <a-table
- ref="table"
- size="middle"
- bordered
- rowKey="id"
- :columns="columnsProject"
- :dataSource="dataProject"
- :pagination="ipaginationAccount"
- :loading="loadingAccount"
- >
- <span slot="action" slot-scope="text, record">
- <a @click="projectEdit(record, 1)">通过</a>
- <a-divider type="vertical" />
- <a @click="projectEdit(record, 2)">拒绝</a>
- </span>
- </a-table>
- </a-modal>
- </a-card>
- </template>
- <script>
- import moment from 'moment';
- import { httpAction, getAction, deleteAction, putAction } from '@/api/manage'
- import { mapGetters } from 'vuex'
- import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
- import { JeecgListMixin } from '@/mixins/ipagination'
- import checkBoxGroup from '@/components/formComponents/checkBoxGroup'
- const myProjectColumns = [
- {
- title: '项目名称',
- align: 'center',
- dataIndex: 'projectName',
- },
- {
- title: '广告主名称',
- align: 'center',
- dataIndex: 'advertiserId_dictText',
- },
- {
- title: '产品名称',
- align: 'center',
- dataIndex: 'productId_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: 'maxBid',
- scopedSlots: {
- customRender: 'maxBid',
- },
- },
- {
- title: '操作',
- dataIndex: 'action',
- align: 'center',
- scopedSlots: {
- customRender: 'action',
- },
- },
- ]
- const participationColumns = [
- {
- title: '项目名称',
- align: 'center',
- dataIndex: 'projectName',
- },
- {
- title: '广告主名称',
- align: 'center',
- dataIndex: 'advertiserName',
- },
- {
- title: '产品名称',
- align: 'center',
- dataIndex: 'productName',
- },
- {
- title: '运营负责人',
- align: 'center',
- dataIndex: 'responsibleName',
- },
- {
- title: '设计负责人',
- align: 'center',
- dataIndex: 'designResponsibleName',
- },
- {
- title: '媒体类型',
- align: 'center',
- dataIndex: 'mediaId',
- scopedSlots: {
- customRender: 'mediaId',
- },
- },
- {
- title: '最高出价',
- align: 'center',
- dataIndex: 'maxBid',
- scopedSlots: {
- customRender: 'maxBid',
- },
- },
- {
- title: '操作',
- dataIndex: 'action',
- align: 'center',
- scopedSlots: {
- customRender: 'action',
- },
- },
- ]
- export default {
- name: 'ProjectMemberList',
- components: {
- JSelectUserByDep,
- checkBoxGroup
- },
- mixins: [JeecgListMixin],
- data() {
- return {
- moment,
- dateValue: '',
- authConfigList:[],
- title: '',
- titleAccount: '',
- description: '我的项目',
- // 表头
- visible: false,
- keyWord: '',
- mode: 'authorization',
- mediaId: '2',
- accountName: '',
- password: '',
- loginType: 'kuaishou',
- id: undefined,
- formEdit: this.$form.createForm(this),
- record: '',
- systemType: '不限',
- systemTypeName: '',
- queryParam: {
- projectId: '',
- userId: '',
- },
- projectId: '',
- user: '',
- tabListNoTitle: [
- {
- key: 'myProject',
- tab: '我管理的',
- },
- {
- key: 'participation',
- tab: '我参与的',
- },
- ],
- noTitleKey: 'participation',
- columns: participationColumns,
- columnsAccount: [
- {
- title: '账户id',
- align: 'center',
- dataIndex: 'accountId',
- },
- {
- title: '账户名称',
- align: 'center',
- dataIndex: 'authName',
- },
- {
- title: '所属人',
- align: 'center',
- dataIndex: 'userName',
- },
- {
- title: '授权时间',
- align: 'center',
- dataIndex: 'createTime',
- scopedSlots: {
- customRender: 'createTime',
- },
- },
- ],
- ipaginationAccount: {
- current: 1,
- pageSize: 10,
- // pageSizeOptions: ['10', '20', '30'],
- showTotal: (total, range) => {
- return range[0] + '-' + range[1] + ' 共' + total + '条'
- },
- showQuickJumper: true,
- // showSizeChanger: true,
- total: 0,
- onChange: (current) => {
- // 切换分页时的回调,
- // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
- this.ipaginationAccount.current = current
- },
- },
- loadingAccount: false,
- projectVisible: false,
- columnsProject: [
- {
- title: '转让账户',
- align: 'center',
- dataIndex: 'accountId',
- },
- {
- title: '受让人姓名',
- align: 'center',
- dataIndex: 'assigneeName',
- },
- {
- title: '转户人姓名',
- align: 'center',
- dataIndex: 'transferorName',
- },
- {
- title: '受让人绩效开始时间',
- align: 'center',
- dataIndex: 'assigneeDate',
- },
- {
- title: '转户人绩效结束时间',
- align: 'center',
- dataIndex: 'transferorDate',
- },
- {
- title: '操作',
- dataIndex: 'action',
- align: 'center',
- scopedSlots: {
- customRender: 'action',
- },
- },
- ],
- dataProject: [],
- dataAccount: [],
- dataSource: [],
- dataElse: [],
- loading: false,
- memberList: [],
- visibleAdd: false,
- member: [],
- itemJson: null,
- visibleBind: false,
- bindAccountLoginUrl: '/ctop/bindAccountLogin/login',
- bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
- appId: [],
- list: [],
- options: [],
- visibleAccount: false,
- confirmLoading: false,
- }
- },
- computed: {
- importExcelUrl: function () {
- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
- },
- },
- filters: {
- roleCode(value) {
- var state = {
- clip: '剪辑',
- shot: '拍摄',
- plan: '策划',
- plane: '平面',
- admin: '管理员',
- operator: '运营专员',
- kuaishouOperationManager: '快手运营经理',
- designTeamLeader: '设计组长',
- planeLeader: '平面组长',
- touTiaoOperationManager: '头条运营经理',
- operationAssistant: '运营助理',
- }
- if (value) {
- return state[value]
- } else {
- return '暂无'
- }
- },
- getDate(value) {
- let date = new Date(value)
- let y = date.getFullYear()
- let MM = date.getMonth() + 1
- MM = MM < 10 ? '0' + MM : MM
- let d = date.getDate()
- d = d < 10 ? '0' + d : d
- return y + '-' + MM + '-' + d
- },
- },
- watch: {
- 'ipagination.current': function (n, o) {
- console.log(n, o)
- if (this.noTitleKey == 'participation') {
- this.getParticipateList()
- } else {
- this.getResponsibleList()
- }
- },
- },
- methods: {
- changeData(data) {
- if (data.length > 1 && data.findIndex((item) => item == 1) == 0) {
- data.splice(
- data.findIndex((item) => item == 1),
- 1
- )
- } else if (data.length > 1 && data.findIndex((item) => item == 1) == data.length - 1) {
- data.splice(0, data.length - 1)
- } else if (data.length == 0) {
- data.push(1)
- }
- },
- getFormFieldValue(field) {
- return this.formEdit.getFieldValue(field)
- },
- // /ctop/userAllocation/getAccountsByProjectId projectId userId
- handleCostTimeChange(date, dateString) {
- console.log(dateString, 'dateString');
- this.dateValue = dateString;
- },
- disabledDate(current) {
- if (this.loginType == 'kuaishou') {
- return current && !(current > moment().subtract(7, 'days'));
- }
- else if (this.loginType == 'bytedance') {
- return false;
- }
- // TODO 时间限制格式
- // return current && !(current > moment().subtract(7, 'days'));
- // return current && !(current > (moment().subtract(7, 'days')) && current < moment());
- // return false;
- },
- projectLook(item) {
- var params = {}
- params.projectId = item.id
- params.status = 0
- getAction('/ctop/transferAccount/list', params).then((res) => {
- if (res.success) {
- this.projectVisible = true
- this.dataProject = res.result.map((item, index) => {
- return {
- ...item,
- key: index,
- }
- })
- this.ipaginationAccount.total = res.result.length
- }
- })
- },
- projectEdit(item, status) {
- var params = {}
- params.id = item.id
- params.status = status
- params.auditor = this.userInfo().id
- putAction('/ctop/transferAccount/edit', params).then((res) => {
- if (res.success) {
- this.projectVisible = false
- this.getResponsibleList()
- }
- })
- },
- handleOkProject() {},
- ...mapGetters(['nickname', 'avatar', 'userInfo']),
- add(value, key) {
- var dataValue = value.split(',')
- var dataKey = key.split(',')
- var jsonArr = []
- for (let i = 0; i < dataValue.length; i++) {
- jsonArr.push({
- userId: dataKey[i],
- userName: dataValue[i],
- })
- }
- this.member = jsonArr
- },
- log(id) {
- deleteAction('/ctop/projectMember/delete', {
- id: id,
- }).then((res) => {
- if (res.success) {
- this.getMemberList(this.projectId)
- this.$message.success('删除成功')
- } else {
- this.$message.error(res.message)
- }
- })
- },
- onTabChange(key, type) {
- this[type] = key
- this.keyWord = ''
- this.ipagination.current = 1
- if (key == 'myProject') {
- this.columns = myProjectColumns
- this.getResponsibleList()
- } else {
- this.columns = participationColumns
- this.getParticipateList()
- }
- },
- getResponsibleList() {
- //我管理的
- this.dataSource = []
- this.dataElse = []
- this.loading = true
- getAction('/ctop/project/responsibleListV2', {
- userId: this.userInfo().id,
- pageSize: this.ipagination.pageSize,
- pageNo: this.ipagination.current,
- projectName: this.keyWord,
- }).then((res) => {
- if (res.code == 0) {
- this.loading = false
- this.dataSource = res.result.records
- this.dataElse = res.result.records
- this.ipagination.total = res.result.total
- }
- })
- },
- getParticipateList() {
- //我参与的
- this.dataSource = []
- this.dataElse = []
- this.loading = true
- getAction('/ctop/projectMember/participateListV2', {
- userId: this.userInfo().id,
- pageSize: this.ipagination.pageSize,
- pageNo: this.ipagination.current,
- projectName: this.keyWord,
- }).then((res) => {
- if (res.code == 0) {
- this.dataSource = res.result.records
- this.dataElse = res.result.records
- this.ipagination.total = res.result.total
- this.loading = false
- }
- })
- },
- getMemberList(projectId) {
- //成员查看
- this.memberList = []
- getAction('/ctop/projectMember/getMemberList', {
- projectId: projectId,
- }).then((res) => {
- if (res.code == 0) {
- this.visible = true
- this.memberList = res.result
- }
- })
- },
- handleOk(e) {
- this.visible = false
- },
- handleOkAdd(e) {
- var params = {}
- params.projectId = this.itemJson.id
- params.projectName = this.itemJson.projectName
- params.memberArr = this.appId
- this.confirmLoading = true
- httpAction('/ctop/projectMember/batchAdd', params, 'post').then((res) => {
- this.confirmLoading = false
- if (res.success) {
- this.visibleAdd = false
- this.appId = []
- this.$message.success('添加成功')
- } else {
- this.$message.error('添加失败')
- }
- })
- },
- getAllUserList(value) {
- getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: value }).then((res) => {
- if (res.success) {
- this.list = res.result.list
- this.options = res.result.list
- }
- })
- },
- addParams(item) {
- if (this.noTitleKey == 'myProject') {
- this.visibleAdd = true
- this.itemJson = item
- this.getAllUserList()
- } else {
- this.visibleAccount = true
- this.titleAccount = item.projectName
- this.loadingAccount = true
- getAction('/ctop/userAllocation/getAccountsByProjectId', {
- projectId: item.projectId,
- userId: this.userInfo().id,
- }).then((res) => {
- if (res.success) {
- this.dataAccount = res.result
- this.loadingAccount = false
- this.ipaginationAccount.total = res.result.length
- }
- })
- }
- },
- handleAdd() {},
- handleEdit(item) {
- if (this.noTitleKey == 'myProject') {
- this.title = item.projectName
- this.projectId = item.id
- this.getMemberList(item.id)
- } else {
- this.mode = 'authorization'
- this.loginType = item.mediaId == '1' || item.mediaId == '3' ? 'bytedance' : 'kuaishou'
- this.record = item
- this.visibleBind = true
- }
- },
- handleDelete(id) {},
- onChageLogin(e) {
- if (this.mode == 'login') {
- this.loginType = 'pangolin'
- } else {
- this.loginType = 'kuaishou'
- this.systemType = '不限'
- }
- },
- handleCancel() {
- this.visibleBind = false
- this.formEdit.resetFields();
- },
- handleSubmit() {
- let params = {}
- params.advertiserId = this.record.advertiserId
- params.advertiser_name = this.record.advertiserName
- params.userId = this.userInfo().id
- params.userName = this.userInfo().realname
- params.projectId = this.record.projectId
- params.projectName = this.record.projectName
- params.systemType = this.systemType == '4' ? this.systemTypeName : this.systemType
- params.authBeginTime = this.dateValue;
-
- // 触发表单验证
- this.formEdit.validateFields((err, values) => {
- if (!err) {
- params.materialType = values.materialType
- params.autoDelivery = values.autoDelivery
- if (this.mode == 'login') {
- params.accountName = this.accountName
- params.password = this.password
- params.loginType = this.loginType
- httpAction(this.bindAccountLoginUrl, params, 'post').then((res) => {
- if (res.success) {
- this.$message.success('绑定成功')
- this.accountName = ''
- this.password = ''
- this.loginType = 'kuaishou'
- this.visibleBind = false
- } else {
- this.$message.error(res.message)
- }
- })
- }
- // 授权登录
- if (this.mode == 'authorization') {
- params.authorizationType = this.loginType
- if (this.loginType == 'kuaishou') {
- params.mediaId = this.mediaId
- params.id = this.id
- } else if (this.loginType == 'bytedance') {
- params.mediaId = 1
- }
- params.warningAmount = values.warningAmount
- params.warningProportion = values.warningProportion
- httpAction(this.bindAuthorizationUrl, params, 'post').then((res) => {
- if (res.success) {
- window.open(res.message, '_blank')
- this.visibleBind = false
- this.formEdit.resetFields();
- } else {
- alert('绑定失败')
- }
- })
- }
- }
- })
- },
- searchReset() {
- this.keyWord = ''
- this.ipagination.current = 1
- // this.dataSource = this.dataElse
- if (this.noTitleKey == 'participation') {
- this.getParticipateList()
- } else {
- this.getResponsibleList()
- }
- },
- searchQuery() {
- this.ipagination.current = 1
- if (this.noTitleKey == 'participation') {
- this.getParticipateList()
- } else {
- this.getResponsibleList()
- }
- // this.dataSource = this.dataElse.filter(item => {
- // return item.projectName.toLowerCase().indexOf(this.keyWord.toLowerCase()) > -1
- // })
- },
- handleChange(value, options) {
- // this.appId = value
- },
- getElseData(value) {
- this.getStatistics()
- },
- handleBlur() {},
- handleFocus() {},
- 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()
- }
- },
- getauthConfigList() {
- getAction('/auth/oauthConfig/list', {
- status: 0,
- mediaId: 2,
- }).then((res) => {
- console.log(res)
- this.authConfigList = res.result
- if (res.result.length > 0) {
- this.id = res.result[0].id
- }
- })
- },
- },
- mounted() {
- this.$nextTick(() => {
- this.getParticipateList()
- this.getauthConfigList()
- })
- },
- }
- </script>
- <style scoped>
- @import '~@assets/less/common.less';
- </style>
|