team.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <view class="headers " :style="headerStyle">
  6. <view class="dis a-c j-start ">
  7. <u-icon name="arrow-left" color="#fff" size="40" @tap="back"></u-icon>
  8. <text style="margin: auto;">{{pageTtile}}</text>
  9. </view>
  10. </view>
  11. <view class="" style="padding-top: 98px;">
  12. <view class="querystyle body">
  13. <view class="statisticsDate dis a-c j-s " style="padding: 0 10px;">
  14. <view class="dis a-c j-c">
  15. <picker style="padding: 0;margin-right: 5px;" @change="bindPickerChange"
  16. :value="queryTimeTypeIndex" :range="queryTimeTypeArray">
  17. <view>{{queryTimeTypeArray[queryTimeTypeIndex]}}</view>
  18. </picker>
  19. <u-icon name="arrow-down-fill" color="#fff" size="16"></u-icon>
  20. </view>
  21. <view class="d-flex a-center j-center flex-1" @click="onShowDatePicker">
  22. <text @click="startshow=true">{{startdate}}</text>
  23. <text style="margin: 0 10px;">-</text>
  24. <text @click="endshow=true">{{enddate}}</text>
  25. </view>
  26. <view class="d-flex a-center j-center" @click="queryData()">
  27. <image src="../../../static/icon/search.png" mode="" style="width: 20px;height: 20px;"></image>
  28. </view>
  29. </view>
  30. <view class="teamStatistics">
  31. <view class="statisticsTitle">
  32. <view class="d-flex a-center j-start">会员级别</view>
  33. <view class="d-flex a-center j-center">会员人数</view>
  34. <view class="d-flex a-center j-center">签单保费(元)</view>
  35. <view class="d-flex a-center j-end">出单人力</view>
  36. </view>
  37. <block v-for="(item,index) in SummaryList" :key="index">
  38. <view class="" style="padding: 0 10px;">
  39. <view class="statisticsContent " :class="index==teamTabIndex?'active':''">
  40. <view class="dis a-c j-start">{{item.teamlevel}}</view>
  41. <view class="dis a-c j-c">{{item.teamnum}}</view>
  42. <view class="dis a-c j-c">{{item.sumpremium.toFixed(2)}}</view>
  43. <view class="dis a-c j-end">{{item.usernum}}</view>
  44. </view>
  45. </view>
  46. </block>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="userdata">
  51. <u-tabs class="tabclass" :list="arrdata" :is-scroll="false" :current="teamTabIndex"
  52. @change="arrchange"></u-tabs>
  53. <view class="team_members">
  54. <view class="team_member d-flex j-s a-c">
  55. <view class="d-flex a-center j-center ">
  56. <view>会员</view>
  57. </view>
  58. <view class="d-flex a-center j-center " style="width: 10%;">
  59. <view v-if="teamTabIndex==0">级别</view>
  60. </view>
  61. <view class="d-flex a-center j-center ">
  62. <view v-if="teamTabIndex!=5">报价笔数</view>
  63. </view>
  64. <view class="d-flex a-center j-center ">
  65. <view v-if="teamTabIndex!=5">核保笔数</view>
  66. </view>
  67. <view class="d-flex a-center j-center ">
  68. <view v-if="teamTabIndex!=5">出单笔数</view>
  69. </view>
  70. <view class="d-flex a-center j-center ">
  71. <view v-if="teamTabIndex!=5">签单保费</view>
  72. </view>
  73. </view>
  74. <view class="dataOver">
  75. <view v-if="teamTabIndex==0" class="dis j-s a-c team_members-data"
  76. v-for="(item,index) in userPolicyList1" :key="index"
  77. @click="toTeamMember('userPolicyList1',index)">
  78. <view class="dis j-start a-c">{{item.username}}</view>
  79. <view class="dis j-c a-c" style="width: 10%;">{{item.teamlevel}}</view>
  80. <view class="dis j-c a-c">{{item.bjpolicynum}}</view>
  81. <view class="dis j-c a-c">{{item.policynum}}</view>
  82. <view class="dis j-c a-c">{{item.ordernum}}</view>
  83. <view class="dis j-c a-c">{{item.sumpremium}}</view>
  84. </view>
  85. <view v-if="teamTabIndex==1" class="dis j-s a-c team_members-data"
  86. v-for="(item,index) in userPolicyList2" :key="index"
  87. @click="toTeamMember('userPolicyList2',index)">
  88. <view class="dis j-start a-c">{{item.username}}</view>
  89. <view class="dis j-c a-c" style="width: 10%;">{{item.teamlevel}}</view>
  90. <view class="dis j-c a-c">{{item.bjpolicynum}}</view>
  91. <view class="dis j-c a-c">{{item.policynum}}</view>
  92. <view class="dis j-c a-c">{{item.ordernum}}</view>
  93. <view class="dis j-c a-c">{{item.sumpremium}}</view>
  94. </view>
  95. <view v-if="teamTabIndex==2" class="dis j-s a-c team_members-data"
  96. v-for="(item,index) in userPolicyList3" :key="index"
  97. @click="toTeamMember('userPolicyList3',index)">
  98. <view class="dis j-start a-c">{{item.username}}</view>
  99. <view class="dis j-c a-c" style="width: 10%;">{{item.teamlevel}}</view>
  100. <view class="dis j-c a-c">{{item.bjpolicynum}}</view>
  101. <view class="dis j-c a-c">{{item.policynum}}</view>
  102. <view class="dis j-c a-c">{{item.ordernum}}</view>
  103. <view class="dis j-c a-c">{{item.sumpremium}}</view>
  104. </view>
  105. <view v-if="teamTabIndex==3" class="dis j-s a-c team_members-data"
  106. v-for="(item,index) in userPolicyList4" :key="index"
  107. @click="toTeamMember('userPolicyList4',index)">
  108. <view class="dis j-start a-c">{{item.username}}</view>
  109. <view class="dis j-c a-c" style="width: 10%;">{{item.teamlevel}}</view>
  110. <view class="dis j-c a-c">{{item.bjpolicynum}}</view>
  111. <view class="dis j-c a-c">{{item.policynum}}</view>
  112. <view class="dis j-c a-c">{{item.ordernum}}</view>
  113. <view class="dis j-c a-c">{{item.sumpremium}}</view>
  114. </view>
  115. <view v-if="teamTabIndex==4" class="dis j-s a-c team_members-data"
  116. v-for="(item,index) in userPolicyList5" :key="index"
  117. @click="toTeamMember('userPolicyList5',index)">
  118. <view class="dis j-start a-c">{{item.username}}</view>
  119. <view class="dis j-c a-c" style="width: 10%;">{{item.teamlevel}}</view>
  120. <view class="dis j-c a-c">{{item.bjpolicynum}}</view>
  121. <view class="dis j-c a-c">{{item.policynum}}</view>
  122. <view class="dis j-c a-c">{{item.ordernum}}</view>
  123. <view class="dis j-c a-c">{{item.sumpremium}}</view>
  124. </view>
  125. <view v-if="teamTabIndex==5" class="dis j-s a-c team_members-data"
  126. v-for="(item,index) in userPolicyList6" :key="index"
  127. @click="toTeamMember('userPolicyList6',index)">
  128. <view class="dis j-start a-c">{{item.username}}</view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <u-picker v-model="startshow" mode="time" :params="params" @confirm="startconfirm"></u-picker>
  134. <u-picker v-model="endshow" mode="time" :params="params" @confirm="endconfirm"></u-picker>
  135. </view>
  136. </template>
  137. <script>
  138. import {
  139. mapState
  140. } from "vuex";
  141. import MxDatePicker from "@/components/modules/tools/team/mx-datepicker/mx-datepicker.vue";
  142. import SwiperTab from "@/components/modules/tools/team/swiper-tab.vue";
  143. export default {
  144. components: {
  145. SwiperTab,
  146. MxDatePicker
  147. },
  148. data() {
  149. return {
  150. params: {
  151. year: true,
  152. month: true,
  153. day: true,
  154. hour: false,
  155. minute: false,
  156. second: false
  157. },
  158. startshow: false,
  159. endshow: false,
  160. headerStyle: {
  161. backgroundColor: '',
  162. backgroundImage: '',
  163. backgroundSize: '',
  164. backgroundPosition: '',
  165. boxShadow: ''
  166. // 其他样式属性...
  167. },
  168. queryPeopleId: "",
  169. queryTimeTypeArray: ['今天', '一周', '当月'],
  170. queryTimeTypeIndex: 0,
  171. startdate: new Date()
  172. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  173. enddate: new Date()
  174. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  175. showDatePicker: false,
  176. teamTabIndex: 0,
  177. SummaryList: [],
  178. userPolicyList1: [],
  179. userPolicyList2: [],
  180. userPolicyList3: [],
  181. userPolicyList4: [],
  182. userPolicyList5: [],
  183. userPolicyList6: [],
  184. arrdata: [{
  185. teamlevel: 0,
  186. name: '汇总',
  187. teamnum: 0, //人数
  188. sumpremium: 0, //签单保费
  189. usernum: 0 //出单人力
  190. },
  191. {
  192. teamlevel: 1,
  193. name: '本人',
  194. teamnum: 0, //人数
  195. sumpremium: 0, //签单保费
  196. usernum: 0 //出单人力
  197. },
  198. {
  199. teamlevel: 2,
  200. name: '一级',
  201. teamnum: 0, //人数
  202. sumpremium: 0, //签单保费
  203. usernum: 0 //出单人力
  204. },
  205. {
  206. teamlevel: 3,
  207. name: '二级',
  208. teamnum: 0, //人数
  209. sumpremium: 0, //签单保费
  210. usernum: 0 //出单人力
  211. },
  212. {
  213. teamlevel: 4,
  214. name: '三级',
  215. teamnum: 0, //人数
  216. sumpremium: 0, //签单保费
  217. usernum: 0 //出单人力
  218. },
  219. {
  220. teamlevel: 9,
  221. name: '临时',
  222. teamnum: 0, //人数
  223. sumpremium: 0, //签单保费
  224. usernum: 0 //出单人力
  225. }
  226. ],
  227. teamStaff: {},
  228. teamStaffList: [],
  229. pageTtile: "",
  230. }
  231. },
  232. onPullDownRefresh() {
  233. this.queryData()
  234. setTimeout(function() {
  235. uni.stopPullDownRefresh();
  236. }, 1000);
  237. },
  238. async onLoad(params) {
  239. this.$http.get('/sysMenuRecord/add?type=1&menuType=5')
  240. this.pageTtile = this.userInfo.sysUser.name + "会员管理"
  241. // this.queryPeopleId = params.id
  242. if ((!!params.id) && (!!params.name)) {
  243. this.queryPeopleId = params.id;
  244. await this.queryData()
  245. } else if (!!this.userInfo) {
  246. this.queryPeopleId = this.userInfo.sysUser.id
  247. await this.queryData()
  248. uni.setNavigationBarTitle({
  249. title: this.userInfo.sysUser.name + "会员管理"
  250. });
  251. } else {
  252. this.queryPeopleId = this.userInfo.sysUser.id
  253. await this.queryData()
  254. }
  255. },
  256. onShow() {},
  257. computed: {
  258. ...mapState(['userInfo']),
  259. getHeight() {
  260. let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(770);
  261. return `height: ${height}px;`;
  262. }
  263. },
  264. methods: {
  265. startconfirm(e) {
  266. this.startdate = e.year + '-' + e.month + '-' + e.day;
  267. },
  268. endconfirm(e) {
  269. this.enddate = e.year + '-' + e.month + '-' + e.day;
  270. },
  271. //页面返回按钮
  272. back() {
  273. uni.navigateBack({
  274. delta: 1, // 返回的页面数,如果是1表示返回上一页
  275. success: function() {}
  276. });
  277. },
  278. bindPickerChange: function(e) {
  279. this.queryTimeTypeIndex = e.target.value
  280. if (e.target.value == 0) {
  281. this.startdate = new Date()
  282. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate();
  283. this.enddate = new Date()
  284. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate();
  285. this.queryData();
  286. this.queryData();
  287. }
  288. if (e.target.value == 1) {
  289. let strDay = new Date().getDate() - 7;
  290. if (strDay < 10) {
  291. strDay = "0" + strDay;
  292. }
  293. this.startdate = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + strDay;
  294. this.enddate = new Date()
  295. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
  296. this.queryData();
  297. }
  298. if (e.target.value == 2) {
  299. this.startdate = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + '01';
  300. this.enddate = new Date()
  301. .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
  302. this.queryData();
  303. }
  304. },
  305. arrchange(e) {
  306. this.teamTabIndex = e;
  307. },
  308. async queryData() {
  309. let params = {
  310. "enddate": this.enddate,
  311. "startdate": this.startdate
  312. }
  313. let res = await this.$http.post('/esm/user/queryUserCount', params);
  314. if (res.code == '200') {
  315. this.SummaryList = res.data.hzList;
  316. this.userPolicyList1 = res.data.userPolicyList;
  317. this.userPolicyList2 = res.data.userPolicyList0;
  318. this.userPolicyList3 = res.data.userPolicyList1;
  319. this.userPolicyList4 = res.data.userPolicyList2;
  320. this.userPolicyList5 = res.data.userPolicyList3;
  321. this.userPolicyList6 = res.data.userPolicyList9;
  322. this.SummaryList.map(ele => {
  323. this.arrdata.map(val => {
  324. if (ele.teamlevel.includes(val.name)) {
  325. val.teamnum = ele.teamnum;
  326. }
  327. })
  328. })
  329. }
  330. },
  331. onShowDatePicker() { //显示
  332. this.showDatePicker = true;
  333. },
  334. onSelected(e) { //选择
  335. this.showDatePicker = false;
  336. if (e) {
  337. this.dateRange = e.value;
  338. this.queryData();
  339. }
  340. },
  341. // 选择团队tap
  342. teamTabtap(index) {
  343. this.teamTabIndex = index;
  344. },
  345. toTeamMember(name, index) {
  346. this.navigate({
  347. url: "/pages/tools/team/teamMember",
  348. success: (res) => {
  349. res.eventChannel.emit("acceptData", {
  350. item: this[name][index],
  351. date: this.dateRange
  352. })
  353. }
  354. }, "navigateTo", true)
  355. }
  356. }
  357. }
  358. </script>
  359. <style lang="scss" scoped>
  360. .active {
  361. color: #FF5600 !important;
  362. }
  363. page {
  364. background-color: #F8FAFE;
  365. height: 100%;
  366. }
  367. .userdata {
  368. padding: 16px;
  369. margin-top: 75px;
  370. }
  371. .dataOver {
  372. max-height: calc(100vh - 480px);
  373. overflow-y: auto;
  374. }
  375. .tabclass {
  376. background-color: transparent !important;
  377. }
  378. .querystyle {
  379. width: 100%;
  380. height: 200px;
  381. background: #F8FAFE;
  382. background-image: url("/static/image/team/bg1.png");
  383. background-size: 100% 100%;
  384. padding: 0 16px;
  385. }
  386. .headers {
  387. position: fixed;
  388. top: 0;
  389. left: 0;
  390. height: auto;
  391. width: 100%;
  392. z-index: 999999;
  393. padding: 16px;
  394. padding-top: 50px;
  395. height: auto;
  396. background: #3D74FE;
  397. text {
  398. font-size: 18px;
  399. font-weight: bold;
  400. color: #fff;
  401. }
  402. }
  403. .body .statisticsDate {
  404. color: #fff;
  405. height: 34px;
  406. background: rgba(51, 94, 203, 0.5);
  407. border-radius: 6px;
  408. }
  409. .statisticsContent {
  410. border-bottom: 1upx solid #ddd;
  411. }
  412. .statisticsContent:last-child() {
  413. border: none,
  414. }
  415. .body .teamStatistics {
  416. width: 100%;
  417. height: auto;
  418. background: #FFFFFF;
  419. box-shadow: 0px 4px 10px 0px #DAE3F4;
  420. border-radius: 6px;
  421. }
  422. .body .teamStatistics .statisticsTitle {
  423. height: 70upx;
  424. padding: 0px 30upx;
  425. margin-top: 10px;
  426. box-sizing: border-box;
  427. line-height: 70upx;
  428. font-size: 24rpx;
  429. background: #FFEFE6;
  430. border-radius: 6px 6px 0 0;
  431. color: #232832;
  432. }
  433. .body .teamStatistics .statisticsContent {
  434. box-sizing: border-box;
  435. height: 70upx;
  436. line-height: 70upx;
  437. font-size: 26rpx;
  438. color: #232832;
  439. }
  440. .body .teamStatistics .statisticsTitle,
  441. .body .teamStatistics .statisticsContent {
  442. display: flex;
  443. flex-wrap: nowrap;
  444. justify-content: space-between;
  445. }
  446. .body .teamStatistics .statisticsTitle>view,
  447. .body .teamStatistics .statisticsContent>view {
  448. width: 200upx;
  449. text-align: center;
  450. font-size: 12px;
  451. }
  452. /* 横向滚动选项Start */
  453. .teamScrollView {
  454. border-bottom: 15upx solid #ccc;
  455. }
  456. /* 横向滚动选项Start */
  457. /* 团队成员列表Start */
  458. .team_members {
  459. width: 100%;
  460. height: auto;
  461. background: #FFFFFF;
  462. box-shadow: 0px 4px 10px 0px #DAE3F4;
  463. border-radius: 6px;
  464. }
  465. .team_members .team_member {
  466. min-height: 70upx;
  467. box-sizing: border-box;
  468. line-height: 70upx;
  469. width: 100%;
  470. height: 34px;
  471. background: #E7ECFD;
  472. border-radius: 6px 6px 0px 0px;
  473. }
  474. /* .team_members .team_member:nth-of-type(1){
  475. background: #CCCCCC;
  476. } */
  477. .team_members .team_member>view {
  478. width: 18%;
  479. flex-wrap: nowrap;
  480. }
  481. .team_members-data {
  482. padding: 0 8px;
  483. border-bottom: 1px solid #ddd;
  484. }
  485. .team_members-data>view {
  486. width: 18%;
  487. padding: 4px;
  488. }
  489. /* 团队成员列表End */
  490. </style>