<template>
  <form novalidate class="form-horizontal" style="width: 95%;margin: auto">
    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_userinfo_code" class=" font text-left label-font">用户编号：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_userinfo_code" class="search_input input-font"
               v-model=item.f_userinfo_code readonly="readonly"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/用户姓名.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label class="font text-left label-font">用户姓名：</label>
      </div>
      <div class="col-xs-8">
        <input class="search_input input-font"
               v-model=item.f_user_name readonly="readonly"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/详细住址.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label class="font text-left label-font">用户地址：</label>
      </div>
      <div class="col-xs-8">
        <input class="search_input text-input input-font"
               v-model=item.f_address readonly="readonly"/>
      </div>
    </div>
    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/详细住址.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label class="font text-left">是否楼层用户：</label>
      </div>
      <v-select :value.sync="item.f_is_lc" class="input-font" style="margin-left: 5%;"
                :width="'60%'"
                v-model="item.f_is_lc"
                :options='is_no' placeholder='是否楼层用户' close-on-select clear-button value-single
      ></v-select>
    </div>
    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/详细住址.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label class="font text-left">定位位置：</label>
      </div>
      <div class="col-xs-8">
        <input type="text"  class="search_input text-input input-font" style="width: 45%"
               v-model=item.f_host_meter_name readonly/>
        <button type="button"
                name="button" class="btn btn-primary" style="width: 35%" @click="getposition">定位
        </button>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/用户电话.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_housing" class="font text-left label-font">用户电话：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_housing" class="search_input input-font"
               v-model="item.f_user_phone" readonly="readonly"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/表号.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_meter_number" class="font text-left label-font">表号：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_meter_number" class="search_input input-font"
               v-model="item.f_meternumber" readonly="readonly"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/门牌.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_cardmeternumber" class="font text-left label-font">现场表号：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_cardmeternumber" class="search_input input-font"
               v-model="item.f_cardmeternumber" placeholder="请设置用户现场表标记"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/用户类型.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_user_type" class="font text-left label-font">用户类型：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_user_type"  class="search_input input-font"
               v-model="item.f_user_type" readonly="readonly"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/用户类型.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_gasproperties" class="font text-left">用气性质：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_gasproperties"  class="search_input input-font"
               v-model="item.f_gasproperties" readonly="readonly"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/表类型.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_meterclassify" class="font text-left label-font">表类型：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_meterclassify" class="search_input input-font"
               v-model="item.f_meter_classify" readonly="readonly"/>
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/shijian.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_tablebase" class="font text-left label-font">上期时间：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_tablebase" class="search_input input-font"
               v-model="item.f_check_meter_data[0].f_hand_date" readonly="readonly"/>
      </div>
    </div>

<!--    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/数据.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_hand_date" class="font text-left label-font">上期底数：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_hand_date" class="search_input input-font" type="text"
               v-model="item.f_check_meter_data[0].f_tablebase" readonly="readonly"/>
      </div>
    </div>-->

    <!--工商业新加上期字段 -->
    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/累计.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_flow_standard_total" class="font text-left label-font">上期标况累计：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_flow_standard_total" class="search_input input-font" type="text"   readonly="readonly" @input="gasConsumptionCompute"
               v-model="item.f_check_meter_data[0].f_flow_standard_total" />
      </div>
    </div>

    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/累计.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_last_surplus_gas" class="font text-left label-font">上期表剩余：</label>
      </div>
      <div class="col-xs-8">
        <input id="f_last_surplus_gas" class="search_input input-font" type="text"   readonly="readonly" @input="deductionCompute"
               v-model="item.f_check_meter_data[0].f_surplus_gas" />
      </div>
    </div>


<!-- 换流量计   -->
    <div class="row app-row">
      <div class="col-xs-4">
        <img src="../../assets/guandao1.png" style="width: 20px;margin-bottom: 5px" alt="">
        <label for="f_newhand_date" class="font text-left label-font" >换流量计：</label>
      </div>
      <div class="col-xs-8">
        正常使用
        <input  class="search_input input-font" type="radio"  v-model="meterDate.f_is_change_flowmeter" value="期间未换流量计"
        />
        <span style="margin-right: 10px"></span>
        换流量计
        <input  class="search_input input-font" type="radio" v-model="meterDate.f_is_change_flowmeter" value="期间有换流量计"
        />
      </div>
    </div>
<!--工商业新流量计抄表信息-->
    <div class="row bg-info" v-show="meterDate.f_is_change_flowmeter === '期间有换流量计'">
      <label class="font text-left label-font">新流量计信息</label>
      <div class="row ">
        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/压力.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_flow_pressure" class="font text-left label-font">压力：</label>
          </div>
          <div class="col-xs-8">
            <input id="f1_flow_pressure" class="search_input input-font" type="text"  placeholder="流量计压力"
                   v-model="meterDate.newPeriodFlowPressure" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/温度.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_flow_temperature" class="font text-left label-font">温度：</label>
          </div>
          <div class="col-xs-8">
            <input id="f1_flow_temperature" class="search_input input-font" type="text" placeholder="流量计温度"
                   v-model="meterDate.newPeriodFlowTemperature" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_flow_standard_instant" class="font text-left label-font">标况瞬时：</label>
          </div>
          <div class="col-xs-8">
            <input id="f1_flow_standard_instant" class="search_input input-font" type="text"   placeholder="流量计标况瞬时"
                   v-model="meterDate.newPeriodFlowStandardInstant" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_flow_standard_total1" class="font text-left label-font">标况累计：</label>
          </div>
          <div class="col-xs-8">
            <input id="f1_flow_standard_total1" class="search_input input-font" type="text"   placeholder="流量计标况累计"
                   v-model="meterDate.newPeriodFlowStandardTotal" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_flow_standard_instant" class="font text-left label-font">工况瞬时：</label>
          </div>
          <div class="col-xs-8">
            <input id="f1_flow_working_instant" class="search_input input-font" type="text"  placeholder="流量计工况瞬时"
                   v-model="meterDate.newPeriodFlowWorkingInstant" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_flow_standard_total1" class="font text-left label-font">工况累计：</label>
          </div>
          <div class="col-xs-8">
            <input id="f1_flow_working_total" class="search_input input-font" type="text"   placeholder="流量计工况累计"
                   v-model="meterDate.newPeriodFlowWorkingTotal" />
          </div>
        </div>

