ProjectMemberList.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. <style>
  2. .my-project .ant-tabs-nav-scroll {
  3. display: flex;
  4. justify-content: center;
  5. }
  6. .close-account-my-project .ant-modal-footer .ant-btn-primary {
  7. display: none;
  8. }
  9. .only .ant-badge-count {
  10. right: -16px;
  11. }
  12. </style>
  13. <template>
  14. <a-card
  15. :bordered="false"
  16. :tabList="tabListNoTitle"
  17. :activeTabKey="noTitleKey"
  18. @tabChange="key => onTabChange(key, 'noTitleKey')"
  19. class="my-project"
  20. >
  21. <!-- 查询区域 -->
  22. <div class="table-page-search-wrapper">
  23. <a-form layout="inline">
  24. <a-row :gutter="24">
  25. <a-col :md="6" :sm="8">
  26. <a-form-item label="项目名称">
  27. <a-input placeholder="请输入项目名称" v-model="keyWord"></a-input>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  32. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  33. <a-button
  34. type="primary"
  35. @click="searchReset"
  36. icon="reload"
  37. style="margin-left: 8px"
  38. >重置</a-button>
  39. </span>
  40. </a-col>
  41. </a-row>
  42. </a-form>
  43. </div>
  44. <!-- table区域-begin -->
  45. <div>
  46. <a-table
  47. ref="table"
  48. size="middle"
  49. bordered
  50. rowKey="id"
  51. :columns="columns"
  52. :dataSource="dataSource"
  53. :pagination="ipagination"
  54. :loading="loading"
  55. >
  56. <span slot="maxBid" slot-scope="maxBid">{{ maxBid / 1000 }}</span>
  57. <span
  58. slot="mediaId"
  59. slot-scope="mediaId"
  60. >{{ mediaId == 1 ? '头条' :mediaId == 2? '快手':mediaId == 3?'头条内广':'快手内广' }}</span>
  61. <span slot="action" slot-scope="text, record">
  62. <a @click="handleEdit(record)">{{ noTitleKey == 'myProject' ? '查看成员' : '账号绑定' }}</a>
  63. <a-divider type="vertical" />
  64. <a @click="addParams(record)">{{ noTitleKey == 'myProject' ? '新增人员' : '查看账户' }}</a>
  65. <a-divider type="vertical" v-if="noTitleKey == 'myProject'" />
  66. <a-badge :count="record.needExamine" class="only">
  67. <a
  68. @click="projectLook(record)"
  69. v-if="noTitleKey == 'myProject'"
  70. :disabled="record.needExamine == 0||record.needExamine == null"
  71. >待办事项</a>
  72. </a-badge>
  73. </span>
  74. </a-table>
  75. </div>
  76. <!-- table区域-end -->
  77. <!-- 查看项目成员 -->
  78. <a-modal
  79. :maskClosable="false"
  80. :title="title"
  81. v-model="visible"
  82. @ok="handleOk"
  83. width="800px"
  84. class="close-account-my-project"
  85. >
  86. <div style="display:flex;line-height:50px;flex-wrap: wrap;">
  87. <div style="width:25%;text-align:center;" v-for="(item, index) of memberList" :key="index">
  88. <a-tag color="#2db7f5" @close="log(item.id)" closable>
  89. {{ item.userName }}
  90. <a-divider type="vertical" />
  91. {{ item.roleCode | roleCode }}
  92. </a-tag>
  93. </div>
  94. </div>
  95. </a-modal>
  96. <!-- 添加项目成员 -->
  97. <a-modal
  98. :maskClosable="false"
  99. title="添加项目成员"
  100. v-model="visibleAdd"
  101. @ok="handleOkAdd"
  102. :confirmLoading="confirmLoading"
  103. >
  104. <!-- /sys/user/getAllUserList -->
  105. <a-select
  106. v-model="appId"
  107. showSearch
  108. allowClear
  109. mode="multiple"
  110. placeholder="请选择成员"
  111. optionFilterProp="children"
  112. style="width: 100%"
  113. @focus="handleFocus"
  114. @blur="handleBlur"
  115. @change="handleChange"
  116. :filterOption="true"
  117. @search="search"
  118. :maxTagCount="1"
  119. >
  120. <a-select-option
  121. v-for="appModel in options"
  122. :key="appModel.userId + new Date().getTime()"
  123. :value="appModel.userId"
  124. >
  125. {{ appModel.realName }}
  126. &#12288;&#12288;{{ appModel.roleName }}
  127. </a-select-option>
  128. </a-select>
  129. </a-modal>
  130. <!-- 账号绑定 -->
  131. <a-modal
  132. :maskClosable="false"
  133. title="账号绑定"
  134. v-model="visibleBind"
  135. @ok="handleSubmit"
  136. :width="800"
  137. :okButtonProps="{ props: { disabled: false } }"
  138. :cancelButtonProps="{ props: { disabled: false } }"
  139. >
  140. <a-form :form="form">
  141. <a-form-item
  142. label="选择方式"
  143. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  144. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  145. >
  146. <a-radio-group buttonStyle="solid" v-model="mode" @change="onChageLogin">
  147. <a-radio-button value="authorization">授权</a-radio-button>
  148. <a-radio-button value="login">登录</a-radio-button>
  149. </a-radio-group>
  150. </a-form-item>
  151. <div v-if="mode=='authorization'">
  152. <a-form-item
  153. label="媒体:"
  154. :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
  155. :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
  156. >
  157. <a-radio-group buttonStyle="outline" v-model="loginType">
  158. <a-radio-button value="kuaishou">快手</a-radio-button>
  159. <a-radio-button value="bytedance">头条</a-radio-button>
  160. </a-radio-group>
  161. <br />
  162. <span style="color:red;" v-if="loginType == 'bytedance'">*重要:如存在一户多开情况,请勾选所有子账号进行授权!!!</span>
  163. </a-form-item>
  164. <a-form-item
  165. label="开户代理商:"
  166. :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
  167. :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
  168. v-if="loginType == 'kuaishou'"
  169. >
  170. <a-radio-group buttonStyle="outline" v-model="id">
  171. <!-- <a-radio-button value="0">否</a-radio-button>
  172. <a-radio-button value="1">是</a-radio-button> -->
  173. <a-radio-button v-for="item in authConfigList" :key="item.id" :value='item.id'>{{item.agentName}}</a-radio-button>
  174. </a-radio-group>
  175. </a-form-item>
  176. <a-form-item
  177. label="系统类型:"
  178. :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
  179. :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
  180. >
  181. <a-radio-group buttonStyle="outline" v-model="systemType">
  182. <a-radio-button value="不限">不限</a-radio-button>
  183. <a-radio-button value="ios">ios</a-radio-button>
  184. <a-radio-button value="android">android</a-radio-button>
  185. <a-radio-button value="4">其他</a-radio-button>
  186. </a-radio-group>
  187. <a-input v-model="systemTypeName" v-if="systemType == '4'" placeholder="请输入系统类型" />
  188. </a-form-item>
  189. <a-form-item
  190. label="预警金额"
  191. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  192. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  193. >
  194. <!-- <a-input v-decorator="['warningAmount', { rules: [{ required: true, message: '请输入预警金额' }] }]" /> -->
  195. <a-input-number
  196. style="width:50%"
  197. v-decorator="[
  198. 'warningAmount',
  199. { rules: [{ required: true, message: '请输入预警金额' }], initialValue: 5000 }
  200. ]"
  201. />
  202. </a-form-item>
  203. <a-form-item
  204. label="预警比例"
  205. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  206. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  207. >
  208. <a-input-number
  209. :step="0.1"
  210. style="width:50%"
  211. v-decorator="[
  212. 'warningProportion',
  213. { rules: [{ required: true, message: '请输入预警比例' }], initialValue: 1.5 }
  214. ]"
  215. />
  216. </a-form-item>
  217. </div>
  218. <div v-else>
  219. <a-form-item
  220. label="媒体:"
  221. :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
  222. :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
  223. >
  224. <a-radio-group buttonStyle="outline" v-model="loginType">
  225. <a-radio-button value="pangolin">穿山甲</a-radio-button>
  226. </a-radio-group>
  227. </a-form-item>
  228. <a-form-item
  229. label="账号:"
  230. :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
  231. :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
  232. v-show="mode == 'login'"
  233. >
  234. <a-input v-model="accountName" placeholder="请输入账户名" />
  235. </a-form-item>
  236. <a-form-item
  237. label="密码:"
  238. :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
  239. :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
  240. v-show="mode == 'login'"
  241. >
  242. <a-input type="password" v-model="password" placeholder="请输入密码" />
  243. </a-form-item>
  244. </div>
  245. </a-form>
  246. </a-modal>
  247. <!-- 查看项目下的账号 -->
  248. <a-modal
  249. :maskClosable="false"
  250. :title="titleAccount"
  251. v-model="visibleAccount"
  252. @ok="handleOk"
  253. width="800px"
  254. class="close-account-my-project"
  255. >
  256. <a-table
  257. ref="table"
  258. size="middle"
  259. bordered
  260. rowKey="id"
  261. :columns="columnsAccount"
  262. :dataSource="dataAccount"
  263. :pagination="ipaginationAccount"
  264. :loading="loadingAccount"
  265. >
  266. <span slot="createTime" slot-scope="createTime">{{ createTime | getDate }}</span>
  267. </a-table>
  268. </a-modal>
  269. <!-- 待办事件审核 -->
  270. <a-modal
  271. :maskClosable="false"
  272. title="待办事件审核"
  273. v-model="projectVisible"
  274. @ok="handleOkProject"
  275. width="800px"
  276. class="close-account-my-project"
  277. :footer="null"
  278. >
  279. <a-table
  280. ref="table"
  281. size="middle"
  282. bordered
  283. rowKey="id"
  284. :columns="columnsProject"
  285. :dataSource="dataProject"
  286. :pagination="ipaginationAccount"
  287. :loading="loadingAccount"
  288. >
  289. <span slot="action" slot-scope="text, record">
  290. <a @click="projectEdit(record, 1)">通过</a>
  291. <a-divider type="vertical" />
  292. <a @click="projectEdit(record, 2)">拒绝</a>
  293. </span>
  294. </a-table>
  295. </a-modal>
  296. </a-card>
  297. </template>
  298. <script>
  299. import { httpAction, getAction, deleteAction, putAction } from '@/api/manage'
  300. import { mapGetters } from 'vuex'
  301. import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
  302. import { JeecgListMixin } from '@/mixins/ipagination'
  303. const myProjectColumns = [
  304. {
  305. title: '项目名称',
  306. align: 'center',
  307. dataIndex: 'projectName',
  308. },
  309. {
  310. title: '广告主名称',
  311. align: 'center',
  312. dataIndex: 'advertiserId_dictText',
  313. },
  314. {
  315. title: '产品名称',
  316. align: 'center',
  317. dataIndex: 'productId_dictText',
  318. },
  319. {
  320. title: '运营负责人',
  321. align: 'center',
  322. dataIndex: 'responsibleId_dictText',
  323. },
  324. {
  325. title: '设计负责人',
  326. align: 'center',
  327. dataIndex: 'designResponsibleId_dictText',
  328. },
  329. {
  330. title: '媒体类型',
  331. align: 'center',
  332. dataIndex: 'mediaId',
  333. scopedSlots: {
  334. customRender: 'mediaId',
  335. },
  336. },
  337. {
  338. title: '最高出价',
  339. align: 'center',
  340. dataIndex: 'maxBid',
  341. scopedSlots: {
  342. customRender: 'maxBid',
  343. },
  344. },
  345. {
  346. title: '操作',
  347. dataIndex: 'action',
  348. align: 'center',
  349. scopedSlots: {
  350. customRender: 'action',
  351. },
  352. },
  353. ]
  354. const participationColumns = [
  355. {
  356. title: '项目名称',
  357. align: 'center',
  358. dataIndex: 'projectName',
  359. },
  360. {
  361. title: '广告主名称',
  362. align: 'center',
  363. dataIndex: 'advertiserName',
  364. },
  365. {
  366. title: '产品名称',
  367. align: 'center',
  368. dataIndex: 'productName',
  369. },
  370. {
  371. title: '运营负责人',
  372. align: 'center',
  373. dataIndex: 'responsibleName',
  374. },
  375. {
  376. title: '设计负责人',
  377. align: 'center',
  378. dataIndex: 'designResponsibleName',
  379. },
  380. {
  381. title: '媒体类型',
  382. align: 'center',
  383. dataIndex: 'mediaId',
  384. scopedSlots: {
  385. customRender: 'mediaId',
  386. },
  387. },
  388. {
  389. title: '最高出价',
  390. align: 'center',
  391. dataIndex: 'maxBid',
  392. scopedSlots: {
  393. customRender: 'maxBid',
  394. },
  395. },
  396. {
  397. title: '操作',
  398. dataIndex: 'action',
  399. align: 'center',
  400. scopedSlots: {
  401. customRender: 'action',
  402. },
  403. },
  404. ]
  405. export default {
  406. name: 'ProjectMemberList',
  407. components: {
  408. JSelectUserByDep,
  409. },
  410. mixins: [JeecgListMixin],
  411. data() {
  412. return {
  413. authConfigList:[],
  414. title: '',
  415. titleAccount: '',
  416. description: '我的项目',
  417. // 表头
  418. visible: false,
  419. keyWord: '',
  420. mode: 'authorization',
  421. mediaId: '2',
  422. accountName: '',
  423. password: '',
  424. loginType: 'kuaishou',
  425. id: undefined,
  426. form: this.$form.createForm(this),
  427. record: '',
  428. systemType: '不限',
  429. systemTypeName: '',
  430. queryParam: {
  431. projectId: '',
  432. userId: '',
  433. },
  434. projectId: '',
  435. user: '',
  436. tabListNoTitle: [
  437. {
  438. key: 'myProject',
  439. tab: '我管理的',
  440. },
  441. {
  442. key: 'participation',
  443. tab: '我参与的',
  444. },
  445. ],
  446. noTitleKey: 'participation',
  447. columns: participationColumns,
  448. columnsAccount: [
  449. {
  450. title: '账户id',
  451. align: 'center',
  452. dataIndex: 'accountId',
  453. },
  454. {
  455. title: '账户名称',
  456. align: 'center',
  457. dataIndex: 'authName',
  458. },
  459. {
  460. title: '所属人',
  461. align: 'center',
  462. dataIndex: 'userName',
  463. },
  464. {
  465. title: '授权时间',
  466. align: 'center',
  467. dataIndex: 'createTime',
  468. scopedSlots: {
  469. customRender: 'createTime',
  470. },
  471. },
  472. ],
  473. ipaginationAccount: {
  474. current: 1,
  475. pageSize: 10,
  476. // pageSizeOptions: ['10', '20', '30'],
  477. showTotal: (total, range) => {
  478. return range[0] + '-' + range[1] + ' 共' + total + '条'
  479. },
  480. showQuickJumper: true,
  481. // showSizeChanger: true,
  482. total: 0,
  483. onChange: (current) => {
  484. // 切换分页时的回调,
  485. // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
  486. this.ipaginationAccount.current = current
  487. },
  488. },
  489. loadingAccount: false,
  490. projectVisible: false,
  491. columnsProject: [
  492. {
  493. title: '转让账户',
  494. align: 'center',
  495. dataIndex: 'accountId',
  496. },
  497. {
  498. title: '受让人姓名',
  499. align: 'center',
  500. dataIndex: 'transferorName',
  501. },
  502. {
  503. title: '转户人姓名',
  504. align: 'center',
  505. dataIndex: 'assigneeName',
  506. },
  507. {
  508. title: '受让人绩效开始时间',
  509. align: 'center',
  510. dataIndex: 'assigneeDate',
  511. },
  512. {
  513. title: '转户人绩效结束时间',
  514. align: 'center',
  515. dataIndex: 'transferorDate',
  516. },
  517. {
  518. title: '操作',
  519. dataIndex: 'action',
  520. align: 'center',
  521. scopedSlots: {
  522. customRender: 'action',
  523. },
  524. },
  525. ],
  526. dataProject: [],
  527. dataAccount: [],
  528. dataSource: [],
  529. dataElse: [],
  530. loading: false,
  531. memberList: [],
  532. visibleAdd: false,
  533. member: [],
  534. itemJson: null,
  535. visibleBind: false,
  536. bindAccountLoginUrl: '/ctop/bindAccountLogin/login',
  537. bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
  538. appId: [],
  539. list: [],
  540. options: [],
  541. visibleAccount: false,
  542. confirmLoading: false,
  543. }
  544. },
  545. computed: {
  546. importExcelUrl: function () {
  547. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  548. },
  549. },
  550. filters: {
  551. roleCode(value) {
  552. var state = {
  553. clip: '剪辑',
  554. shot: '拍摄',
  555. plan: '策划',
  556. plane: '平面',
  557. admin: '管理员',
  558. operator: '运营专员',
  559. kuaishouOperationManager: '快手运营经理',
  560. designTeamLeader: '设计组长',
  561. planeLeader: '平面组长',
  562. touTiaoOperationManager: '头条运营经理',
  563. operationAssistant: '运营助理',
  564. }
  565. if (value) {
  566. return state[value]
  567. } else {
  568. return '暂无'
  569. }
  570. },
  571. getDate(value) {
  572. let date = new Date(value)
  573. let y = date.getFullYear()
  574. let MM = date.getMonth() + 1
  575. MM = MM < 10 ? '0' + MM : MM
  576. let d = date.getDate()
  577. d = d < 10 ? '0' + d : d
  578. return y + '-' + MM + '-' + d
  579. },
  580. },
  581. watch: {
  582. 'ipagination.current': function (n, o) {
  583. console.log(n, o)
  584. if (this.noTitleKey == 'participation') {
  585. this.getParticipateList()
  586. } else {
  587. this.getResponsibleList()
  588. }
  589. },
  590. },
  591. methods: {
  592. // /ctop/userAllocation/getAccountsByProjectId projectId userId
  593. projectLook(item) {
  594. var params = {}
  595. params.projectId = item.id
  596. params.status = 0
  597. getAction('/ctop/transferAccount/list', params).then((res) => {
  598. if (res.success) {
  599. this.projectVisible = true
  600. this.dataProject = res.result.map((item, index) => {
  601. return {
  602. ...item,
  603. key: index,
  604. }
  605. })
  606. this.ipaginationAccount.total = res.result.length
  607. }
  608. })
  609. },
  610. projectEdit(item, status) {
  611. var params = {}
  612. params.id = item.id
  613. params.status = status
  614. params.auditor = this.userInfo().id
  615. putAction('/ctop/transferAccount/edit', params).then((res) => {
  616. if (res.success) {
  617. this.projectVisible = false
  618. this.getResponsibleList()
  619. }
  620. })
  621. },
  622. handleOkProject() {},
  623. ...mapGetters(['nickname', 'avatar', 'userInfo']),
  624. add(value, key) {
  625. var dataValue = value.split(',')
  626. var dataKey = key.split(',')
  627. var jsonArr = []
  628. for (let i = 0; i < dataValue.length; i++) {
  629. jsonArr.push({
  630. userId: dataKey[i],
  631. userName: dataValue[i],
  632. })
  633. }
  634. this.member = jsonArr
  635. },
  636. log(id) {
  637. deleteAction('/ctop/projectMember/delete', {
  638. id: id,
  639. }).then((res) => {
  640. if (res.success) {
  641. this.getMemberList(this.projectId)
  642. this.$message.success('删除成功')
  643. } else {
  644. this.$message.error(res.message)
  645. }
  646. })
  647. },
  648. onTabChange(key, type) {
  649. this[type] = key
  650. this.keyWord = ''
  651. this.ipagination.current = 1
  652. if (key == 'myProject') {
  653. this.columns = myProjectColumns
  654. this.getResponsibleList()
  655. } else {
  656. this.columns = participationColumns
  657. this.getParticipateList()
  658. }
  659. },
  660. getResponsibleList() {
  661. //我管理的
  662. this.dataSource = []
  663. this.dataElse = []
  664. this.loading = true
  665. getAction('/ctop/project/responsibleListV2', {
  666. userId: this.userInfo().id,
  667. pageSize: this.ipagination.pageSize,
  668. pageNo: this.ipagination.current,
  669. projectName: this.keyWord,
  670. }).then((res) => {
  671. if (res.code == 0) {
  672. this.loading = false
  673. this.dataSource = res.result.records
  674. this.dataElse = res.result.records
  675. this.ipagination.total = res.result.total
  676. }
  677. })
  678. },
  679. getParticipateList() {
  680. //我参与的
  681. this.dataSource = []
  682. this.dataElse = []
  683. this.loading = true
  684. getAction('/ctop/projectMember/participateListV2', {
  685. userId: this.userInfo().id,
  686. pageSize: this.ipagination.pageSize,
  687. pageNo: this.ipagination.current,
  688. projectName: this.keyWord,
  689. }).then((res) => {
  690. if (res.code == 0) {
  691. this.dataSource = res.result.records
  692. this.dataElse = res.result.records
  693. this.ipagination.total = res.result.total
  694. this.loading = false
  695. }
  696. })
  697. },
  698. getMemberList(projectId) {
  699. //成员查看
  700. this.memberList = []
  701. getAction('/ctop/projectMember/getMemberList', {
  702. projectId: projectId,
  703. }).then((res) => {
  704. if (res.code == 0) {
  705. this.visible = true
  706. this.memberList = res.result
  707. }
  708. })
  709. },
  710. handleOk(e) {
  711. this.visible = false
  712. },
  713. handleOkAdd(e) {
  714. var params = {}
  715. params.projectId = this.itemJson.id
  716. params.projectName = this.itemJson.projectName
  717. params.memberArr = this.appId
  718. this.confirmLoading = true
  719. httpAction('/ctop/projectMember/batchAdd', params, 'post').then((res) => {
  720. this.confirmLoading = false
  721. if (res.success) {
  722. this.visibleAdd = false
  723. this.appId = []
  724. this.$message.success('添加成功')
  725. } else {
  726. this.$message.error('添加失败')
  727. }
  728. })
  729. },
  730. getAllUserList(value) {
  731. getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: value }).then((res) => {
  732. if (res.success) {
  733. this.list = res.result.list
  734. this.options = res.result.list
  735. }
  736. })
  737. },
  738. addParams(item) {
  739. if (this.noTitleKey == 'myProject') {
  740. this.visibleAdd = true
  741. this.itemJson = item
  742. this.getAllUserList()
  743. } else {
  744. this.visibleAccount = true
  745. this.titleAccount = item.projectName
  746. this.loadingAccount = true
  747. getAction('/ctop/userAllocation/getAccountsByProjectId', {
  748. projectId: item.projectId,
  749. userId: this.userInfo().id,
  750. }).then((res) => {
  751. if (res.success) {
  752. this.dataAccount = res.result
  753. this.loadingAccount = false
  754. this.ipaginationAccount.total = res.result.length
  755. }
  756. })
  757. }
  758. },
  759. handleAdd() {},
  760. handleEdit(item) {
  761. if (this.noTitleKey == 'myProject') {
  762. this.title = item.projectName
  763. this.projectId = item.id
  764. this.getMemberList(item.id)
  765. } else {
  766. this.mode = 'authorization'
  767. this.loginType = item.mediaId == '1' || item.mediaId == '3' ? 'bytedance' : 'kuaishou'
  768. this.record = item
  769. this.visibleBind = true
  770. }
  771. },
  772. handleDelete(id) {},
  773. onChageLogin(e) {
  774. if (this.mode == 'login') {
  775. this.loginType = 'pangolin'
  776. } else {
  777. this.loginType = 'kuaishou'
  778. this.systemType = '不限'
  779. }
  780. },
  781. handleSubmit() {
  782. let params = {}
  783. params.advertiserId = this.record.advertiserId
  784. params.advertiser_name = this.record.advertiserName
  785. params.userId = this.userInfo().id
  786. params.userName = this.userInfo().realname
  787. params.projectId = this.record.projectId
  788. params.projectName = this.record.projectName
  789. params.systemType = this.systemType == '4' ? this.systemTypeName : this.systemType
  790. params.channelType = 'jiaoyang'
  791. // 触发表单验证
  792. this.form.validateFields((err, values) => {
  793. if (!err) {
  794. if (this.mode == 'login') {
  795. params.accountName = this.accountName
  796. params.password = this.password
  797. params.loginType = this.loginType
  798. httpAction(this.bindAccountLoginUrl, params, 'post').then((res) => {
  799. if (res.success) {
  800. this.$message.success('绑定成功')
  801. this.accountName = ''
  802. this.password = ''
  803. this.loginType = 'kuaishou'
  804. this.visibleBind = false
  805. } else {
  806. this.$message.error(res.message)
  807. }
  808. })
  809. }
  810. // 授权登录
  811. if (this.mode == 'authorization') {
  812. params.authorizationType = this.loginType
  813. if (this.loginType == 'kuaishou') {
  814. params.mediaId = this.mediaId
  815. params.id = this.id
  816. } else if (this.loginType == 'bytedance') {
  817. params.mediaId = 1
  818. }
  819. params.warningAmount = values.warningAmount
  820. params.warningProportion = values.warningProportion
  821. httpAction(this.bindAuthorizationUrl, params, 'post').then((res) => {
  822. if (res.success) {
  823. window.open(res.message, '_blank')
  824. this.visibleBind = false
  825. } else {
  826. alert('绑定失败')
  827. }
  828. })
  829. }
  830. }
  831. })
  832. },
  833. searchReset() {
  834. this.keyWord = ''
  835. this.ipagination.current = 1
  836. // this.dataSource = this.dataElse
  837. if (this.noTitleKey == 'participation') {
  838. this.getParticipateList()
  839. } else {
  840. this.getResponsibleList()
  841. }
  842. },
  843. searchQuery() {
  844. this.ipagination.current=1
  845. if (this.noTitleKey == 'participation') {
  846. this.getParticipateList()
  847. } else {
  848. this.getResponsibleList()
  849. }
  850. // this.dataSource = this.dataElse.filter(item => {
  851. // return item.projectName.toLowerCase().indexOf(this.keyWord.toLowerCase()) > -1
  852. // })
  853. },
  854. handleChange(value, options) {
  855. // this.appId = value
  856. },
  857. getElseData(value) {
  858. this.getStatistics()
  859. },
  860. handleBlur() {},
  861. handleFocus() {},
  862. search(value) {
  863. this.options = []
  864. if (value != '') {
  865. // this.options = this.list.filter(item => {
  866. // var data = item.realName + ' ' + item.roleName
  867. // return data.toLowerCase().indexOf(value.toLowerCase()) > -1
  868. // })
  869. // this.options = [...this.options]
  870. this.getAllUserList(value)
  871. } else {
  872. this.getAllUserList()
  873. }
  874. },
  875. getauthConfigList(){
  876. getAction('/auth/oauthConfig/list',{
  877. status:0,
  878. mediaId:2
  879. }).then(res=>{
  880. console.log(res)
  881. this.authConfigList=res.result;
  882. if(res.result.length>0){
  883. this.id=res.result[0].id
  884. }
  885. })
  886. }
  887. },
  888. mounted() {
  889. this.$nextTick(() => {
  890. this.getParticipateList()
  891. this.getauthConfigList()
  892. })
  893. },
  894. }
  895. </script>
  896. <style scoped>
  897. @import '~@assets/less/common.less';
  898. </style>