企微助手 ,仓库名 短剧

userDetail.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <div class="modular">
  3. <div class="modularItem" v-loading='loading'>
  4. <div class="flex">
  5. <div class="big_title flex-align-center">成员详情</div>
  6. <a :href="exportHref" class="selfBtn_detial">导出</a>
  7. </div>
  8. <div class="tabBox">
  9. <div :class="['tabItem',memberType==item.id?'active':'']" v-for="(item) in memberTypeList" :key="item.id+'memberTypeList'" @click="memberType=item.id;sender_list_change()">{{item.name}}</div>
  10. </div>
  11. <div class="flex">
  12. <div class="totalCustom"><i class="el-icon-user-solid"></i> 共<span>{{total}}</span>人</div>
  13. <self-input label_name='成员昵称' :hasLabel='false' @inputChange='(val)=>{input_keyword = val;sender_list_change()}'></self-input>
  14. </div>
  15. <div class="userListBox self-scrollbar-3 senderSccrollBox">
  16. <div class="userItem" v-for="(item,idx) in senderList" :key="item.user_id+'sender'+idx">
  17. <div class="time">群发时间:{{item.send_time?item.send_time:'-'}}</div>
  18. <div class="userBox">
  19. <img :src="item.avatar" alt="" class="userImg">
  20. <div>
  21. <div class="userName">{{item.name}}</div>
  22. <div class="other">共需发送{{$formatNum(item.customer_num)}}个好友,已发送{{$formatNum(item.send_success)}}人</div>
  23. </div>
  24. </div>
  25. </div>
  26. <noData v-if="senderList&&senderList.length<=0&&!loading"></noData>
  27. </div>
  28. <div class="pagination" v-show="total>page_size">
  29. <el-pagination background :current-page="page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count='Number(pages)'>
  30. </el-pagination>
  31. </div>
  32. </div>
  33. <div class="modularItem" v-loading="cy_loading">
  34. <div class="flex">
  35. <div class="big_title flex-align-center">客户详情</div>
  36. <div class="flex-align-center">
  37. <el-select v-model="user_id" size='mini' clearable placeholder="请选择客服" @change="sendCustList_change()">
  38. <el-option v-for="item in allMemberOptions" :key="item.user_id" :label="item.name" :value="item.user_id">
  39. </el-option>
  40. </el-select>
  41. <a :href="exportHref_send" class="selfBtn_detial" style="margin-left:20px">导出</a>
  42. </div>
  43. </div>
  44. <div class="tabBox">
  45. <div :class="['tabItem',massType==item.id?'active':'']" v-for="(item) in massTypeList" :key="item.id+'massTypeList'" @click="massType=item.id;sendCustList_change()">{{item.name}}</div>
  46. </div>
  47. <div class="flex">
  48. <div class="totalCustom"><i class="el-icon-user-solid"></i> 共<span>{{$formatNum(cy_total)}}</span>人</div>
  49. <self-input label_name='客户昵称' :hasLabel='false' @inputChange='(val)=>{input_mass_keyword = val;sendCustList_change()}'></self-input>
  50. </div>
  51. <div class="userListBox self-scrollbar-3 massSendScroll">
  52. <div class="userItem massList" v-for="(item,index) in massSendCustList" :key="index+'massSend'">
  53. <div class="userBox">
  54. <img :src="item.external_avatar" alt="" class="userImg">
  55. <div>
  56. <div class="userName">{{item.external_username}}</div>
  57. <div :class="['statusBox',item.status!=1?'statusBox2':'']">{{item.status==0?'未发送':item.status==1?'已发送':item.status==2?'已不是好友':item.status==3?'接收已达上限':item.status_description}}</div>
  58. </div>
  59. </div>
  60. <div class="userRight">通过 {{item.sender_name}} 发送</div>
  61. </div>
  62. <noData v-if="massSendCustList&&massSendCustList.length<=0&&!cy_loading"></noData>
  63. </div>
  64. <div class="pagination" v-show="cy_total>page_size">
  65. <el-pagination background :current-page="cy_page" @current-change="cy_handleCurrentChange" layout="prev, pager, next" :page-count='Number(cy_pages)'>
  66. </el-pagination>
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. import selfInput from '@/components/assembly/screen/input.vue'
  73. import noData from "@/components/assembly/noData";
  74. export default {
  75. components: {
  76. noData,
  77. selfInput
  78. },
  79. props: ['rule_id', 'send_num', 'send_date'],
  80. data () {
  81. return {
  82. memberType: 'all',
  83. memberTypeList: [
  84. { id: 'all', name: '全部成员' },
  85. { id: 'sent', name: '已发送成员' },
  86. { id: 'unsent', name: '未发送成员' },
  87. { id: 'fail', name: '发送失败' },
  88. ],
  89. massType: 0,
  90. massTypeList: [
  91. { id: 0, name: '全部' },
  92. { id: 1, name: '已送达' },
  93. { id: 2, name: '未送达' },
  94. { id: 3, name: '接收已达上限' },
  95. { id: 4, name: '已不是好友' },
  96. ],
  97. input_keyword: '',
  98. loading: false,
  99. page: 1,
  100. page_size: 20,
  101. total: 0,
  102. pages: 0,
  103. senderList: [],
  104. massSendCustList: [],
  105. cy_page: 1,
  106. cy_total: 0,
  107. cy_pages: 0,
  108. cy_loading: false,
  109. input_mass_keyword: '',
  110. allMemberOptions: [],
  111. user_id: '',
  112. exportHref: '',
  113. corpid: '',
  114. exportHref_send: ''
  115. }
  116. },
  117. created () {
  118. let corpid = '';
  119. if (sessionStorage.getItem('company_session_defaultCorp') && sessionStorage.getItem('company_session_defaultCorp') != 'undefined') {
  120. this.corpid = JSON.parse(sessionStorage.getItem('company_session_defaultCorp')).corpid
  121. } else {
  122. this.corpid = this.$localSelfStore.getLocal('defaultCorp') && this.$localSelfStore.getLocal('defaultCorp') != 'undefined' ? JSON.parse(this.$localSelfStore.getLocal('defaultCorp')).corpid : ''
  123. }
  124. this.sender_list_change()
  125. this.get_allMemberOptions()
  126. this.sendCustList_change()
  127. },
  128. methods: {
  129. sender_list_change () {//成员列表
  130. this.exportHref = this.URL.BASEURL + this.URL.smartPush_senderListExport + `?admin_id=${this.$cookie.getCookie('admin_id')}&ttl=${Number(this.$cookie.getCookie('ttl'))}&sign=${this.$cookie.getCookie('sign')}&corpid=${this.corpid}&rule_id=${this.rule_id}&type=${this.memberType}&keyword=${this.input_keyword}&send_num=${this.send_num}&send_date=${this.send_date}`;
  131. this.get_sender_list(1)
  132. },
  133. sendCustList_change () {//客户列表
  134. this.exportHref_send = this.URL.BASEURL + this.URL.smartPush_massSendCustListExport + `?admin_id=${this.$cookie.getCookie('admin_id')}&ttl=${Number(this.$cookie.getCookie('ttl'))}&sign=${this.$cookie.getCookie('sign')}&corpid=${this.corpid}&rule_id=${this.rule_id}&type=${this.massType}&name=${this.input_mass_keyword}&sender=${this.user_id}&send_num=${this.send_num}&send_date=${this.send_date}`;
  135. this.get_mass_SendCustList(1)
  136. },
  137. get_allMemberOptions () {//客户详情-客服筛选列表
  138. this.$axios.get(this.URL.BASEURL + this.URL.smartPush_senderList, {
  139. params: {
  140. rule_id: this.rule_id,
  141. send_num: this.send_num,
  142. send_date: this.send_date,
  143. page: 1,
  144. page_size: 500,
  145. type: 'all',
  146. }
  147. }).then((res) => {
  148. var res = res.data
  149. if (res && res.errno == 0) {
  150. this.allMemberOptions = res.rst.data;
  151. } else if (res.errno != 4002) {
  152. this.$message({
  153. message: res.err,
  154. type: "warning"
  155. })
  156. }
  157. }).catch((err) => {
  158. });
  159. },
  160. get_sender_list (page) {
  161. this.page = page ? page : this.page;
  162. this.loading = true
  163. this.$axios.get(this.URL.BASEURL + this.URL.smartPush_senderList, {
  164. params: {
  165. rule_id: this.rule_id,
  166. send_num: this.send_num,
  167. send_date: this.send_date,
  168. page: this.page,
  169. page_size: this.page_size,
  170. type: this.memberType,
  171. keyword: this.input_keyword
  172. }
  173. }).then((res) => {
  174. var res = res.data
  175. this.loading = false
  176. if (res && res.errno == 0) {
  177. this.senderList = res.rst.data;
  178. // if (this.memberType == 'all') {
  179. // this.allMemberOptions
  180. // }
  181. this.total = res.rst.pageInfo.total;
  182. this.pages = res.rst.pageInfo.pages;
  183. document.getElementsByClassName('senderSccrollBox')[0].scrollTop = 0
  184. } else if (res.errno != 4002) {
  185. this.$message({
  186. message: res.err,
  187. type: "warning"
  188. })
  189. }
  190. }).catch((err) => {
  191. this.loading = false
  192. });
  193. },
  194. handleCurrentChange (val) {
  195. this.get_sender_list(val)
  196. },
  197. get_mass_SendCustList (page) {//成员列表
  198. this.cy_page = page ? page : this.cy_page;
  199. this.cy_loading = true
  200. this.$axios.get(this.URL.BASEURL + this.URL.smartPush_massSendCustList, {
  201. params: {
  202. rule_id: this.rule_id,
  203. send_num: this.send_num,
  204. send_date: this.send_date,
  205. page: this.cy_page,
  206. page_size: this.page_size,
  207. type: this.massType,
  208. name: this.input_mass_keyword,
  209. sender: this.user_id
  210. }
  211. }).then((res) => {
  212. var res = res.data
  213. this.cy_loading = false
  214. if (res && res.errno == 0) {
  215. this.massSendCustList = res.rst.data;
  216. this.cy_total = res.rst.pageInfo.total;
  217. this.cy_pages = res.rst.pageInfo.pages;
  218. document.getElementsByClassName('massSendScroll')[0].scrollTop = 0
  219. } else if (res.errno != 4002) {
  220. this.$message({
  221. message: res.err,
  222. type: "warning"
  223. })
  224. }
  225. }).catch((err) => {
  226. this.cy_loading = false
  227. });
  228. },
  229. cy_handleCurrentChange (val) {
  230. this.get_mass_SendCustList(val)
  231. }
  232. }
  233. }
  234. </script>
  235. <style lang="scss" scoped>
  236. .modular {
  237. background: #f5f6f8;
  238. display: flex;
  239. justify-content: space-between;
  240. padding: 0;
  241. .modularItem {
  242. background: #ffffff;
  243. padding: 20px;
  244. width: calc(50% - 5px);
  245. }
  246. .big_title {
  247. font-size: 15px;
  248. font-weight: 600;
  249. color: #333333;
  250. line-height: 21px;
  251. }
  252. }
  253. .tabBox {
  254. display: flex;
  255. align-items: center;
  256. border-bottom: 1px solid #eee;
  257. margin-top: 10px;
  258. .tabItem {
  259. font-size: 14px;
  260. line-height: 40px;
  261. margin-right: 30px;
  262. cursor: pointer;
  263. &.active {
  264. color: #00b38a;
  265. font-weight: bold;
  266. position: relative;
  267. &::after {
  268. content: "";
  269. width: 30px;
  270. height: 2px;
  271. border-radius: 2px;
  272. position: absolute;
  273. bottom: 0;
  274. left: 0;
  275. right: 0;
  276. margin: auto;
  277. background: #00b38a;
  278. }
  279. }
  280. }
  281. }
  282. .totalCustom {
  283. color: #333333;
  284. font-size: 14px;
  285. line-height: 20px;
  286. span {
  287. color: #00b38a;
  288. font-weight: bold;
  289. font-size: 16px;
  290. line-height: 25px;
  291. padding: 0 4px;
  292. }
  293. }
  294. .userListBox {
  295. height: 500px;
  296. overflow-y: auto;
  297. .userItem {
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-between;
  301. position: relative;
  302. border: 1px solid rgba(0, 90, 255, 0.25);
  303. background: #f5faff;
  304. padding: 15px 20px;
  305. margin-bottom: 15px;
  306. &.massList {
  307. background: #fffdfa;
  308. border-color: #fddc9e;
  309. }
  310. .time {
  311. font-size: 12px;
  312. line-height: 20px;
  313. color: #666;
  314. position: absolute;
  315. top: 10px;
  316. right: 20px;
  317. }
  318. .statusBox {
  319. background: #c0eae0;
  320. font-size: 12px;
  321. line-height: 20px;
  322. border: 1px solid #01b28a;
  323. padding: 0 4px;
  324. margin-top: 4px;
  325. display: inline-block;
  326. &.statusBox2 {
  327. background: #ffe1d6;
  328. border-color: #ffb16c;
  329. }
  330. }
  331. .userBox {
  332. display: flex;
  333. align-items: center;
  334. .userImg {
  335. width: 50px;
  336. height: 50px;
  337. border-radius: 4px;
  338. margin-right: 8px;
  339. }
  340. .userName {
  341. font-size: 15px;
  342. font-weight: bold;
  343. line-height: 20px;
  344. }
  345. .other {
  346. font-size: 13px;
  347. color: #777;
  348. margin-top: 7px;
  349. }
  350. }
  351. .userRight {
  352. font-size: 14px;
  353. color: #666;
  354. }
  355. }
  356. }
  357. .selfBtn_detial {
  358. padding: 7px 15px;
  359. font-size: 12px;
  360. border-radius: 3px;
  361. color: #fff;
  362. background-color: #00b38a;
  363. border-color: #00b38a;
  364. }
  365. </style>