<template>
  <div class="auto" style="height: 100%">
    <criteria-paged :model="model"  v-ref:paged>
      <criteria partial='criteria' @condition-changed='search' v-ref:cri>
        <div partial>
          <form>
            <img @click="$parent.$parent.getNewOrder" src="../../assets/shuaxindaiban1.png" style="position: fixed;right: 3%; bottom: 20%;">
          </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" style="display: flex">
                  <p class="panel-title col-xs-7 text-left font" style="margin: 8px auto;word-break: break-all;white-space: normal;font-size: 18px;text-align: center;"><b>{{ row.f_title }}</b></p>
                </div>
                <div class="col-xs-12">
                  <p class="panel-title text-left font" style="width: 21%;float: left"><b>发&ensp;送&ensp;人:</b></p>
                  <p class="panel-title text-left input-font" style="width: 79%;float: left">{{ row.f_send_people }}
                  </p>
                </div>
                <div class="col-xs-12" style="margin-top: 8px">
                  <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%;float: left">{{ row.f_sendtime }}</p>
                </div>

                <div class="col-xs-12" style="margin-top: 8px">
                  <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%;float: left">{{ row.f_content }}</p>
                </div>

              </div>
            </div>
          </div>
        </div>
      </list>
    </criteria-paged>
  </div>
</template>

<script>
  import { PagedList } from 'vue-client'
  import Vue from 'vue'
  import LocalPagedList from "../../plugins/LocalPagedList";

  export default {
    title: '安检公告',
    data () {
      return {
        model:new PagedList(`${this.$androidUtil.getProxyUrl()}/rs/sql/FetchAnnouncement`, 20, {f_filialeids:"this.f_filialeid", orderitem: "'id desc'"}),
        showModal:false,
        signs: [
          {label:'请选择录入状态', value:''},
          {label:'录入', value:'1'},
          {label:'非录入', value:'0'},
        ],
        user_types: [
          {label: '请选择用户类型', value: ''},
          {label: '民用', value: '民用'},
          {label: '非民用', value: '非民用'},
        ],
        f_user_states: [
          {label:'请选择档案状态', value:''},
          {label:'正常', value:'正常'},
          {label:'点火', value:'点火'},
        ],
        f_check_types: [
          {label:'请选择安检类型', value:''},
          {label:'应检', value:'应检'},
          {label:'超期', value:'超期'},
        ],
      }
    },
    ready () {
      this.model.f_filialeid="('305')"
      this.$refs.paged.$refs.cri.search()
    },
    computed: {
      reload(){
        this.$refs.paged.loadPage(this.$refs.paged.model.pageIndex)
      },
      selected () {
        return this.$refs.paged.$refs.grid.selected
      }
    },
    methods:{
      getNewOrder(){
        this.$refs.paged.$refs.cri.search()
      },
      inspect (info){
        info.id = ''
        info.f_state = '未检'
        info.f_no_checkplan = '无计划安检'
        //tag)
        this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/查询计划项表信息`,{data:{f_userid:info.f_userinfo_id}}).then((response)=>{
          //tag)
          info['f_plan_meters'] = response.data
          var pardate = {
            _this:this,
            tittle:'安检详情',
            safe:true
          }
          this.$dispatch('gotoson',pardate)
          if(info.f_user_type=='民用'){
            this.$goto('safecheck-order-v', {item: info, role: 'inspect'}, 'self', this.reload)
          }else if(info.f_user_type=='非民用'){
            this.$goto('safecheck-order-v-cli', {item: info, role: 'inspect'}, 'self', this.reload)
          }else{
            this.$showMessage('当前用户类型不明确，请联系管理员！')
          }


        }).catch((err)=>{
          this.$showMessage('网络异常，请稍后再试！')
        })
      }
    }
  }
</script>
<style>
  .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{
    border-radius: 4px ;
    border: 1px solid #499EDF;
  }
  .qxbtn-color{
    background-color: #FFFFFF;
    border-radius: 4px ;
    border: 1px solid #499EDF;
  }
</style>
