<style scoped>
.bg {
  background-color: blue;
  height: 1px;
  border: 0;
}
.app-row {
  background-color: white;
  padding: 10px 10px 0 10px;
  border-bottom: 1px solid rgba(235, 235, 235, 0.5);
}
.search_input {
  border: 0;
  outline: none;
}
.font{
  font: 15px PingFang-SC-Medium;
  color: #666666;
}
.input-font{
  font: 15px PingFang-SC-Medium;
  color: #333333;
}
.btn-font{
  font:600 16px PingFang-SC-Bold;
  color: #499EDF;
}
.btn-color{
  background-color: #FFFFFF;
  border-radius: 10px ;
  border: 1px solid #499EDF;
}
.app-text {
  font-size: 12px;
}
.panel-self{
  border-radius: 10px;
  border:1px solid #499EDF;
  background-color: #F8F8F8;
}
.yybtn-color{
  background-color:#499edf;
  border-radius: 4px ;
  border: 1px solid #499EDF;
  color: #FFFFFF;
  font: 14px PingFang-SC-Bold;
}
.qxbtn-color{
  background-color: #FFFFFF;
  border-radius: 4px ;
  color: #499edf;
  font: 14px PingFang-SC-Bold;
  border: 1px solid #499EDF;
}

.button_shrink_top {width: 35px; height: 35px; background-size:100%;background-image: url("../../../../static/newStyle/stretch_top.png")}
.button_shrink_bottom {width: 35px; height: 35px;  background-size:100%;background-image: url("../../../../static/newStyle/stretch_bottom.png")}
.button_shrink_left {width: 35px; height: 35px;  background-size:100%;background-image: url("../../../../static/newStyle/stretch_left.png")}
.button_shrink_right {width: 35px; height: 35px; background-size:100%;background-image: url("../../../../static/newStyle/stretch_right.png")}
</style>
<template>
  <div style="height: auto;width: 100%">
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria' @condition-changed='search' v-ref:cri>
        <div partial>
          <form>
            <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  class="search_input input-font" v-model=model.f_meternumber condition="f_meternumber like '%{}%'" />
              </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="$parent.$parent.selfSearch">查询1</button>
              <!--              <div style="float: right;margin-right: 3% " class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"  @click="$parent.$parent.hidden()"></div>-->
            </div>
            <div style="height:30px;"></div>
          </form>
        </div>
      </criteria>
      <list :model="model" partial='list'>
        <div partial>
          <div  class="auto app-text" style="margin-top: 5px;">
            <div class="panel" style="padding: 10px 10px 5px 10px;">
              <div class="panel-body panel-self">
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 21%;float: left"><b>表号:</b></p>
                  <p class="panel-title text-left input-font" style="width: 79%">{{row.f_meternumber}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>指令类型:</b></p>
                  <p class="panel-title  text-left input-font" style="width: 74%">{{row.f_instruct_type}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>指令内容:</b></p>
                  <p class="panel-title  text-left input-font" style="width: 79%">{{ row.f_instruct_title }}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 21%;float: left"><b>指令状态:</b></p>
                  <p class="panel-title text-left input-font" style="width: 77%">{{row.f_instruct_state}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 31%;float: left"><b>指令生成时间:</b></p>
                  <p class="panel-title text-left input-font" style="width: 77%">{{row.f_instruct_date}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 21%;float: left"><b>操作状态:</b></p>
                  <p class="panel-title text-left input-font" style="width: 77%">{{row.f_state}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 31%;float: left"><b>指令发送时间:</b></p>
                  <p class="panel-title text-left input-font" style="width: 77%">{{row.f_send_date}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 21%;float: left"><b>操作人:</b></p>
                  <p class="panel-title text-left input-font" style="width: 79%">{{row.f_inputtor}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 31%;float: left"><b>指令上表时间:</b></p>
                  <p class="panel-title text-left input-font" style="width: 79%">{{row.f_callback_date}}</p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 31%;float: left"><b>操作/指令状态:</b></p>
                  <p class="panel-title text-left input-font" style="width: 79%" >
                    {{row.f_receive_state}}</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </list>
    </criteria-paged>
  </div>
</template>

<script>

import Vue from 'vue'
import { PagedList,HttpResetClass } from 'vue-client'
import * as Util from '../../Util'
import co from 'co'

export default {
  title: '物联网表指令查看',
  data() {
    return {
      f_orgid: Vue.user.orgid,
      model:new PagedList( `${this.$androidUtil.getProxyUrl()}/rs/sql/insturctDetailQuery`,5,{condition:'this.condition',f_orgid:`'${Vue.user.orgid}'`}),
      criteriaShow: false
    }
  },
  ready(){

  },
  methods: {
    search(args) {
      args.condition += ` and i.f_orgid in ${Vue.user.orgid}`
      this.model.search(args.condition, args.model)
    },
    selfSearch () {
      let condition = "1=1"
      if(this.$refs.paged.$refs.cri.model.f_meternumber==''||this.$refs.paged.$refs.cri.model.f_meternumber==undefined){
        this.$showMessage('请输入表号进行查询...')
        return
      }
      if(this.$refs.paged.$refs.cri.model.f_meternumber){
        if(this.$refs.paged.$refs.cri.model.f_meternumber.toString().trim()){
          condition += " and t.f_meternumber like '%"+this.$refs.paged.$refs.cri.model.f_meternumber+"%'"
        }
      }
      console.log('condition ===> '+ condition)
      this.model.search(condition)
    },

    hidden() {
      this.criteriaShow = !this.criteriaShow
    }
  }
}
</script>
