ProjectMemberList.vue 26 KB

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