hjw 6 天之前
父节点
当前提交
4fe3e2a9e5
共有 1 个文件被更改,包括 93 次插入43 次删除
  1. 93 43
      app/statistics/html/resident-analysis.html

+ 93 - 43
app/statistics/html/resident-analysis.html

@ -138,17 +138,49 @@
                </div> -->
          <div class="mt10">
            <div class="area-tab-panel">
              <div class="area-tab" :class="areaType == 4?'active':''" data-val="4" @click="showTabs(4)">
              <div class="area-tab" v-if="levelType == 4" :class="areaType == 4?'active':''" data-val="4" @click="showTabs(4)">
                <span>各区</span>
                <i class="border-line-right"></i>
              </div>
              <div class="area-tab" :class="areaType == 3?'active':''" data-val="3" @click="showTabs(3)">
              <div class="area-tab" v-if="levelType >= 3" :class="areaType == 3?'active':''" data-val="3" @click="showTabs(3)">
                <span>社区</span>
                <i class="border-line-right"></i>
              </div>
              <div class="area-tab" :class="areaType == 2?'active':''" data-val="2" @click="showTabs(2)"><span>团队</span></div>
              <div class="area-tab" :class="areaType == 2?'active':''" data-val="2" @click="showTabs(2)">
                <span>团队</span>
                <i class="border-line-right"></i>
              </div>
            </div>
            <table class="bottom-list-table mb20" id="listTable"></table>
            <table class="bottom-list-table mb20" id="listTable">
              <thead>
                <tr>
                  <th>排名</th>
                  <th>线上缴费量</th>
                  <th>总缴费量</th>
                  <!-- {{if level>2 && lowLevel != 1}} -->
                  <th width="20"></th>
                  <!-- {{/if}} -->
                </tr>
              </thead>
              <tbody>
                <tr v-for="v in tableList"class="data-row" :data-name="v.name" :data-code="v.code" data-type="">
                  <td class="area-name">
                    <div v-if="v.top == 1" class="ranking ranking1">{{v.top}}</div>
                    <div v-else-if="v.top == 2" class="ranking ranking2">{{v.top}}</div>
                    <div v-else-if="v.top == 3" class="ranking ranking3">{{v.top}}</div>
                    <div v-else class="ranking">{{v.top}}</div>
                    <div class="ui-col-1 c-nowrap-multi">{{v.name}}</div>
                  </td>
                  <td>{{v.signPayOnlineNum}}</td>
                  <td>{{v.signNum}}</td>
                  <!-- {{if level>2 && lowLevel != 1}} -->
                  <td>
                    <i class="fa fa-angle-right"></i>
                  </td>
                  <!-- {{/if}} -->
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
@ -182,14 +214,14 @@
          <th>排名</th>
          <th>线上缴费量</th>
          <th>总缴费量</th>
          {{if level>2 && lowLevel != 1}}
          <!-- {{if level>2 && lowLevel != 1}} -->
          <th width="20"></th>
          {{/if}}
          <!-- {{/if}} -->
        </tr>
      </thead>
      <tbody>
        {{each list as v i}}
        <tr class="data-row" @click="showRow" data-name="{{v.name}}" data-code="{{v.code}}" data-type="">
        <tr class="data-row" data-name="{{v.name}}" data-code="{{v.code}}" data-type="">
          <td class="area-name">
            {{if v.top == 1}}
            <div class="ranking ranking1">{{v.top}}</div>
@ -204,9 +236,11 @@
          </td>
          <td>{{v.signPayOnlineNum}}</td>
          <td>{{v.signNum}}</td>
          {{if level>2 && lowLevel != 1}}
          <td><i class="fa fa-angle-right"></i></td>
          {{/if}}
          <!-- {{if level>2 && lowLevel != 1}} -->
          <td>
            <i class="fa fa-angle-right"></i>
          </td>
          <!-- {{/if}} -->
        </tr>
        {{/each}}
      </tbody>
@ -278,6 +312,7 @@
          selectedDateType: 1,
          analysisType: '1',
          areaType: null,
		  tableList:[],
          chooseYear: new Date().getFullYear(),
          userRole: {},
          reqParam: [],