<!--        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/数据.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_newhand_date" class="font text-left label-font">流量计底数：</label>
          </div>
          <div class="col-xs-8"> &lt;!&ndash;标况累计与表底数是一个值&ndash;&gt;
            <input id="f1_newhand_date" class="search_input input-font" type="number" placeholder="请输入新流量计底数"
                   v-model="meterDate.newPeriodFlowStandardTotal"
            />
          </div>
        </div>-->

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/数据.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f1_surplus_gas" class="font text-left label-font" v-if="item.f_meter_classify != '物联网表'">表剩余气量：</label>
            <label for="f1_surplus_gas1" class="font text-left label-font" v-if="item.f_meter_classify == '物联网表'">表剩余金额：</label>
          </div>
          <div class="col-xs-8"> <!--工商业的剩余气量-->
            <input id="f1_surplus_gas" class="search_input input-font" type="number" placeholder="表剩余气量" v-if="item.f_meter_classify != '物联网表'"
                   v-model="meterDate.newSurPlusGasOver" />
            <input id="f1_surplus_gas1" class="search_input input-font" type="number" placeholder="表剩余金额" v-if="item.f_meter_classify == '物联网表'"
                   v-model="meterDate.newSurPlusGasOver" />
          </div>
        </div>

        <div class="col-md-12 col-sm-12 col-xs-12">
          <label class="text-left font label-font">换流量计后整体照片(要求能清晰反应用户表底数信息)：</label>
          <div class="auto">
            <div class="panel" style="padding: 10px 10px 5px 10px;">
              <div class="panel-body panel-self"
                   style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
                <div class="row" style="height: 240px;overflow: scroll;top: 1px">
                  <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 35px" v-for="(index,img) in meterDate.f_newmeter_paths">
                    <img-self :src="img.f_meter_path" alt="换流量计后照片" :width="150" :height="200"></img-self>
                    <img src="../../assets/删除.png" @click="delfile('f_newmeter_paths', img.f_meter_path,index)" style="width: 15px;margin-top: -80px" alt="">
                  </div>
                </div>
                <div class="row text-right div-photo">
                  <button type="button" name="button" class="btn btn-primary btn-photo"
                          @click="takePic('f_newmeter_paths', '工商业用户抄表照片')">拍照
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
<!-- 工商业流量计信息 -->
    <div class="row bg-info">
      <label class="font text-left label-font">{{meterDate.f_is_change_flowmeter === '期间有换流量计'?'旧流量计信息':'流量计信息'}}</label>
      <div class="row">
        <!-- 工商本期新加字段    -->
        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/压力.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_flow_pressure" class="font text-left label-font">压力：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_flow_pressure" class="search_input input-font" type="text"  placeholder="流量计压力"
                   v-model="thisPeriodFlowPressure" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/温度.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_flow_pressure" class="font text-left label-font">温度：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_flow_temperature" class="search_input input-font" type="text" placeholder="流量计温度"
                   v-model="thisPeriodFlowTemperature" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_flow_standard_instant" class="font text-left label-font">标况瞬时：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_flow_standard_instant" class="search_input input-font" type="number"   placeholder="流量计标况瞬时"
                   v-model="thisPeriodFlowStandardInstant" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_flow_standard_total1" class="font text-left label-font">标况累计：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_flow_standard_total1" class="search_input input-font" type="number"   placeholder="流量计标况累计" @input="gasConsumptionCompute"
                   v-model="thisPeriodFlowStandardTotal" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_flow_standard_instant" class="font text-left label-font">工况瞬时：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_flow_working_instant" class="search_input input-font" type="number"  placeholder="流量计工况瞬时"
                   v-model="thisPeriodFlowWorkingInstant" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/瞬时.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_flow_standard_total1" class="font text-left label-font">工况累计：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_flow_working_total" class="search_input input-font" type="number"   placeholder="流量计工况累计"
                   v-model="thisPeriodFlowWorkingTotal" />
          </div>
        </div>

