<template>
  <div class="auto app-text" style="margin-top: 5px;">
    <header class="head">
      周检表信息
    </header>
    <div class="panel" style="padding: 0 10px 5px 10px;">
      <div class="panel-body panel-self">
        <div  class="row auto app-row col-xs-12  col-sm-6 col-md-6">
          <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">上次抄表日期</p>
          <p class="panel-title col-xs-8 col-sm-8 col-md-8 text-left font">{{ model.f_last_hand_date }}</p>
        </div>
        <div  class="row auto app-row col-xs-12  col-sm-6 col-md-6">
          <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">上次基表底数</p>
          <p class="panel-title col-xs-8 col-sm-8 col-md-8 text-left font">{{ model.f_last_tablebase }}</p>
        </div>
        <div  class="row auto app-row col-xs-12  col-sm-6 col-md-6">
          <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">上次剩余气量</p>
          <p class="panel-title col-xs-8 col-sm-8 col-md-8 text-left font">{{ model.f_last_lcd }}</p>
        </div>
        <div  class="row auto app-row col-xs-12  col-sm-6 col-md-6">
          <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">上次剩余金额</p>
          <p class="panel-title col-xs-8 col-sm-8 col-md-8 text-left font">{{ model.f_iclastmoney}}</p>
        </div>
        <div class=" col-xs-12 col-sm-12 col-md-12 bg-white row auto app-row col-xs-12 ">
          <label for="f_card_id" class="panel-title col-xs-4 col-sm-2 col-md-2 text-left font">总购气量</label>
          <div class="col-xs-6  col-sm-4 col-md-4 ">
            <input type="number" id="f_card_id" class="form-control font " v-model="model.f_sumgas" readonly>
          </div>
          <div class="col-sm-2 col-xs-2 col-sm-offset-1 col-md-2 col-md-offset-1">
            <button type="button" name="button" class="btn btn-primary" @click="getSumGas(model.card_id)"
            >详情
            </button>
          </div>
        </div>

        <div  class="row auto app-row col-xs-12  col-sm-3 col-md-3">
          <p class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">期间购气:</p>
          <p class="panel-title col-xs-8 col-sm-6 col-md-6 text-left font">{{ model.f_sumgas_moment}}</p>
        </div>
        <div  class="row auto app-row col-xs-12  col-sm-3 col-md-3">
          <p class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">上次未充:</p>
          <p class="panel-title col-xs-8 col-sm-6 col-md-6 text-left font">{{ model.f_nogasvalue }}</p>
        </div>
        <div  class="row auto app-row col-xs-12  col-sm-3 col-md-3">
          <p class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">本次已充:</p>
          <p class="panel-title col-xs-8 col-sm-6 col-md-6 text-left font">{{ model.f_hascharge }}</p>
        </div>
        <div  class="row auto app-row col-xs-12  col-sm-3 col-md-3">
          <p class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">本次未充:</p>
          <p class="panel-title col-xs-8 col-sm-6 col-md-6 text-left font">{{ model.f_hasnotcharge }}</p>
        </div>
        <div class="row auto app-row col-xs-12 col-sm-12 col-md-12 bg-white ">
          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_new_tablebase" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">基表底数</label>
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="number" id="f_new_tablebase" class="form-control font " v-el:f_new_tablebase @blur="getMeterMessage()" v-model="model.f_new_tablebase" v-next-el="f_new_lcd">
            </div>
          </div>
          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_tablesnapsgas" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">基表走气量</label>
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="number" id="f_card_id" class="form-control font " v-model="model.f_tablesnapsgas" readonly>
            </div>
          </div>
          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_meter_repair" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">表维修</label>
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="number" id="f_meter_repair" class="form-control font " v-model="model.f_meter_repair" readonly>
            </div>
          </div>
        </div>
        <div class="row auto app-row col-xs-12 col-sm-12 col-md-12 bg-white ">
          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_new_tablebase" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">卡剩余气量</label>
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="number" id="f_new_lcd" class="form-control font "  v-el:f_new_lcd @blur="getCardMessage()" v-model="model.f_new_lcd" v-next-el="f_insflow">
            </div>
          </div>
          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_icsnapsgas" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">IC卡扣气量</label>
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="number" id="f_icsnapsgas" class="form-control font " v-model="model.f_icsnapsgas" readonly>
            </div>
          </div>
          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_card_repair" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">卡维修</label>
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="number" id="f_card_repair" class="form-control font " v-model="model.f_card_repair" readonly>
            </div>
          </div>
        </div>
        <div class="row auto app-row col-xs-12 col-sm-12 col-md-12 bg-white ">
          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_curbalance" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">卡剩余金额</label>
            <div class="col-xs-8  col-sm-6 col-md-6  ">
              <input type="number" id="f_curbalance" class="form-control font " v-model="model.f_curbalance" @blur="getMoneyMessage()" >
            </div>
          </div>

          <div class="auto col-xs-12 col-sm-4 col-md-4 bg-white app-row ">
            <label for="f_datacomparison" class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">数据对比</label>
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="number" id="f_datacomparison" class="form-control font " v-model="model.f_datacomparison" readonly>
            </div>
          </div>
          <div  class="row auto bg-white app-row col-xs-12  col-sm-4 col-md-4">
            <p class="panel-title col-xs-4 col-sm-6 col-md-6 text-left font">抄表状态</p>
            <!--<p class="panel-title col-xs-8 col-sm-6 col-md-6 text-left font">{{ model.f_result_state}}</p>-->
            <div class="col-xs-8  col-sm-6 col-md-6 ">
              <input type="text" id="f_datacomparison" class="form-control font " v-model="model.f_result_state" readonly>
            </div>
          </div>
          <div   class="row auto bg-white app-row col-xs-12  col-sm-12 col-md-12" >
            <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">IC卡累计</p>
            <div class="col-xs-8  col-sm-8 col-md-8 ">
              <input type="text" id="" class="form-control font " v-model="model.f_checkic1" @blur="checkbyic1()">
            </div>
          </div>
