123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- <template>
- <view>
- <!-- 公共组件-每个页面必须引入 -->
- <public-module></public-module>
- <view class="body">
- <view class="statisticsDate d-flex">
- <view style="width: 180upx;flex-shrink: 0;">
- <picker style="padding: 0;" @change="bindPickerChange" :value="queryTimeTypeIndex"
- :range="queryTimeTypeArray">
- <view>{{queryTimeTypeArray[queryTimeTypeIndex]}}</view>
- </picker>
- </view>
- <view class="d-flex a-center j-center flex-1" @click="onShowDatePicker">
- {{dateRange[0].replace('/','-')}} -
- {{dateRange[1]}}
- </view>
- <view class="d-flex a-center j-center" style="width: 60upx;flex-shrink: 0;">
- <view class="icon iconfont icon-search-1-copy"></view>
- </view>
- </view>
- <view class="teamStatistics">
- <view class="statisticsTitle">
- <view class="d-flex a-center j-center">团队级别</view>
- <view class="d-flex a-center j-center">团队人数</view>
- <view class="d-flex a-center j-center">签单保费(元)</view>
- <view class="d-flex a-center j-center">出单人力</view>
- </view>
- <block v-for="(item,index) in SummaryList" :key="index">
- <view class="statisticsContent">
- <view class="d-flex a-center j-center">{{item.teamlevel}}</view>
- <view class="d-flex a-center j-center">{{item.teamnum}}</view>
- <view class="d-flex a-center j-center">{{item.sumpremium.toFixed(2)}}</view>
- <view class="d-flex a-center j-center">{{item.usernum}}</view>
- </view>
- </block>
- </view>
- <swiper-tab :tabBars="arrdata" :tabIndex="teamTabIndex" @tabtap="teamTabtap"></swiper-tab>
- <view class="team_members">
- <view class="team_member d-flex" style="background-color: #CCCCCC;">
- <view class="d-flex a-center j-center flex-1">
- <view>团队成员</view>
- </view>
- <view class="d-flex a-center j-center flex-1">
- <view>核保笔数</view>
- </view>
- <view class="d-flex a-center j-center flex-1">
- <view>出单笔数</view>
- </view>
- <view class="d-flex a-center j-center flex-1">
- <view>签单保费</view>
- </view>
- </view>
- <view v-if="teamTabIndex==0" class="dis j-s a-c team_members-data"
- v-for="(item,index) in userPolicyList1" :key="index" @click="toTeamMember('userPolicyList1',index)">
- <view class="dis j-c a-c">{{item.username}}</view>
- <view class="dis j-c a-c">{{item.ordernum}}</view>
- <view class="dis j-c a-c">{{item.policynum}}</view>
- <view class="dis j-c a-c">{{item.sumpremium}}</view>
- </view>
- <view v-if="teamTabIndex==1" class="dis j-s a-c team_members-data"
- v-for="(item,index) in userPolicyList2" :key="index">
- <view class="dis j-c a-c">{{item.username}}</view>
- <view class="dis j-c a-c">{{item.ordernum}}</view>
- <view class="dis j-c a-c">{{item.policynum}}</view>
- <view class="dis j-c a-c">{{item.sumpremium}}</view>
- </view>
- <view v-if="teamTabIndex==2" class="dis j-s a-c team_members-data"
- v-for="(item,index) in userPolicyList3" :key="index">
- <view class="dis j-c a-c">{{item.username}}</view>
- <view class="dis j-c a-c">{{item.ordernum}}</view>
- <view class="dis j-c a-c">{{item.policynum}}</view>
- <view class="dis j-c a-c">{{item.sumpremium}}</view>
- </view>
- <view v-if="teamTabIndex==3" class="dis j-s a-c team_members-data"
- v-for="(item,index) in userPolicyList4" :key="index">
- <view class="dis j-c a-c">{{item.username}}</view>
- <view class="dis j-c a-c">{{item.ordernum}}</view>
- <view class="dis j-c a-c">{{item.policynum}}</view>
- <view class="dis j-c a-c">{{item.sumpremium}}</view>
- </view>
- <view v-if="teamTabIndex==4" class="dis j-s a-c team_members-data"
- v-for="(item,index) in userPolicyList5" :key="index">
- <view class="dis j-c a-c">{{item.username}}</view>
- <view class="dis j-c a-c">{{item.ordernum}}</view>
- <view class="dis j-c a-c">{{item.policynum}}</view>
- <view class="dis j-c a-c">{{item.sumpremium}}</view>
- </view>
- </view>
- </view>
- <mx-date-picker :show="showDatePicker" type="range" :value="dateRange" :show-tips="true" @confirm="onSelected"
- @cancel="onSelected" />
- </view>
- </template>
- <script>
- import {
- mapState
- } from "vuex";
- import MxDatePicker from "@/components/modules/tools/team/mx-datepicker/mx-datepicker.vue";
- import SwiperTab from "@/components/modules/tools/team/swiper-tab.vue";
- export default {
- components: {
- SwiperTab,
- MxDatePicker
- },
- data() {
- return {
- queryPeopleId: "",
- queryTimeTypeArray: ['本月查询', '本年查询', '自定义查询'],
- queryTimeTypeIndex: 0,
- dateRange: [new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-01', new Date()
- .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
- ],
- showDatePicker: false,
- teamTabIndex: 0,
- SummaryList: [],
- userPolicyList1: [],
- userPolicyList2: [],
- userPolicyList3: [],
- userPolicyList4: [],
- userPolicyList5: [],
- arrdata: [{
- teamlevel: 99,
- name: '汇总',
- teamnum: 0, //人数
- sumpremium: 0, //签单保费
- usernum: 0 //出单人力
- },
- {
- teamlevel: 1,
- name: '本人',
- teamnum: 0, //人数
- sumpremium: 0, //签单保费
- usernum: 0 //出单人力
- },
- {
- teamlevel: 2,
- name: '一级团队',
- teamnum: 0, //人数
- sumpremium: 0, //签单保费
- usernum: 0 //出单人力
- },
- {
- teamlevel: 3,
- name: '二级团队',
- teamnum: 0, //人数
- sumpremium: 0, //签单保费
- usernum: 0 //出单人力
- },
- {
- teamlevel: 9,
- name: '临时团队',
- teamnum: 0, //人数
- sumpremium: 0, //签单保费
- usernum: 0 //出单人力
- }
- ],
- teamStaff: {},
- teamStaffList: [],
- }
- },
- async onLoad(params) {
- // this.queryPeopleId = params.id
- if ((!!params.id) && (!!params.name)) {
- this.queryPeopleId = params.id
- await this.queryData()
- uni.setNavigationBarTitle({
- title: params.name + "团队管理"
- });
- } else if (!!this.userInfo) {
- this.queryPeopleId = this.userInfo.sysUser.id
- await this.queryData()
- uni.setNavigationBarTitle({
- title: this.userInfo.sysUser.name + "团队管理"
- });
- } else {
- this.queryPeopleId = this.userInfo.sysUser.id
- await this.queryData()
- }
- },
- onShow() {},
- computed: {
- ...mapState(['userInfo']),
- getHeight() {
- let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(770);
- return `height: ${height}px;`;
- }
- },
- methods: {
- bindPickerChange: function(e) {
- this.queryTimeTypeIndex = e.target.value
- if (e.target.value == 0) {
- this.dateRange = [new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + '01',
- new Date()
- .getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
- ];
- this.queryData();
- }
- if (e.target.value == 1) {
- this.dateRange = [new Date().getFullYear() + '-01-01', new Date().getFullYear() + '-12-31'];
- this.queryData();
- }
- if (e.target.value == 2) {
- this.showDatePicker = true;
- }
- },
- async queryData() {
- let params = {
- "enddate": this.dateRange[1],
- "startdate": this.dateRange[0]
- }
- let res = await this.$http.post('/esm/user/queryUserCount', params);
- if (res.code == '200') {
- this.SummaryList = res.data.hzList;
- this.userPolicyList1 = res.data.userPolicyList;
- this.userPolicyList2 = res.data.userPolicyList0;
- this.userPolicyList3 = res.data.userPolicyList1;
- this.userPolicyList4 = res.data.userPolicyList2;
- this.userPolicyList5 = res.data.userPolicyList9;
- }
- },
- onShowDatePicker() { //显示
- this.showDatePicker = true;
- },
- onSelected(e) { //选择
- this.showDatePicker = false;
- if (e) {
- this.dateRange = e.value;
- this.queryData();
- }
- },
- // 选择团队tap
- teamTabtap(index) {
- this.teamTabIndex = index;
- },
- toTeamMember(index) {
- this.navigate({
- url: "/pages/tools/team/teamMember",
- success: (res) => {
- res.eventChannel.emit("acceptData", {
- item: this.teamStaffList[index]
- })
- }
- }, "navigateTo", true)
- }
- }
- }
- </script>
- <style>
- .body .statisticsDate {
- padding: 15upx 30upx;
- border-radius: 35upx;
- border: 1px solid #ddd;
- margin: 15upx 30upx;
- font-size: 28upx;
- }
- .body .teamStatistics {
- border-bottom: 15upx solid #ddd;
- }
- .body .teamStatistics .statisticsTitle {
- height: 70upx;
- padding: 0px 30upx;
- box-sizing: border-box;
- line-height: 70upx;
- font-size: 30upx;
- background: #ccc;
- }
- .body .teamStatistics .statisticsContent {
- padding: 0px 30upx;
- box-sizing: border-box;
- height: 70upx;
- line-height: 70upx;
- border-bottom: 1upx solid #ddd;
- font-size: 28upx;
- }
- .body .teamStatistics .statisticsTitle,
- .body .teamStatistics .statisticsContent {
- display: flex;
- flex-wrap: nowrap;
- justify-content: space-between;
- }
- .body .teamStatistics .statisticsTitle>view,
- .body .teamStatistics .statisticsContent>view {
- width: 200upx;
- text-align: center;
- }
- /* 横向滚动选项Start */
- .teamScrollView {
- border-bottom: 15upx solid #ccc;
- }
- /* 横向滚动选项Start */
- /* 团队成员列表Start */
- .team_members {}
- .team_members .team_member {
- min-height: 70upx;
- padding: 0px 30upx;
- box-sizing: border-box;
- line-height: 70upx;
- border-bottom: 1px solid #ddd;
- }
- /* .team_members .team_member:nth-of-type(1){
- background: #CCCCCC;
- } */
- .team_members .team_member>view {
- flex-wrap: nowrap;
- }
- .team_members-data {
- padding: 0 15px;
- border-bottom: 1px solid #ddd;
- }
- .team_members-data>view {
- width: 25%;
- padding: 4px;
- }
- /* 团队成员列表End */
- </style>
|