team.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <view class="body">
  6. <view class="statisticsDate d-flex">
  7. <view style="width: 180upx;flex-shrink: 0;">
  8. <picker style="padding: 0;" @change="bindPickerChange" :value="queryTimeTypeIndex"
  9. :range="queryTimeTypeArray">
  10. <view>{{queryTimeTypeArray[queryTimeTypeIndex]}}</view>
  11. </picker>
  12. </view>
  13. <view class="d-flex a-center j-center flex-1" @click="onShowDatePicker">{{dateRange[0]}} -
  14. {{dateRange[1]}}
  15. </view>
  16. <view class="d-flex a-center j-center" style="width: 60upx;flex-shrink: 0;">
  17. <view class="icon iconfont icon-search-1-copy"></view>
  18. </view>
  19. </view>
  20. <view class="teamStatistics">
  21. <view class="statisticsTitle">
  22. <view class="d-flex a-center j-center">团队级别</view>
  23. <view class="d-flex a-center j-center">团队人数</view>
  24. <view class="d-flex a-center j-center">签单保费(元)</view>
  25. <view class="d-flex a-center j-center">出单人力</view>
  26. </view>
  27. <block v-for="(item,index) in teamTabBars" :key="index">
  28. <view class="statisticsContent">
  29. <view class="d-flex a-center j-center">{{item.name}}</view>
  30. <view class="d-flex a-center j-center">{{item.personNum}}</view>
  31. <view class="d-flex a-center j-center">{{item.premium.toFixed(2)}}</view>
  32. <view class="d-flex a-center j-center">{{item.outSingle}}</view>
  33. </view>
  34. </block>
  35. </view>
  36. <view class="teamScrollView">
  37. <swiper-tab :tabBars="teamTabBars" :tabIndex="teamTabIndex" @tabtap="teamTabtap"></swiper-tab>
  38. </view>
  39. <!-- <search @search="search"></search> -->
  40. <view class="team_members">
  41. <view class="team_member d-flex" style="background-color: #CCCCCC;">
  42. <view class="d-flex a-center j-center flex-1">
  43. <view>团队成员</view>
  44. </view>
  45. <view class="d-flex a-center j-center flex-1">
  46. <view>核保笔数</view>
  47. </view>
  48. <view class="d-flex a-center j-center flex-1">
  49. <view>出单笔数</view>
  50. </view>
  51. <view class="d-flex a-center j-center flex-1">
  52. <view>签单保费</view>
  53. </view>
  54. </view>
  55. <z-paging auto-show-back-to-top ref="paging" v-model="teamStaffList" :refresher-enabled="false"
  56. :loading-more-enabled="false" :mounted-auto-call-reload="false" :style="getHeight">
  57. <view class="team_member d-flex" v-for="(item,index) in teamStaffList" :key="index"
  58. @tap="toTeamMember(index)">
  59. <view class="d-flex a-center j-center flex-1">
  60. <view>{{item.sysUser.name}}</view>
  61. </view>
  62. <view class="d-flex a-center j-center flex-1">
  63. <view>{{item.teamUserCountPriceVO?item.teamUserCountPriceVO.underwriting:0}}</view>
  64. </view>
  65. <view class="d-flex a-center j-center flex-1">
  66. <view>{{item.teamUserCountPriceVO?item.teamUserCountPriceVO.issue:0}}</view>
  67. </view>
  68. <view class="d-flex a-center j-center flex-1">
  69. <template v-if="item.teamUserCountPriceVO && (item.teamUserCountPriceVO.billPrice>0)">
  70. <view class="main-text-color">
  71. {{item.teamUserCountPriceVO?(item.teamUserCountPriceVO.billPrice).toFixed(2):0}}
  72. </view>
  73. </template>
  74. <template v-else>
  75. <view>
  76. {{item.teamUserCountPriceVO?(item.teamUserCountPriceVO.billPrice).toFixed(2):'0.00'}}
  77. </view>
  78. </template>
  79. </view>
  80. </view>
  81. </z-paging>
  82. </view>
  83. </view>
  84. <mx-date-picker :show="showDatePicker" type="range" :value="dateRange" :show-tips="true" @confirm="onSelected"
  85. @cancel="onSelected" />
  86. </view>
  87. </template>
  88. <script>
  89. import {
  90. mapState
  91. } from "vuex";
  92. import search from "@/components/modules/orders/search.vue";
  93. import swiperTab from "@/components/modules/tools/team/swiper-tab.vue";
  94. import MxDatePicker from "@/components/modules/tools/team/mx-datepicker/mx-datepicker.vue";
  95. export default {
  96. components: {
  97. search,
  98. swiperTab,
  99. MxDatePicker
  100. },
  101. async onLoad(params) {
  102. // this.queryPeopleId = params.id
  103. if ((!!params.id) && (!!params.name)) {
  104. this.queryPeopleId = params.id
  105. await this.queryData()
  106. uni.setNavigationBarTitle({
  107. title: params.name + "团队管理"
  108. });
  109. } else if (!!this.userInfo) {
  110. this.queryPeopleId = this.userInfo.sysUser.id
  111. await this.queryData()
  112. uni.setNavigationBarTitle({
  113. title: this.userInfo.sysUser.name + "团队管理"
  114. });
  115. } else {
  116. this.queryPeopleId = this.userInfo.sysUser.id
  117. await this.queryData()
  118. }
  119. },
  120. onShow() {
  121. },
  122. computed: {
  123. ...mapState(['userInfo']),
  124. getHeight() {
  125. let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(770);
  126. return `height: ${height}px;`;
  127. }
  128. },
  129. data() {
  130. return {
  131. queryPeopleId: "",
  132. queryTimeTypeArray: ['本月查询', '本年查询', '自定义查询'],
  133. queryTimeTypeIndex: 0,
  134. dateRange: [new Date().getFullYear() + '/' + (new Date().getMonth() + 1) + '/01', new Date()
  135. .getFullYear() + '/' + (new Date().getMonth() + 1) + '/' + new Date().getDate()
  136. ],
  137. showDatePicker: false,
  138. teamTabIndex: 0,
  139. teamTabBars: [{
  140. id: 1,
  141. name: '总计',
  142. personNum: '0',
  143. orderNum: '0',
  144. premium: 0,
  145. outSingle: 0
  146. },
  147. {
  148. id: 2,
  149. name: '一级团队',
  150. personNum: '0',
  151. orderNum: '0',
  152. premium: 0,
  153. outSingle: 0
  154. },
  155. {
  156. id: 3,
  157. name: '二级团队',
  158. personNum: '0',
  159. orderNum: '0',
  160. premium: 0,
  161. outSingle: 0
  162. },
  163. {
  164. id: 4,
  165. name: '三级团队',
  166. personNum: '0',
  167. orderNum: '0',
  168. premium: 0,
  169. outSingle: 0
  170. },
  171. {
  172. id: 5,
  173. name: '临时团队',
  174. personNum: '0',
  175. orderNum: '0',
  176. premium: 0,
  177. outSingle: 0
  178. }
  179. ],
  180. teamStaff: {},
  181. teamStaffList: []
  182. }
  183. },
  184. methods: {
  185. bindPickerChange: function(e) {
  186. this.queryTimeTypeIndex = e.target.value
  187. if (e.target.value == 0) {
  188. this.dateRange = [new Date().getFullYear() + '/' + (new Date().getMonth() + 1) + '/01', new Date()
  189. .getFullYear() + '/' + (new Date().getMonth() + 1) + '/' + new Date().getDate()
  190. ];
  191. this.queryData();
  192. }
  193. if (e.target.value == 1) {
  194. this.dateRange = [new Date().getFullYear() + '/01/01', new Date().getFullYear() + '/12/31'];
  195. this.queryData();
  196. }
  197. if (e.target.value == 2) {
  198. this.showDatePicker = true;
  199. }
  200. },
  201. async queryData() {
  202. console.log(this.userInfo)
  203. this.teamTabIndex = 0;
  204. var params = {
  205. "userid": this.queryPeopleId,
  206. "mobile": "",
  207. "name": "",
  208. "enddate": this.dateRange[1],
  209. "startdate": this.dateRange[0]
  210. }
  211. let res = await this.$http.post('/esm/user/queryTeamNum', params);
  212. console.log(res)
  213. this.teamTabBars[0].personNum = res.data[2].teamnum;
  214. this.teamTabBars[1].personNum = res.data[2].level1num;
  215. this.teamTabBars[2].personNum = res.data[2].level2num;
  216. this.teamTabBars[3].personNum = res.data[2].level3num;
  217. this.teamTabBars[4].personNum = res.data[2].tempnum;
  218. this.teamTabBars[0].premium = res.data[0].countPremium;
  219. this.teamTabBars[1].premium = res.data[0].list1Premium;
  220. this.teamTabBars[2].premium = res.data[0].list2Premium;
  221. this.teamTabBars[3].premium = res.data[0].list3Premium;
  222. this.teamTabBars[4].premium = 0;
  223. this.teamTabBars[0].outSingle = res.data[0].countSingle;
  224. this.teamTabBars[1].outSingle = res.data[0].outSingle1;
  225. this.teamTabBars[2].outSingle = res.data[0].outSingle2;
  226. this.teamTabBars[3].outSingle = res.data[0].outSingle3;
  227. this.teamTabBars[4].outSingle = 0;
  228. let res1 = await this.$http.post('/esmUserInternal/queryTeamUser', params);
  229. this.teamStaff = res1.data;
  230. var level1Team = this.teamStaff['level1'];
  231. var level2Team = this.teamStaff['level2'];
  232. var level3Team = this.teamStaff['level3'];
  233. var tempTeam = this.teamStaff['temp'];
  234. this.teamStaffList = level1Team.concat(level2Team).concat(level3Team).concat(tempTeam);
  235. this.$refs.paging.complete(this.teamStaffList);
  236. },
  237. onShowDatePicker() { //显示
  238. if (this.queryTimeTypeIndex == 2) {
  239. this.showDatePicker = true;
  240. }
  241. },
  242. onSelected(e) { //选择
  243. this.showDatePicker = false;
  244. if (e) {
  245. this.dateRange = e.value;
  246. this.queryData();
  247. }
  248. },
  249. // 选择团队tap
  250. teamTabtap(index) {
  251. this.teamTabIndex = index;
  252. var level1Team = this.teamStaff['level1'];
  253. var level2Team = this.teamStaff['level2'];
  254. var level3Team = this.teamStaff['level3'];
  255. var tempTeam = this.teamStaff['temp'];
  256. if (index == 0) {
  257. this.teamStaffList = level1Team.concat(level2Team).concat(level3Team).concat(tempTeam);
  258. } else if (index == 1) {
  259. this.teamStaffList = level1Team;
  260. } else if (index == 2) {
  261. this.teamStaffList = level2Team;
  262. } else if (index == 3) {
  263. this.teamStaffList = level3Team;
  264. } else if (index == 4) {
  265. this.teamStaffList = tempTeam;
  266. }
  267. this.$refs.paging.complete(this.teamStaffList);
  268. },
  269. toTeamMember(index) {
  270. this.navigate({
  271. url: "/pages/tools/team/teamMember",
  272. success: (res) => {
  273. res.eventChannel.emit("acceptData", {
  274. item: this.teamStaffList[index]
  275. })
  276. }
  277. }, "navigateTo", true)
  278. }
  279. }
  280. }
  281. </script>
  282. <style>
  283. .body .statisticsDate {
  284. padding: 15upx 30upx;
  285. border-radius: 35upx;
  286. border: 1px solid #ddd;
  287. margin: 15upx 30upx;
  288. font-size: 28upx;
  289. }
  290. .body .teamStatistics {
  291. border-bottom: 15upx solid #ddd;
  292. }
  293. .body .teamStatistics .statisticsTitle {
  294. height: 70upx;
  295. padding: 0px 30upx;
  296. box-sizing: border-box;
  297. line-height: 70upx;
  298. font-size: 30upx;
  299. background: #ccc;
  300. }
  301. .body .teamStatistics .statisticsContent {
  302. padding: 0px 30upx;
  303. box-sizing: border-box;
  304. height: 70upx;
  305. line-height: 70upx;
  306. border-bottom: 1upx solid #ddd;
  307. font-size: 28upx;
  308. }
  309. .body .teamStatistics .statisticsTitle,
  310. .body .teamStatistics .statisticsContent {
  311. display: flex;
  312. flex-wrap: nowrap;
  313. justify-content: space-between;
  314. }
  315. .body .teamStatistics .statisticsTitle>view,
  316. .body .teamStatistics .statisticsContent>view {
  317. width: 200upx;
  318. text-align: center;
  319. }
  320. /* 横向滚动选项Start */
  321. .teamScrollView {
  322. border-bottom: 15upx solid #ccc;
  323. }
  324. /* 横向滚动选项Start */
  325. /* 团队成员列表Start */
  326. .team_members {}
  327. .team_members .team_member {
  328. min-height: 70upx;
  329. padding: 0px 30upx;
  330. box-sizing: border-box;
  331. line-height: 70upx;
  332. border-bottom: 1px solid #ddd;
  333. }
  334. /* .team_members .team_member:nth-of-type(1){
  335. background: #CCCCCC;
  336. } */
  337. .team_members .team_member>view {
  338. flex-wrap: nowrap;
  339. }
  340. /* 团队成员列表End */
  341. </style>