<template>
  <ele-modal
    :before-close="cancel"
    :close-on-click-modal="false"
    :maxable="true"
    title="首件两检报工"
    :visible.sync="visible"
    v-if="visible"
    append-to-body
    custom-class="ele-dialog-form"
    width="60vw"
  >
    <el-form
      ref="form"
      :model="form"
      :rules="rules"
      label-position="right"
      label-width="110px"
    >
      <headerTitle style="margin-top: 15px" title="基本信息" />
      <el-row :gutter="10" class="basic">
        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="工序类型：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="工序名称：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="产品编码：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="零件名称：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="零部件编码：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="批次号：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="首件编码：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>

        <el-col :lg="8" :md="12" :sm="12" :xl="8" :xs="12">
          <el-form-item label="自检报工时间：">
            <el-input v-model="form.order" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <headerTitle style="margin-top: 15px" title="过程控制" />

      <el-row>
        <el-col :span="12">
          <el-form-item label="工艺、图纸是否有效：" label-width="200px">
            <el-radio-group v-model="form.feedNeedTurnover">
              <el-radio
                :label="item.value"
                v-for="(item, i) in radioList"
                :key="i"
                >{{ item.name }}</el-radio
              >
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="设备是否完好：" label-width="200px">
            <el-radio-group v-model="form.feedNeedTurnover">
              <el-radio
                :label="item.value"
                v-for="(item, i) in radioList"
                :key="i"
                >{{ item.name }}</el-radio
              >
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="工装是否合格：" label-width="200px">
            <el-radio-group v-model="form.feedNeedTurnover">
              <el-radio
                :label="item.value"
                v-for="(item, i) in radioList"
                :key="i"
                >{{ item.name }}</el-radio
              >
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="量具是否合格并在有效期内：" label-width="200px">
            <el-radio-group v-model="form.feedNeedTurnover">
              <el-radio
                :label="item.value"
                v-for="(item, i) in radioList"
                :key="i"
                >{{ item.name }}</el-radio
              >
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="数控程序是否确认：" label-width="200px">
            <el-radio-group v-model="form.feedNeedTurnover">
              <el-radio
                :label="item.value"
                v-for="(item, i) in radioList"
                :key="i"
                >{{ item.name }}</el-radio
              >
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="原材料或半成品是否合格：" label-width="200px">
            <el-radio-group v-model="form.feedNeedTurnover">
              <el-radio
                :label="item.value"
                v-for="(item, i) in radioList"
                :key="i"
                >{{ item.name }}</el-radio
              >
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>

      <headerTitle style="margin-top: 15px" title="检查项目" />
      <ele-pro-table
        ref="table"
        row-key="id"
        :columns="columns"
        :datasource="list"
        cache-key="mes-selfInspectionRequest-20251201"
        autoAmendPage
        :need-page="false"
        @refresh="getData"
        :selection.sync="selection"
      >
      </ele-pro-table>
    </el-form>

    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="submitSelf">提交</el-button>
      <el-button type="primary" @click="saveSelf">保存</el-button>
    </span>
  </ele-modal>
</template>

<script>
  export default {
    data() {
      return {
        visible: false,
        form: { order: '', feedNeedTurnover: 1 },
        rules: {},
        radioList: [
          {
            name: '是',
            value: 1
          },
          {
            name: '否',
            value: 0
          }
        ],
        list: []
      };
    },

    computed: {
      columns() {
        return [
          {
            width: 50,
            type: 'index',
            columnKey: 'index',
            label: '序号',
            align: 'center'
          },
          {
            prop: 'preType',
            slot: 'preType',
            align: 'center',
            label: '工艺参数'
          },
          {
            prop: 'preType',
            slot: 'preType',
            align: 'center',
            label: '是否请托'
          },
          {
            prop: 'preType',
            slot: 'preType',
            align: 'center',
            label: '检验状态'
          },
          {
            prop: 'preType',
            slot: 'preType',
            align: 'center',
            label: '自检实测结果'
          },
          {
            prop: 'preType',
            slot: 'preType',
            align: 'center',
            label: '自检结果'
          },
          {
            prop: 'preType',
            slot: 'preType',
            align: 'center',
            label: '专检实测结果'
          },
          {
            prop: 'preType',
            slot: 'preType',
            align: 'center',
            label: '专检结果'
          }
        ];
      }
    },

    methods: {
      cancel() {
        this.visible = false;
      },

      open() {
        this.visible = true;
      },

      submitSelf() {},

      saveSelf() {},

      getData() {}
    }
  };
</script>

<style></style>