<!--        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/数据.png" style="width: 20px;margin-bottom: 5px" alt=""> &lt;!&ndash;流量计底数和标况累计是一个值&ndash;&gt;
            <label for="f_newhand_date" class="font text-left label-font">流量计底数：</label>
          </div>
          <div class="col-xs-8"> &lt;!&ndash;工商业的本期底数&ndash;&gt;
            <input id="f_newhand_date" class="search_input input-font" type="number" placeholder="流量计底数"
                   v-model="thisPeriodFlowStandardTotal"
            />
          </div>
        </div>-->

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/数据.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_surplus_gas" class="font text-left label-font" v-if="item.f_meter_classify != '物联网表'">表剩余气量：</label>
            <label for="f_surplus_gas1" class="font text-left label-font" v-if="item.f_meter_classify == '物联网表'">表剩余金额：</label>
          </div>
          <div class="col-xs-8"> <!--工商业的剩余气量和金额-->
            <input id="f_surplus_gas" class="search_input input-font" type="number" placeholder="表剩余气量" v-if="item.f_meter_classify != '物联网表'"
                   v-model="SurPlusGasOver" @input="deductionCompute"
            />
            <input id="f_surplus_gas1" class="search_input input-font" type="number" placeholder="表剩余金额" v-if="item.f_meter_classify == '物联网表'"
                   v-model="SurPlusGasOver" @input="deductionCompute"
            />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/housestyle.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_total_gas_total_fee" class="font text-left" v-if="item.f_meter_classify != '物联网表'">累购气量：</label>
            <label for="f_total_gas_total_fee1" class="font text-left" v-if="item.f_meter_classify == '物联网表'">累购金额：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_total_gas_total_fee"  type="number" class="search_input input-font" placeholder="累购气量" v-if="item.f_meter_classify != '物联网表'"
                   v-model="item.f_total_gas_total_fee" readonly="readonly"/>
            <input id="f_total_gas_total_fee1"  type="number" class="search_input input-font" placeholder="累购金额" v-if="item.f_meter_classify == '物联网表'"
                   v-model="item.f_total_gas_total_fee" readonly="readonly"/>
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <!--  计算得出的期间用气量      -->
            <img src="../../assets/数据.png" style="width: 20px;margin-bottom: 5px" alt=""> <!--流量计-->
            <label for="thisPeriodFlowDeduction" class="font text-left label-font"  v-if="item.f_meter_classify != '物联网表'">期间用气金额：</label>
            <label for="thisPeriodFlowDeduction" class="font text-left label-font"  v-if="item.f_meter_classify == '物联网表'">期间用气量：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_flow_gas_consumption" class="search_input input-font" type="number"  readonly="readonly"
                   v-model="thisPeriodFlowGasConsumption" />
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <!--  表期间扣减量      -->
            <img src="../../assets/数据.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_flow_gas_consumption" class="font text-left label-font">表期间扣减量：</label>
          </div>
          <div class="col-xs-8">
            <input id="thisPeriodFlowDeduction" class="search_input input-font" type="number" readonly="readonly"
                   v-model="thisPeriodFlowDeduction" />
          </div>
        </div>

        <div class="row app-row" v-if="item.f_meter_classify != '物联网表'">
          <div class="col-xs-4">
            <img src="../../assets/差值.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_difference" class="font text-left label-font" :style="{color: errorTotalGasDifferenceClass}">差值：</label>
          </div>
          <div class="col-xs-8">
            <input id="f_difference" class="search_input input-font" readonly="readonly" v-model="totalGasDifference"/>
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/上传状态.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_difference" class="font text-left">抄表类型：</label>
          </div>
          <div class="col-xs-8">
            <v-select  :close-on-select="true" search="false" :value-single="true"
                       :value.sync="meterDate.f_meter_read_type" class="input-font"
                       :options='f_meter_read_types' placeholder='抄表类型'
                       close-on-select clear-button
                       v-model="meterDate.f_meter_read_type"></v-select>
          </div>
        </div>

        <div class="row app-row">
          <div class="col-xs-4">
            <img src="../../assets/baoxiuxinxi1.png" style="width: 20px;margin-bottom: 5px" alt="">
            <label for="f_difference" class="font text-left" >情况备注：</label>
          </div>
          <div class="col-xs-8">
            <textarea v-model="meterDate.f_remake" rows="2" class="input_textarea" placeholder="请输入差值原因或用户特殊情况"></textarea>
          </div>
        </div>

      </div>
    </div>


<!--    <div class="form-group col-sm-12" :class="style__">
      <label class="text-left font label-font">用户签名</label>
      <div class="auto">
        <div class="panel">
          <div class="panel-body panel-self"
               style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
            <div class="row" style="height: 240px;overflow: scroll;top: 1px">
              <div class="col-sm-4">
                <img :class="style__" :src="meterDate.f_sign_path" :width="200" :height="150" alt="签名"/>
              </div>
            </div>
            <div class="row text-right div-photo">
              <button type="button" name="button" class="btn btn-primary btn-photo" @click="sign">签名</button>
            </div>
          </div>
        </div>
      </div>
    </div>-->

    <div class="form-group col-md-12 col-sm-12 col-xs-12">
      <label class="text-left font label-font">抄表整体照片(要求能清晰反应用户表底数信息)：</label>
      <div class="auto">
        <div class="panel" style="padding: 10px 10px 5px 10px;">
          <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
            <div class="row" style="height: 240px;overflow: scroll;top: 1px">
              <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 35px" v-for="(index,img) in meterDate.f_meter_paths">
                <img-self :src="img.f_meter_path" alt="用户表底数照片" :width="150" :height="200"></img-self>
                <img src="../../assets/删除.png" @click="delfile('f_meter_paths', img.f_meter_path,index)" style="width: 15px;margin-top: -80px" alt="">
              </div>
            </div>
            <div class="row text-right div-photo">
              <button type="button" name="button" class="btn btn-primary btn-photo"
                      @click="takePic('f_meter_paths', '工商业用户抄表照片')">拍照
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="row text-center" style="margin-top: 20px;">
      <button type="button" class="btn btn-lg btn-font btn-color" style="width: 25%;" @click="saveCheckMeterReding">
        提交
      </button>
    </div>
    <div style="height:30px;"></div>
  </form>
</template>

