team.vue 10 KB

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