企微助手 ,仓库名 短剧

channel.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <template>
  2. <div class="common-screen-item">
  3. <label class="common-screen-label" v-if="title && title != ''"
  4. :style="labelWidth ? 'width:auto;padding-left:30px' : ''">{{ title }}</label>
  5. <!-- <div :style="width ? 'width:' + width : ''"
  6. :class="['common-screen-self-box', 'common-input-select', (valueCon && valueCon.val) && clearable ? 'common-input-select-hover' : '']">
  7. <div :class="['common-screen-self-con', (!valueCon || !valueCon.val) ? 'common-screen-self-placeholder' : '']">
  8. <div class="common-screen-self-con-div">
  9. <span>{{ valueCon && valueCon.val ? valueCon.val : (placeholder || placeholderVal || '请选择') }}</span>
  10. </div>
  11. <i class="el-icon-circle-close other-icon" @click.stop="clear"></i>
  12. </div>
  13. <div class="common-screen-self-icon">
  14. <i class="el-icon-arrow-down"></i>
  15. </div>
  16. <el-select v-model="value" class="common-screen-opacity-0" placeholder="请选择" @change="change">
  17. <el-option v-for="item in options" :key="item.key" :label="item.val" :value="item.key">
  18. </el-option>
  19. </el-select>
  20. </div> -->
  21. <el-select
  22. class="select-cls"
  23. v-model="value"
  24. :style="{width: width || '210px'}"
  25. size="small"
  26. :placeholder="placeholder || placeholderVal || '请选择'"
  27. :clearable="clearable"
  28. filterable
  29. :disabled="disabled"
  30. @change="change"
  31. >
  32. <el-option v-for="item in options" :key="item.key" :label="item.val" :value="item.key" />
  33. </el-select>
  34. </div>
  35. </template>
  36. <script>
  37. import {
  38. promotionTypeCode,
  39. incomeSourceCode,
  40. launchTypeCode,
  41. customerStaffStatusCode,
  42. kfActiveStatusCode,
  43. } from '@/assets/js/staticTypes'
  44. export default {
  45. props: {
  46. afferent_value: '',
  47. clearable: {
  48. type: Boolean,
  49. default: true
  50. },
  51. reset: {
  52. type: Boolean,
  53. default: false
  54. },
  55. title: {
  56. type: String,
  57. default: '添加渠道'
  58. },
  59. type: {
  60. type: String,
  61. default: ''
  62. },
  63. labelWidth: {
  64. type: Boolean,
  65. default: false
  66. },
  67. disabled: {
  68. type: Boolean,
  69. default: false
  70. },
  71. afferent_params: {//接口传入数据
  72. type: Object,
  73. default: () => ({})
  74. },
  75. width: {
  76. type: String,
  77. },
  78. placeholder: {
  79. type: String,
  80. default: () => ''
  81. },
  82. },
  83. watch: {
  84. reset () {
  85. this.value = ''
  86. this.valueCon = {}
  87. },
  88. options () {
  89. if (this.options && this.options.length > 0) {
  90. this.init_afferent()
  91. }
  92. }
  93. },
  94. data () {
  95. return {
  96. value: '',
  97. options: [],
  98. valueCon: {},
  99. placeholderVal: ''
  100. }
  101. },
  102. created () {
  103. if (this.type == 'assignment_status') {
  104. this.options = [
  105. { key: 1, val: '已转接' },
  106. { key: 2, val: '客户转接中' },
  107. { key: 3, val: '客户已拒绝' },
  108. { key: 4, val: '接替成员客户达到上限' },
  109. { key: 5, val: '无接替记录' },
  110. { key: -1, val: '迁移失败' },
  111. ]
  112. } else if (this.type == 'remove_status') {
  113. this.options = [
  114. { key: 1, val: '待迁移' },
  115. { key: 2, val: '迁移中' },
  116. { key: 3, val: '迁移完成' },
  117. { key: -1, val: '迁移失败' },
  118. ]
  119. } else if (this.type == 'remove_type') {
  120. this.options = [
  121. { key: 1, val: '在职' },
  122. { key: 2, val: '离职' },
  123. ]
  124. } else if (this.type == 'chat_group_status') {
  125. this.options = [
  126. { key: 1, val: '群主已发送' },
  127. { key: 2, val: '群主未发送' },
  128. { key: 3, val: '发送失败' },
  129. ]
  130. } else if (this.type == 'thePublic') {//公众号(投放账号)
  131. this.placeholderVal = '公众号'
  132. this.thePublic_init()
  133. } else if (this.type == 'officialAccount') { // 公众号(成员、运营配置账号)
  134. this.placeholderVal = '公众号'
  135. this.getOfficialAccount()
  136. } else if (this.type == 'dramaList') {//短剧列表
  137. this.dramaList_init()
  138. } else if (this.type == 'popularizCompanys') {//推广数据
  139. this.popularizCompanys_init()
  140. } else if (this.type == 'pitcher') {//投手列表
  141. this.pitcher_init()
  142. } else if (this.type == 'chargePay') {//充值订单管理-支付状态
  143. this.options = [
  144. { key: 1, val: '已付款' },
  145. { key: 2, val: '未付款' }
  146. ]
  147. this.placeholderVal = '支付状态'
  148. } else if (this.type == 'orderType') {//充值订单管理-订单类型
  149. this.options = [
  150. { key: 1, val: '通用充值' },
  151. { key: 2, val: '充值活动' },
  152. { key: 3, val: '会员充值' },
  153. { key: 4, val: '平台会员充值' },
  154. ]
  155. this.placeholderVal = '订单类型'
  156. } else if (this.type == 'paySource') {//充值订单管理-付费来源
  157. this.options = [
  158. { key: 1, val: '柚子' },
  159. { key: 2, val: '嘉书' },
  160. { key: 3, val: '迈步' },
  161. { key: 4, val: '点众-阳光' },
  162. // { key: 5, val: '中文在线' },
  163. ]
  164. this.placeholderVal = '付费来源'
  165. } else if (this.type == 'wx_reportRule') {//回传规则
  166. this.reportRule_init()
  167. } else if (this.type == 'corpIdList') {//企微账号下拉列表
  168. this.getCorpIdList()
  169. } else if (this.type == 'circleCreate') {//企微朋友圈-选择创建人
  170. this.getsysUserList()
  171. this.placeholderVal = '选择创建人'
  172. } else if (this.type == 'circleType') {//企微朋友圈-朋友圈类型
  173. this.options = [
  174. { key: 2, val: '个人发表' },
  175. { key: 1, val: '企业发表' }
  176. ]
  177. this.placeholderVal = '朋友圈类型'
  178. } else if (this.type == 'importRecordDetial_addStatus') {//批量加好友/导入详情/添加状态
  179. this.options = [
  180. { key: 0, val: '全部' },
  181. { key: 1, val: '待添加' },
  182. { key: 2, val: '待通过' },
  183. { key: 3, val: '已添加' },
  184. { key: 4, val: '待分配' },
  185. ]
  186. this.placeholderVal = '添加状态'
  187. } else if (this.type == 'promotionType') { // 推广类型
  188. this.options = [
  189. { key: promotionTypeCode.h5, val: 'H5' },
  190. { key: promotionTypeCode.mini_program, val: '小程序' },
  191. ]
  192. this.placeholderVal = '推广类型'
  193. } else if (this.type == 'incomeSource') { // 收入来源
  194. this.options = [
  195. { key: incomeSourceCode.launch, val: '投放推广' },
  196. { key: incomeSourceCode.operation, val: '运营推广' },
  197. ]
  198. this.placeholderVal = '收入来源'
  199. } else if (this.type == 'launchType') { // 投放类型
  200. this.options = [
  201. { key: launchTypeCode.mp, val: 'MP投放' },
  202. { key: launchTypeCode.adq, val: 'ADQ投放' },
  203. ]
  204. this.placeholderVal = '投放类型'
  205. } else if (this.type == 'adqAccount') { // adq 账号选项
  206. this.getAdqAccountList()
  207. this.placeholderVal = 'ADQ账号'
  208. } else if (this.type == 'allAccount') { // 总表 账号选项
  209. this.getAllAccountList()
  210. this.placeholderVal = '总表账号'
  211. } else if (this.type == 'platform') { // 平台选项
  212. this.getPlatformList()
  213. this.placeholderVal = '请选择平台'
  214. } else if (this.type == 'mpAccountHS') { // 花生平台 MP账号
  215. this.getMpAccountHSList()
  216. this.placeholderVal = '请选择账号'
  217. } else if (this.type == 'isActive') { // 成员管理 激活状态
  218. this.options = [
  219. { key: kfActiveStatusCode.NOT_ACTIVATED, val: '未激活' },
  220. { key: kfActiveStatusCode.ACTIVATED, val: '已激活' },
  221. ]
  222. this.placeholderVal = '请选择激活状态'
  223. } else if (this.type == 'orderSource') { // 付费来源
  224. this.getOrderSource()
  225. this.placeholderVal = '付费来源'
  226. } else if (this.type == 'orderSourceHS') { // 订单来源 花生
  227. this.getOrderSourceHS()
  228. this.placeholderVal = '订单来源'
  229. } else if (this.type == 'operatorGroup') { // 运营组
  230. this.getOperatorGroup()
  231. this.placeholderVal = '运营组'
  232. } else if (this.type == 'materialLibrary') { // 图片组
  233. this.getPicturesGroup()
  234. this.placeholderVal = '图片组'
  235. } else if (this.type == 'customerStaffStatus') { // 客服状态
  236. this.options = [
  237. { key: customerStaffStatusCode.USING, val: '运营中' },
  238. { key: customerStaffStatusCode.STOPPED, val: '已停用' },
  239. { key: customerStaffStatusCode.BANNED, val: '已封禁' },
  240. ]
  241. this.placeholderVal = '请选择'
  242. } else if (this.type == 'expireDays') { // 到期时间
  243. this.options = [
  244. { key: 3, val: '3天' },
  245. { key: 7, val: '7天' },
  246. { key: 15, val: '15天' },
  247. ]
  248. this.placeholderVal = '请选择'
  249. } else {
  250. this.init()
  251. }
  252. },
  253. methods: {
  254. getPicturesGroup() { //图片组
  255. this.$axios.get(this.URL.BASEURL + this.URL.media_groupList, {
  256. params: {
  257. page: 1,
  258. page_size: 500,
  259. operator_id: '',
  260. }
  261. }).then((res) => {
  262. var res = res.data
  263. if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
  264. this.options = res.rst.data
  265. this.$emit('groupList', res.rst.data)
  266. this.options.forEach((item) => {
  267. item.val = item.name
  268. item.key = item.id
  269. });
  270. } else if (res.errno != 4002) {
  271. }
  272. }).catch((err) => {
  273. });
  274. },
  275. getOperatorGroup() { // 运营组
  276. this.$axios.get(this.URL.BASEURL + this.URL.operatorGroup_groupList, {
  277. params: {
  278. page: 1,
  279. page_size: 500,
  280. operator_id: '',
  281. }
  282. }).then((res) => {
  283. var res = res.data
  284. if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
  285. this.options = res.rst.data
  286. this.options.forEach((item) => {
  287. item.val = item.group_name
  288. item.key = item.group_id
  289. });
  290. } else if (res.errno != 4002) {
  291. }
  292. }).catch((err) => {
  293. });
  294. },
  295. getOrderSourceHS() { // 订单来源 花生
  296. this.$axios.get(this.URL.BASEURL + this.URL.dataBoardHS_platformList, { params: {}}).then((res) => {
  297. var res = res.data
  298. if (res && res.errno == 0) {
  299. this.options = res.rst
  300. this.options.forEach((item) => {
  301. item.val = item.desc
  302. item.key = item.order_source
  303. });
  304. } else if (res.errno != 4002) {
  305. }
  306. }).catch((err) => {
  307. });
  308. },
  309. getOrderSource() { // 付费来源
  310. this.$axios.get(this.URL.BASEURL + this.URL.order_platformList, { params: {}}).then((res) => {
  311. var res = res.data
  312. if (res && res.errno == 0) {
  313. this.options = res.rst
  314. this.options.forEach((item) => {
  315. item.val = item.platform_title
  316. item.key = item.platform_id
  317. });
  318. } else if (res.errno != 4002) {
  319. }
  320. }).catch((err) => {
  321. });
  322. },
  323. getMpAccountHSList() { // 花生平台 MP账号
  324. this.$axios.get(this.URL.BASEURL + this.URL.dataBoardHS_wxAccountList, {
  325. params: {
  326. is_select: 1
  327. }
  328. }).then((res) => {
  329. var res = res.data
  330. if (res && res.errno == 0) {
  331. this.options = res.rst
  332. this.options.forEach((item) => {
  333. item.val = item.account_name
  334. item.key = item.wechat_account_id
  335. });
  336. } else if (res.errno != 4002) {
  337. }
  338. }).catch((err) => {
  339. });
  340. },
  341. getPlatformList() { // 平台选项
  342. this.$axios.post(this.URL.BASEURL + this.URL.getPlatformOptions, {}).then((res) => {
  343. var res = res.data
  344. if (res && res.errno == 0) {
  345. this.options = res.rst
  346. this.options.forEach((item) => {
  347. item.val = item.platform_name
  348. item.key = item.platform_id
  349. });
  350. this.$emit('platformList', res.rst)
  351. } else if (res.errno != 4002) {
  352. }
  353. }).catch((err) => {
  354. });
  355. },
  356. getAdqAccountList() { // ADQ账号选项
  357. this.$axios.get(this.URL.BASEURL + this.URL.adqAccount_list, {
  358. params: {
  359. is_select: 1
  360. }
  361. }).then((res) => {
  362. var res = res.data
  363. if (res && res.errno == 0) {
  364. this.options = res.rst
  365. this.options.forEach((item) => {
  366. item.val = item.account_id
  367. item.key = item.account_id
  368. });
  369. } else if (res.errno != 4002) {
  370. }
  371. }).catch((err) => {
  372. });
  373. },
  374. getAllAccountList() { // 总表账号选项
  375. this.$axios.get(this.URL.BASEURL + this.URL.dataBoard_allAccountOptions, {
  376. params: {
  377. keyword: ''
  378. }
  379. }).then((res) => {
  380. var res = res.data
  381. if (res && res.errno == 0) {
  382. this.options = res.rst
  383. this.options.forEach((item) => {
  384. item.val = item.account_name
  385. item.key = item.account_id
  386. });
  387. } else if (res.errno != 4002) {
  388. }
  389. }).catch((err) => {
  390. });
  391. },
  392. getsysUserList () {
  393. this.$axios.get(this.URL.BASEURL + this.URL.getsysUserList, {
  394. params: {
  395. ...this.afferent_params
  396. }
  397. }).then((res) => {
  398. var res = res.data
  399. if (res && res.errno == 0) {
  400. this.options = res.rst
  401. this.options.forEach((item) => {
  402. item.val = item.name;
  403. item.key = item.admin_id
  404. });
  405. } else if (res.errno != 4002) {
  406. }
  407. }).catch((err) => {
  408. });
  409. },
  410. init_afferent () {//传入的时初始化
  411. if (this.afferent_value) {
  412. this.value = this.afferent_value
  413. let arr = this.options.filter((v) => {
  414. return v.key == this.value
  415. })
  416. arr.length > 0 ? this.valueCon = arr[0] : ''
  417. }
  418. },
  419. clear () {
  420. this.value = ''
  421. this.valueCon = {}
  422. this.$emit('channelDefine', '')
  423. },
  424. change () {
  425. let arr = this.options.filter((v) => {
  426. return v.key == this.value
  427. })
  428. arr.length > 0 ? this.valueCon = arr[0] : ''
  429. this.$emit('channelDefine', this.value)
  430. },
  431. init () {
  432. this.$axios.get(this.URL.BASEURL + this.URL.addWayList, {}).then((res) => {
  433. var res = res.data
  434. if (res && res.errno == 0) {
  435. this.options = res.rst
  436. } else if (res.errno != 4002) {
  437. }
  438. }).catch((err) => {
  439. });
  440. },
  441. thePublic_init () {
  442. this.$axios.get(this.URL.BASEURL + this.URL.pitcher_wxAccountList, {
  443. params: {
  444. is_select: 1,
  445. }
  446. }).then((res) => {
  447. var res = res.data
  448. if (res && res.errno == 0) {
  449. this.options = res.rst
  450. this.options.forEach((item) => {
  451. item.val = item.account_name;
  452. item.key = item.wechat_account_id
  453. });
  454. } else if (res.errno != 4002) {
  455. }
  456. }).catch((err) => {
  457. });
  458. },
  459. getOfficialAccount () {
  460. this.$axios.get(this.URL.BASEURL + this.URL.pitcher_officialAccountsList, {
  461. params: {
  462. is_select: 1,
  463. }
  464. }).then((res) => {
  465. var res = res.data
  466. if (res && res.errno == 0) {
  467. this.options = res.rst
  468. this.options.forEach((item) => {
  469. item.val = item.account_name;
  470. item.key = item.wechat_account_id
  471. });
  472. } else if (res.errno != 4002) {
  473. }
  474. }).catch((err) => {
  475. });
  476. },
  477. dramaList_init () {
  478. this.$axios.get(this.URL.BASEURL + this.URL.pitcher_dramaList, {
  479. params: {
  480. is_select: 1
  481. }
  482. }).then((res) => {
  483. var res = res.data
  484. if (res && res.errno == 0) {
  485. this.options = res.rst
  486. this.options.forEach((item) => {
  487. item.val = item.name;
  488. item.key = item.id
  489. });
  490. } else if (res.errno != 4002) {
  491. }
  492. }).catch((err) => {
  493. });
  494. },
  495. popularizCompanys_init () {
  496. this.$axios.get(this.URL.BASEURL + this.URL.stat_popularizCompanys, {
  497. params: this.afferent_params
  498. }).then((res) => {
  499. var res = res.data
  500. if (res && res.errno == 0) {
  501. this.options = res.rst
  502. this.options.forEach((item) => {
  503. item.val = item.principalName;
  504. item.key = item.principalName
  505. });
  506. } else if (res.errno != 4002) {
  507. }
  508. }).catch((err) => {
  509. });
  510. },
  511. pitcher_init () {
  512. this.$axios.get(this.URL.BASEURL + this.URL.pitcher_pitcherList, {
  513. params: this.afferent_params
  514. }).then((res) => {
  515. var res = res.data
  516. if (res && res.errno == 0) {
  517. this.options = res.rst
  518. this.options.forEach((item) => {
  519. item.val = item.name;
  520. item.key = item.id
  521. });
  522. } else if (res.errno != 4002) {
  523. }
  524. }).catch((err) => {
  525. });
  526. },
  527. reportRule_init () {
  528. this.$axios.get(this.URL.BASEURL + this.URL.pitcher_reportRuleList, {
  529. }).then((res) => {
  530. var res = res.data
  531. if (res && res.errno == 0) {
  532. this.options = res.rst
  533. this.options.forEach((item) => {
  534. item.val = item.name;
  535. item.key = item.id
  536. });
  537. } else if (res.errno != 4002) {
  538. }
  539. }).catch((err) => {
  540. });
  541. },
  542. getCorpIdList () {
  543. this.$axios.get(this.URL.BASEURL + this.URL.pitcher_getCorpIdList, {
  544. }).then((res) => {
  545. var res = res.data
  546. if (res && res.errno == 0) {
  547. this.options = res.rst
  548. this.options.forEach((item) => {
  549. item.val = item.corp_name;
  550. item.key = item.corpid
  551. });
  552. } else if (res.errno != 4002) {
  553. }
  554. }).catch((err) => {
  555. });
  556. }
  557. }
  558. }
  559. </script>
  560. <style lang="scss" scoped>
  561. .dateInput {
  562. padding: 0 !important;
  563. text-align: center;
  564. }
  565. .select-cls {
  566. /deep/ &.el-select .el-input.is-focus .el-input__inner,
  567. /deep/ &.el-select .el-input__inner:focus {
  568. border-color: #DCDFE6;
  569. }
  570. /deep/ .el-input__suffix {
  571. border-top-right-radius: 4px;
  572. border-bottom-right-radius: 4px;
  573. border: 1px solid #DCDFE6;
  574. right: 0;
  575. width: 30px;
  576. background-color: #F1F1F1;
  577. .el-input__icon {
  578. color: #909399;
  579. }
  580. }
  581. }
  582. </style>