<template>
  <div :style="{'height':needRepair?'60%':'100%'}">
    <criteria-paged :model="model" :pager="false" v-ref:paged>
      <data-grid :model="$parent.model" partial='list' class="table_sy">
        <template partial='head'>
          <tr>
            <th>
              <nobr>安检人</nobr>
            </th>
            <th>
              <nobr>安检开始时间</nobr>
            </th>
            <th>
              <nobr>安检结束时间</nobr>
            </th>
            <th>
              <nobr>安检状态</nobr>
            </th>
            <th>
              <nobr>操作</nobr>
            </th>
          </tr>
        </template>

        <template partial='body'>
          <td style="text-align: center">
            <nobr>{{row.f_checker_name}}</nobr>
          </td>
          <td style="text-align: center">
            <nobr>{{row.f_onsite_time}}</nobr>
          </td>
          <td style="text-align: center">
            <nobr>{{row.f_offsite_time}}</nobr>
          </td>
          <td style="text-align: center">
            <nobr>{{row.f_entry_status}}</nobr>
          </td>
          <td style="text-align: center">
            <button class="button_spacing button_search-1" @click='$parent.$parent.$parent.goDetail(row)'>查看</button>
          </td>
        </template>
      </data-grid>
    </criteria-paged>
  </div>
</template>

<script>
import {PagedList} from 'vue-client'
import Vue from "vue";
let asyncReady = async function (self) {
  // 获取配置信息
  try {
    let res = await Vue.resetget(`/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
    Vue.config = res.data
  } catch (error) {
    // 忽略704,文件找不到异常R
    if (error.status !== 704) {
      throw error
    }
  }
}
 export default {
   title: '安检记录',
   props: ['check'],
   data(){
     return{
       model: new PagedList('api/af-safecheck/sql/QueryCheckPaper', 100, {
         f_userinfo_code:"''",
         f_plan_id:"''",
         f_approved:"''",
         f_entry_status:"''",
         f_no_checkplan:"''",
         f_filialeid:"''",//查值 通过id
         orderitem:"'f_onsite_time'"
       }),
       model1: [{f_device_type:'111',f_item_name:'123',f_item_value:'133',f_repaire_type:'153'}]
     }

   },
   methods: {
     //查看的方法
     goDetail(row){
       row.f_upload_state = '已传'
       this.$goto('new-check-paper', {f_plan_id: row.f_check_plan_id, item: row, role: 'view'}, 'self')
     }
   },
   watch: {                                            //监听check
     'check'() {
       console.log('11111111111'+JSON.stringify(this.check))
       //console.log('11111111111'+JSON.stringify(this.model))
      // this.model.paramSource.f_userinfo_code = this.check.f_userinfo_code
       console.log('22222222222'+JSON.stringify(this.model))
       this.model.search(`tcp.f_userinfo_code = '${this.check.f_userinfo_code}'`)
     }
   },

   ready(){
     console.log("7777777777777777"+JSON.stringify(this.check)+JSON.stringify(this.model))
     this.model.search(`tcp.f_userinfo_code = '${this.check.f_userinfo_code}'`,{}) //发送请求
   },
   }


</script>


<style lang="less" scoped>
.select-error {
button {
  border-bottom: 1px solid #a94442 !important;
}
}
</style>

