<template>
  <div id="unit" class="flex-row">
    <div class="basic-main" @keyup.enter="search">
      <div class="flex" v-if="!show">
        <criteria-paged :model="model" v-ref:paged>
          <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
            <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
              <div class="row">
                <div class="col-sm-2 form-group">
                  <label for="startDate" class="font_normal_body">开始日期</label>
                  <datepicker id="startDate" placeholder="开始日期" style="width:60%"
                              v-model="model.startDate"
                              :value.sync="model.startDate"
                              :format="'yyyy-MM-dd HH:mm:ss'"
                              :show-reset-button="true"
                  >
                  </datepicker>
                </div>
                <div class="col-sm-2 form-group">
                  <label for="endDate" class="font_normal_body">结束日期</label>
                  <datepicker id="endDate" placeholder="结束日期" style="width:60%"
                              v-model="model.endDate"
                              :value.sync="model.endDate"
                              :format="'yyyy-MM-dd HH:mm:ss'"
                              :show-reset-button="true"
                  >
                  </datepicker>
                </div>
                <div class="col-sm-2 form-group">
                  <label for="area" class="font_normal_body">&nbsp;&nbsp;&nbsp;小区&nbsp;&nbsp;&nbsp;</label>
                  <v-select :value.sync="model.f_residential_area"
                            id="area"
                            class="select_list select"
                            enter-push
                            multiple="true"
                            v-model="model.f_residential_area"
                            style="width: 60%"
                            :options='$parent.$parent.residentialArea' placeholder='选择小区'
                            close-on-select>
                  </v-select>
                </div>
<!--                <div class="col-sm-2 form-group">-->
<!--                  <label for="f_area_id" class="font_normal_body">小区编码</label>-->
<!--                  <input id="f_area_id" type="text" style="width:60%" class="input_search" v-model="model.f_area_id"-->
<!--                         condition="f_area_id = '{}'" placeholder='小区编码'>-->
<!--                </div>-->
                <!--<div class="col-sm-2 form-group">-->
                <!--<label class="font_normal_body">客户编号</label>-->
                <!--<input type="text" style="width:60%" class="input_search" v-model="model.f_userinfo_code"-->
                <!--condition="f_userinfo_code = '{}' " placeholder="客户编号">-->
                <!--</div>-->
                <!--<div class="col-sm-2 form-group">-->
                <!--<label class="font_normal_body">客户名称</label>-->
                <!--<input type="text" style="width:60%" class="input_search" v-model="model.f_user_name"-->
                <!--condition="f_user_name like '%{}%'" placeholder="客户名称">-->
                <!--</div>-->

                <div class="span" style="float:right;">
                  <!--<read-idcard></read-idcard>-->
                  <button class="button_search button_spacing" @click="search()">查询</button>
                  <button class="button_clear  button_spacing" @click="$parent.$parent.clear()">清空</button>

