<template>
  <el-dialog v-drag title="电子档案模板维护" append-to-body :modelValue="templateOpenShow" :before-close="cancel" fullscreen @opened="open">
    <div class="templateBox">
      <div class="leftTemplate">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板一</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertOneNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" size="medium" style="margin-left:10px;" @click="insertOneClick(1)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="3" />
              </tr>
              <!-- <template > -->
                <!-- :key="i" -->
                <tr v-for="(i,index) in 2" :key="index">
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" />
                  <td v-if="i ==1" />
                  <td v-if="i ==2" />
                  <td v-if="i ==2" />
                </tr>
              <!-- </template> -->
            <!-- </template> -->
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板二</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertTwoNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(2)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="4" />
              </tr>
              <template v-for="i in 3">
                <!-- :key="i" -->
                <tr v-if="i <=2" >
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" />
                  <td v-if="i ==1" />
                  <td v-if="i ==2" />
                  <td v-if="i ==2" />
                </tr>
                <!-- :key="i" -->
                <tr v-else >
                  <td />
                  <td />
                  <td colspan="2" />
                </tr>
              </template>
            <!-- </template> -->
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板三</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertThreeNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(3)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="5" />
              </tr>
              <template v-for="i in 4">
                <tr v-if="i <=2" :key="i">
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" />
                  <td v-if="i ==1" />
                  <td v-if="i ==2" />
                  <td v-if="i ==2" />
                </tr>
                <!-- :key="i" -->
                <tr  v-else >
                  <td />
                  <td />
                  <td colspan="2" />
                </tr>
              <!-- </template> -->
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板四</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertFourNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(4)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="4" />
              </tr>
              <!-- <template > -->
                <!--  -->
                <tr v-for="i in 3" :key="i">
                  <td />
                  <td />
                  <td />
                </tr>
              <!-- </template> -->
            <!-- </template> -->
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板五</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertFiveNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(5)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="6" />
            </tr>
            <template v-for="i in 5">
              <!-- :key="i" -->
              <tr v-if="i == 1" >
                <td />
                <td />
                <td />
              </tr>
              <!-- :key="i" -->
              <tr v-else >
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板六</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertSixNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(6)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="7" />
            </tr>
            <template v-for="i in 6">
              <!-- :key="i" -->
              <tr v-if="i <= 2" >
                <td />
                <td />
                <td />
              </tr>
              <!-- :key="i" -->
              <tr v-else >
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板七</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertSevenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(7)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td />
              <td />
              <td />
              <td />
            </tr>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板八</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertEightNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(8)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="3" />
            </tr>
            <template v-for="i in 2">
              <!-- :key="i" -->
              <tr >
                <td />
                <td />
                <td />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板九</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertNineNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(9)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="6" />
              </tr>
              <template v-for="i in 5">
                <!-- :key="i" -->
                <tr v-if="i <=2" >
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" />
                  <td v-if="i ==1" />
                  <td v-if="i ==2" />
                  <td v-if="i ==2" />
                </tr>
                <tr v-else :key="i">
                  <td />
                  <td />
                  <td colspan="2" />
                </tr>
              </template>
            <!-- </template> -->
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertTenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(10)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2" style="width:120px">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td />
                <td />
                <td />
                <td style="width:200px">
                  <el-switch v-model="switchData" style="display: block" active-color="#13ce66" inactive-color="#ff4949" active-text="合格" inactive-text="不合格" />
                </td>
              </tr>
            <!-- </template> -->
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十一</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertElevenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(11)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="5" />
              </tr>
              <template v-for="i in 4">
                <!-- :key="i" -->
                <tr v-if="i <=2" >
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" :rowspan="2" />
                  <td v-if="i ==1" />
                  <td v-if="i ==1" />
                  <td v-if="i ==2" />
                  <td v-if="i ==2" />
                </tr>
                <!-- :key="i" -->
                <tr v-else-if="i==3" >
                  <td />
                  <td />
                  <td colspan="2" />
                </tr>
                <!-- :key="i" -->
                <tr v-else-if="i==4" >
                  <td colspan="2" />
                  <td colspan="2" />
                </tr>
              </template>
            <!-- </template> -->
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十二</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertTwelveNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(12)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="4" />
              </tr>
              <!-- :key="i" -->
                <tr v-for="i in 3" :key="i">
                  <td v-if="i ==1" :rowspan="3" />
                  <td v-if="i ==1" :rowspan="3" />
                  <td v-if="i ==1" />
                  <td v-if="i >1" />
                </tr>
            <!-- </template> -->
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十三</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertThirteenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(13)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="11" />
            </tr>
            <template v-for="i in 10">
              <!-- :key="i" -->
              <tr >
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十四</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertFourteenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(14)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="13" />
            </tr>
            <template v-for="i in 12">
              <!-- :key="i" -->
              <tr v-if="i <=2" >
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" />
                <td v-if="i ==1" />
                <td v-if="i ==2" />
                <td v-if="i ==2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 3" >
                <td />
                <td />
                <td colspan="2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 4" >
                <td />
                <td />
                <td />
                <td />
              </tr>
              <!-- :key="i" -->
              <tr v-else >
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十五</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertFifteenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(15)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="15" />
            </tr>
            <template v-for="i in 14">
              <!-- :key="i" -->
              <tr v-if="i <=2" >
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" />
                <td v-if="i ==1" />
                <td v-if="i ==2" />
                <td v-if="i ==2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 3" >
                <td />
                <td />
                <td colspan="2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 4 || i == 5" >
                <td v-if="i == 4" :rowspan="2" />
                <td v-if="i == 4" :rowspan="2" />
                <td :colspan="2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 6" >
                <td />
                <td />
                <td />
                <td />
              </tr>
              <tr v-else :key="i">
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十六</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertSixteenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(16)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="17" />
            </tr>
            <template v-for="i in 16">
              <!-- :key="i" -->
              <tr v-if="i <=2" >
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" />
                <td v-if="i ==1" />
                <td v-if="i ==2" />
                <td v-if="i ==2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 3" >
                <td />
                <td />
                <td colspan="2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 4" >
                <td />
                <td />
                <td />
                <td />
              </tr>
              <!-- :key="i" -->
              <tr v-else >
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十七</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertSeventeenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(17)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="9" />
            </tr>
            <template v-for="i in 8">
              <!-- :key="i" -->
              <tr v-if="i <=2" >
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" :rowspan="2" />
                <td v-if="i ==1" />
                <td v-if="i ==1" />
                <td v-if="i ==2" />
                <td v-if="i ==2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 3" >
                <td />
                <td />
                <td colspan="2" />
              </tr>
              <!-- :key="i" -->
              <tr v-else-if="i == 4" >
                <td />
                <td />
                <td />
                <td />
              </tr>
              <!-- :key="i" -->
              <tr v-else >
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十八</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertEighteenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(18)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td />
              <td />
              <td colspan="3" />
            </tr>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板十九</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertThirteenNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(19)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="4">实际参数</td>
            </tr>
            <tr>
              <td rowspan="13" />
            </tr>
            <template v-for="i in 12">
              <!-- :key="i" -->
              <tr >
                <td />
                <td colspan="3" />
              </tr>
            </template>
          </table>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="color:rgb(85, 85, 243)">模板二十</span>
            <span style="float: right">
              插入行数:
              <el-input v-model="insertTwentyNum" style="width:90px" placeholder="请输入内容" />
              <el-button type="primary" style="margin-left:10px;" @click="insertOneClick(20)">插入模板</el-button>
            </span>
          </div>
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
            </tr>
            <!-- <template> -->
              <tr>
                <td rowspan="9" />
              </tr>
              <template v-for="i in 8">
                <!-- :key="i" -->
                <tr >
                  <td />
                  <td />
                  <td />
                </tr>
              </template>
            <!-- </template> -->
          </table>
        </el-card>
      </div>
      <div class="rightPage">
        <div class="submitClass">
          <el-button type="primary" @click="saveClick(false)">保存</el-button>
          <el-button type="primary" @click="saveClick(true)">保存并退出</el-button>
        </div>
        <div class="cusTable">
          <table id="cus-table" cellspacing="0" style="width:100%">
            <tr>
              <td>槽号序号</td>
              <td>槽位/工步</td>
              <td colspan="2">工艺要求</td>
              <td colspan="2">实际参数</td>
              <td>操作</td>
            </tr>
            <template v-for="(items, listIndex) in rightList">
              <!-- 模板一 -->
              <template v-if="items.rfpsType == 1">
                <tr :key="listIndex">
                  <td rowspan="3">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="3">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==0" :rowspan="2">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                  </tr>
                </template>
              </template>
              <!-- 模板二 -->
              <template v-else-if="items.rfpsType == 2">
                <tr :key="listIndex">
                  <td rowspan="4">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="4">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                    <td v-if="index ==0" :rowspan="3">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                    <td v-if="index > 1">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index > 1">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index > 1" colspan="2" />
                  </tr>
                </template>
              </template>
              <!-- 模板三 -->
              <template v-else-if="items.rfpsType == 3">
                <tr :key="listIndex">
                  <td rowspan="5">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="5">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td v-if="index == 0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index == 0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index == 0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index == 0" />
                    <td v-if="index == 0" :rowspan="4">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                    <td v-if="index == 1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index == 1" />
                    <td v-if="index > 1">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index > 1">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index > 1" colspan="2" />
                  </tr>
                </template>
              </template>
              <!-- 模板四 -->
              <template v-else-if="items.rfpsType == 4">
                <tr :key="listIndex">
                  <td rowspan="4">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="4">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                    <td v-if="index ==0" :rowspan="3">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板五 -->
              <template v-else-if="items.rfpsType == 5">
                <tr :key="listIndex">
                  <td rowspan="6">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="6">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index == 0" :key="listIndex+''+index">
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                    <td rowspan="6">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                  </tr>
                </template>
              </template>
              <!-- 模板六 -->
              <template v-else-if="items.rfpsType == 6">
                <tr :key="listIndex">
                  <td rowspan="7">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="7">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index <= 1" :key="listIndex+''+index">
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                    <td v-if="index ==0" :rowspan="6">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                  </tr>
                </template>
              </template>
              <!-- 模板七 -->
              <template v-else-if="items.rfpsType == 7">
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="items.slotIndex" />
                    </td>
                    <td>
                      <el-input v-model="items.slotName" />
                    </td>
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                    <td>
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板八 -->
              <template v-else-if="items.rfpsType == 8">
                <tr :key="listIndex">
                  <td rowspan="3">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="3">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                    <td v-if="index ==0" :rowspan="2">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板九 -->
              <template v-else-if="items.rfpsType == 9">
                <tr :key="listIndex">
                  <td rowspan="6">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="6">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index <=1" :key="listIndex+''+index">
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                    <td v-if="index ==0" :rowspan="5">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                  </tr>
                </template>
              </template>
              <!-- 模板十 -->
              <template v-else-if="items.rfpsType == 10">
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="items.slotIndex" />
                    </td>
                    <td>
                      <el-input v-model="items.slotName" />
                    </td>
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2">
                      <el-switch v-model="item.qualified" disabled style="display: block" active-color="#13ce66" inactive-color="#ff4949" active-text="合格" inactive-text="不合格" />
                    </td>
                    <td>
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板十一 -->
              <template v-else-if="items.rfpsType == 11">
                <tr :key="listIndex">
                  <td rowspan="5">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="5">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index <=1" :key="listIndex+''+index">
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                    <td v-if="index ==0" :rowspan="4">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index==2" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index==3" >
                    <td colspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="2" />
                  </tr>

                </template>
              </template>
              <!-- 模板十二 -->
              <template v-else-if="items.rfpsType == 12">
                <tr :key="listIndex">
                  <td rowspan="4">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="4">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td v-if="index ==0" :rowspan="3">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="3">
                      <el-input v-model="item.ask" />
                    </td>
                    <td>
                      <el-input v-model="item.paramName" />
                    </td>
                    <td />
                    <td v-if="index ==0" :rowspan="3">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板十三 -->
              <template v-else-if="items.rfpsType == 13">
                <tr :key="listIndex">
                  <td rowspan="11">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="11">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                    <td v-if="index ==0" :rowspan="10">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板十四 -->
              <template v-else-if="items.rfpsType == 14">
                <tr :key="listIndex">
                  <td rowspan="13">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="13">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index <=1" :key="listIndex+''+index">
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                    <td v-if="index ==0" :rowspan="12">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 2" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 3" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td>
                      <el-input v-model="item.paramName" />
                    </td>
                    <td />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                  </tr>
                </template>
              </template>
              <!-- 模板十五 -->
              <template v-else-if="items.rfpsType == 15">
                <tr :key="listIndex">
                  <td rowspan="15">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="15">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index <=1" :key="listIndex+''+index">
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                    <td v-if="index ==0" :rowspan="14">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 2" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 3 || index == 4" >
                    <td v-if="index == 3" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index == 3" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td :colspan="2" />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 5" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td>
                      <el-input v-model="item.paramName" />
                    </td>
                    <td />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                  </tr>
                </template>
              </template>
              <!-- 模板十六 -->
              <template v-else-if="items.rfpsType == 16">
                <tr :key="listIndex">
                  <td rowspan="17">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="17">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index <=1" :key="listIndex+''+index">
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                    <td v-if="index ==0" :rowspan="16">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 2" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 3" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td>
                      <el-input v-model="item.paramName" />
                    </td>
                    <td />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                  </tr>
                </template>
              </template>
              <!-- 模板十七 -->
              <template v-else-if="items.rfpsType == 17">
                <tr :key="listIndex">
                  <td rowspan="9">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="9">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <tr v-if="index <=1" :key="listIndex+''+index">
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.detailName" />
                    </td>
                    <td v-if="index ==0" :rowspan="2">
                      <el-input v-model="item.ask" />
                    </td>
                    <td v-if="index ==0">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==0" />
                    <td v-if="index ==1">
                      <el-input v-model="item.paramName" />
                    </td>
                    <td v-if="index ==1" />
                    <td v-if="index ==0" :rowspan="8">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 2" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else-if="index == 3" >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td>
                      <el-input v-model="item.paramName" />
                    </td>
                    <td />
                  </tr>
                  <!-- :key="listIndex+''+index" -->
                  <tr v-else >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                  </tr>
                </template>
              </template>
              <!-- 模板十八 -->
              <template v-else-if="items.rfpsType == 18">
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="items.slotIndex" />
                    </td>
                    <td>
                      <el-input v-model="items.slotName" />
                    </td>
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                    <td>
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板十九 -->
              <template v-else-if="items.rfpsType == 19">
                <tr :key="listIndex">
                  <td rowspan="13">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="13">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td colspan="3" />
                    <td v-if="index ==0" :rowspan="13">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
              <!-- 模板二十 -->
              <template v-else-if="items.rfpsType == 20">
                <tr :key="listIndex">
                  <td rowspan="9">
                    <el-input v-model="items.slotIndex" />
                  </td>
                  <td rowspan="9">
                    <el-input v-model="items.slotName" />
                  </td>
                </tr>
                <template v-for="(item,index) in items.childrenList">
                  <!-- :key="listIndex+''+index" -->
                  <tr >
                    <td>
                      <el-input v-model="item.detailName" />
                    </td>
                    <td>
                      <el-input v-model="item.ask" />
                    </td>
                    <td colspan="2" />
                    <td v-if="index ==0" :rowspan="8">
                      <el-button type="danger" @click="deleteRow(listIndex)">删除</el-button>
                    </td>
                  </tr>
                </template>
              </template>
            </template>
          </table>
        </div>
      </div>
    </div>
  </el-dialog>
