team.vue 13 KB

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