<template>
  <div>
    <el-form ref="form" inline @submit.native.prevent>
      <el-row>
        <el-col :span="8">
          <el-form-item label="流程卡号：" label-width="100px">
            <el-input
              ref="codeFocus"
              v-model="cardNo"
              placeholder="请扫描流程卡号"
              @keyup.enter.native="codeKeyUp"
              style="width: 220px"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item v-limits="'RB250906'" label="设备编码：" prop="ecId">
            <!-- <equipment-card v-model="ecId" clearable /> -->
          </el-form-item>
        </el-col>
        <el-form-item>
          <el-button
            v-limits="'RB251905'"
            :disabled="qcProduceRunList.length == 0"
            style="margin-top: 4px"
            type="primary"
            @click="onSubmit"
            >保存</el-button
          >
        </el-form-item>
        <el-form-item>
          <el-button
            v-limits="'RB251907'"
            :disabled="!wpId"
            style="margin-top: 4px"
            type="danger"
            @click="deletedFun"
            >删除</el-button
          >
        </el-form-item>
      </el-row>
    </el-form>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span style="color: rgb(85, 85, 243)">绑定数据</span>
        <el-button
          v-limits="'RB250906'"
          v-if="wpId"
          style="float: right; padding: 3px 0"
          type="text"
          @click="insertEvent"
          >新增记录</el-button
        >
      </div>
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      cardNo: '',
      qcProduceRunList: [],
      prWorkPlanList: [],
      isOpen: false,
      itemObj: { procedureSet: {} },
      mtnCode: null,
      wpId: null,
      recOpen: false,
      recList: [],
      rfpId: null,
      dsRbFilePreserveList: [],
      ecId: null,
      lineType: null,
    };
  },
  methods: {
    async codeKeyUp() {
      if (this.cardNo) {
        // const res = await this.$ajax.get('prWorkPlan/getWorkOrderProcess/' + this.cardNo);
        // if (this.$ifAjax(res)) {
        //   this.prWorkPlanList = res.data;
        //   this.isOpen = true;
        // }
      }
    },
  },
};
</script>