@ -309,22 +344,25 @@
          vuedals: Vuedals.Component
        },
        mounted: function () {
		  var vm = this
          var vm = this
          this.initData()
		  EventBus.$on('time-data', function (arg) {
            console.log('arg',arg);
			vm.chooseYear = arg.year
          EventBus.$on('time-data', function (arg) {
            console.log('arg', arg)
            vm.chooseYear = arg.year
            vm.chartObj.chooseYear = arg.year
			vm.level = arg.level
			if (arg.level == '3') {
            vm.level = Number(arg.level)
            if (arg.level == '3') {
              vm.lowLevel = 2
            } else if (arg.level == '2') {
              vm.lowLevel = 1
            } else {
              vm.lowLevel = 0
            }
			vm.area = arg.areaCode
            vm.area = arg.areaCode || '350200'
            vm.startDate = vm.getStartDate()
            vm.endDate = vm.getEndDate()
            vm.showTabs()
            vm.showTabs(vm.level, 1)
            vm.initReqParams()
            vm.loadData([0, 1, 2])
            vm.bindEvents()
@ -349,7 +387,7 @@
            }
          },
          initData() {
            const self = JSON.parse(window.sessionStorage.getItem("selectedRole"))
            const self = JSON.parse(window.sessionStorage.getItem('selectedRole'))
            // const self = {
            //   doctorAuthOperate: '1',
            //   high: '1',
@ -371,7 +409,7 @@
            //   }
            this.startDate = this.getStartDate()
            this.endDate = this.getEndDate()
            this.showTabs()
            this.showTabs(this.level, 1)
            this.initReqParams()
            this.reqList.push({
              level: this.level,
@ -418,7 +456,7 @@
            }
          },
          initReqParams() {
			this.startDate = this.getStartDate()
            this.startDate = this.getStartDate()
            this.endDate = this.getEndDate()
            var mIndex = 82, //折线图指标index
              bIndexs = { '4': '75', '3': '76', '2': '77' }
@ -761,16 +799,16 @@
            for (var k in res) {
              var list = res[k]
              var topArr = soreRank(this.amountArr(list))
              list = _.map(list, function (o, index) {
                o.top = topArr[index]
                o.rate = parseFloat(o.rate).toFixed(2)
                o.targetRate = parseFloat(o.targetRate).toFixed(2)
                return o
              })
              var html = template('data-list', { list: list, level: this.level, lowLevel: this.lowLevel, analysisType: this.analysisType })
              $('#listTable').empty().append(html)
              console.log('list', { list: list, level: this.level, lowLevel: this.lowLevel, analysisType: this.analysisType })
			  this.tableList = list
            //   var html = template('data-list', { list: list, level: this.level, lowLevel: this.lowLevel, analysisType: this.analysisType })
            //   $('#listTable').empty().append(html)
            }
          },
          amountArr(list) {
@ -782,24 +820,34 @@
            return amountArr
          },
          showRow() {},
          showTabs(type) {
            $('.area-tab').removeClass('active')
          showTabs(type, levelType) {
            // $('.area-tab').removeClass('active')
            switch (type) {
              case 4:
                // $('.area-tab').show()
                // $('.area-tab').eq(0).addClass('active')
                if (levelType) {
                  this.levelType = 4
                  //   $('.area-tab').show()
                  //   $('.area-tab').eq(0).addClass('active')
                }
                this.areaType = '4'
                break
              case 3:
                // $('.area-tab').eq(0).hide()
                // $('.area-tab').eq(1).show()
                // $('.area-tab').eq(1).addClass('active')
                if (levelType) {
                  this.levelType = 3
                  //   $('.area-tab').eq(0).hide()
                  //   $('.area-tab').eq(1).show()
                  //   $('.area-tab').eq(1).addClass('active')
                }
                this.areaType = '3'
                break
              case 2:
                // $('.area-tab').eq(0).hide()
                // $('.area-tab').eq(1).hide()
                // $('.area-tab').eq(2).addClass('active')
                if (levelType) {
                  this.levelType = 2
                  //   $('.area-tab').eq(0).hide()
                  //   $('.area-tab').eq(1).hide()
                  //   $('.area-tab').eq(2).addClass('active')
                }
                this.areaType = '2'
                break
              case 1: //团队
@ -810,7 +858,10 @@
              this.lowLevel = 2
            } else if (type == '2') {
              this.lowLevel = 1
            } else {
              this.lowLevel = 0
            }
            this.initReqParams()
            this.loadData([2])
            // this.loadData([2], this)
@ -904,17 +955,18 @@
                type = $this.attr('data-val') //4 - 各区, 3 - 社区, 2 - 团队
              this.areaType = type
              if ($this.hasClass('active')) {
                return false
              }
              $('.area-tab').removeClass('active')
              $this.addClass('active')
              if (type == '4') {
                this.lowLevel = 0
              } else if (type == '3') {
              this.showTabs(this.level)
              if (type == '3') {
                this.lowLevel = 2
              } else if (type == '2') {
                this.lowLevel = 1
              } else {
                this.lowLevel = 0
              }
              this.initReqParams()
              vm.loadData([2])
@ -922,8 +974,6 @@
            //底部每条记录的点击事件
            $('#listTable').on('click', '.data-row', function () {
              console.log(666666)
              var $this = $(this),
                name = $this.attr('data-name'),
                code = $this.attr('data-code'),
@ -947,7 +997,7 @@
              vm.areaType = newlevel
              $('#areaTitle').text(vm.title)
              vm.showTabs()
              vm.showTabs(vm.level, 1)
              vm.initReqParams()
              //记录返回链接信息
              vm.reqList.push({