<script>
import Vue from 'vue'
import * as Util from '../Util'
import {HttpResetClass} from 'vue-client'
export default {
  title: '工商移动抄表',
  data () {
    return {
      is_no: [{label: '是',value: '是'},{label: '否',value: '否'}],
      totalGasDifference: 0, // 差值
      bottomOfTheCurrentPeriod: '', //当前底数
      SurPlusGasOver: '', //剩余气量
      errorTotalGasDifferenceClass: '#666666',
      f_meter_read_types: [{label: '日常抄表',value: '日常抄表'},{label: '月度抄表',value: '月度抄表'}],
      meterDate: {
        f_inputtor_id: Vue.user.id,//抄表员ID
        f_total_gas_total_fee: '',// 累购气量 、 累购金额
        f_sign_path: '', //签名照片
        f_meter_paths: [],//总体照片
        f_newmeter_paths: [], //换流量计后总体照片
        f_is_change_flowmeter: '期间未换流量计',
        // 新表信息
        newPeriodFlowPressure: '',//新流量计压力
        newPeriodFlowTemperature: '',//新流量计温度
        newPeriodFlowStandardInstant: '',//新流量计标况瞬时
        newPeriodFlowStandardTotal: '',//新流量计标况累计
        newPeriodFlowWorkingInstant: '',//新流量计工况瞬时
        newPeriodFlowWorkingTotal: '',//新流量计工况累计
        newBottomOfTheCurrentPeriod: '',//新流量计底数
        newTotalApplyGas: '',//换新后流量计累计用气量 每次提交把流量计本次用气量和上次用气量加起来
        newSurPlusGasOver: '',//新剩余数
        t_userfiles: {}, //表信息
        f_meter_read_type: '月度抄表',
        f_total_apply_gas: '', //流量计累计用气量
        f_remake: ''
      },
      isErrorDifference: '正常',
      thisPeriodFlowPressure:'', //本期流量计压力
      thisPeriodFlowTemperature:'', //本期流量计温度
      thisPeriodFlowStandardInstant:'', //本期流量计标况瞬时
      thisPeriodFlowStandardTotal:'', //本期流量计标况累计
      thisPeriodFlowWorkingInstant:'', //本期流量计工况瞬时
      thisPeriodFlowWorkingTotal:'', //本期流量计工况累计
      thisPeriodFlowGasConsumption:'',  //本期工商的  期间用气量（流量计）=    本次标况累积 - 上次的标况累积
      thisPeriodFlowDeduction:'',//本期工商的 扣减量 = (上次剩余+ 期间购气量) - 本次剩余
      thisTotalApplyGas:'', // 本期流量计累计用气量 每次提交把流量计本次用气量和上次用气量加起来
    }
  },
  props: ['item', 'role'],
  components: {},
  methods: {
    getposition(){
      const longitude = HostApp.getPreference('longitude')
      const latitude = HostApp.getPreference('latitude')
      this.item.f_host_meter_name = [longitude.data, latitude.data]
    },
    // 期间用气量（流量计）=    本次标况累积 - 上次的标况累积
    gasConsumptionCompute() {
      this.thisPeriodFlowGasConsumption = ( (this.thisPeriodFlowStandardTotal || 0) - (this.item.f_check_meter_data[0].f_flow_standard_total || 0)).toFixed(3)
    },
    //  表期间扣减量 = 上次剩余气量（金额） + 期间购气量（金额） - 本次表剩余（金额）
    deductionCompute() {
      this.thisPeriodFlowDeduction =
        (
          parseFloat(this.item.f_check_meter_data[0].f_surplus_gas || 0)
          + parseFloat(this.item.f_check_meter_data[0].sumpregas || 0)
          - parseFloat(this.SurPlusGasOver || 0)
        ).toFixed(3)
      // try {
      //   if ( this.item.f_check_meter_data.length>0 && this.item.f_check_meter_data[0].f_surplus_gas && this.SurPlusGasOver ) {
      //     console.log("扣减量计算" + this.item.f_check_meter_data[0].f_surplus_gas + "," + this.item.f_check_meter_data[0].sumpregas + "," + this.SurPlusGasOver)
      //     this.thisPeriodFlowDeduction =
      //       (
      //         parseFloat(this.item.f_check_meter_data[0].f_surplus_gas || 0)
      //         + parseFloat(this.item.f_check_meter_data[0].sumpregas || 0)
      //         - parseFloat(this.SurPlusGasOver || 0)
      //       ).toFixed(3)
      //     console.log(`表期间扣减量 为  ${(  parseFloat(this.item.f_check_meter_data[0].f_surplus_gas)  + parseFloat(this.item.f_check_meter_data[0].sumpregas) - parseFloat(this.SurPlusGasOver)).toFixed(3)}`)
      //
      //   }else {
      //     console.log("提示！计算扣减量时 上期底数为空或剩余气量为空")
      //   }
      // }catch (e) {
      //   console.log("提示！计算扣减量时 上期底数为空")
      // }
    },
    // 异常差值计算和异常标注
    countTotalGasDifference () {
      /*差值= 用气量 - 扣减量*/
      this.totalGasDifference = parseFloat(this.thisPeriodFlowGasConsumption + "" || 0) - parseFloat(this.thisPeriodFlowDeduction  + "" || 0)
      /*从参数管理中获取： 安检抄表最大异常差值 */
      if (Math.abs(this.totalGasDifference) > this.$appdata.getSingleValue('非民用异常差值允许误差')) {
        this.isErrorDifference = '异常'
        this.errorTotalGasDifferenceClass = 'red'
      } else {
        this.isErrorDifference = '正常'
        this.errorTotalGasDifferenceClass = '#666666'
      }
      // // 当当前底数和剩余量都填入正确的值后
      // if (this.thisPeriodFlowGasConsumption && this.thisPeriodFlowDeduction) {
      //   /*差值= 用气量 - 扣减量*/
      //   this.totalGasDifference = parseFloat(this.thisPeriodFlowGasConsumption + "") - parseFloat(this.thisPeriodFlowDeduction  + "")
      //   /*从参数管理中获取： 安检抄表最大异常差值 */
      //   if (Math.abs(this.totalGasDifference) > this.$appdata.getSingleValue('非民用异常差值允许误差')) {
      //     this.isErrorDifference = '异常'
      //     this.errorTotalGasDifferenceClass = 'red'
      //   } else {
      //     this.isErrorDifference = '正常'
      //     this.errorTotalGasDifferenceClass = '#666666'
      //   }
      // } else {
      //   console.log('值错误，用气量和扣减量未赋值 ')
      //   this.errorTotalGasDifferenceClass = '#666666'
      //   this.isErrorDifference = '正常'
      // }
    },
    // 组织数据
    dataFormatInit() {
      this.meterDate.t_userfiles.f_cardmeternumber = this.item.f_cardmeternumber //用户表标记字段
      this.meterDate.t_userfiles.f_userfiles_id = this.item.f_userfiles_id //userfiles的主键id

      this.meterDate.f_difference_value = this.totalGasDifference // 差值
      this.meterDate.f_difference_state = this.isErrorDifference //差值状态。正常或异常
      this.meterDate.f_total_gas_total_fee = this.item.f_total_gas_total_fee //累购气量或累购金额
      // 表类型
      this.meterDate.f_meter_classify = this.item.f_meter_classify
      // 本次抄表底数
      this.meterDate.f_tablebase = this.bottomOfTheCurrentPeriod
      // 上次抄表底数
      this.meterDate.f_last_tablebase = this.item.f_check_meter_data.length>0 ? this.item.f_check_meter_data[0].f_tablebase : '0'
      // 上次抄表剩余量
      this.meterDate.f_last_surplus_gas = this.item.f_check_meter_data.length>0 ? this.item.f_check_meter_data[0].f_surplus_gas : '0'
      // 上次标况累计
      this.meterDate.f_last_flow_standard_total = this.item.f_check_meter_data.length>0 ? this.item.f_check_meter_data[0].f_flow_standard_total : '0'
      // 上次抄表时间 item.f_check_meter_data[0].f_hand_date
      this.meterDate.f_last_hand_date = this.item.f_check_meter_data.length>0 ? this.item.f_check_meter_data[0].f_hand_date : ''
      // 本期剩余气量  工商的剩余量就是抄表底数
      this.meterDate.f_surplus_gas = this.SurPlusGasOver
      // 抄表员
      this.meterDate.f_inputtor = Vue.user.name
      // 操作人
      this.meterDate.f_operator = Vue.user.name
      // 公司机构ids
      this.meterDate.f_filialeids = this.item.f_filialeid
      // 分公司
      this.meterDate.f_filiale = this.item.f_orgname
      //用户表编号
      this.meterDate.f_userfiles_id = this.item.f_userfiles_id
      // 用户姓名
      this.meterDate.f_user_name = this.item.f_user_name
      this.meterDate.f_userinfo_code = this.item.f_userinfo_code
      this.meterDate.f_user_phone = this.item.f_user_phone
      this.meterDate.f_user_type = this.item.f_user_type
      this.meterDate.f_gasproperties = this.item.f_gasproperties
      this.meterDate.f_userinfo_id = this.item.f_userinfo_id
      this.meterDate.f_address = this.item.f_address
      this.meterDate.f_residential_area = this.item.f_residential_area
      this.meterDate.f_building = this.item.f_building
      this.meterDate.f_unit = this.item.f_unit
      this.meterDate.f_room = this.item.f_room
      this.meterDate.f_meternumber = this.item.f_meternumber
      this.meterDate.f_meter_brand = this.item.f_meter_brand // 气表品牌
      this.meterDate.f_meter_style = this.item.f_meter_style //气表型号
      // 取上次抄表时间和现在时间算  距离最后一次抄表时间的天数
      if (this.item.f_check_meter_data.length>0 &&  this.item.f_check_meter_data[0].f_hand_date) {
        // 距离最后一次抄表时间的天数
        this.meterDate.f_lastdate_to_days = Math.round((Date.parse(new Date()) - Date.parse(this.item.f_check_meter_data[0].f_hand_date))/1000/60/60/24)
        // 距离上次抄表的日均用气量 = （ 本次抄表底数 - 上次超表底数 ）/ 期间天数
        if ((parseFloat(this.bottomOfTheCurrentPeriod + "") - parseFloat(this.item.f_check_meter_data[0].f_tablebase + "")) / ( Math.round((Date.parse(new Date()) - Date.parse(this.item.f_check_meter_data[0].f_hand_date))/1000/60/60/24)) === Infinity) {
          this.meterDate.f_lastdate_average_gas_consumption_day = 0
        }else {
          this.meterDate.f_lastdate_average_gas_consumption_day = (parseFloat(this.bottomOfTheCurrentPeriod + "") - parseFloat(this.item.f_check_meter_data[0].f_tablebase + "")) / ( Math.round((Date.parse(new Date()) - Date.parse(this.item.f_check_meter_data[0].f_hand_date))/1000/60/60/24))
        }
      }else {
        this.meterDate.f_lastdate_to_days = 0 //距离上次抄表时间过去多少天
        this.meterDate.f_lastdate_average_gas_consumption_day = 0 //距离上次抄表日均用气量
      }
      // 如果未换流量计 累计标况累计用气量 = 本期 - 上期
      // 换流量计旧数据 按未换流量计计算
      // 换流量计新数据 旧流量计的累计标况累计用气量 + 本期底数
      if (this.meterDate.f_is_change_flowmeter === '期间未换流量计') {
        if (this.item.f_check_meter_data.length > 0) {
          this.thisTotalApplyGas = parseFloat(Util.isnull(this.thisPeriodFlowStandardTotal,0.0)+"") - parseFloat(Util.isnull( this.item.f_check_meter_data[0].f_flow_standard_total,0.0)+"")
        }else {
          this.thisTotalApplyGas = parseFloat(Util.isnull(this.thisPeriodFlowStandardTotal,0)+"") - 0
        }
      } else {
        if (this.item.f_check_meter_data.length > 0) {
          this.thisTotalApplyGas = parseFloat(Util.isnull(this.thisPeriodFlowStandardTotal,0.0)  + "") - parseFloat(Util.isnull(this.item.f_check_meter_data[0].f_flow_standard_total,0.0)  + "")
          this.meterDate.newTotalApplyGas = parseFloat(this.thisTotalApplyGas  + "") + parseFloat(this.meterDate.newPeriodFlowStandardTotal  + "")
        }else {
          this.thisTotalApplyGas = parseFloat(Util.isnull(this.thisPeriodFlowStandardTotal,0) + "") - 0
          this.meterDate.newTotalApplyGas = parseFloat(this.thisTotalApplyGas  + "" ) + parseFloat(this.meterDate.newPeriodFlowStandardTotal  + "")
        }
      }
      // 表底图形识别
      // this.meterDate.f_notified_path=
      // 是否存在差值异常
      this.meterDate.f_difference_odd = this.isErrorDifference
      // 流量计压力
      this.meterDate.f_flow_pressure = this.thisPeriodFlowPressure
      //流量计温度
      this.meterDate.f_flow_temperature = this.thisPeriodFlowTemperature
      //流量计标况瞬时
      this.meterDate.f_flow_standard_instant = this.thisPeriodFlowStandardInstant
      //流量计标况累计
      this.meterDate.f_flow_standard_total = this.thisPeriodFlowStandardTotal
      //流量计工况瞬时
      this.meterDate.f_flow_working_instant = this.thisPeriodFlowWorkingInstant
      //流量计工况累计
      this.meterDate.f_flow_working_total = this.thisPeriodFlowWorkingTotal
      //已用气量 用气量
      this.meterDate.f_flow_gas_consumption = this.thisPeriodFlowGasConsumption
      //已用气量 扣减量
      this.meterDate.f_flow_deduction = this.thisPeriodFlowDeduction
      // 本次流量计累计标况累计用气量 （未换流量计，和换流量计前记录中的累计标况累计用气量）
      this.meterDate.f_total_apply_gas = this.thisTotalApplyGas
      // 当前抄表时间
      this.meterDate.f_hand_date = Util.toStandardTimeString()
      // 换新表后自动生成的抄表时间，必须保证比旧表的抄表时间大
      let curTime = new Date();
      let todate = new Date(curTime.setSeconds(curTime.getSeconds() + 100));
      this.meterDate.f_hand_date_two = Util.dateFormatToFmt("YYYY-mm-dd HH:MM:SS",todate)

      // 根据本次抄表的最新表号和上次抄表的表号进行判断  判断是否换过表
      if (this.item.f_check_meter_data.length > 0 && this.item.f_check_meter_data[0].f_meternumber && this.item.f_meternumber) {
        if (this.item.f_check_meter_data[0].f_meternumber !== this.item.f_meternumber) {
          this.meterDate.f_is_change_table = "期间有换表"
        }else {
          this.meterDate.f_is_change_table = "期间未换表"
        }
      }else {
        this.meterDate.f_is_change_table = "期间未换表"
      }
    },
    // 保存操作
    saveCheckMeterReding () {
      if (!this.meterDate.f_meter_read_type) {
        return this.$showMessage('请选择抄表类型')
      }
      if (this.item.f_is_lc == '否' && !this.item.f_host_meter_name){
        this.$showMessage('不为楼层用户时，需在表具信息中重新定位')
        return
      }
      if ((this.meterDate.f_is_change_flowmeter !== '期间未换流量计') && (this.meterDate.f_newmeter_paths === '' || this.meterDate.f_newmeter_paths.length === 0 || this.meterDate.f_newmeter_paths[0].f_meter_path===Vue.nopic) ) {
        return this.$showMessage('请拍摄新换的流量计的整体照片')
      }
      if ((this.meterDate.f_is_change_flowmeter !== '期间未换流量计') && this.meterDate.newBottomOfTheCurrentPeriod === '') {
        return this.$showMessage('请填写换流量计后的表底数等信息')
      }
      if (this.bottomOfTheCurrentPeriod === '') {
        return this.$showMessage('请填写当前表底数')
      }
      if (this.meterDate.f_meter_paths.length === 0 || this.meterDate.f_meter_paths[0].f_meter_path===Vue.nopic ) {
        return this.$showMessage('请拍摄用户表底数照')
      }
      let pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>《》/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？ ]");
      if (this.item.f_cardmeternumber==="" || pattern.test(this.item.f_cardmeternumber)){
        return this.$showMessage('请检查用户现场表号！必填且不可包含特殊字符！')
      }
      if (this.meterDate.f_inputtor_id != Vue.user.id) {
        this.meterDate.f_inputtor_id = Vue.user.id
      }
      this.meterDate.f_is_lc = this.item.f_is_lc
      this.meterDate.t_userfiles.f_host_meter_name = this.item.f_host_meter_name //定位地址
      this.dataFormatInit() //数据组装
      // 保存抄表信息 ${this.$androidUtil.getProxyUrl()}
      let paramStr = JSON.stringify(this.meterDate)
      // 多长截断一次
      let subLength = 800
      for (let i = 0; i < paramStr.length; i += subLength) {
        HostApp.param_cache(paramStr.substr(i, subLength))
      }
      HostApp.__this__ = this
      HostApp.syncLogic({
        // logic别名，key必须为logic
        'logic': 'uploadCheckHandplan',
        // 回调执行方法名，key必须为callback
        'callback': 'javascript:HostApp.__this__.uploadCallBack()',
        // 固定key，代表是否将logic执行结果作为参数传入回调方法，1代表true，0代表false，
        // 执行回调方法传入key为backresult
        // 如需额外拼接参数，写在logic返回值的params，例如xxlogic返回:{"params": "success"}
        'backresult': 1
      })
    },
    // 上传回调
    uploadCallBack(response) {
      console.log("上传回调返回" + JSON.stringify(response))
      let obj = JSON.parse(response.result)
      if (obj.code == 200) {
        console.log('成功')
        this.$showMessage('抄表信息上传成功！')
        // this.clearAll()
        this.$dispatch('confirm');
      } else {
         if (obj.msg) {
           return this.$showMessage(`${obj.msg}`)
         } else {
           return this.$showMessage('抄表信息上传失败，服务器内部错误！')
         }
      }
    },
    // 签名回调
    signCallback (prop, fileName1) {
      // HostApp.alert('绑定属性:' + prop + ' 文件全路径如file:///storage/sdcard0/safecheck/abc.jpg：' + fullFileName)
      HostApp.__this__.$set('meterDate.f_sign_path', fileName1)
      HostApp.__this__.$set('meterDate.signfileName', fileName1.substring(fileName1.lastIndexOf('/') + 1, fileName1.length))
      HostApp.__callback__ = null
      HostApp.__this__ = null
    },
    // 用户签名
    sign () {
      this.delfile('f_sign_path', this.meterDate.f_sign_path,0)
      let prop = 'f_sign_path'
      let idx = 'aofeng'
      let fileName1
      if (!this.meterDate.f_sign_path) {
        fileName1 = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
      } else {
        fileName1 = Util.getFileName(this.meterDate.f_sign_path)
      }
      HostApp.__callback__ = this.signCallback
      HostApp.__this__ = this
      HostApp.getSignature({
        file: fileName1,
        requestCode: 111,
        callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");'
      })
    },
    // 拍照回调
    cameraCallBack (prop, fileName) {
      console.log("拍照回调文件名和prop" + prop + '')
      if(prop == 'f_meter_paths'){ //总体图片为多图
        HostApp.__this__.meterDate.f_meter_paths.push({
          f_meter_path:fileName
        })
      }else if (prop== 'f_newmeter_paths') {
        HostApp.__this__.meterDate.f_newmeter_paths.push({
          f_meter_path:fileName
        })
      }else{
        HostApp.__this__.meterDate[prop] = fileName
      }
      HostApp.__callback__ = null
      HostApp.__this__ = null
      // HostApp.__this__.$set('meterDate.f_meter_path', fileName)
      // HostApp.__this__.$set('meterDate.imgsfilename', fileName.substring(fileName.lastIndexOf('/') + 1, fileName.length))
    },
    // 拍照
    takePic (prop, title, index) {
      HostApp.__callback__ = this.cameraCallBack
      HostApp.__this__ = this
      let fileName
      if (prop === 'f_meter_paths') {
        if (!this.meterDate.f_meter_paths[index] || this.meterDate.f_meter_paths[index].f_meter_path.includes('nopic.png')) {
          fileName = Util.guid() + '-' + prop + '.jpg'
          console.log("生成的文件名" + fileName)
        } else {
          fileName = Util.getFileName(this.meterDate.f_meter_paths[index].f_meter_path)
          console.log("原本的文件名" + fileName)
        }
      }else if (prop === 'f_newmeter_paths') {
        if (!this.meterDate.f_newmeter_paths[index] || this.meterDate.f_newmeter_paths[index].f_meter_path.includes('nopic.png')) {
          fileName = Util.guid() + '-' + prop + '.jpg'
        } else {
          fileName = Util.getFileName(this.meterDate.f_newmeter_paths[index].f_meter_path)
        }
      } else {
        if (!this.meterDate[prop] || this.meterDate[prop].includes("nopic.png")) {
          fileName = Util.guid() + '-' + prop + '.jpg'
        } else {
          fileName = Util.getFileName(this.meterDate[prop])
        }
      }
      HostApp._open_a_page({
        type: 'boomerang',
        page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
        param: {
          file: fileName,
          requestCode: 111,
          callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");',
          watermark: title + '\t时间：' + Util.toStandardTimeString() + '\t' + Vue.user.name + '\t' + this.item.f_address
        }
      })
    },
    // 删除照片
    delfile (prop, fileName,index) {
      if (fileName == Vue.nopic) {
        return
      } else {
        if(prop === 'f_meter_paths'){
          this.meterDate.f_meter_paths.splice(index,1)
          HostApp.delfile(fileName)
        }else if (prop === 'f_newmeter_paths') {
          this.meterDate.f_newmeter_paths.splice(index,1)
          HostApp.delfile(fileName)
        }else{
          HostApp.delfile(fileName)
          this.meterDate[prop] =  ''
        }
      }
    },
    // 初始化数据
    clearAll () {
      console.log('清除页面中累购差值与当前底数，剩余量')
      this.thisPeriodFlowPressure='' //本期流量计压力
      this.thisPeriodFlowTemperature='' //本期流量计温度
      this.thisPeriodFlowStandardInstant='' //本期流量计标况瞬时
      this.thisPeriodFlowStandardTotal='' //本期流量计标况累计
      this.thisPeriodFlowWorkingInstant='' //本期流量计工况瞬时
      this.thisPeriodFlowWorkingTotal='' //本期流量计工况累计
      this.thisPeriodFlowGasConsumption='' //本期工商的  期间用气量（流量计）=    本次标况累积 - 上次的标况累积
      this.thisPeriodFlowDeduction='' //本期工商的 扣减量 = (上次剩余+ 期间购气量) - 本次剩余
      this.totalGasDifference = 0 // 差值
      this.bottomOfTheCurrentPeriod = '' //当前底数
      this.SurPlusGasOver= '',//剩余数
      this.errorTotalGasDifferenceClass = '#666666'
      this.isErrorDifference = '正常'
      for (let item of this.meterDate.f_meter_paths) {
        this.delfile('f_meter_paths', item.f_meter_path,0)
      }
      for (let item of this.meterDate.f_newmeter_paths) {
        this.delfile('f_newmeter_paths', item.f_meter_path,0)
      }
      this.delfile('f_sign_path', this.meterDate.f_sign_path,0)
      this.meterDate= {
        f_inputtor_id: Vue.user.id,//抄表员ID
        f_sign_path: '', //签名照片
        f_meter_paths: [],//总体照片
        f_total_gas_total_fee: '',//累购气量、累购金额
        f_newmeter_paths: [], //换流量计后总体照片
        f_is_change_flowmeter: '期间未换流量计',
        // 新表信息
        newPeriodFlowPressure: '',//新流量计压力
        newPeriodFlowTemperature: '',//新流量计温度
        newPeriodFlowStandardInstant: '',//新流量计标况瞬时
        newPeriodFlowStandardTotal: '',//新流量计标况累计
        newPeriodFlowWorkingInstant: '',//新流量计工况瞬时
        newPeriodFlowWorkingTotal: '',//新流量计工况累计
        newBottomOfTheCurrentPeriod: '',//新流量计底数
        newSurPlusGasOver: '',//新剩余数
        t_userfiles: {}, //修改的表信息
        f_meter_read_type: '月度抄表',
        f_total_apply_gas:'',
        f_remake:''
      }
    },
    // 本月是否进行过月度抄表,进行过月度抄表，但是不包含换流量计的记录，则不允许抄月度抄表
    isMonthCheckPlan () {
      let http1 = new HttpResetClass()
      http1.load('POST',`${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/findHandPlanIsMonth`, {data: {
          condition: ` f_meter_read_type = '月度抄表'`,
          userinfoid: `${this.item.f_userinfo_id}`
        }}, {resolveMsg: null, rejectMsg: null}).then((ress) => {
        let ressdata  = ress.data
        // 当本月已有月度抄表，本次不换流量计，则只能进行日常抄表
        if (this.meterDate.f_meter_read_type==='月度抄表' && this.meterDate.f_is_change_flowmeter === '期间未换流量计' &&  ressdata.length > 0 ) {
          this.meterDate.f_meter_read_type = '日常抄表'
          this.f_meter_read_types = [{label: '日常抄表',value: '日常抄表'}]
          return this.$showMessage(`当前用户，已在本月${ressdata[0].f_hand_date},被抄表员${ressdata[0].f_inputtor}进行过【月度抄表】,月度抄表每月一次。已为你自动切换为【日常抄表】`)
        } else
          // 本月还未有月度抄表记录，本次不换流量计 则提示本月还未进行月度抄表
          if (this.meterDate.f_meter_read_type==='日常抄表' && this.meterDate.f_is_change_flowmeter === '期间未换流量计'  && ressdata.length <= 0 ) {
          this.f_meter_read_types =  [{label: '日常抄表',value: '日常抄表'},{label: '月度抄表',value: '月度抄表'}]
          return this.$showMessage("本月还未完成该用户的【月度抄表】任务，请优先完成【月度抄表】任务(该信息仅为提示信息，可忽略)");
        } else
          // 当前是日常抄表，并且是换流量计，则给提示必须月度抄表（每月可多次换流量计，月度抄表就会有多条）
          if (this.meterDate.f_meter_read_type==='日常抄表' && this.meterDate.f_is_change_flowmeter === '期间有换流量计') {
          this.meterDate.f_meter_read_type = '月度抄表'
          this.f_meter_read_types = [{label: '月度抄表',value: '月度抄表'}]
          return this.$showMessage("【换流量计】时抄表类型必须是【月度抄表】，已为您自动切换。")
        }
      })
    }
  },

  async ready () {
    this.meterDate.t_userfiles.f_cardmeternumber = this.item.f_cardmeternumber
    this.meterDate.t_userfiles.f_userfiles_id = this.item.f_userfiles_id
    this.meterDate.f_inputtor_id =  Vue.user.id //抄表员ID
    // 初始化的时候，判断改用户是否已经进行过月度抄表计划，如本月已有月度计划数据，则只能进行日常抄表
    this.isMonthCheckPlan()
  },
  watch: {
    // 已用气量变化 期间用气量（流量计）=    本次标况累积 - 上次的标况累积
    'thisPeriodFlowGasConsumption' : function (val) {
        if (val!=null && val!=='' && val!==undefined ) {
          this.countTotalGasDifference()
        }
    },
    // 扣减量变化
    'thisPeriodFlowDeduction' : function (val) {
      if (val!=null && val!=='' && val!==undefined) {
        this.countTotalGasDifference()
      }
    },
    // 流量计的标况累计，复制给流量计的底数  应绑定同一个值，需要完整测试计算过程值是否正确，着急要，遗留
    'thisPeriodFlowStandardTotal': function (val) {
      this.bottomOfTheCurrentPeriod = val
    },
    // 新流量计标况累计，就是新流量计的底数  应绑定同一个值，需要完整测试计算过程值是否正确，着急要，遗留
    'meterDate.newPeriodFlowStandardTotal': function (val) {
      this.meterDate.newBottomOfTheCurrentPeriod = val
    },
    // 抄表类型变化
    'meterDate.f_meter_read_type': function (val) {
      this.isMonthCheckPlan()
    },
    // 期间是否换流量计
    'meterDate.f_is_change_flowmeter': function (val) {
      this.isMonthCheckPlan()
    }
  }
}
</script>
<style>
.panel-self {
  border-radius: 5px;
  border: 1px solid #c5e1f7;
  background-color: #F2F6FA;
}
.label-font {
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 70%;
}

