<template>
  <div class="panel panel-info auto">
    <div class="panel-heading auto" style="height: 35px">
      <h4 style="display:inline-block;margin-top: auto" title="参数:改造记录">改造记录</h4>
    </div>
    <table class="table table-striped table-bordered" v-if="this.pared==1" >
      <tbody>
      <tr>
        <td style="text-align: center;border: #E9E9E9 solid 1px;">工单编号</td>
        <td style="text-align: center;border: #E9E9E9 solid 1px;">工单状态</td>
        <td style="text-align: center;border: #E9E9E9 solid 1px;">反应内容</td>
      </tr>
      <tr v-for="row in model">
        <td  style="text-align: center;border: #E9E9E9 solid 1px;width: 33%"><span><a @click="order_show(row.OrderSN)">{{row.OrderSN}}</a></span></td>
        <td  style="text-align: center;border: #E9E9E9 solid 1px;width: 33%">{{row.OrderStatus}}</td>
        <td  style="text-align: center;border: #E9E9E9 solid 1px;width: 33%">{{row.CaseType}}</td>
      </tr>
      </tbody>
    </table>
    <div class="auto info-content" v-if="pared == 0">
      <div class="row">
        <strong>暂无改造记录</strong>
      </div>
    </div>
  </div>
</template>
<script>
  /**
   *工单信息
   *改造记录
   */

  import {HttpResetClass} from 'vue-client'

  export default {
    title: '改造记录',
    data () {
      return {
        model: {},
        pared: 0

      }
    },
    props: ['data'],
    ready () {
      this.getServiceReform()
    },
    methods: {
      order_show(val){
        this.$dispatch('order_show', val)
      },
      async getServiceReform () {
        if(this.data && this.data.f_userinfo_code){
          let data = {
            method :'GetWorkOrderList',
            sign :'567A58E0-1B91-48A9-AAF3-0A5A9C96CC39',
            CustomerNo :'',
            OrderType :'改造'
          }
          console.log('=data.f_userinfo_code=:',this.data.f_userinfo_code)
          data.CustomerNo = this.data.f_userinfo_code
          var url = 'gdServices/api/cc/WorkOrder.ashx?method=' + data.method
            +'&sign='+data.sign
            +'&CustomerNo='+data.CustomerNo
            +'&OrderType='+data.OrderType
          let http = new HttpResetClass()
          let res = await http.load('GET', url, {}, {resolveMsg: null, rejectMsg: '获取工单改造失败'})
          this.model = res.data.children
          console.log('看看改造记录', res.data,this.model,">>>length:",this.model.length)
          if (this.model.length>0) {
            this.pared = 1
          } else {
            this.pared = 0
          }
        } else{
          this.pared = 0
        }
      }
    },
    watch: {
      'data' () {
        console.log('改造记录', this.data),
        this.getServiceReform()
      }
    }
  }
</script>
<style scoped>
  img {
    margin: 6px;
  }
  div::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
  }

  div{
    -ms-overflow-style: none;
    overflow: -moz-scrollbars-none;
  }
</style>