<!--          <div   class="row auto bg-white app-row col-xs-12  col-sm-12 col-md-12" v-if="showic1">-->
<!--            <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">本期IC卡底数</p>-->
<!--            <div class="col-xs-8  col-sm-8 col-md-8 ">-->
<!--              <input type="text" id="" class="form-control font " v-model="model.f_checkicbase" >-->
<!--            </div>-->
<!--          </div>-->
        </div>
        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_insflow" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">瞬时流量</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_insflow" class="form-control font " v-el:f_insflow v-model="model.f_insflow" v-next-el="f_temperature">
          </div>
        </div>

        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_temperature" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">温度</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_temperature" class="form-control font " v-el:f_temperature v-model="model.f_temperature" v-next-el="f_pressure">
          </div>
        </div>

        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_pressure" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">压力</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_pressure" class="form-control font" v-el:f_pressure v-model="model.f_pressure"  v-next-el="f_condition">
          </div>
        </div>
        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_condition" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">工况</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_condition" class="form-control font "v-el:f_condition  v-model="model.f_condition" v-next-el="f_remark">
          </div>
        </div>
        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_condition" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">计量表钢丝锁</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="f_wirelock" class="form-control font "v-el:f_wirelock  v-model="model.f_wirelock" v-next-el="f_remark">
          </div>
        </div>
        <div class="auto  col-xs-12 col-sm-12 col-md-12 bg-white " style="padding: 0.5em" >

          <p class="panel-title col-xs-4  col-sm-2 col-md-2 text-left font">换表</p>
          <div class="col-xs-4 col-sm-2 col-md-2">
            <input type="radio" name="f_if_change" id="f_if_change" value="是" v-model="model.f_if_change" > 是
          </div>
          <div class="col-xs-4 col-sm-2 col-md-2">
            <input type="radio" name="f_if_change" id="f_if_change" value="否" v-model="model.f_if_change" checked> 否
          </div>

        </div>
        <div class="row auto app-row col-xs-12 col-sm-12 col-md-12 bg-white ">
          <label for="f_mark" class="panel-title col-xs-4 col-sm-2 col-md-2 text-left font">备注</label>
          <div class="col-xs-8  col-sm-10 col-md-10 ">
            <input type="text" id="f_remark" class="form-control font" v-el:f_remark v-model="model.f_remark" >
          </div>
        </div>
        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_condition" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">未安装替换表周检</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <v-select id="f_new_install"
                      v-model="model.f_new_install"
                      placeholder='请选择'
                      :value.sync="model.f_new_install"
                      :value-single="true"
                      :options='install'
                      close-on-select clear-button>
            </v-select>
          </div>
        </div>
        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_condition" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">清理滤芯人员</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <v-select id="f_clean_person"
                      v-model="model.f_clean_person"
                      placeholder='请选择'
                      :value.sync="model.f_clean_person"
                      multiple
                      :options='cleanperson'
                      close-on-select >
            </v-select>
          </div>
        </div>
        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_condition" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">查漏人员</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <v-select id="f_check_person"
                      v-model="model.f_check_person"
                      placeholder='请选择'
                      :value.sync="model.f_check_person"
                      multiple
                      :options='checkperson'
                      close-on-select >
            </v-select>
          </div>
        </div>
        <div class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_condition" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">单据填算人员</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <v-select id="f_clean_person"
                      v-model="model.f_form_person"
                      placeholder='请选择'
                      :value.sync="model.f_form_person"
                      multiple
                      :options='formperson'
                      close-on-select >
            </v-select>
          </div>
        </div>
        <div class="auto row col-sm-12 col-xs-12 col-md-12 bg-white">
          <div class="auto col-sm-6 col-xs-6 col-md-6">
            <input class="magic-checkbox" type="checkbox" id="f_check_install" :true-value="'是'" :false-value="''"
                   v-model="model.f_check_install" >
            <label class="text-left font" for="f_check_install">替换表安装信息</label>
          </div>
        </div>
        <div v-if="!model.f_check_unstall && model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekchecknum" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表安装时表底数</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weekchecknum" class="form-control font " v-el:f_weekchecknum v-model="model.f_weekchecknum" v-next-el="f_weekcheckicnum">
          </div>
        </div>
        <!--        <div v-if="!model.f_check_unstall && model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">-->
        <!--          <label for="f_weekchecknum" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表IC卡累计底数</label>-->
        <!--          <div class="col-xs-8  col-sm-8 col-md-8 ">-->
        <!--            <input type="number" id="f_weekcheckcardnum" class="form-control font " v-el:f_weekchecknum v-model="model.f_weekcheckcardnum" v-next-el="f_weekcheckicnum">-->
        <!--          </div>-->
        <!--        </div>-->
        <div v-if="!model.f_check_unstall && model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekcheckicnum" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表安装时剩余气量</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weekcheckicnum" class="form-control font " v-el:f_weekcheckicnum v-model="model.f_weekcheckicnum" v-next-el="f_weekchecksn">
          </div>

        </div>

        <div v-if="!model.f_check_unstall && model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekcheckicsn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表安装时间</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <datepicker
              :value.sync="model.f_weekchecktime"
              :format="'yyyy-MM-dd HH:mm:ss'"
              v-model="model.f_weekchecktime"
              :show-reset-button="reset" placeholder="替换表安装时间" style="margin-bottom: 8px">
            </datepicker>
          </div>
        </div>
        <div v-if="!model.f_check_unstall && model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">

          <label for="f_weekcheckicsn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表卡号</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="f_weekchecksn" class="form-control font" v-el:f_weekcheckicsn v-model="model.f_weekcheckicsn" @blur="getWeekByCard(model.f_weekcheckicsn)" >
          </div>
        </div>
        <div v-if="!model.f_check_unstall && model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">

          <label for="f_weekchecksn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表基表表号</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="f_weekcheckmeternum" class="form-control font" v-el:f_weekcheckmeternum v-model="model.f_weekcheckmeternum" >
          </div>
        </div>
        <div v-if="!model.f_check_unstall && model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">

          <label for="f_weekchecksn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表表号</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="f_weekchecksn" class="form-control font" v-el:f_weekchecksn v-model="model.f_weekchecksn" >
          </div>
        </div>
        <div class="auto row bg-white col-sm-12 col-xs-12 col-md-12">
          <div class="auto col-sm-6 col-xs-6 col-md-6">
            <input class="magic-checkbox" type="checkbox" id="f_check_unstall" :true-value="'是'" :false-value="''"
                   v-model="model.f_check_unstall" >
            <label class="text-left font" for="f_check_unstall">替换表卸载信息</label>
          </div>
        </div>
        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekcheckicsn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表拆卸时间</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <datepicker
              :value.sync="model.f_weekchecktime"
              :format="'yyyy-MM-dd HH:mm:ss'"
              v-model="model.f_weekchecktime"
              :show-reset-button="reset" placeholder="替换表拆卸时间" style="margin-bottom: 8px">
            </datepicker>
          </div>
        </div>
        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">

          <label for="f_weekcheckicsn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表卡号</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="f_weekchecksn" class="form-control font" v-el:f_weekcheckicsn v-model="model.f_weekcheckicsn" readonly >
          </div>

        </div>
        <div v-if="model.f_check_unstall && !model.f_check_install" class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">

          <label for="f_weekchecksn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表基表表号</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="f_weekcheckmeternum" class="form-control font" v-el:f_weekcheckmeternum v-model="model.f_weekcheckmeternum"  readonly>
          </div>
        </div>
        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">

          <label for="f_weekchecksn" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表表号</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="f_weekchecksn" class="form-control font" v-el:f_weekchecksn v-model="model.f_weekchecksn" readonly>
          </div>
        </div>
        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekchecknum" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表上次读数</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weekchecknum" class="form-control font " v-model="model.f_weekchecknum" readonly>
          </div>
        </div>

        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekcheckicnum" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">上次剩余气量</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weekcheckicnum" class="form-control font " v-model="model.f_weekcheckicnum" readonly>
          </div>
        </div>

        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekcheckdishu" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">替换表底数</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weekcheckdishu" class="form-control font " v-el:f_weekcheckdishu v-model="model.f_weekcheckdishu" @blur="getWeekMeterMessage()" v-next-el="f_weekcheckicdishu">
          </div>
        </div>
        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weektablesnapsgas" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">走气量</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weektablesnapsgas" class="form-control font " v-el:f_weektablesnapsgas  v-model="model.f_weektablesnapsgas" readonly>
          </div>
        </div>

        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_temperature" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">卡剩余气量</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weekcheckicdishu" class="form-control font" v-el:f_weekcheckicdishu  v-model="model.f_weekcheckicdishu"  @blur="getWeekCardMessage()">
          </div>
        </div>

        <div v-if="model.f_check_unstall && !model.f_check_install " class="auto col-xs-12 col-sm-6 col-md-6 bg-white app-row ">
          <label for="f_weekicsnapsgas" class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">扣气量</label>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="number" id="f_weekicsnapsgas" class="form-control font " v-model="model.f_weekicsnapsgas"  readonly>
          </div>
        </div>
        <div  class="row auto bg-white app-row col-xs-12  col-sm-12 col-md-12" v-if="model.f_check_unstall && !model.f_check_install">
          <p class="panel-title col-xs-2 col-sm-2 col-md-2 text-left font">抄表状态</p>
          <div class="col-xs-4  col-sm-4 col-md-4 ">
            <input type="text" id="f_result_state" class="form-control font " v-model="model.f_check_result_state" readonly>
          </div>
        </div>
        <div   class="row auto bg-white app-row col-xs-12  col-sm-12 col-md-12" v-if="model.f_check_unstall && !model.f_check_install && showic">
          <p class="panel-title col-xs-4 col-sm-4 col-md-4 text-left font">周检表IC卡累计</p>
          <div class="col-xs-8  col-sm-8 col-md-8 ">
            <input type="text" id="" class="form-control font " v-model="model.f_checkic" @blur="checkbyic()">
          </div>
        </div>
        <div class="row auto col-xs-12 col-sm-12 col-md-12 mt-20">
          <!--<img-area :model="model.imgs"></img-area>-->
          <picture-area  :model="model.imgs"></picture-area>
        </div>
        <div class="row col-xs-12 col-sm-12 col-md-12  auto mt-20"  v-if="!data.hidden">
          <div class="col-xs-2 col-sm-2 col-md-2  col-xs-offset-4 col-sm-offset-4 col-md-offset-4">
            <button type="button" class="btn btn-lg btn-color btn-font"  @click="save()">保存</button>
          </div>
          <div class="col-xs-2 col-sm-2 col-md-2 col-xs-offset-1 col-sm-offset-1 col-md-offset-1" >
            <button type="button" class="btn btn-color btn-font btn-lg"  @click="commit()">提交</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import * as Util from './../Util'