.text-left {
  text-align: left;
}

.font {
  font: 15px PingFang-SC-Medium;
  color: #333333;
}

.showIi {
  font: 14px PingFang-SC-Medium;
  color: #666666;
}

.info {
  margin-top: 15px;
  border-radius: 5px;
  background-color: #f3faff;
}

.btn-photo {
  border: 0;
  border-radius: 7px;
  background-color: #7dc1f4;
  font: 15px PingFang-SC-Bold;
  height: 20%;
}

.div-photo {
  width: auto;
  height: auto;
  /* margin-top: 10px; */
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.btn-voice {
  border-radius: 7px;
  border: 1px solid #dedede;
  background-color: #f5fbff;
  font: 15px PingFang-SC-Bold;
  color: #499edf;
}

.save-btn {
  width: 25%;
  background-color: #499edf;
  border-radius: 6px;
  color: #FFFFFF;
  font: 15px PingFang-SC-Bold;
}

.upload-btn {
  width: 25%;
  background-color: #ffffff;
  border: 1px solid #499edf;
  border-radius: 6px;
  color: #499edf;
  font: 15px PingFang-SC-Bold;
}

.repair-btn {
  width: 25%;
  border: 1px solid #499edf;
  border-radius: 6px;
  font: 15px PingFang-SC-Bold;
}

#el_ca_tx {
  width: 100%;
  margin: 5px;
}
</style>
