<template>
  <div>
    <div class="col-xs-12 col-xs-12">
      <list :model="model" partial='list'>
      <div partial class="panel">
        <div class="panel-self">
          <div class="row">
            <p class="col-xs-3 text-left font"><b class="control-label-justify">客户编号</b></p>
            <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_userinfo_id }}</p>
          </div>
          <div class="row">
            <p class="col-xs-3 text-left font"><b class="control-label-justify">客户名称</b></p>
            <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_user_name }}</p>
          </div>
          <div class="row">
            <p class="col-xs-3 text-left font"><b class="control-label-justify">客户电话</b></p>
            <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_user_phone }}</p>
          </div>
          <div class="row">
            <p class="col-xs-3 text-left font"><b class="control-label-justify">地址信息</b></p>
            <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{row.f_address}}{{row.f_address_detail}}</p>
          </div>
          <div class="row">
            <p class="col-xs-3 text-left font"><b class="control-label-justify">表号</b></p>
            <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meternumber }}</p>
          </div>
          <div class="row">
            <p class="col-xs-3 text-left font"><b class="control-label-justify">气表品牌</b></p>
            <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meter_brand }}</p>
          </div>
          <div class="row">
            <p class="col-xs-3 text-left font"><b class="control-label-justify">气表型号</b></p>
            <p class="col-xs-8 col-xs-offset-1 text-left input-font">{{ row.f_meter_style }}</p>
          </div>
          <div class="row text-right">
            <button class="btn btn-info"
                    @click.prevent="$parent.$parent.openModal(row)">
              {{$parent.$parent.mark === 1 ? '查看' : '修正'}}
            </button>
          </div>
        </div>
      </div>
    </list>
    </div>

    <validator name="v">
      <modal v-if="showModal" :show.sync="showModal" v-ref:modal :large="true" :backdrop="false">
        <header slot="modal-header" class="modal-header">
          <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
          <h4 class="modal-title">安装明细</h4>
        </header>
        <article slot="modal-body" class="modal-body clearfix">
          <!-- 表具信息 -->
          <div class="form-group col-xs-12 panel panel-info" v-if="showUserFile">
            <div class="panel-heading head col-xs-12" style="background-color: #e8f4ff;margin-bottom: 10px">
              <div class="col-xs-6 text-left">旧表具信息</div>
            </div>
            <div class="form-group row vertical-center" :class="[$v.f_gasbrand_id.required ? 'has-error' : '']">
              <label class="col-xs-4 control-label">气表品牌：</label>
              <div class="col-xs-8">
                <input type="text" v-show="false" v-model="userfile.f_gasbrand_id" :value.sync="userfile.f_gasbrand_id" v-validate:f_gasbrand_id = "['required']" >
                <input-select
                  class="select select_list"
                  :value.sync="userfile.f_gasbrand_id"
                  v-model="userfile.f_gasbrand_id"
                  :options="meterBrandList"
                  @change="gasbrandChange()"
                  :disable="mark === 1 || userinfo.f_user_state === '正常' || gasbrandDisable"
                  :valueSingle="true"></input-select>
              </div>
            </div>
            <div class="form-group row vertical-center" :class="[$v.f_gasmodel_id.required ? 'has-error' : '']">
              <label class="col-xs-4 control-label">气表型号：</label>
              <div class="col-xs-8">
                <input type="text" v-show="false" v-model="userfile.f_gasmodel_id" :value.sync="userfile.f_gasmodel_id" v-validate:f_gasmodel_id = "['required']" >
                <input-select
                  class="select select_list"
                  :value.sync="userfile.f_gasmodel_id"
                  v-model="userfile.f_gasmodel_id"
                  :options.sync="gasModelList"
                  :disable="mark === 1 || userinfo.f_user_state === '正常' || gasbrandDisable"
                  :valueSingle="true"></input-select>
              </div>
            </div>
            <div class="form-group row vertical-center" :class="[$v.f_meternumber.required ? 'has-error' : '']">
              <label class="col-xs-4 control-label">表&emsp;&emsp;号：</label>
              <div class="col-xs-8">
                <input class="form-control input_view" style=""
                       placeholder="表号" v-validate:f_meternumber = "['required']"
                       v-model="newUserfile.f_meternumber"
                       :value.sync="userfile.f_meternumber"
                       @change="meternumberValidate()"
                       :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <label class="col-xs-4 control-label">表&ensp;封&ensp;号：</label>
              <div class="col-xs-8">
                <input class="form-control input_view" style=""
                       placeholder="表封号"
                       v-model="newUserfile.f_metertitles"
                       :value="userfile.f_metertitles"
                       :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <label class="col-xs-4 control-label">表&ensp;读&ensp;数：</label>
              <div class="col-xs-8">
                <input class="form-control input_view" style=""
                       type="number"
                       placeholder="表读数"
                       v-model="newUserfile.f_meter_base"
                       :value="userfile.f_meter_base"
                       :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <label class="col-xs-4 control-label">初始底数：</label>
              <div class="col-xs-8">
                <input class="form-control input_view" style=""
                       type="number"
                       v-model="newUserfile.f_initial_base"
                       :value="userfile.f_initial_base"
                       placeholder="初始底数"
                       :readonly="mark === 1 || userinfo.f_user_state === '正常'"/>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <label class="col-xs-4 control-label">表&emsp;&emsp;向：</label>
              <div class="col-xs-8">
                <input-select
                  class="select select_list"
                  :value.sync="userfile.f_aroundmeter"
                  v-model="newUserfile.f_aroundmeter"
                  :options="aroundmeters"
                  :disable="mark === 1 || userinfo.f_user_state === '正常'"
                  :valueSingle="true"></input-select>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <label class="col-xs-4 control-label">安装位置：</label>
              <div class="col-xs-8">
                <input-select
                  class="select select_list"
                  :value.sync="userfile.f_position"
                  v-model="newUserfile.f_position"
                  :options="positions"
                  :disable="mark === 1 || userinfo.f_user_state === '正常'"
                  :valueSingle="true"></input-select>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <label class="col-xs-4 control-label">安&ensp;装&ensp;人：</label>
              <div class="col-xs-8">
                <input class="form-control input_view" style=""
                       v-model="newUserfile.f_install_person"
                       :value.sync="installperson(userfile.f_install_person)"
                       placeholder="安装人"
                       readonly/>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <label class="col-xs-4 control-label">安装日期：</label>
              <div class="col-xs-8">
                <input class="form-control input_view" style=""
                       v-model="newUserfile.f_install_date"
                       :value.sync="installdate(userfile.f_install_date)"
                       placeholder="安装日期"
                       readonly/>
              </div>
            </div>
            <div class="form-group row vertical-center">
              <button type="button" class="btn btn-primary" @click="showNewUserFile = !showNewUserFile">换表</button>
            </div>
            <div class="form-group col-xs-12 panel panel-info" v-if="showNewUserFile">
              <div class="panel-heading head col-xs-12" style="background-color: #e8f4ff;margin-bottom: 10px">
                <div class="col-xs-6 text-left">新表具信息</div>
                <div class="col-xs-6 text-right">
                  <svg @click="scanCode()" style="width: 25px;height: 25px;margin-right: 10px" t="1636095770822" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2457" width="64" height="64">
                    <path d="M928.016126 543.908618 95.983874 543.908618c-17.717453 0-31.994625-14.277171-31.994625-31.994625S78.26642 479.919368 95.983874 479.919368l832.032253 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S945.73358 543.908618 928.016126 543.908618z" p-id="2458"></path>
                    <path d="M832.032253 928.016126 639.892491 928.016126c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l191.967747 0c17.717453 0 31.994625-14.277171 31.994625-31.994625l0-159.973123c0-17.717453 14.277171-31.994625 31.994625-31.994625s31.994625 14.277171 31.994625 31.994625l0 159.973123C928.016126 884.840585 884.840585 928.016126 832.032253 928.016126z" p-id="2459"></path>
                    <path d="M351.94087 928.016126l-159.973123 0c-52.980346 0-95.983874-43.003528-95.983874-95.983874l0-159.973123c0-17.717453 14.277171-31.994625 31.994625-31.994625S159.973123 654.341676 159.973123 672.05913l0 159.973123c0 17.717453 14.449185 31.994625 31.994625 31.994625l159.973123 0c17.717453 0 31.994625 14.277171 31.994625 31.994625C383.935495 913.738955 369.658324 928.016126 351.94087 928.016126z" p-id="2460"></path>
                    <path d="M127.978498 383.935495c-17.717453 0-31.994625-14.277171-31.994625-31.994625l0-159.973123c0-52.980346 43.003528-95.983874 95.983874-95.983874l159.973123 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S369.658324 159.973123 351.94087 159.973123l-159.973123 0c-17.545439 0-31.994625 14.449185-31.994625 31.994625l0 159.973123C159.973123 369.658324 145.695952 383.935495 127.978498 383.935495z" p-id="2461"></path>
                    <path d="M896.021502 383.935495c-17.717453 0-31.994625-14.277171-31.994625-31.994625l0-159.973123c0-17.545439-14.277171-31.994625-31.994625-31.994625L639.892491 159.973123c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l191.967747 0c52.980346 0 95.983874 43.003528 95.983874 95.983874l0 159.973123C928.016126 369.658324 913.738955 383.935495 896.021502 383.935495z" p-id="2462"></path>
                  </svg>
                </div>
              </div>
              <div class="form-group row vertical-center" :class="[$v.f_gasbrand_id.required ? 'has-error' : '']">
                <label class="col-xs-4 control-label">新气表品牌：</label>
                <div class="col-xs-8">
                  <input type="text" v-show="false" v-model="newUserfile.f_new_gasbrand_id" :value.sync="newUserfile.f_new_gasbrand_id" >
                  <input-select
                    class="select select_list"
                    :value.sync="newUserfile.f_new_gasbrand_id"
                    v-model="newUserfile.f_new_gasbrand_id"
                    :options="meterBrandList"
                    @change="gasbrandChange()"
                    :disable="mark === 1 || gasbrandDisable"
                    :valueSingle="true"></input-select>
                </div>
              </div>
              <div class="form-group row vertical-center" :class="[$v.f_gasmodel_id.required ? 'has-error' : '']">
                <label class="col-xs-4 control-label">新气表型号：</label>
                <div class="col-xs-8">
                  <input type="text" v-show="false" v-model="newUserfile.f_new_gasmodel_id"
                         :value.sync="newUserfile.f_new_gasmodel_id" >
                  <input-select
                    class="select select_list"
                    :value.sync="newUserfile.f_new_gasmodel_id"
                    v-model="newUserfile.f_new_gasmodel_id"
                    :options.sync="newgasModelList"
                    :disable="mark === 1 || gasbrandDisable"
                    :valueSingle="true"></input-select>
                </div>
              </div>
                <div class="form-group row vertical-center" :class="[$v.f_meternumber.required ? 'has-error' : '']">
                  <label class="col-xs-4 control-label">新&ensp;表&ensp;号：</label>
                  <div class="col-xs-8">
                    <input class="form-control input_view" style=""
                           placeholder="表号"
                           v-model="newUserfile.f_new_meternumber"
                           :value.sync="newUserfile.f_new_meternumber"
                           @change="meternumberValidate()"
                           :readonly="mark === 1"/>
                  </div>
                </div>
                <div class="form-group row vertical-center">
                  <label class="col-xs-4 control-label">新表封号：</label>
                  <div class="col-xs-8">
                    <input class="form-control input_view" style=""
                           placeholder="新表封号"
                           v-model="newUserfile.f_new_metertitles"
                           :value="newUserfile.f_new_metertitles"
                           :readonly="mark === 1"/>
                  </div>
                </div>
                <div class="form-group row vertical-center">
                  <label class="col-xs-4 control-label">新表读数：</label>
                  <div class="col-xs-8">
                    <input class="form-control input_view" style=""
                           type="number"
                           placeholder="新表读数"
                           v-model="newUserfile.f_new_meter_base"
                           :value="newUserfile.f_new_meter_base"
                           :readonly="mark === 1"/>
                  </div>
                </div>
                <div class="form-group row vertical-center">
                  <label class="col-xs-4 control-label">新初始底数：</label>
                  <div class="col-xs-8">
                    <input class="form-control input_view" style=""
                           type="number"
                           v-model="newUserfile.f_new_initial_base"
                           :value="newUserfile.f_new_initial_base"
                           placeholder="新初始底数"
                           :readonly="mark === 1"/>
                  </div>
                </div>
                <div class="form-group row vertical-center">
                  <label class="col-xs-4 control-label">新&ensp;表&ensp;向：</label>
                  <div class="col-xs-8">
                    <input-select
                      class="select select_list"
                      :value.sync="newUserfile.f_new_aroundmeter"
                      v-model="newUserfile.f_new_aroundmeter"
                      :options="aroundmeters"
                      :disable="mark === 1"
                      :valueSingle="true"></input-select>
                  </div>
                </div>
                <div class="form-group row vertical-center">
                  <label class="col-xs-4 control-label">新安装位置：</label>
                  <div class="col-xs-8">
                    <input-select
                      class="select select_list"
                      :value.sync="newUserfile.f_new_position"
                      v-model="newUserfile.f_new_position"
                      :options="positions"
                      :disable="mark === 1"
                      :valueSingle="true"></input-select>
                  </div>
                </div>
          </div>
          </div>
        </article>
        <footer slot="modal-footer" class="modal-footer">
          <template v-if="mark !== 1">
            <button type="button" class="btn btn-primary" @click="saveUserFile" :disabled="!$v.valid">确认</button>
          </template>
        </footer>
      </modal>
    </validator>
  </div>