import Vue from 'vue'
import co from 'co'
import LoadData from '../../plugins/LoadData'
import AppData from 'readmeter-changan/src/stores/AppData'
let getDataGen = function * (self, val) {
  yield self.$resetpost(Vue.handdataUrl + 'rs/sql/getUserInfo', {data:{
      condition:`card_id = '${self.model.f_weekcheckicsn}'`
    }}, {resolveMsg: null, rejectMsg: null})
    .then((res) =>{
      console.log(JSON.stringify(res.data));
      if(res.data.length>0){
        self.model.f_weekcheckmeternum = res.data[0].f_jb_table_code
        self.model.f_weekchecksn = res.data[0].f_meternumber
      }

    })
}
export default {
  title: '手机单户抄表',
  data () {
    return {
      result:{params:{}},
      cleanperson:[],
      checkperson:[],
      formperson:[],
      install:[{label:'开始',value:'开始'},{label:'结束',value:'结束'}],
      model: {
        f_mark:'',
        f_condition:'',
        f_pressure:'',
        f_temperature:'',
        f_new_install:'',
        f_checkic1:'',
        f_result_state:'',
        f_check_result_state:'',
        f_check_install:'',
        f_check_unstall:'',
        f_wirelock:'',
        imgInfo: '',
        imgName: '',
        sumgas_moment:0,
        f_datacomparison:0,
        f_weekicsnapsgas:0,
        f_weekcheckmeternum:'',
        f_weektablesnapsgas:0,
        f_weekchecktime:Util.toStandardTimeString(),
        f_weekcheckicsn:'',
        f_weekchecksn:'',
        f_weekchecknum:'',
        f_weekcheckicnum:'',
        f_weekcheckdishu:'',
        f_insflow:0,
        f_weekcheckicdishu:'',
        f_oughtamount: 0,
        f_new_lcd:0,
        f_checkicbase:0,
        f_curbalance:0,
        f_meter_repair:0,
        f_card_repair:0,
        f_new_tablebase:0,
        f_tablesnapsgas:0,
        f_icsnapsgas:0,
        imgs:[]
      },
      showic:false,
      showic1:false,
      imgurl:'',
      system:'',
      flag: false
    }
  },
  props: {
    data: {
      type: Object,
      default: function () {
        return {
        }
      }
    },
    showmessage:true,
    type: {
      type: String,
      default: 'save'
    }
  },
  watch:{
    'model.f_result_state'(val){
      if(val && val==='异常'){
        this.showic1 = true
      }
    },
    'model.f_check_result_state'(val){
      if(val && val==='异常'){
        this.showic = true
      }
    },
    'model.f_check_install'(val){
      if(val){
        this.model.f_check_unstall = ''
      }
    },
    'model.f_check_unstall'(val){
      if(val){
        this.model.f_check_install = ''
      }
    },
    'data.f_download'(val){
      if(this.data.f_download){
        // this.$showMessage('数据更新成功,请核对数据重新计算')
        this.data.f_new_lcd = this.model.f_new_lcd,
          this.data.f_tablebase = this.model.f_new_tablebase,
          this.data.f_weekcheckdishu = this.model.f_weekcheckdishu,
          this.data.f_weekcheckicdishu = this.model.f_weekcheckicdishu
      }

      // this.model = Object.assign({}, this.model, this.data)
      this.updatedata()
    }
  },
  async ready () {
    Vue.resetpost(Vue.handdataUrl + 'NewSaleRest/rs/logic/getSaleInitData', {data: {f_filialeids:''}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
      res.data.params.forEach((item) => {
        let value = []
        item.f_paramvalues.forEach((item, index) => {
          value[index] = {}
          value[index].label = item.name
          value[index].value = item.name
        })
        this.result.params[item.name] = value
      })
      this.cleanperson = this.result.params['清理滤芯人员']
      this.checkperson = this.result.params['查漏人员']
      this.formperson = this.result.params['单据填算人员']
    })
    // Vue.handdataUrl = ''
    //   this.$resetpost( 'rs/sql/getUserInfo', {data:{
    //       condition:`card_id = '9999999014'`
    //     }}, {resolveMsg: null, rejectMsg: null})
    //     .then((res) =>{
    //       console.log(JSON.stringify(res.data));
    //       if(res.data.length>0){
    //         this.data = Object.assign(this.data,res.data[0])
    //         this.model = Object.assign(this.model,res.data[0])
    //         this.model.f_result_state = '异常'
    //       }
    //
    //       this.flag = true
    //       this.updatedata()
    //       this.model.f_result_state = '异常'
    //     })

    // 抄表按钮可以点击
    this.flag = true
    this.updatedata()
  },
  methods: {
    checkbyic(){
      this.model.f_check_result_state = Math.abs(parseInt(this.model.f_checkic)-parseInt(this.model.f_weekcheckdishu))<=this.model.f_tablewitherrorvalue?'正常':'异常'
    },
    checkbyic1(){
      this.model.f_result_state = Math.abs(parseInt(this.model.f_checkic1)-parseInt(this.model.f_new_tablebase))<=this.model.f_tablewitherrorvalue?'正常':'异常'
    },
    getWeekByCard(){
      let gen = getDataGen(this)
      co(gen)
    },
    updatedata(){
      this.model = Object.assign({}, this.model, this.data)
      this.model.f_weekchecktime = Util.toStandardTimeString()
      if(this.type === 'save'){
        this.model.f_sumgas = this.data.f_sumgas?this.data.f_sumgas:0,
          this.model.f_nogasvalue  = this.data.f_nogasvalue?this.data.f_nogasvalue:0,
          this.model.f_hasnotcharge  = this.data.f_hasnotcharge?this.data.f_hasnotcharge:0,
          this.model.f_hascharge  = this.data.f_hascharge?this.data.f_hascharge:0,
          this.model.f_last_lcd = this.data.f_last_lcd?this.data.f_last_lcd:0,
          this.model.f_new_tablebase=this.data.f_new_tablebase?this.data.f_new_tablebase:0,
          this.model.f_new_lcd= this.data.f_new_lcd?this.data.f_new_lcd:0,
          this.model.f_tablesnapsgas=this.data.f_tablesnapsgas?this.data.f_tablesnapsgas:0,
          this.model.f_meter_repair=this.data.f_meter_repair?this.data.f_meter_repair:0,
          this.model.f_card_repair=this.data.f_card_repair?this.data.f_card_repair:0,
          this.model.f_icsnapsgas=this.data.f_icsnapsgas?this.data.f_icsnapsgas:0,
          this.model.f_result_state = this.data.f_result_state?this.data.f_result_state:'正常',
          this.model.f_sumgas_moment = this.data.f_sumgas_moment?this.data.f_sumgas_moment:0,
          this.model.f_curbalance = this.data.f_curbalance?this.data.f_curbalance:0,
          this.model.f_datacomparison = this.data.f_datacomparison?this.data.f_datacomparison:0
      }
    },
    getSumGas(){
      this.$goto('hand-sell-history', {model: this.model,showmessage:this.showmessage,temp:'check-info'}, 'list')
    },
    //获取ic卡表数据
    getMoneyMessage(){
      if (this.model.f_curbalance === '' || this.model.f_curbalance === undefined) {
        this.$showMessage('请检查你录入的金额')
        return
      }
      this.model.f_new_lcd = parseInt(this.model.f_curbalance / this.model.f_price)
      this.model.f_pregas = this.model.f_pregas?this.model.f_pregas:0
      this.model.f_sumgas_moment = this.model.f_sumgas_moment?this.model.f_sumgas_moment:0
      let res = this.$androidUtil.bzLogic('gasComputation', this.model,{rejectMsg: null, resolve: null})
      this.model.f_hasnotcharge = parseInt(res.hasnotCharge)
      this.model.f_hascharge = (parseInt(this.model.f_sumgas_moment)+ parseInt(this.model.f_nogasvalue) - parseInt(this.model.f_hasnotcharge))
      console.log('本期已充'+this.model.f_hascharge)
      this.model.f_last_lcd= this.model.f_last_lcd?this.model.f_last_lcd:0
      this.model.f_icsnapsgas = (parseInt(this.model.f_last_lcd)+ parseInt(this.model.f_hascharge)+parseInt(this.model.f_card_repair)- parseInt(this.model.f_new_lcd))
      console.log('IC走气'+this.model.f_icsnapsgas)
      this.model.f_result_state = res.f_result_state
      console.log('抄表状态'+this.model.f_result_state)
      this.model.f_datacomparison = (parseInt(this.model.f_icsnapsgas)-parseInt(this.model.f_tablesnapsgas))
    },
    getCardMessage(){
      if (this.model.f_new_lcd === '' || this.model.f_new_lcd === undefined) {
        this.$showMessage('请检查你录入的液晶示数')
        return
      }
      this.model.f_pregas = this.model.f_pregas?this.model.f_pregas:0
      this.model.f_sumgas_moment = this.model.f_sumgas_moment?this.model.f_sumgas_moment:0
      let res = this.$androidUtil.bzLogic('gasComputation', this.model,{rejectMsg: null, resolve: null})
      this.model.f_hasnotcharge = parseInt(res.hasnotCharge)
      this.model.f_hascharge = (parseInt(this.model.f_sumgas_moment)+ parseInt(this.model.f_nogasvalue) - parseInt(this.model.f_hasnotcharge))
      console.log('本期已充'+this.model.f_hascharge)
      this.model.f_last_lcd= this.model.f_last_lcd?this.model.f_last_lcd:0
      this.model.f_icsnapsgas = (parseInt(this.model.f_last_lcd)+ parseInt(this.model.f_hascharge)+parseInt(this.model.f_card_repair)- parseInt(this.model.f_new_lcd))
      console.log('IC走气'+this.model.f_icsnapsgas)
      this.model.f_result_state = res.f_result_state
      console.log('抄表状态'+this.model.f_result_state)
      this.model.f_datacomparison = (parseInt(this.model.f_icsnapsgas)-parseInt(this.model.f_tablesnapsgas))
      this.model.f_curbalance = parseInt(this.model.f_new_lcd * this.model.f_price)
      console.log('剩余金额'+this.model.f_curbalance)

    },

    getWeekCardMessage(){
      // if(this.model.f_weekcheck&&this.model.f_weekcheck ==='1'&& this.model.f_weekcheckicdishu){
      //   this.model.f_new_lcd = this.model.f_weekcheckicdishu
      // }
      if (this.model.f_weekcheckicdishu === '' || this.model.f_weekcheckicdishu === undefined) {
        this.$showMessage('请检查你录入的液晶示数')
        return
      }

      let postdata = Object.assign({},this.model)
      postdata.week = '1'
      this.model.f_weekcheckicnum= this.model.f_weekcheckicnum?this.model.f_weekcheckicnum:0
      this.model.f_weekicsnapsgas = (parseInt(this.model.f_weekcheckicnum)- parseInt(this.model.f_weekcheckicdishu))
      console.log('IC走气'+this.model.f_icsnapsgas)
      this.model.f_check_result_state = Math.abs(parseInt(this.model.f_weekicsnapsgas)-parseInt(this.model.f_weektablesnapsgas))<=this.model.f_tablewitherrorvalue?'正常':'异常'
      console.log('抄表状态'+this.model.f_result_state)
      console.log('剩余金额'+this.model.f_curbalance)
    },
    //获取基表走气量
    getMeterMessage(){
      // if(this.model.f_weekcheck&&this.model.f_weekcheck ==='1'&& this.model.f_weekcheckdishu){
      //  this.model.f_weekcheckdishu = this.model.f_new_tablebase
      // }
      if (this.model.f_new_tablebase === '' || this.model.f_new_tablebase === undefined) {
        this.$showMessage('请检查你录入的表底数')
        return
      }
      if (parseInt(this.model.f_new_tablebase) - parseInt(this.model.f_last_tablebase) < 0) {
        this.$showMessage('录入本期表底数不能小于上期表底数！')
        return
      }
      this.model.f_meter_repair= this.model.f_meter_repair?this.model.f_meter_repair:0
      this.model.f_last_tablebase= this.model.f_last_tablebase?this.model.f_last_tablebase:0
      // this.$set(this.model.f_tablesnapsgas,'')
      this.model.f_tablesnapsgas = parseInt(this.model.f_new_tablebase)- parseInt(this.model.f_last_tablebase)-parseInt(this.model.f_meter_repair)
      if (this.model.f_new_lcd ) {
        this.getCardMessage()
      }
    },

    //获取基表走气量
    getWeekMeterMessage(){
      console.log(1)
      if (this.model.f_weekcheckdishu === '' || this.model.f_weekcheckdishu === undefined) {
        this.$showMessage('请检查你录入的表底数')
        return
      }
      if (parseInt(this.model.f_weekcheckdishu) - parseInt(this.model.f_weekchecknum) < 0) {
        this.$showMessage('录入本期表底数不能小于上期表底数！')
        return
      }
      this.model.f_meter_repair= this.model.f_meter_repair?this.model.f_meter_repair:0
      this.model.f_weekchecknum= this.model.f_weekchecknum?this.model.f_weekchecknum:0
      // this.$set(this.model.f_weektablesnapsgas,'')
      this.model.f_weektablesnapsgas = parseInt(this.model.f_weekcheckdishu)- parseInt(this.model.f_weekchecknum)-parseInt(this.model.f_meter_repair)
      if (this.model.f_weekcheckicdishu ) {
        this.getWeekCardMessage()
      }
    },

    commit () {
      if ((parseInt(this.model.f_new_tablebase) - parseInt(this.model.f_last_tablebase) < 0) && this.model.f_if_change!=='是') {
        this.$showMessage('录入本期表底数不能小于上期表底数！请核对抄表数据')
        return
      }
      if(!this.model.f_checkic1){
        console.log(this.model.f_checkic1)
        this.$showMessage('请输入IC卡累计！！！')
        return
      }
      if(this.model.f_check_install){
        this.model.f_weekcheck = 1
      }
      if(this.model.f_check_unstall){
        this.model.f_weekcheck = 0
      }
      if(this.model.f_weekcheck==='1'||this.model.f_weekcheck==='true'||this.model.f_weekcheck==='是'){
        if (parseInt(this.model.f_weekcheckdishu) - parseInt(this.model.f_weekchecknum) < 0) {
          this.$showMessage('录入本期表底数不能小于上期表底数！')
          return
        }
        // if (parseInt(this.model.f_weekcheckdishu) - parseInt(this.model.f_weekchecknum) < 0) {
        //   this.$showMessage('录入本期表底数不能小于上期表底数！')
        //   return
        // }
      }
      // if (!(this.model.imgName && this.model.imgName.length > 0)) {
      //   this.$showMessage('请录入抄表照片！')
      //   return
      // }
      if (!this.flag) {
        this.$showMessage(`系统正在进行抄表，请勿重复操作！`)
        // this.$showAlert('系统正在进行抄表，请勿重复操作！', 'warning', 2000)
        return
      }
      if(this.model.lastImgName){
        this.model.lastImgName = `.${this.model.f_user_name}${this.model.imgName.substring(this.model.imgName.indexOf('.'))}`
      }
      // 设置抄表按钮不可用
      this.flag = false
      // 将用户编号放入抄表照片名中
      console.log(this.model.lastImgName)
      this.model.f_oughtamount = parseInt(this.model.f_new_tablebase) - parseInt(this.model.f_last_tablebase)
      // this.model.f_last_hand_date = Util.getBeforeMonth(this.model.f_hand_date)
      // this.model.f_last_hand_date =
      this.model.f_new_tablebase = parseInt(this.model.f_new_tablebase)
      this.model.f_new_lcd = parseInt(this.model.f_new_lcd)
      this.model.f_end_time = this.data.f_end_time
      let res = this.$androidUtil.bzLogic('phone-readmeter', this.model, {rejectMsg: null, resolve: null})
      console.log(res)
      if (res.code === 200) {
        console.log('抄表完成！')
        // 抄表完成设置按钮可用
        this.flag = false
        this.$showMessage('抄表成功！')
        // this.$showAlert('抄表成功！', 'success', 2000)
        // 发送抄表成功事件给父页面
        // this.$dispatch('hand-success', this.type)
      }else{
        console.log('抄表失败')
        // 抄表完成设置按钮可用
        this.flag = true
        // this.$showMessage(`${res.backData.msg}！请前往表单上传重新提交`)
        // this.$showAlert(`${res.backData.msg}！请前往表单上传重新提交`, 'danger', 2000)
      }
    },
    //将数据存入本地数据库，下次进入页面回写数据
    save(){
      if (!this.flag) {
        this.$showMessage(`该抄表单已上传成功,请勿重复保存！`)
        return
      }

      if ((parseInt(this.model.f_new_tablebase) - parseInt(this.model.f_last_tablebase)) < 0 && this.model.f_if_change!=='是') {
        this.$showMessage('录入本期表底数不能小于上期表底数！请核对抄表数据')
        return
      }
      // window.alert(this.f_check_install)
      if(this.model.f_check_install){
        this.model.f_weekcheck = 1
      }
      if(this.model.f_check_unstall){
        this.model.f_weekcheck = 0
      }
      if(this.model.f_weekcheck==='1'||this.model.f_weekcheck==='true'||this.model.f_weekcheck==='是'){
        if (parseInt(this.model.f_weekcheckdishu) - parseInt(this.model.f_weekchecknum) < 0) {
          this.$showMessage('录入本期表底数不能小于上期表底数！')
          return
        }
        // if (parseInt(this.model.f_weekcheckdishu) - parseInt(this.model.f_weekchecknum) < 0) {
        //   this.$showMessage('录入本期表底数不能小于上期表底数！')
        //   return
        // }
      }
      this.model.f_end_time = this.data.f_end_time
      this.model.f_new_tablebase = parseInt(this.model.f_new_tablebase)
      this.model.f_new_lcd = parseInt(this.model.f_new_lcd)
      let res = this.$androidUtil.bzLogic('local-save',this.model,{rejectMsg: null, resolve: null})
      if(res.status === 200){
        // this.flag = false
        this.$showMessage('本地数据保存成功！')
        // this.$showAlert('本地数据保存成功!', 'success', 2000)
      }
    }
  }
}
</script>
<style scoped>
.mt-5 {
  margin-top: 5px;
}
.mt-10 {
  margin-top: 10px;
}
.mt-20 {
  margin-top: 20px;
}
.app-row-none-border {
  background-color: white;
  padding: 10px 10px 0 10px;
}
.font{
  font: 17px PingFang-SC-Medium;
  color: #666666
}
.show-font{
  font: 17px PingFang-SC-Medium;
  color: #333333
}
.btn-font{
  font:600 16px PingFang-SC-Bold;
  color: #499EDF;
}
.head{
  font-size: 1.25em;
  font-weight: bolder;
  padding: 0.5em;
}
.btn-color{
  background-color: #FFFFFF;
  border-radius: 10px ;
  border: 1px solid #499EDF;
}
</style>