</template>
<script>
export default {
  props: {
    templateOpen: {
      type: Boolean,
      default: false
    },
    rfpId: {
      type: Number,
      default: null
    }
  },
  data() {
    return {
      rightList: [],
      insertIndex: 0,
      insertOneNum: 1,
      insertTwoNum: 1,
      insertThreeNum: 1,
      insertFourNum: 1,
      insertFiveNum: 1,
      insertSixNum: 1,
      insertSevenNum: 1,
      insertEightNum: 1,
      insertNineNum: 1,
      insertTenNum: 1,
      insertElevenNum: 1,
      insertTwelveNum: 1,
      insertThirteenNum: 1,
      insertFourteenNum: 1,
      insertFifteenNum: 1,
      insertSixteenNum: 1,
      insertSeventeenNum: 1,
      insertEighteenNum: 1,
      insertNineteenNum: 1,
      insertTwentyNum: 1,
      deleteIds: [],
      switchData: true,
      templateOpenShow:false
    };
  },
  mounted(){
    this.templateOpenShow = this.templateOpen
  },
  methods: {
    open() {
      this.getDate();
    },
    getDate() {
      // this.$ajax
      //   .get('dsRbFilePreserveSlot/getByRfpId/' + this.rfpId)
      //   .then((res) => {
      //     if (this.$ifAjax(res)) {
      //       const { preserveSlotList, insertIndex } = res.data;
      //       this.rightList = preserveSlotList;
      //       this.insertIndex = insertIndex;
      //     }
      //   });
    },
    async insertOneClick(type) {
      if (type == 1) {
        for (var i = 0; i < this.insertOneNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 1,
            childrenList: [
              { detailName: '', detailIndex: 1, ask: '' },
              { detailName: '', detailIndex: 2, ask: '' }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 2) {
        for (var i = 0; i < this.insertTwoNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 2,
            childrenList: [
              { detailName: '', detailIndex: 1, ask: '' },
              { detailName: '', detailIndex: 2, ask: '' },
              { detailName: '', detailIndex: 3, ask: '' }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 3) {
        for (var i = 0; i < this.insertThreeNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 3,
            childrenList: [
              { detailName: '', detailIndex: 1, ask: '' },
              { detailName: '', detailIndex: 2, ask: '' },
              { detailName: '', detailIndex: 3, ask: '' },
              { detailName: '', detailIndex: 4, ask: '' }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 4) {
        for (var i = 0; i < this.insertFourNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 4,
            childrenList: [
              { detailName: '', detailIndex: 1, ask: '' },
              { detailName: '', detailIndex: 2, ask: '' },
              { detailName: '', detailIndex: 3, ask: '' }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 5) {
        for (var i = 0; i < this.insertFiveNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 5,
            childrenList: [
              { detailName: '', detailIndex: 1, ask: '' },
              { detailName: '', detailIndex: 2, ask: '' },
              { detailName: '', detailIndex: 3, ask: '' },
              { detailName: '', detailIndex: 4, ask: '' },
              { detailName: '', detailIndex: 5, ask: '' }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      }
      if (type == 6) {
        for (var i = 0; i < this.insertSixNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 6,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 6,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 7) {
        for (var i = 0; i < this.insertSevenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 7,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 8) {
        for (var i = 0; i < this.insertEightNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 8,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 9) {
        for (var i = 0; i < this.insertNineNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 9,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 10) {
        for (var i = 0; i < this.insertTenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 10,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                qualified: true,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 11) {
        for (var i = 0; i < this.insertElevenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 11,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 12) {
        for (var i = 0; i < this.insertTwelveNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 12,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 13) {
        for (var i = 0; i < this.insertThirteenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 13,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 6,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 7,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 8,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 9,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 10,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 14) {
        for (var i = 0; i < this.insertFourteenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 14,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 6,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 7,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 8,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 9,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 10,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 11,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 12,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 15) {
        for (var i = 0; i < this.insertFifteenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 15,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 6,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 7,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 8,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 9,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 10,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 11,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 12,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 13,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 14,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 16) {
        for (var i = 0; i < this.insertSixteenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 16,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 6,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 7,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 8,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 9,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 10,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 11,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 12,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 13,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 14,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 15,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 16,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 17) {
        for (var i = 0; i < this.insertSeventeenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 17,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 6,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 7,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 8,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 18) {
        for (var i = 0; i < this.insertEighteenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 18,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      } else if (type == 19) {
        for (var i = 0; i < this.insertNineteenNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 19,
            childrenList: [
              {
                detailName: '',
                detailIndex: 1,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 2,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 3,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 4,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 5,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 6,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 7,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 8,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 9,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 10,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 11,
                ask: ''
              },
              {
                detailName: '',
                detailIndex: 12,
                ask: ''
              }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      }else if (type == 20) {
        for (var i = 0; i < this.insertFourNum; i++) {
          const obj = {
            slotName: '',
            slotIndex: this.rightList.length,
            insertIndex: this.insertIndex,
            rfpsType: 20,
            childrenList: [
              { detailName: '', detailIndex: 1, ask: '' },
              { detailName: '', detailIndex: 2, ask: '' },
              { detailName: '', detailIndex: 3, ask: '' },
              { detailName: '', detailIndex: 4, ask: '' },
              { detailName: '', detailIndex: 5, ask: '' },
              { detailName: '', detailIndex: 6, ask: '' },
              { detailName: '', detailIndex: 7, ask: '' },
              { detailName: '', detailIndex: 8, ask: '' }
            ]
          };
          this.rightList.push(obj);
          this.insertIndex++;
        }
      }
    },
    deleteRow(index) {
      const row = this.rightList[index];
      if (row.rfpsId) {
        this.deleteIds.push(row.rfpsId);
      }
      this.rightList.splice(index, 1);
    },
    saveClick(flag) {
      this.$ajax
        .post('dsRbFilePreserveSlot/saveOrEdit', {
          rfpId: this.rfpId,
          submitList: this.rightList,
          deleteIds: this.deleteIds
        })
        .then((res) => {
          if (this.$ifAjax(res)) {
            this.$message.success('保存成功');
            if (flag) {
              this.cancel(true);
            } else {
              this.getDate();
            }
          }
        });
    },
    cancel(isRefresh) {
      this.rightList = [];
      this.$emit('cancel', isRefresh == true);
    }
  }
};
</script>
<style lang="scss" scoped>
.templateBox {
  display: flex;
  .leftTemplate {
    width: 34%;
    max-height: 88vh;
    overflow: auto;
    .box-card {
      margin-bottom: 10px;
    }
  }
  .rightPage {
    width: 65%;
    margin-left: 1%;
    max-height: 80vh;
    position: relative;
    .submitClass {
      position: absolute;
      right: 4px;
      top: 4px;
      height: 28px;
    }
    .cusTable {
      margin-top: 40px;
      max-height: 85vh;
      overflow: auto;
      padding-bottom: 40px;
    }
  }
}
.clearfix{
  height: 50px;
}
table {
  tr {
    page-break-inside: avoid;
  }
  td {
    width: 168px;
    height: 30px;
    border: 1px solid #000;
    background: transparent;
    color: #000;
    font-size: 14px;
    text-align: center;
    padding: 0;
    margin: 0;
    :deep(.el-input__inner) {
      max-width: 80%;
      text-align: center;
    }
  }
}
</style>
