<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_order_man}}</nobr>
          </td>
          <td style="text-align: center">
            <nobr>{{row.f_address}}</nobr>
          </td>
          <td style="text-align: center">
            <nobr>{{row.f_date_leave}}</nobr>
          </td>
          <td style="text-align: center">
            <nobr>{{row.f_repairman_phone}}</nobr>
          </td>
          <td style="text-align: center">
            <button class="button_spacing button_search-1" @click="$parent.$parent.$parent.repairlist(row)">查看</button>
          </td>
        </template>
      </data-grid>
    </criteria-paged>
  </div>

</template>

<script>
import {PagedList} from 'vue-client'


export default {
  title: '置换记录',
props:['check'],
  data(){
    return{
      service: null,
      // 是否显示详情modal
      repaierShow: false,
      isshow: false,
      show: false,
      takeshow:false,   // 操作面板显示
      repair: {},
      rowOne:{},
      evaluate: {},
      curActivity:{},
      num: 14,
      wavflie : '',
      model: new PagedList('api/af-safecheck/sql/SelectReplacementListById', 100, {
        condition: {
          condition1: ` 1=1 and sub.f_workorder_type like '%置换通气单%' and sub.f_userinfo_id = '${this.check.f_userinfo_id}'`
        }
      })
    }
  },
  watch: {
    'check'() {
      if (!this.check.f_userinfo_id) {
        return this.$showMessage("置换单获取用户ID错误！！！")
      }
      this.model.search(`1=1`)
    }
  },
  ready(){
    this.model.search()
  },
  methods:{
     repairlist(row) {
       this.$resetpost('/af-telephone/rs/path/getService', {data: {id: row.id}}, {resolveMsg: null, rejectMsg: null})
         .then((res) => {
           this.service = res.data[0]
           this.$goto('new-repair-paper', {service:this.service,curActivity: this.service.serviceacitivity[this.service.serviceacitivity.length-1]}, 'self')
         })
    }
  }
}


</script>


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


