businessList.vue 11 KB

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