businessList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <template>
  2. <view class="content">
  3. <!-- <view class="filter-box">
  4. <u-search placeholder="请输入关键字" v-model="filterText" @search="setFilterText" @custom="setFilterText"></u-search>
  5. </view> -->
  6. <u-dropdown>
  7. <u-dropdown-item v-model="applySaleFlag" :title="applyTitle" :options="applyOptions" @change="handleDropDownClick"></u-dropdown-item>
  8. </u-dropdown>
  9. <u-tabs-swiper ref="uTabs" :active-color="mainColor" :list="tabList" :current="current" @change="tabsChange"
  10. :is-scroll="false"></u-tabs-swiper>
  11. <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" class="swiper-box">
  12. <swiper-item class="swiper-item" v-for="(item, index1) in tabList" :key="index1">
  13. <scroll-view scroll-y class="scroll-box" @scrolltolower="handleLoadMore" :refresher-enabled="true"
  14. :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
  15. @refresherrestore="onRestore">
  16. <u-card :show-head="false" :foot-border-top="false" margin="10px 15px" borderRadius="40" :foot-style="{padding: '0 10px 5px 0'}" v-for="(site, index2) in item.tableList"
  17. :key="index2" class="card-box" @click="goToOrderList(site)">
  18. <view slot="body" class="card-content">
  19. <view class="student-info">
  20. <view class="info-name">{{site.studentName}}</view>
  21. <!-- <view class="info-type" :class="site.status == 1 ? 'info-type-active' : ''">{{site.status == 0 ? '未报名' : '已报名'}}</view> -->
  22. <view class="info-name">{{site.parentName}}</view>
  23. <view class="info-phone">{{site.parentPhone}}</view>
  24. <view class="info-saleName" v-if="site.saleName!=null">{{site.saleName}}</view>
  25. </view>
  26. <!-- <u-image width="28px" height="28px" :src="site.type == 2 ? iconPath1 : iconPath2"></u-image> -->
  27. </view>
  28. <view slot="foot" style="text-align: right;">
  29. <u-button type="warning" :ripple="true" shape="circle" :custom-style="{...handleCustomStyle, marginRight: '5px'}" size="mini" @click="handleSaleShowClick(site)">分配</u-button>
  30. <!-- <u-button type="warning" :ripple="true" shape="circle" :custom-style="{...handleCustomStyle, marginRight: '5px'}" size="mini" @click="handleUpdateClick(site)">修改</u-button>
  31. <u-button type="warning" :ripple="true" shape="circle" :custom-style="handleCustomStyle" size="mini" @click="handleJumpSubscribeClick">预约体验</u-button> -->
  32. </view>
  33. </u-card>
  34. <u-divider v-if="item.isOver" bg-color="transparent" :style="{paddingTop : item.tableList.length == 0 ? '10px' : ''}">没有更多了</u-divider>
  35. </scroll-view>
  36. </swiper-item>
  37. </swiper>
  38. <u-icon name="plus-circle-fill" :color="mainColor" size="96" class="fix-add-icon" @click="handleThreadAddClick"></u-icon>
  39. <!-- 标签 -->
  40. <u-action-sheet :list="signList" v-model="signShow" @click="handleSetSexClick"></u-action-sheet>
  41. <!-- 销售 -->
  42. <!-- <u-action-sheet :list="saleList" v-model="saleShow" @click="handleSetSaleClick"></u-action-sheet> -->
  43. <u-picker mode="selector" v-model="saleShow" :range="saleList" range-key="text" @confirm="handleSetSaleClick"></u-picker>
  44. <u-top-tips ref="uTips"></u-top-tips>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. mapGetters
  50. } from 'vuex'
  51. const NET = require('@/utils/request')
  52. const API = require('@/config/api')
  53. export default {
  54. computed: {
  55. ...mapGetters([
  56. 'mainColor',
  57. 'customStyle',
  58. 'handleCustomStyle',
  59. 'handleDefaultCustomStyle',
  60. ])
  61. },
  62. data() {
  63. return {
  64. customerId: '',
  65. // filterText: '',
  66. applyTitle: '已分配',
  67. applySaleFlag: 1,
  68. applyOptions: [
  69. {
  70. label: '已分配',
  71. value: 1,
  72. },
  73. {
  74. label: '未分配',
  75. value: 2,
  76. }
  77. ],
  78. triggered: false,
  79. tabList: [
  80. {
  81. name: '未联系',
  82. isOver: false,
  83. pageIndex: 1,
  84. filterText: '',
  85. type: 1,
  86. tableList: [],
  87. }, {
  88. name: '有意向',
  89. isOver: false,
  90. pageIndex: 1,
  91. filterText: '',
  92. type: 2,
  93. tableList: [],
  94. }, {
  95. name: '已预约',
  96. isOver: false,
  97. pageIndex: 1,
  98. filterText: '',
  99. type: 3,
  100. tableList: [],
  101. }, {
  102. name: '商机',
  103. isOver: false,
  104. pageIndex: 1,
  105. filterText: '',
  106. type: 4,
  107. tableList: [],
  108. },{
  109. name: '无效',
  110. isOver: false,
  111. pageIndex: 1,
  112. filterText: '',
  113. type: 0,
  114. tableList: [],
  115. },],
  116. current: 0,
  117. swiperCurrent: 0,
  118. iconPath1: API.getServerImg + 'weibaoming.png',
  119. iconPath2: API.getServerImg + 'xianshangkehu.png',
  120. signShow: false,
  121. signList: [
  122. { text: '未联系', type: 1 },
  123. { text: '有意向', type: 2 },
  124. { text: '已预约', type: 3 },
  125. { text: '商机', type: 4 },
  126. { text: '无效', type: 0 }
  127. ],
  128. saleShow: false,
  129. saleList: []
  130. }
  131. },
  132. onShow() {
  133. this.getTable()
  134. },
  135. onReady() {},
  136. methods: {
  137. getTable() {
  138. this.tabList = Object.assign([], this.$options.data().tabList)
  139. this.getTableList(0)
  140. this.getTableList(1)
  141. this.getTableList(2)
  142. this.getTableList(3)
  143. this.getTableList(4)
  144. },
  145. handleDropDownClick(e) {
  146. if(e == 1) {
  147. this.applySaleFlag = 1
  148. this.applyTitle = '已分配'
  149. } else {
  150. this.applySaleFlag = 2
  151. this.applyTitle = '未分配'
  152. }
  153. this.tabList = Object.assign([], this.$options.data().tabList)
  154. this.getTable()
  155. },
  156. // 修改
  157. handleUpdateClick(item) {
  158. this.customerId = item.id
  159. this.signShow = true
  160. },
  161. // 修改线索标签
  162. handleSetSexClick(index) {
  163. // 调修改接口
  164. NET.request(API.updateCustomerState, {
  165. customerId: this.customerId,
  166. clueState: this.signList[index].type
  167. }, 'POST').then(res => {
  168. if(res.status === 10000) {
  169. this.$refs.uTips.show({
  170. title: '修改成功',
  171. type: 'success',
  172. })
  173. this.getTable()
  174. } else {
  175. this.$refs.uTips.show({
  176. title: res.msg,
  177. type: 'warning',
  178. })
  179. }
  180. })
  181. },
  182. // 分配
  183. handleSaleShowClick(item) {
  184. this.customerId = item.id
  185. // 显示销售员列表
  186. NET.request(API.findGroups, {}, 'POST').then(res => {
  187. if(res.status === 10000) {
  188. this.saleList = res.data.map( item => {
  189. return {
  190. saleId: item.memberId,
  191. text: item.memberName
  192. }
  193. })
  194. this.saleShow = true
  195. } else {
  196. this.$refs.uTips.show({
  197. title: res.msg,
  198. type: 'warning',
  199. })
  200. }
  201. })
  202. },
  203. // 分配
  204. handleSetSaleClick(index) {
  205. NET.request(API.updateCustomerState, {
  206. customerId: this.customerId,
  207. saleId: this.saleList[index].saleId
  208. }, 'POST').then(res => {
  209. if(res.status === 10000) {
  210. this.$refs.uTips.show({
  211. title: '分配成功',
  212. type: 'success',
  213. })
  214. this.getTable()
  215. } else {
  216. this.$refs.uTips.show({
  217. title: res.msg,
  218. type: 'warning',
  219. })
  220. }
  221. })
  222. },
  223. // 跳转添加信息
  224. handleThreadAddClick() {
  225. uni.navigateTo({
  226. url: '/pagesEnroll/intentionForm?type=1'
  227. });
  228. },
  229. // 跳转场馆列表
  230. handleJumpSubscribeClick() {
  231. uni.navigateTo({
  232. url: '/pagesMain/venueMore'
  233. });
  234. },
  235. // 设置过滤字段
  236. setFilterText(value) {
  237. this.tabList[this.current].filterText = value
  238. this.onRefresh()
  239. },
  240. // tab页面切换
  241. tabsChange(index) {
  242. this.swiperCurrent = index;
  243. },
  244. // swiper-item左右移动,通知tabs的滑块跟随移动
  245. transition(e) {
  246. let dx = e.detail.dx;
  247. this.$refs.uTabs.setDx(dx);
  248. },
  249. // swiper滑动结束,分别设置tabs和swiper的状态
  250. animationfinish(e) {
  251. let current = e.detail.current;
  252. this.$refs.uTabs.setFinishCurrent(current);
  253. this.swiperCurrent = current;
  254. this.current = current;
  255. },
  256. // 下拉刷新
  257. onRefresh() {
  258. if (!this.triggered) {
  259. this.triggered = true
  260. this.tabList[this.current].isOver = false
  261. this.tabList[this.current].pageIndex = 1
  262. this.tabList[this.current].tableList = []
  263. this.getTableList(this.current)
  264. }
  265. },
  266. // 重置下拉刷新状态
  267. onRestore() {
  268. this.triggered = 'restore'
  269. this.triggered = false
  270. },
  271. // 懒加载
  272. handleLoadMore() {
  273. if (!this.tabList[this.current].isOver) {
  274. this.tabList[this.current].pageIndex++
  275. this.getTableList(this.current)
  276. }
  277. },
  278. // 获取列表数据
  279. getTableList(index) {
  280. NET.request(API.getCustomerList, {
  281. isSignUp: 1,
  282. applySaleFlag: this.applySaleFlag == 1 ? true : false,
  283. name: this.tabList[index].filterText,
  284. type: this.tabList[index].type,
  285. page: this.tabList[index].pageIndex,
  286. size: 10,
  287. }, 'POST').then(res => {
  288. this.triggered = false
  289. this.tabList[index].tableList = this.tabList[index].tableList.concat(res.data.row)
  290. this.tabList[index].isOver = res.data.row.length != 10
  291. }).catch(error => {
  292. this.triggered = false
  293. this.$refs.uTips.show({
  294. title: error.msg,
  295. type: 'warning',
  296. })
  297. })
  298. },
  299. // 跳转到报名详情
  300. goToOrderList(item) {
  301. uni.navigateTo({
  302. url: `/pagesMain/customerInfo?id=${item.id}&title=公海信息`
  303. });
  304. }
  305. },
  306. }
  307. </script>
  308. <style>
  309. page {
  310. width: 100%;
  311. height: 100%;
  312. background-color: #f7f7f7;
  313. }
  314. </style>
  315. <style lang="scss" scoped>
  316. @import "@/static/css/themes.scss";
  317. .content {
  318. width: 100%;
  319. float: left;
  320. .filter-box {
  321. height: 48px;
  322. padding: 10px 15px;
  323. background-color: #FFFFFF;
  324. }
  325. .swiper-box {
  326. height: calc(100vh - 82px);
  327. .swiper-item {
  328. height: calc(100vh - 82px);
  329. .scroll-box {
  330. width: 100%;
  331. height: calc(100vh - 82px);
  332. .card-box {
  333. .card-content {
  334. display: flex;
  335. align-items: center;
  336. .student-info {
  337. flex: 1;
  338. .info-name {
  339. width: 64px;
  340. float: left;
  341. line-height: 28px;
  342. font-size: 14px;
  343. font-weight: bold;
  344. }
  345. .info-type {
  346. padding: 0 10px;
  347. margin-top: 3px;
  348. border-radius: 20px;
  349. float: left;
  350. line-height: 20px;
  351. font-size: 10px;
  352. color: #FFFFFF;
  353. background-color: #999999;
  354. }
  355. .info-type-active {
  356. background-color: $mainColor;
  357. }
  358. .info-phone {
  359. width: calc(100% - 64px);
  360. float: left;
  361. line-height: 28px;
  362. font-size: 12px;
  363. color: #999999;
  364. }
  365. .info-saleName{
  366. width: calc(100% - 64px);
  367. float: left;
  368. line-height: 28px;
  369. font-size: 12px;
  370. color: #6287d2;
  371. }
  372. }
  373. }
  374. }
  375. }
  376. }
  377. }
  378. }
  379. .menber-box {
  380. width: 100%;
  381. // float: left;
  382. padding: 10px 15px;
  383. margin-bottom: 10px;
  384. .menber-col {
  385. width: 100%;
  386. padding: 15px;
  387. margin-bottom: 10px;
  388. display: inline-block;
  389. background-color: #FFFFFF;
  390. border-radius: 15px;
  391. box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
  392. position: relative;
  393. overflow: hidden;
  394. box-sizing: border-box;
  395. .menber-label {
  396. width: 100%;
  397. margin-bottom: 5px;
  398. float: left;
  399. font-size: 14px;
  400. // line-height: 20px;
  401. }
  402. .menber-num {
  403. width: 100%;
  404. float: left;
  405. font-size: 26px;
  406. line-height: 28px;
  407. color: $mainColor;
  408. }
  409. .menber-icon {
  410. font-size: 100px;
  411. color: $mainColor;
  412. position: absolute;
  413. right: -5px;
  414. bottom: -30px;
  415. opacity: 0.5;
  416. }
  417. }
  418. }
  419. .common-title {
  420. width:100%;
  421. text-align: center;
  422. font-size: 20px;
  423. margin: 10px 0;
  424. }
  425. .fix-add-icon {
  426. position: fixed;
  427. bottom: 15px;
  428. right: 15px;
  429. }
  430. </style>