</template>
<script>
import Vue from 'vue'
import {PagedList} from 'vue-client'
import {HttpResetClass} from 'vue-client'
import {isEmpty} from '../../../Util'

export default {
  title: '安装明细',
  props: {
    selectdata: {
      type: Object
    },
    mark: {
      type: Number,
      default: 0
    }
  },
  data () {
    return {
      showModal: false,
      model: {
        rows: null
      },
      areaList: [],
      area: {},
      userinfo: {},
      userfile: {},
      meterBrandList: [],
      gasModelList: [],
      scanCodeConfig: null,
      gasbrandDisable: false,
      showNewUserFile: false,
      newUserfile: {},
      newgasModelList: []
    }
  },
  ready () {
    this.search()
    this.getMeterBrand()

    this.getScanCodeConfig()
  },
  methods: {
    async getScanCodeConfig () {
      let http = new HttpResetClass()
      let res = await http.load(
        'POST',
        `${this.$androidUtil.getProxyUrl()}/rs/logic/getScanCodeConfig`,
        null,
        {resolveMsg: null, rejectMsg: '扫码配置获取失败！！！'}
      )

      this.scanCodeConfig = res.data
    },
    scanCode () {
      console.log('===============扫码===================')
      HostApp.__this__=this,
      HostApp.scanCode({callback:"javascript:HostApp.__this__.getCode();"})

      this.getCode()
    },
    getCode() {
      let code = HostApp.getCode().data;
      // let code = '012199312345'
      console.log('===========扫码结果=============')
      console.log(code)
      if (!/^\d{12}$/.test(this.userfile.f_meternumber)) {
        if(!/^\d{14}$/.test(this.userfile.f_meternumber)){
          this.$showMessage('表号不符合规则')
          return
        }
      }

      // 解析厂家
      let factory = null
      for (const item of this.scanCodeConfig.factory) {
        if (item.key === code.substring(0, 2)) {
          factory = item.val
          break
        }
      }
      if (isEmpty(factory)) {
        this.$showMessage('未知厂家！！！')
        return
      }
      console.log(factory)

      // 解析运营商
      let ips = null
      for (const item of this.scanCodeConfig.ips) {
        if (item.key === code.substring(5, 6)) {
          ips = item.val
          break
        }
      }
      if (isEmpty(ips)) {
        this.$showMessage('未知运营商！！！')
        return
      }
      console.log(ips)

      // 表向
      console.log(code.substring(6, 7) % 2 === 0 ? '偶数' : '奇数')
      console.log(code.substring(6, 7) % 2 === 0 ? '右表' : '左表')
      this.userfile.f_aroundmeter = code.substring(6, 7) % 2 === 0 ? '右表' : '左表'

      // 顺序号
      console.log(code.substring(7, 12))
      if (code.substring(7, 12) < this.scanCodeConfig.number.min || code.substring(7, 12) > this.scanCodeConfig.number.max) {
        this.$showMessage('顺序号超出范围！！！')
        return
      }

      for (const item of this.meterBrandList) {
        if (item.label === factory) {
          // this.userfile.f_gasbrand_id = item.value
          // this.gasbrandChange()
          break
        }
      }

      Vue.set(this.userfile, 'f_meternumber', code)

      this.meternumberValidate()
    },
    // 保存档案
    async saveUserFile() {
      let data = {
        user: Vue.user,
        userinfo: this.userinfo,
        userfile: this.userfile,
        newUserfile: this.newUserfile,
        selectdata: this.selectdata
      }
      let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyAddNweUserfiles`, {data:data}, {
        resolveMsg: null,
        rejectMsg: '用户档案添加失败！！！'
      })
      this.$dispatch('breakControl', this.selectdata)
    },
    ifDisable() {
      if (this.selectdata.f_apply_type === '非民用报建' && this.selectdata.defname === '工程施工') {
        this.gasbrandDisable = true
      }
    },
    // 检查表号是否存在
    async meternumberValidate() {
      if (!this.newUserfile.f_gasbrand_id) {
        this.newUserfile.f_meternumber = ''
        this.$showMessage('请先选择气表品牌！！！')
        return
      }
      if (this.newUserfile.f_new_gasbrand_id && this.newUserfile.f_new_meternumber) {
        let data = {
          f_meternumber: this.newUserfile.f_new_meternumber,
          f_gasbrand_id: this.newUserfile.f_new_gasbrand_id
        }
        if (this.newUserfile.f_user_id) {
          data.f_user_id = this.newUserfile.f_user_id
        }
        let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/meterbrandsNumberValidate`, {data:data}, {
          resolveMsg: null,
          rejectMsg: '表号验证失败！！'
        })
        console.log(`查询结果${res.data}`)
        console.log(res.data)
        if (res.data === '表号已存在' || res.data === '表号无效') {
          this.newUserfile.f_meternumber = ''
          this.$showMessage(res.data)
        }
      }
    },
    // 选择气表品牌
    async gasbrandChange() {
      // 清空已保存的气表型号
      // this.newUserfile.f_new_gasbrand_id = null
      if (isEmpty(this.newUserfile.f_new_gasbrand_id)) {
        return
      }
      let data = {
        f_gasbrand_id: this.newUserfile.f_new_gasbrand_id
      }
      let http = new HttpResetClass()
      let res = await http.load(
        'POST',
        `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
        {data: data},
        {resolveMsg: null, rejectMsg: '气表型号查询失败！！！'}
      )

      this.newgasModelList = res.data

      data = {
        tablename: 't_gasbrand',
        condition: `id = '${this.newUserfile.f_new_gasbrand_id}'`
      }
      res = await http.load(
        'POST',
        `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
        {data: data},
        {resolveMsg: null, rejectMsg: '表具类型查询失败！！！'}
      )
      this.newUserfile.f_new_meter_classify = res.data[0].f_meter_type
    },
    // 打开安装明细
    async openModal (row) {
      this.ifDisable()
      if (row) {
        console.log('------------------修正---------------------')
        this.userinfo = row


        let data = {
          tablename: 't_userfiles',
          condition: `f_userinfo_id = ${row.f_userinfo_id}`
        }
        let http = new HttpResetClass()
        let res = await http.load(
          'POST',
          `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
          {data: data},
          {resolveMsg: null, rejectMsg: '表档案查询失败！！！'}
        )
        this.userfile = res.data[0]

        let newdata = {
          tablename: 't_userfiles_modify',
          condition: `f_userinfo_id = ${row.f_userinfo_id}`
        }
        let newRes = await http.load(
          'POST',
          `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
          {data: newdata},
          {resolveMsg: null, rejectMsg: '表档案查询失败！！！'}
        )
        if (newRes.data.length > 0) {

          this.newUserfile = newRes.data[0]
          if (!isEmpty(this.newUserfile.f_new_gasbrand_id)) {
            let data = {
              f_gasbrand_id: this.newUserfile.f_new_gasbrand_id
            }
            let res = await http.load(
              'POST',
              `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
              {data: data},
              {resolveMsg: null, rejectMsg: '气表型号查询失败！！！'}
            )
            this.newgasModelList = res.data
          }
        }


        if (!isEmpty(this.userfile.f_gasbrand_id)) {
          let data = {
            f_gasbrand_id: this.userfile.f_gasbrand_id
          }
          let http = new HttpResetClass()
          let res = await http.load(
            'POST',
            `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
            {data: data},
            {resolveMsg: null, rejectMsg: '气表型号查询失败！！！'}
          )

          this.gasModelList = res.data
        }
      }
      this.showModal = true
    },
    // 获取气表品牌
    async getMeterBrand () {
      let data = {
      }

      let http = new HttpResetClass()
      let res = await http.load(
        'POST',
        `${this.$androidUtil.getProxyUrl()}/rs/sql/getMeterBrand`,
        {data: data},
        {resolveMsg: null, rejectMsg: '气表品牌查询失败！！！'}
      )

      this.meterBrandList = res.data
      this.meterBrandList.push({label: '无', value: 'null'})
    },
    // 查询
    async search () {
      let http = new HttpResetClass()
      let data = {
        condition: `ui.f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
      }

      let res = await http.load('POST',
      `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
      {data:data}, {
        resolveMsg: null,
        rejectMsg: '获取档案失败！！！'
      })
      this.model.rows = res.data
    },
    // 关闭安装明细
    closeUserFile() {
      this.showModal = false
      this.area = {}
      this.userinfo = {}
      this.userfile = {}
      this.gasModelList = {}
      this.newgasModelList = {}
      this.newUserfile = {}
      this.search()
    }
  },
  events: {
  },
  computed: {
    showAddress () {
      return this.selectdata.f_apply_type === '民用报建'
    },
    showUserInfo () {
      return this.selectdata.f_apply_type === '民用报建' && this.selectdata.f_apply_nature !== '分户挂表'
    },
    showUserFile () {
      return (this.selectdata.f_apply_type === '民用报建' && this.selectdata.f_apply_nature !== '分户挂表' && this.selectdata.defname === '工程施工') ||
        this.selectdata.f_apply_type === '非民用报建' ||
        this.selectdata.f_apply_type === '设备变更' ||
        this.selectdata.f_apply_type === '分户挂表'
    },
    showInstall () {
      return this.showUserFile && (this.selectdata.defname === '工程施工' || this.selectdata.defname === '施工通气' || this.selectdata.defname === '点火通气')
    },
    // 证件类型
    credentialsList() {
      return this.$appdata.getParam('证件类型')
    },
    // 安装人
    installperson() {
      return function (f_install_person) {
        if (isEmpty(f_install_person)) {
          return Vue.user.name
        }
        return f_install_person
      }
    },
    // 安装时间
    installdate() {
      return function (f_install_date) {
        if (isEmpty(f_install_date)) {
          return new Date().Format('yyyy-MM-dd HH:mm:ss')
        }
        return f_install_date
      }
    },
    // 表向
    aroundmeters() {
      return this.$appdata.getParam('左右表')
    },
    // 安装位置
    positions() {
      return this.$appdata.getParam('安装位置')
    }
  },
  watch: {
  }
}
</script>
<style scoped>
  .panel {
    margin-bottom: 8px;
  }
  .panel-self{
    border-radius: 10px;
    border:1px solid #499EDF;
    padding: 8px;
  }
</style>
