<template>
  <el-dialog
    title="查看"
    width="70%"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <div style="margin-left: 20px;margin-right: 20px">
      <e-desc title="基本信息" column="3">
        <e-desc-item label="产品名称">{{dataForm.productName}}</e-desc-item>
        <e-desc-item label="产品编号" span="2">{{dataForm.prodCode}}</e-desc-item>

        <e-desc-item label="工艺名称">{{dataForm.techName}}</e-desc-item>
        <e-desc-item label="工序名称" span="2">{{dataForm.nodeName}}</e-desc-item>

        <e-desc-item label="移交发起人">{{dataForm.creatorName}}</e-desc-item>
        <e-desc-item label="移交接收人">{{dataForm.transferUserName}}</e-desc-item>
        <e-desc-item label="移交时间">{{dataForm.createTime}}</e-desc-item>

        <e-desc-item label="移交说明" span="3">{{dataForm.transferExplain}}</e-desc-item>
      </e-desc>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">返回</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import {getTransferDetail} from '@/api/task'
  import EDesc from '../common/e-desc'
  import EDescItem from '../common/e-desc-item'
  export default {
    name: 'handover-records-details',
    components: {
      EDesc, EDescItem
    },
    data () {
      return {
        visible: false,
        id: 0,
        dataForm: {}
      }
    },
    methods: {
      async init (id) {
        this.visible = true
        this.id = id || 0
        this.dataForm = {}
        this.getDetails()
      },
      getDetails () {
        getTransferDetail(this.id).then(({data}) => {
          if (data && data.code === '200' && data.data) {
            this.dataForm = data.data
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