<!--                  <export-excel :data="$parent.$parent.getCondition"-->
<!--                                :field="$parent.$parent.getfield"-->
<!--                                :footer="$parent.$parent.footer"-->
<!--                                :header="$parent.$parent.other"-->
<!--                                sqlurl="rs/logic/exportfile"-->
<!--                                sql-name="areaGeneralQuery"-->
<!--                                template-name='小区综合查询导出'-->
<!--                                :choose-col="true"></export-excel>-->

                  <!--<print-data :model="$parent.model" :field="$parent.$parent.getfield"-->
                  <!--:defaultfield="$parent.$parent.defaultfield" print-name="收费查询"-->
                  <!--:sumsmodel="$parent.$parent.sumsmodel"></print-data>-->
                  <div style="float: right" class="button_spacing"
                       :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
                       @click="$parent.$parent.hidden()"></div>

                </div>
              </div>
              <div class="row" v-show="$parent.$parent.criteriaShow">
                <res-select-group :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes"
                                  v-ref:sel></res-select-group>

                <!--<div class="col-sm-2 form-group">-->
                <!--<label class="font_normal_body">客户电话</label>-->
                <!--<input type="text" style="width:60%" class="input_search" v-model="model.f_user_phone"-->
                <!--condition="f_user_phone like '%{}%'" placeholder="客户电话">-->
                <!--</div>-->
                <!--<div class="col-sm-2 form-group">-->
                <!--<label class="font_normal_body">身份证号</label>-->
                <!--<input type="text" style="width:60%" class="input_search" v-model="model.f_idnumber"-->
                <!--condition="f_idnumber like '%{}%'" placeholder="身份证号">-->
                <!--</div>-->
                <!--<div class="col-sm-2 form-group">-->
                <!--<label class="font_normal_body">客户地址</label>-->
                <!--<input type="text" style="width:60%" class="input_search" v-model="model.f_address"-->
                <!--condition="f_address like '%{}%'" placeholder='客户地址'>-->
                <!--</div>-->
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">用户分类</label>
                  <v-select :value.sync="model.f_user_type"
                            @change="$parent.$parent.userTypeChange"
                            :options='$parent.$parent.usertypes' placeholder='请选择' v-model="model.f_user_type"
                            condition="f_user_type = '{}'"
                            close-on-select></v-select>
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">用户类型</label>
                  <v-select :value.sync="model.f_user_mold"
                            @change="$parent.$parent.userMoldChange"
                            :options='$parent.$parent.usermold' placeholder='请选择' v-model="model.f_user_mold"
                            condition="f_user_mold = '{}'"
                            close-on-select></v-select>
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">用气性质</label>
                  <v-select :value.sync="model.f_gasproperties" v-model="model.f_gasproperties"
                            :options='$parent.$parent.gasproperties' placeholder='请选择'
                            condition="f_gasproperties = '{}'"
                            close-on-select></v-select>
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">房产地址</label>
                  <input class="input_search" condition="f_house_address = '{}'"
                         placeholder='房产地址'
                         style="width:60%" type="text" v-model="model.f_house_address">
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">用途</label>
                  <input class="input_search" condition="f_property_usage = '{}'"
                         placeholder='用途'
                         style="width:60%" type="text" v-model="model.f_property_usage">
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">房型</label>
                  <input class="input_search" condition="f_house_type = '{}'"
                         placeholder='房型'
                         style="width:60%" type="text" v-model="model.f_house_type">
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">是否一户多表</label>
                  <input class="input_search" condition="f_is_multi_meter = '{}'"
                         placeholder='是否一户多表'
                         style="width:60%" type="text" v-model="model.f_is_multi_meter">
                </div>
                <div class="col-sm-2 form-group">
                  <label class="font_normal_body">关联ID</label>
                  <input class="input_search" condition="f_house_id = '{}'"
                         placeholder='关联ID'
                         style="width:60%" type="text" v-model="model.f_house_id">
                </div>


              </div>
            </div>
          </criteria>

          <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid>
            <template partial='head'>
              <tr>
                <th rowspan="2">
                  <nobr>序号</nobr>
                </th>
                <th rowspan="2">
                  <nobr>小区名称</nobr>
                </th>
                <th colspan="6">
                  <nobr>用户数(档案户数)</nobr>
                </th>
                <th colspan="4">
                  <nobr>机表(抄表情况)</nobr>
                </th>
                <th colspan="4">
                  <nobr>卡表(售气情况)</nobr>
                </th>
                <th colspan="4">
                  <nobr>物联网表(用气情况)</nobr>
                </th>
                <th rowspan="2">
                  <nobr>期间实收金额</nobr>
                </th>
              </tr>
              <tr>
                <th>
                  <nobr>正常</nobr>
                </th>
                <th>
                  <nobr>停用</nobr>
                </th>
                <th>
                  <nobr>销户</nobr>
                </th>
                <th>
                  <nobr>未开户</nobr>
                </th>
                <th>
                  <nobr>壁挂锅炉</nobr>
                </th>
                <th>
                  <nobr>楼栋</nobr>
                </th>

                <th>
                  <nobr>户数</nobr>
                </th>
                <th>
                  <nobr>气量</nobr>
                </th>
                <th>
                  <nobr>金额</nobr>
                </th>
                <th>
                  <nobr>实收</nobr>
                </th>
                <th>
                  <nobr>户数</nobr>
                </th>
                <th>
                  <nobr>气量</nobr>
                </th>
                <th>
                  <nobr>金额</nobr>
                </th>
                <th>
                  <nobr>实收</nobr>
                </th>
                <th title="用气户数">
                  <nobr>户数</nobr>
                </th>
                <th>
                  <nobr>气量</nobr>
                </th>
                <th>
                  <nobr>金额</nobr>
                </th>
                <th>
                  <nobr>实收</nobr>
                </th>
              </tr>
            </template>
            <template partial='body'>
              <td style="text-align:center">
                <nobr>{{ $index + 1 }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_residential_area }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_zhengchang }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_tingyong }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_xiaohu }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_weikaihu }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.bgl }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_building }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_jibiao }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_oughtamount }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_oughtfee }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_collection_hand }}</nobr>
              </td>

              <td style="text-align: center;">
                <nobr>{{ row.f_kabiao }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_pregas }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_preamount }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_collection_card }}</nobr>
              </td>

              <td style="text-align: center;">
                <nobr>{{ row.f_wulian }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_oughtamount_web }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_oughtfee_web }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_collection_web }}</nobr>
              </td>
              <td style="text-align: center;">
                <nobr>{{ row.f_collection }}</nobr>
              </td>
            </template>
            <template partial='foot'></template>
          </data-grid>
        </criteria-paged>
        <table class="table-hover">
          <tr style="position: relative" class="table-bordered">
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
              汇总信息
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              正常合计:&emsp;{{ sumsmodel.f_zhengchang }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              停用合计:&emsp;{{ sumsmodel.f_tingyong }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              未开户合计:&emsp;{{ sumsmodel.f_weikaihu }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              销户合计:&emsp;{{ sumsmodel.f_xiaohu }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              壁挂炉合计:&emsp;{{ sumsmodel.bgl }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              楼栋合计:&emsp;{{ sumsmodel.f_building }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              机表抄表户数合计:&emsp;{{ sumsmodel.f_jibiao }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              机表抄表气量合计:&emsp;{{ sumsmodel.f_oughtamount }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              机表抄表金额合计:&emsp;{{ sumsmodel.f_oughtfee }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              机表实收金额合计:&emsp;{{ sumsmodel.f_collection_hand }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              物联用气户数合计:&emsp;{{ sumsmodel.f_wulian }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              物联用气量合计:&emsp;{{ sumsmodel.f_oughtamount_web }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              物联用气金额合计:&emsp;{{ sumsmodel.f_oughtfee_web }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              物联实收金额合计:&emsp;{{ sumsmodel.f_collection_web }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              卡表售气户数合计:&emsp;{{ sumsmodel.f_kabiao }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              卡表售气量合计:&emsp;{{ sumsmodel.f_pregas }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              卡表售气金额合计:&emsp;{{ sumsmodel.f_preamount }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              卡表实收金额合计:&emsp;{{ sumsmodel.f_collection_card }}
            </td>
            <td
              style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
              总实收金额合计:&emsp;{{ sumsmodel.f_collection }}
            </td>
          </tr>
        </table>
      </div>
      <!--<div v-if="show">-->
      <!--<user-info-detail-manage :f_userinfo_id="rowdata.f_userinfo_id" @cancel-main="cancel"></user-info-detail-manage>-->
      <!--</div>-->
    </div>
  </div>
</template>

<script>
import {HttpResetClass, PagedList} from 'vue-client'
import exportConfig from '../config/exportConfig'
import plugins from "../../../plugins/GetLoginInfoService";

let readySomething = async function (self) {
  self.$refs.paged.$refs.cri.model.startDate = self.$login.toStandardDateString() + ' 00:00:00'
  self.$refs.paged.$refs.cri.model.endDate = self.$login.toStandardDateString() + ' 23:59:59'
  // self.$refs.paged.$refs.cri.search()
  self.defaultfield = [...self.defaultfield, ...self.config.defaultPrint]
  await self.$MagLoadParams.loadParam()
  self.initParams()
  self.sumsmodel = self.$refs.paged.$refs.grid.model.sums
}
export default {
  data() {
    return {

      config: {
        defaultPrint: []
      },
      other: [],
      footer: [],
      //f_price_name:[],
      gasproperties:[],
      usermold:[],
      showinfo: false,
      data: {},
      show: false,
      rowdata: {},
      initres: {
        org: [this.$login.f.orgid],
        dep: [],
        user: []
      },
      model: new PagedList('rs/sql/areaGeneralQuery', 20, {
        startDate: 'this.model.startDate',
        endDate: 'this.model.endDate'
      }, {
        f_zhengchang: 0,
        bgl:0,
        f_building:0,
        f_tingyong: 0,
        f_weikaihu: 0,
        f_xiaohu: 0,
        f_jibiao: 0,
        f_oughtamount: 0,
        f_oughtfee: 0,
        f_collection_hand: 0,
        f_wulian: 0,
        f_oughtamount_web: 0,
        f_oughtfee_web: 0,
        f_collection_web: 0,
        f_kabiao: 0,
        f_pregas: 0,
        f_preamount: 0,
        f_collection_card: 0,
        f_collection: 0
      }),
      criteriaShow: false,
      // 下拉框
      meterbrands: [],
      pricenames: [],
      prices: [],
      area: [],
      orgCondtionStr: '(' + this.$login.f.orgid + ')',
      //合计数据
      defaultfield: [],
      //小区
      residentialArea: [],
      sumsmodel: {},
      f_filialeid: this.$login.f.f_orgid
    }
  },
  ready() {
    this.getaddress()

    readySomething(this).then(() => {
      this.$emit('ready')
    }).catch((error) => {
      this.$emit('error', error)
    })
  },
  methods: {
    getRes(obj) {
      this.orgCondtionStr = obj
      console.log('this.orgCondtionStr===>',this.orgCondtionStr)
    },
    getotherfooter() {
      // this.$refs.paged.$refs.cri.$refs.exports.otherData=[];
      // this.$refs.paged.$refs.cri.$refs.exports.footerData=[];
      this.other = [];
      this.footer = [];
      let exportdata = this.getCondition;
      let otherInData = [];
      otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`);
      let footerData = [], exportfield = this.getfield;
      footerData.push("合计");
      let self = this;
      for (var field in self.sumsmodel) {
        footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`);
      }
      this.footer.push(footerData);
      this.other.push(otherInData);
    },
    async getaddress(){
      console.log('开始获取小区')
      let HttpReset = new HttpResetClass()
      var data = await HttpReset.load('POST', 'rs/sql/manage_getarealist?pageNo=1&pageSize=5000', {
        data: {
          condition: '1=1'
        }
      }, {resolveMsg: null, rejectMsg: '获取小区失败!'})
      console.log('小区',data)
      let house = []
      for (let row of data.data){
        console.log('开始保存小区')
        house.push({label: row.f_residential_area, value: row.f_residential_area})
      }
      this.residentialArea = house
    },


    //把数据库查询数据转换为下拉数据
    calculate(rows) {
      let data = []
      rows.forEach((row, n) => {
        data[n] = {label: row.f_residential_area, value: row.id}
      })
      return data
    },

    search() {
      this.$refs.paged.$refs.cri.search()
    },
    cancel() {
      this.show = false
    },
    showmsg(obj) {
      this.rowdata = obj
      this.show = true
    },
    userTypeChange () {
      this.usermold=[]
      this.f_gasproperties=[]
      if(this.$refs.paged.$refs.cri.model !== null) {
        this.$refs.paged.$refs.cri.model.f_gasproperties=''
        this.$refs.paged.$refs.cri.model.f_user_mold=''
        this.usermold = this.$appdata.getParam(this.$refs.paged.$refs.cri.model.f_user_type[0])
      }
      else{
        this.usermold =[{label: '全部', value: ''}]
      }
    },
    userMoldChange () {
      this.gasproperties=[]
      if(this.$refs.paged.$refs.cri.model !==null) {
        this.$refs.paged.$refs.cri.model.f_gasproperties=''
        if (this.$refs.paged.$refs.cri.model.f_user_mold[0] ==='居民'){
          this.gasproperties = this.$appdata.getParam(this.$refs.paged.$refs.cri.model.f_user_type[0] + this.$refs.paged.$refs.cri.model.f_user_mold[0])
          return
        }
        this.gasproperties = this.$appdata.getParam(this.$refs.paged.$refs.cri.model.f_user_mold[0])
      }
      else{
        this.gasproperties =[{label: '全部', value: ''}]
      }
    },
    initParams() {
      // 初始化气表品牌
      let brandArr = []
      this.$MagGetSaleParam.getGasbrand().forEach((item) => {
        let temp = {}
        temp.label = item.label
        temp.value = item.value.f_meter_brand
        brandArr.push(temp)
      })
      this.meterbrands = [{label: '全部', value: ''}, ...brandArr]
      //初始化气表价格
      this.prices = this.$MagGetSaleParam.getPrices();
    },
    selfSearch(args) {
      if (this.$refs.paged.$refs.cri.model.startDate === '' || this.$refs.paged.$refs.cri.model.endDate === '') {
        this.$showAlert('请先选择开始时间、结束时间，再进行查询操作！', 'warning', 3000)
      } else {
        //小区查询条件
        this.area = this.$refs.paged.$refs.cri.model.f_residential_area
        console.log("=====小区model绑定====", this.area)
        if (this.area.length !== 0) {
          let str = JSON.stringify(this.area)
          str = str.replace(/"/g, `'`)
          str = str.replace(/\[/g, ``)
          str = str.replace(/\]/g, ``)
          console.log("=====小区model22222222222绑定====", str)
          //查询多个小区时条件
          args.condition += ` and f_residential_area in  ( ${str} )`
        }

        let f_orgstr = this.orgCondtionStr
        args.condition = `${args.condition} ` + f_orgstr
        this.model.search(args.condition, args.model)
        this.sumsmodel = this.$refs.paged.$refs.grid.model.sums
      }
    },
    clear() {
      //清空部门和人员
      this.$refs.paged.$refs.cri.$refs.sel.$children[1].selectres = []
      //部门和人员变为全选
      this.$refs.paged.$refs.cri.$refs.sel.$children[1].$children[0].isSelectAll = false
      this.$refs.paged.$refs.cri.$refs.sel.$children[2].$children[0].isSelectAll = false
      Object.keys(this.$refs.paged.$refs.cri.model).forEach((key) => {
        this.$refs.paged.$refs.cri.model[key] = []
      })

    },
    dealmsg(val) {
      val.model = this.model.model
      this.$dispatch('deal-msg', val)
    },
    show() {
      this.criteriaShow = true
    },
    hidden() {
      this.criteriaShow = !this.criteriaShow
    },

    async updateParams() {
      await this.$MagLoadParams.loadParam(this.f_filialeid)
      this.initParams()
    }

  },
  events: {
    'getidcard'(IdCard) {
      console.log("IdCard-===")
      console.log(IdCard)
      // console.log(param)
      this.$refs.paged.$refs.cri.model.f_info_idnumber = IdCard.strID
    }
  },
  watch: {
    'model'(val) {
    },
    'orgCondtionStr'(val) {
      let res = val.match(/'(.*?)'/)
      console.log('正则提取:', res && res[1])
      if (res) {
        this.f_filialeid = res[1]
        this.updateParams()
      }
    },
    sumsmodel: {
      handler: function (val) {
        this.getotherfooter();
      },
      deep: true
    }
  },
  computed: {
    getPricenames() {
      let f_user_type = this.$refs.paged.model.model.f_user_type;
      let f_gasproperties = this.$refs.paged.model.model.f_gasproperties;
      let pricetype = this.$refs.paged.model.model.pricetype;
      console.log("打印一下:", f_user_type, f_gasproperties, pricetype, this.f_filialeid, this.prices)
      if (this.$refs.paged.model.model !== null) {
        let rs = []
        let priceArr = []
        if (f_user_type.length > 0 && f_gasproperties.length > 0 && pricetype.length > 0) {
          let params = {
            f_user_type: f_user_type[0],
            f_gasproperties: f_gasproperties[0],
            f_price_type: pricetype[0],
            filter: this.f_filialeid,
            prices: this.prices
          }
          this.$MagGetSaleParam.getPrice(params).forEach((item) => {
            let temp = {}
            temp.label = item.label
            temp.value = item.value.f_price_name
            priceArr.push(temp)
          })
          rs = [{label: '全部', value: ''}, ...priceArr]
        }
        if (rs.length === 0) {
          console.log('rs读出来是空')
          this.$refs.paged.model.model.f_price_name = ''
        }
        return rs
      }
    },
    getCondition() {
      return {
        condition: `${this.$refs.paged.$refs.cri.condition}` + this.orgCondtionStr,
        startDate: this.$refs.paged.$refs.cri.model.startDate,
        endDate: this.$refs.paged.$refs.cri.model.endDate
      }
    },
    getfield() {
      return exportConfig.AreaGeneralQuery
    },
    usertypes() {
      return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('用户类型')]
    },
    metertypes() {
      return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('气表类型')]
    },
    tablestate() {
      return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('气表状态')]
    }
  }
}
</script>
