<template>
    <!-- <el-dialog
      title="详情"
      width="70%"
      :close-on-click-modal="false"
      :visible.sync="visible"> -->
      <div>
        <div class="my-title">详情</div>
        <div style="margin-left: 20px;margin-right: 20px">
          <e-desc title="基本信息">
            <e-desc-item label="物料名称">{{dataForm.productName}}</e-desc-item>
            <e-desc-item label="物料编号">{{dataForm.productNumber}}</e-desc-item>
            <e-desc-item label="状态">{{dataForm.state?optionsStates.find(item => item.code === dataForm.state).value:''}}</e-desc-item>

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

            <e-desc-item label="记录说明" span="3">{{dataForm.operationRecords}}</e-desc-item>

            <e-desc-item label="检验员">{{dataForm.operation}}</e-desc-item>
            <e-desc-item label="检验时间">{{dataForm.operationTime}}</e-desc-item>

            <e-desc-item label="备注说明" span="3">{{dataForm.notes}}</e-desc-item>
          </e-desc>
          <h1 style="font-size:16px;margin:20px 0 0;">检验项目</h1>
          <el-table
            :data="dataForm.prodProductionRecordList"
            style="width: 100%"
          >
            <el-table-column prop="pageNo" label="页次/图区"> </el-table-column>
            <el-table-column prop="inspectionParam" label="检查参数">
            </el-table-column>
            <el-table-column prop="inspectionMethod" label="检验方法">
              <template slot-scope="scope">
                <span>{{
                  inspectionMethodOptions[scope.row.inspectionMethod]
                }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="allowValues" label="允许值">
            </el-table-column>
            <el-table-column prop="measureRecord1" label="实测记录1">
            </el-table-column>
            <el-table-column prop="measureRecord2" label="实测纪录2">
            </el-table-column>
            <el-table-column prop="remarks" label="备注">
            </el-table-column>
          </el-table>
        </div>

        <span slot="footer" class="dialog-footer">
          <el-button @click="onChose">取消</el-button>
        </span>
      </div>
    <!-- </el-dialog> -->
</template>

<script>
  import EDesc from '../common/e-desc'
  import EDescItem from '../common/e-desc-item'
  import { getFinishedInspectionDetail } from '@/api/check'
  export default {
    name: 'fc-detail',
    components: {
      EDesc, EDescItem
    },
    data () {
      return {
        visible: false,
        dataForm: {},
        checkList: [],
        optionsStates: [
          {
            code: '0', value: '等待'
          },
          {
            code: '1', value: '未开始'
          },
          {
            code: '2', value: '进行中'
          },
          {
            code: '3', value: '已完成'
          }
        ],
        inspectionMethodOptions: {
          1: '游标卡尺',
          2: '千分尺',
          3: '高度尺',
          4: '百分表',
          5: 'R规',
          6: '环规、塞规',
          7: '游标角度尺',
          8: '三坐标',
          9: '模具',
          10: '样板',
          11: '夹具',
          12: '目测',
          13: '组合测量',
          14: '精密测量',
          15: '敲击',
          16: '测厚仪',
          17: '其他'
        }
      }
    },
    methods: {
      onChose () {
        this.$emit('onChose')
      },
      async init (id) {
        this.visible = true
        this.dataForm = {}
        await getFinishedInspectionDetail(id).then(({data}) => {
          if (data && data.code === '200' && data.data) {
            this.dataForm = data.data
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
