<!-- 标准管理-测试任务维护 -->
<template>
  <div class="examination">
    <div class="common-head-search">
        <span>测试任务名称</span>
        <el-input v-model="search.taskName" size="small" @keyup.enter.native="searchData" placeholder="请输入查询内容" style="width: 200px;margin-right: 10px;"></el-input>
        <span>测试计划编号</span>
        <el-input v-model="search.testPlanNo" size="small" @keyup.enter.native="searchData" placeholder="请输入查询内容" style="width: 200px;margin-right: 10px;"></el-input>
        <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
        <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="reset">重置</el-button>
        <el-button icon="el-icon-back" type="goon" plain v-show="backButton" size="mini" @click="toBack">返回样品模板</el-button>
    </div>
    <el-row>
      <el-col :span='12'>
        <div>
          <div style="padding-top: 10px;padding-left: 30px;">
            <div class="common-title-name" style="display:inline-block;margin-right:0">
              <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />测试任务集
            </div>
            <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="dialogTableVisible2 = true">新增</el-button>
            <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData4">修改</el-button>
            <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="copyData4">复制</el-button>
            <el-button icon="el-icon-remove-outline" type="danger" size="mini" @click="deleteData4">停用</el-button>
            <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData4">启用</el-button>
          </div>
        </div>
        <div class="common-table-div">
          <el-table v-loading="dataLoading4" ref="dataTable4" border :height="heightTop" @row-click="handleCurrentChange2" highlight-current-row @selection-change="handleSelectionChange4"
          :data="table.list4" :icore-filter-flag="icoreFilterFlag"
          :header-cell-style="tableHeaderCellStyle" :row-class-name="tableRowClassName4" :summary-method="getSummaries" show-summary>
            <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
            <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="taskNo" label="测试任务编号" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="taskName" label="测试任务名称" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="testPlanNo" label="测试计划编号" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="testPlanName" label="测试计划名称" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="testTypeName" label="测试类型" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag1" label="数据状态" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="createTime" label="创建时间" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="updateTime" label="修改时间" align="center"></el-table-column>
         </el-table>
        </div>
        <div class="common-foot-style">
          <el-pagination v-loading="dataLoading4" @size-change="pageSizeChange4" @current-change="pageCurrentChange4"
            :current-page="page4.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="page4.pageSize" layout="total, sizes, prev, pager, next, jumper"
            :total="page4.totalPage" background>
          </el-pagination>
        </div>
      </el-col>
      <el-col :span='12'>
        <div style="padding-top: 10px;padding-left: 30px;">
          <div class="common-title-name" style="display:inline-block;margin-right:0">
            <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />测试任务
          </div>
          <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addPlan">新增</el-button>
          <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData">编辑</el-button>
          <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteTest" style="margin-right：60px">删除</el-button>
          <el-button icon="el-icon-remove-outline" type="danger" :loading='btnLoading1' size="mini" @click="deleteData">停用</el-button>
          <el-button icon="el-icon-check" type="goon" size="mini" :loading='btnLoading1' @click="recoverData" style="margin-right：60px">启用</el-button>
        </div>
        <div class="common-table-div">
          <el-table v-loading="dataLoading" ref="dataTable" border :height="heightTop" highlight-current-row @current-change="handleCurrentChange" @selection-change="handleSelectionChange" :data="table.list" :icore-filter-flag="icoreFilterFlag"
          :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName" :summary-method="getSummaries" show-summary>
            <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
            <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testItemNo" label="测试项目编号" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testItemName" label="测试项目名称" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="doOrder" label="执行顺序" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="itemTypeName" label="项目类型" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="testCnt" label="测试次数" align="center"></el-table-column>
            <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="testLocate" label="测试位置" align="center"></el-table-column> -->
            <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag1" label="数据状态" align="center"></el-table-column> -->
            <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="pointName" label="作业点" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="testPostName" label="测试岗位" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="ruleName" label="业务规则" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="110px" prop="eqpTypeName" label="测试设备类型" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="testLimit" label="测试时限" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isTest1" label="是否免检" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isCtrlName" label="是否控制" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isAutoName" label="是否执行" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isSonName" label="是否子任务" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isSynName" label="是否同步" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isRefer1" label="是否引用" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="memo" label="备注" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="createTime" label="创建时间" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人" align="center"></el-table-column>
            <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="updateTime" label="修改时间" align="center"></el-table-column>
          </el-table>
        </div>
        <div class="common-foot-style">
          <el-pagination v-loading="dataLoading" @size-change="pageSizeChange" @current-change="pageCurrentChange"
            :current-page="page.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
            :total="page.totalPage" background>
          </el-pagination>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col>
        <div>
    <template>
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
    <!-- <el-tab-pane label="分析项目指标" name="first">
       <div>
    <div class="common-title-div">
      <div class="common-title-name">
        <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
        分析项目指标
      </div>
      <div>
      <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addData2">新增</el-button>
      <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData2">修改</el-button>
      <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteIndex">删除</el-button>
      </div>
    </div>
    <div class="common-table-div">
       <el-table v-loading="dataLoading2" ref="dataTable2" border :height="heightTop" highlight-current-row @selection-change="handleSelectionChange2" :data="table.list2" :icore-filter-flag="icoreFilterFlag2"
       :header-cell-style="tableHeaderCellStyle" :row-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
        <el-table-column type="index" label="NO" fixed="left" align="center">
        </el-table-column>
        <el-table-column type="selection" width="55" align="center" fixed="left"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testItemNo" label="测试任务编码" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testItemName" label="测试任务名称" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemNo" label="分析项目编号" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemName" label="分析项目名称" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="formulaName" label="计算公式" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemAlias" label="分析项目别名" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="unitName" label="数值单位" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="defaultValue" label="默认值" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="dspOrder" label="显示顺序" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="dataTypeName" label="数据类型" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="reviseRuleName" label="修约规则" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="anlyCnt" label="分析次数" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="outputTypeName" label="输出类型" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="minSign" label="下限符" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="minValue" label="下限值" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="maxSign" label="上限符" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="maxValue" label="上限值" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="isReport1" label="是否报出" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="isRare1" label="是否贵重" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="isLogin1" label="是否必检" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="isAlarm1" label="是否报警" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="isCompute1" label="是否计算" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="isMid1" label="是否中间项" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="memo" label="备注" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="createTime" label="创建时间" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="updateTime" label="修改时间" align="center"></el-table-column>
      </el-table>
    </div>
    </div>
    </el-tab-pane> -->
    <el-tab-pane label="方法标准" name="first">
    <div>
    <div class="common-title-div">
      <div class="common-title-name">
        <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
        方法标准
      </div>
      <div>
      <!-- <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addData3">新增</el-button> -->
      <el-button icon="el-icon-circle-plus-outline" type="goon" @click="confirmData" size="mini">确认</el-button>
      <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteData3">停用</el-button>
      <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData3">启用</el-button>
      </div>
    </div>
    <div class="common-table-div">
       <el-table v-loading="dataLoading3" ref="dataTable3" border :height="heightTop" highlight-current-row @selection-change="handleSelectionChange3" :data="table.listbz" :icore-filter-flag="icoreFilterFlag3"
       :header-cell-style="tableHeaderCellStyle" :row-class-name="tableRowClassName3" :summary-method="getSummaries" show-summary>
        <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
        <el-table-column type="selection" width="55" align="center" fixed="left"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testItemName" label="测试项目名称" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="stdNo" label="标准号" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="stdName" label="标准名称" align="center"></el-table-column>
        <!-- <el-table-column sortable width="120px" prop="stdDesc" label="方法描述" align="center"></el-table-column> -->
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlag1" label="数据状态" align="center">
          <!-- <template slot-scope="scope">
              <span v-if="scope.row.validFlag == 1">有效</span>
              <span v-else-if="scope.row.validFlag == 0">无效</span>
          </template> -->
        </el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="dspOrder" label="显示顺序" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="memo" label="备注" align="center"></el-table-column>
        <el-table-column  sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间" align="center"></el-table-column>
        <el-table-column  sortable :show-overflow-tooltip="true" min-width="80px" prop="createMan" label="创建人" align="center"></el-table-column>
        <el-table-column  sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间" align="center"></el-table-column>
        <el-table-column  sortable :show-overflow-tooltip="true" min-width="80px" prop="updateMan" label="修改人" align="center"></el-table-column>
      </el-table>
    </div>
    <!-- <div class="common-foot-style">
        <el-pagination v-loading="dataLoading3" @size-change="pageSizeChange3" @current-change="pageCurrentChange3"
          :current-page="pagebz.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="pagebz.pageSize" layout="total, sizes, prev, pager, next, jumper"
          :total="pagebz.totalPage" background>
        </el-pagination>
    </div> -->
    </div>
    </el-tab-pane>
    </el-tabs>
    </template>
    </div>
      </el-col>
    </el-row>
    <el-dialog @close="closeDialog" :close-on-click-modal='false' :show-close='false' :visible.sync="dialogTableVisible2">
        <div slot="title" class="titleBox">
        <i :class="tableType2 === 0? 'el-icon-document':'el-icon-edit-outline'" style="font-size: 20px"></i>
        <span style="margin-left:10px;font-size:18px">{{tableTypeDsc2}}</span>
        </div>
        <el-form :model="formData2" label-width="90px" :rules="monitorRules2" ref="monitorForm2" >
          <el-row>
            <el-col>
              <el-form-item prop="testPlanNo" v-if="tableType2 == 0" label="测试计划名称">
               <el-select v-model="formData2.testPlanNo" filterable clearable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in testPlanNameType" :key="index" :label="item.testPlanName"
                    :value="item.testPlanNo">
                  </el-option>
                </el-select>
               </el-form-item>
              <el-form-item prop="testPlanName" v-if="tableType2 == 1" label="测试计划名称">
                <el-input v-model="formData2.testPlanName" readonly disabled size="small" style="width: 100%;"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col>
              <el-form-item prop="taskName" label="测试任务名称">
                <el-input v-model="formData2.taskName" size="small" style="width: 100%;"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col>
              <el-form-item prop="testTypeCode" label="检验类型">
               <el-select v-model="formData2.testTypeCode" filterable clearable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in testTypeNameType" :key="index" :label="item.baseName"
                    :value="item.baseCode">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col>
              <el-form-item prop="memo" label="备注">
               <el-input v-model="formData2.memo" size="small" style="width: 100%;" placeholder="请输入"></el-input>
               </el-form-item>
            </el-col>
          </el-row>
        </el-form>
       <span slot="footer" v-if="tableType2 === 0" class="dialog-footer">
        <el-button type="goon" size="mini" icon="el-icon-check" @click="addDataTest()">下一步</el-button>
        <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button>
        <!-- <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button> -->
       </span>
       <span slot="footer" v-if="tableType2 === 1" class="dialog-footer">
        <el-button type="goon" size="mini" icon="el-icon-check" @click="modifyDataTest()">确定</el-button>
        <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button>
        <!-- <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button> -->
       </span>
    </el-dialog>
    <el-dialog @close="closeDialog" :close-on-click-modal='false' :show-close='false' width='80%' :visible.sync="dialogTableVisible3" customClass="boxWidth33">
        <div slot="title" class="titleBox">
        <i class='el-icon-document' style="font-size: 20px"></i>
        <!-- <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/more.png' /> -->
        <span style="margin-left:10px;font-size:18px">{{tableTypeDsc3}}</span>
        </div>
        <el-row>
          <el-col :span='10'>
            <div>
                <div class="common-title-name">
                     <img style="width: 25px; height: 25px; margin-left: 20px" src='../../../../assets/img/imgScreen/logo.png' />
                     测试任务
                     <span style="font-size: 16px; margin-left: 30px">{{testNumber}}/{{pageTest.totalPage}}</span>
                     <el-input v-model="testItemName" size="small" placeholder="请输入查询内容" @keyup.enter.native="getDataLists()" style="width: 150px"></el-input>
                </div>
                <div class="common-table-div">
                     <el-table v-loading="dataLoading" ref="dataTable" border :height="heightTop" highlight-current-row @selection-change="handleSelectionTest" :data="table.listTest"
                     :header-cell-style="tableHeaderCellStyle" :icore-filter-flag="icoreFilterFlag">
                      <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
                      <el-table-column type="selection" width="45" align="center"></el-table-column>
                      <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="testItemName" label="测试名称" align="center"></el-table-column>
                      <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="itemTypeName" label="项目类型" align="center"></el-table-column>
                     </el-table>
                </div>
                <div style="margin-top: 20px; margin-left: 10px">
                    <el-pagination  @size-change="pageSizeTest" @current-change="pageCurrentTest"
                      :current-page="pageTest.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="pageTest.pageSize" layout="total, sizes, prev, pager, next"
                      :total="pageTest.totalPage" background>
                    </el-pagination>
                </div>
            </div>
          </el-col>
          <el-col :span='4'>
            <div style="margin-top: 70px;margin-left: 20px">
              <el-button type="goon" size="mini" icon="el-icon-arrow-right" @click="rightData">右移</el-button>
              <el-button type="goon" size="mini" icon="el-icon-arrow-left" @click="leftData" style="margin-top: 20px">删除</el-button>
              <el-button type="goon" size="mini" icon="el-icon-arrow-up" @click="upData" style="margin-top: 20px">上移</el-button>
              <el-button type="goon" size="mini" icon="el-icon-arrow-down" @click="downData" style="margin-top: 20px">下移</el-button>
            </div>
          </el-col>
          <el-col :span='10'>
            <div>
                <div class="common-title-name">
                     <img style="width: 25px; height: 25px; margin-left: 20px" src='../../../../assets/img/imgScreen/logo.png' />
                     选择任务
                     <span style="font-size: 16px; margin-left: 70px">{{selectNumber}}/{{table.list3.length}}</span>
                </div>
                <div class="common-table-div">
                     <el-table v-loading="dataLoading2" ref="dataTable2" border :height="300" highlight-current-row @selection-change="handleSelectionTest2" :data="table.list3"
                     :header-cell-style="tableHeaderCellStyle">
                      <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
                      <el-table-column type="selection" width="45" align="center"></el-table-column>
                      <el-table-column min-width="120px" :show-overflow-tooltip="true" prop="testItemName" label="测试名称" align="center"></el-table-column>
                      <el-table-column min-width="120px" :show-overflow-tooltip="true" prop="itemTypeName" label="项目类型" align="center"></el-table-column>
                     </el-table>
                </div>
                <!-- <div class="common-foot-style">
                    <el-pagination v-loading="dataLoading2" @size-change="pageSizeChange2" @current-change="pageCurrentChange2"
                      :current-page="page2.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="page2.pageSize" layout="total, sizes, prev, pager, next, jumper"
                      :total="page2.totalPage" background>
                    </el-pagination>
                </div> -->
            </div>
          </el-col>
        </el-row>
        <!-- <div style="display: flex; margin-top: 20px">

            <div style="margin-top: 70px;margin-left: 20px">

            </div>

        </div> -->
      <span slot="footer" class="dialog-footer">
         <!-- <el-button type="goon" size="mini" icon="el-icon-check" @click="addData()">确定</el-button> -->
        <el-button type="goon" size="mini" icon="el-icon-check" @click="dialogTableVisible2 = true;dialogTableVisible3 = false">上一步</el-button>
        <el-button type="goon" size="mini" icon="el-icon-check" @click="addDataCase()">下一步</el-button>
        <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button>
      </span>
    </el-dialog>
    <el-dialog @close="closeDialog" :close-on-click-modal='false' :show-close='false' :visible.sync="dialogTableVisible4" customClass="customWidth_standas">
        <div slot="title" class="titleBox">
        <i :class="tableType4 === 0? 'el-icon-document':'el-icon-edit-outline'" style="font-size: 20px"></i>
        <span style="margin-left:10px;font-size:18px">{{tableTypeDsc4}}</span>
        </div>
        <el-form :model="formData4" label-width="80px" :rules="monitorRules4" ref="monitorForm4">
          <el-row>
            <el-col :span='12'>
              <el-form-item  prop="testPlanName" label="测试计划">
                <el-input v-model="formData4.testPlanName" readOnly disabled size="small" style="width: 100%;"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span='12'>
              <el-form-item  prop="taskName" label="测试任务">
                <el-input v-model="formData4.taskName" readOnly disabled size="small" style="width: 100%;"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span='12'>
              <el-form-item prop="indexName" label="指标名称">
                <el-input v-model="formData4.indexName" placeholder="请输入" size="small" style="width: 100%;"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span='12'>
              <el-form-item label="产品标准">
                <el-select v-model="formData4.stdNo" filterable clearable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in stdNameType" :key="index" :label="item.stdName"
                    :value="item.stdNo">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span='12'>
              <el-form-item label="牌号">
                <el-select v-model="formData4.gradeNo" filterable clearable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in gradeNameType" :key="index" :label="item.gradeName"
                    :value="item.gradeNo">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span='12'>
              <el-form-item label="判定类型">
                <el-select v-model="formData4.judgeTypeCode" filterable clearable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in judgeTypeNameType" :key="index" :label="item.baseName"
                    :value="item.baseCode">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span='24'>
              <el-form-item prop="memo" label="备注">
               <el-input v-model="formData4.memo" size="small" style="width: 100%;" placeholder="请输入"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
         </el-form>
       <span slot="footer" class="dialog-footer">
        <el-button type="goon" size="mini" icon="el-icon-check" @click="dialogTableVisible3 = true;dialogTableVisible4 = false">上一步</el-button>
        <el-button type="goon" icon="el-icon-check" size="mini" @click="addTarget()">确定</el-button>
        <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button>
      </span>
    </el-dialog>
    <el-dialog :close-on-click-modal='false' @close="testCancel" width='80%' :visible.sync="testShow" customClass="boxWidth33">
        <div slot="title" class="titleBox">
        <i class='el-icon-document' style="font-size: 20px"></i>
        <!-- <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/more.png' /> -->
        <span style="margin-left:10px;font-size:18px">新增测试方案集</span>
        </div>
        <el-row>
          <el-col :span='12'>
            <div>
                <div class="common-title-name">
                     <img style="width: 25px; height: 25px; margin-left: 20px" src='../../../../assets/img/imgScreen/logo.png' />
                     测试任务
                     <!-- <span style="font-size: 16px; margin-left: 30px">{{testNumbers}}/{{pageTests.totalPage}}</span> -->
                      <el-input v-model="testItemName2" size="small" placeholder="请输入查询内容" @keyup.enter.native="getDataLists2()" style="width: 150px"></el-input>
                </div>
                <div class="common-table-div">
                     <el-table v-loading="dataLoading" ref="dataTable" border :height="heightTop" highlight-current-row @selection-change="selectionTest" :data="table.listTests"
                     :header-cell-style="tableHeaderCellStyle" :icore-filter-flag="icoreFilterFlag">
                      <el-table-column type="index" label="NO" align="center"></el-table-column>
                      <el-table-column label="操作" width="50">
                          <template slot-scope="{row}">
                              <el-button type="text" style="padding:0"  @click="rightData2(row)">右移</el-button>
                          </template>
                      </el-table-column>
                      <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="testItemName" label="测试名称" align="center"></el-table-column>
                      <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="itemTypeName" label="项目类型" align="center"></el-table-column>
                     </el-table>
                </div>
                <div style="margin-top: 20px; margin-left: 10px">
                    <el-pagination  @size-change="SizeTest" @current-change="pageChangeTest"
                      :current-page="pageTests.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="pageTests.pageSize" layout="total, sizes, prev, pager, next"
                      :total="pageTests.totalPage" background>
                    </el-pagination>
                </div>
            </div>
          </el-col>
          <!-- <el-col :span='4'>
            <div style="margin-top: 70px;margin-left: 20px">
              <el-button type="goon" size="mini" icon="el-icon-arrow-right" @click="rightData2">右移</el-button>
              <el-button type="goon" size="mini" icon="el-icon-arrow-left" @click="leftData2" style="margin-top: 20px">删除</el-button>
              <el-button type="goon" size="mini" icon="el-icon-arrow-up" @click="upData2" style="margin-top: 20px">上移</el-button>
              <el-button type="goon" size="mini" icon="el-icon-arrow-down" @click="downData2" style="margin-top: 20px">下移</el-button>
            </div>
          </el-col> -->
          <el-col :span='12'>
            <div>
                <div class="common-title-name">
                     <img style="width: 25px; height: 25px; margin-left: 20px" src='../../../../assets/img/imgScreen/logo.png' />
                     选择任务
                     <!-- <span style="font-size: 16px; margin-left: 70px">{{selectNumbers}}/{{table.addTest.length}}</span> -->
                </div>
                <div class="common-table-div">
                     <el-table v-loading="dataLoading2" ref="dataTable2" border :height="300" @selection-change="addSelectionTest2" :data="table.addTest"
                     :header-cell-style="tableHeaderCellStyle">
                      <el-table-column type="index" label="NO" align="center"></el-table-column>
                      <el-table-column label="操作" width="120px">
                        <template slot-scope="scope">
                          <el-button type="text" style="padding:0" :disabled="scope.$index == 0" @click="moveUpward(scope.row, scope.$index)">上移</el-button>
                          <el-button type="text" style="padding:0" :disabled="(scope.$index + 1) == table.addTest.length" @click="moveDown(scope.row, scope.$index)">下移</el-button>
                          <el-button type="text" style="padding:0"  @click="leftData2(scope.$index,scope.row)">删除</el-button>
                        </template>
                      </el-table-column>
                      <el-table-column min-width="120px"  :show-overflow-tooltip="true" prop="testItemName" label="测试名称" align="center"></el-table-column>
                      <el-table-column min-width="120px"  :show-overflow-tooltip="true" prop="itemTypeName" label="项目类型" align="center"></el-table-column>
                     </el-table>
                </div>
                <!-- <div class="common-foot-style">
                    <el-pagination v-loading="dataLoading2" @size-change="pageSizeChange2" @current-change="pageCurrentChange2"
                      :current-page="page2.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="page2.pageSize" layout="total, sizes, prev, pager, next, jumper"
                      :total="page2.totalPage" background>
                    </el-pagination>
                </div> -->
            </div>
          </el-col>
        </el-row>
      <span slot="footer" class="dialog-footer">
         <!-- <el-button type="goon" size="mini" icon="el-icon-check" @click="addData()">确定</el-button> -->
        <el-button type="goon" size="mini" :loading='btnLoading2' icon="el-icon-check" @click="addtestData()">确定</el-button>
        <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="testCancel">取消</el-button>
      </span>
    </el-dialog>
    <!-- 新增分析项目指标 -->
    <el-dialog @close="fxcloseDialog" :close-on-click-modal='false' :visible.sync="fxdialogTableVisible" width='80%'>
        <div slot="title" class="titleBox">
         <i class="el-icon-document" style="font-size: 20px"></i>
        <span style="margin-left:10px;font-size:18px;margin-right:20px">新增分析项目</span>
        <span style="font-size:16px;color:#fff;">分析项目名称</span>
        <el-input v-model="anlyItemName" size="small" @keyup.enter.native="searchData2" style="width: 150px;"></el-input>
        <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData2">查询</el-button>
        </div>
        <el-row>
          <el-col :span='12'>
            <div class="common-table-div">
               <el-table v-loading="fxdataLoading" ref="dataTable" border :height="350" highlight-current-row :data="fxlist" :icore-filter-flag="icoreFilterFlag"
               :header-cell-style="tableHeaderCellStyle" :cell-class-name="fxtableRowClassName" :summary-method="getSummaries" show-summary>
              <el-table-column type="index" label="NO" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="" label="操作" align="center">
                <template slot-scope="{row}">
                  <el-button type="text" size='mini' @click="checkRow(row)">添加</el-button>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="anlyItemNo" label="分析项目编号" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemName" label="分析项目名称" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlag1" label="数据状态" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="itemTypeName" label="项目类型" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="dspOrder" label="显示顺序" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="dataTypeName" label="数据类型" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemAlias" label="分析项目别名" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemDesc" label="分析项目描述" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemEng" label="分析项目英文" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="unitName" label="度量单位" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="formulaName" label="计算公式" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="reviseRuleName" label="修约规则" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="outputTypeName" label="输出类型" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="defaultValue" label="默认值" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="maxSign" label="上限符" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="maxValue" label="上限值" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="minSign" label="下限符" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="minValue" label="下限值" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="anlyCnt" label="分析次数" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isCompute1" label="是否计算" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" prop="isMid1" min-width="90px" label="是否中间项" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" prop="isReport1" min-width="80px" label="是否报出" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isLogin1" label="是否必检" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isAlarm1" label="是否报警" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isRare1" label="是否贵重" align="center">
              </el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间" align="center"></el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="80px" prop="createMan" label="创建人" align="center"></el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间" align="center"></el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="80px" prop="updateMan" label="修改人" align="center"></el-table-column>
               </el-table>
               </div>
              <div class="common-foot-style">
              <el-pagination @size-change="fxpageSizeChange" @current-change="fxpageCurrentChange"
                :current-page="fxpage.pageNum" :page-sizes="[100, 200,500]" :page-size="fxpage.pageSize" layout="total, sizes, prev, pager, next"
                :total="fxpage.totalPage" background>
              </el-pagination>
            </div>
          </el-col>
          <el-col :span='12'>
            <div class="common-table-div">
               <el-table  border :height="350"  :data="checkList" :icore-filter-flag="icoreFilterFlag"
               :header-cell-style="tableHeaderCellStyle" :cell-class-name="fxtableRowClassName" :summary-method="getSummaries" show-summary>
              <el-table-column type="index" label="NO" fixed="left" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="" label="操作" align="center">
                <template slot-scope="scope">
                  <el-button type="text" size='mini' @click="removeItem(scope.$index)">删除</el-button>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="anlyItemNo" label="分析项目编号" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemName" label="分析项目名称" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlag1" label="数据状态" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="itemTypeName" label="项目类型" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="dspOrder" label="显示顺序" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="dataTypeName" label="数据类型" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemAlias" label="分析项目别名" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemDesc" label="分析项目描述" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemEng" label="分析项目英文" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="unitName" label="度量单位" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="formulaName" label="计算公式" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="reviseRuleName" label="修约规则" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="outputTypeName" label="输出类型" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="defaultValue" label="默认值" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="maxSign" label="上限符" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="maxValue" label="上限值" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="minSign" label="下限符" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="minValue" label="下限值" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="anlyCnt" label="分析次数" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isCompute1" label="是否计算" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="isMid1" label="是否中间项" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isReport1" label="是否报出" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isLogin1" label="是否必检" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isAlarm1" label="是否报警" align="center">
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isRare1" label="是否贵重" align="center">
              </el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间" align="center"></el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="80px" prop="createMan" label="创建人" align="center"></el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间" align="center"></el-table-column>
              <el-table-column  sortable :show-overflow-tooltip="true" min-width="80px" prop="updateMan" label="修改人" align="center"></el-table-column>
               </el-table>
               </div>
          </el-col>
        </el-row>
       <div style="margin-top: 20px; margin-right: 50px" class="clearfix">
       <span slot="footer" class="dialog-footer" style="float:right">
        <el-button type="goon"  icon="el-icon-check" size="mini" @click="fxaddData()">确定</el-button>
        <el-button size="mini"  type="goon" icon="el-icon-remove-outline" @click="fxcancel">取消</el-button>
      </span>
       </div>
    </el-dialog>
    <div is="alertComponets" :showFlag="showFlag" :Params="Params" @refresh='refresh'></div>
    <div is="alertComponets3" :showFlag="showFlag3" :Params="Params3" @refresh='refresh2'></div>
  </div>
</template>
<script>
import {
  getCookie
} from '@/utils/util.js';
import {
  cookieUserId,
  cookieUserName
} from '@/config/config.js';
import alertComponets from './alertComponents';
import alertComponets3 from './alertComponents3';
let userName = getCookie(cookieUserName);
let userId = getCookie(cookieUserId);
export default {
  components: {alertComponets, alertComponets3},
  data () {
    return {
      table: {
        list: [],
        list2: [],
        listTest:[],
        listTests:[],
        addTest:[],
        list3: [],
        listbz:[]
      },
      addTask:[],
      //模板
      anlyItemName:'',
      fxdataLoading:false,
      fxData:{},
      fxpage: {
        pageSize: 500,
        pageNum: 1,
        totalPage: 0
      },
      checkList:[],
      fxlist:[],
      fxdialogTableVisible:false,
      testPlanNameType:[],
      testShow:false,
      dialogTableVisible2:false,
      tableType2:0,
      tableTypeDsc2:'新增测试任务集',
      testTypeNameType:[],
      formData2:{},
      monitorRules2:{
        taskName: [{ required: true, message: '该项不能为空', trigger: 'blur' }],
        testPlanNo: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        testPlanName: [{ required: true, message: '该项不能为空', trigger: 'blur' }],
        testTypeCode: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        },
      dialogTableVisible3:false,
      tableTypeDsc3:'新增测试方案集',
      testNumber:0,
      testList:[],
      selectNumber:0,
      selectNumbers:0,
      testNumbers:0,
      saveObj:{},
      dialogTableVisible4:false,
      tableType4:0,
      tableTypeDsc4:'新增测试指标集',
      formData4:{indexName:'默认指标集'},
      monitorRules4:{taskName: [{ required: true, message: '该项不能为空', trigger: 'change' }],
                    indexName: [{ required: true, message: '该项不能为空', trigger: 'blur' }],
      },
      stdNameType:[],
      gradeNameType:[],
      judgeTypeNameType:[],
      dataLoading: false,
      dataLoading2: false,
      dataLoading3: false,
      dataLoading4: false,
      btnLoading1: false, // 测试任务停用、启用
      btnLoading2: false, // 新增测试任务-确定
      icoreFilterFlag: true,
      icoreFilterFlag2: true,
      icoreFilterFlag3: true,
      icoreFilterFlag4: true,
      activeName: 'first',
      taskNoD:'',
      page: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page2: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      page3: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      pagebz: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      pageTest: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      pageTests: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page4: {
        pageSize: 500,
        pageNum: 1,
        totalPage: 0
      },
      backButton:false,
      testItemNo: '',
      taskNo: '',
      showFlag: false,
      showFlag2: false,
      showFlag3: false,
      showFlag4: false,
      showFlag5: false,
      showFlag6: false,
      showFlag7: false,
      Params: {},
      Params2: {},
      Params3: {},
      Params4: {},
      Params5: {},
      Params6: {},
      Params7: {},
      Params8: {},
      addList:[],
      testList2:[],
      multipleSelection: [],
      multipleSelection2: [],
      multipleSelection3: [],
      multipleSelection5: [],
      search: {
        taskNo: '',
        testPlanNo: ''
      },
      heightTop:0,
      testItemName: '',
      testItemName2: '',
      search2:{},
      tmpNo: '',
      pageList: {},
    }
  },
  created(){
    this.heightTop = window.innerHeight/2 - 130 < 249 ? 249 : window.innerHeight/2 - 130
    this.backButton = this.$route.query.testPlanNo ? true : false
    this.search.testPlanNo = this.$route.query.testPlanNo ? this.$route.query.testPlanNo : ''
    this.search2 = this.$route.query.searchData ? this.$route.query.searchData : {}
    this.tmpNo = this.$route.query.tmpNo ? this.$route.query.tmpNo : ''
    this.pageList = this.$route.query.pageList ? this.$route.query.pageList : {}
  },
 mounted () {
    this.searchData ();
    this.getList()
    this.getDataListTest()
    this.getDataListTest2()
    // this.addScreen();
    // this.addScreen2();
    // this.addScreen3();
    // this.addScreen4();
    this.axios.post('pass/baseManagement/v1/limsstdtestplans/queryLimsStdTestPlanPage',{object:{validFlag:1},pageIndex:1,pageSize:99999}, {individualType: 'json'}).then(res => {
      this.testPlanNameType = res.data.list;
    })
    //取样地点
    this.axios.get('pass/baseManagement/v1/limsbasepoints/'+ '?validFlag=1').then(res => {
      this.pointNameType = res.data.list;
    })
    this.axios.post("pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",{validFlag:1,baseCode:4803}, {individualType: 'json'}).then(res => {
      this.testTypeNameType = res.data
    })
    //产品标准
      this.axios.post('pass/baseManagement/v1/limsstdinfos/queryLimsStdInfoList/',{object:{validFlag:1},pageIndex:1,pageSize:9999},{individualType: 'json'}).then(res => {
          this.stdNameType = res.data.list;
        })
    //牌号
    this.axios.post('pass/baseManagement/v1/limsbasegrades/queryLimsBaseGradePage',{object:{grandTypeCode:'',gradeName:'',validFlag:1},pageIndex:1,pageSize:9999}, {individualType: 'json'}).then(res => {
        this.gradeNameType = res.data.list;
      })
    //判定类型
    this.axios.post("pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",{validFlag:1,baseCode:4816}, {individualType: 'json'}).then(res => {
      this.judgeTypeNameType = res.data
    })
  },
  methods: {
    toBack(){
      // window.history.back(-1)
      this.$router.push({path:'/sampleTemplateMaintenance', query:{searchData: this.search2, pageList: this.pageList, tmpNo: this.tmpNo}})
    },
    handleClick(tab, event) {
    },
    confirmData () {
      if (this.multipleSelection.length < 1) {
        this.$message.warning('请选择测试任务！')
      } else if (this.multipleSelection3.length < 1) {
        this.$message.warning('请选择方法标准！')
      } else {
        this.multipleSelection3.forEach(item => {
        if (item.validFlag === '0') {
          return this.$message.warning('请选择有效的方法标准！')
        }
        })
        this.multipleSelection3.forEach(item => {
          item.taskNoD = this.multipleSelection[this.multipleSelection.length-1].taskNoD;
          item.testItemNo = this.multipleSelection[this.multipleSelection.length-1].testItemNo;
        })
        this.axios.post('pass/baseManagement/v1/limsstdtestchooses/', this.multipleSelection3, {individualType: 'json'}).then(res => {
          if (res.succeed) {
           this.$message.success('确认成功')
           this.refresh()
          } else {
           this.$message.error(res.message)
          }
          }).catch(e => {
           this.$message.error(e.message)
          })
        }
    },
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
        }
        if (index === 1) {
          sums[index] = data.length;
        }
      });
      return sums;
    },
    getCode (code, arr, codeKey, nameKey) {
      if (!code) {
        return '';
      }
      let targetRow = arr.find(item => {
        return item[codeKey] === code;
      });
      // console.log(targetRow, 'targetRow');
      return targetRow ? targetRow[nameKey] : '';
    },
    addtestData(){
      if (this.table.addTest.length < 1) {
        this.$message.warning('请先移动数据到右边的表格中')
        return
      }
      this.table.addTest.forEach(item =>{
        item.id = ''
        item.taskNo = this.multipleSelection5[0].taskNo
      })
      let params = {
        stdTasks:  this.table.addTest,
        addTask : this.addTask
      }
      this.btnLoading2 = true
      this.axios.post('pass/baseManagement/v1/limsstdtaskds/saveLimsStdTaskDs', params, {individualType: 'json'}).then(res => {
        if (res.succeed) {
          this.getDataList(this.taskNo)
          this.testCancel()
          this.$message.success("新增成功")
        } else {
         this.$message.error(res.message)
        }
        this.btnLoading2 = false
      }).catch(e => {
        this.$message.error(e.message)
        this.btnLoading2 = false
      })
    },
    testCancel(){
      this.table.addTest = []
      this.addList = []
      this.testShow = false
      this.addTask = []
    },
    addDataTest(){
      let _this = this;
      _this.$refs['monitorForm2'].validate((valid) => {
        if (valid) {
          this.formData2.createMan = userName;
          this.formData2.createNo = userId;
          this.formData2.testPlanName = this.getCode(this.formData2.testPlanNo,this.testPlanNameType,'testPlanNo','testPlanName')
          this.formData2.testTypeName = this.getCode(this.formData2.testTypeCode,this.testTypeNameType,'baseCode','baseName')
          let obj = {taskName:this.formData2.taskName,testPlanNo:this.formData2.testPlanNo,testPlanName:this.formData2.testPlanName}
          this.saveObj = Object.assign({},obj)
          this.dialogTableVisible2 = false;
          this.dialogTableVisible3 = true
        }
       })
    },
    modifyDataTest () {
        let _this = this;
        _this.$refs['monitorForm2'].validate((valid) => {
        if (valid) {
        this.formData2.testTypeName = this.getCode(this.formData2.testTypeCode,this.testTypeNameType,'baseCode','baseName')
        _this.axios.put('pass/baseManagement/v1/limsstdtasks/', this.formData2, {individualType: 'json'}).then(res => {
           if (res.succeed) {
            this.$message.success('修改成功')
            _this.searchData()
            this.cancel()
           } else {
            this.$message.error(res.message)
           }
           }).catch(e => {
            this.$message.error(e.message)
          })
        }
        })
    },
    upData () {
         if (this.selectList.length === 1) {
             this.selectList.forEach((item, index) => {
             // 遍历源数据
             this.table.list3.forEach((itemI, indexI) => {
             // 如果选中数据跟元数据某一条标识相等，删除对应的源数据
             if (item.indexof === itemI.indexof) {
               this.index = indexI
             }
           })
          })
          if (this.index > 0) {
              let upDate = this.table.list3[this.index - 1];
              this.table.list3.splice(this.index - 1, 1);
              this.table.list3.splice(this.index, 0, upDate);
          } else {
              this.$message.warning('已经是第一条，不可上移!');
          }
       } else {
           this.$message.warning('请在左边框选择一条上移的数据！')
         }
       },
       upData2 () {
         if (this.addList.length === 1) {
             this.addList.forEach((item, index) => {
             // 遍历源数据
             this.table.addTest.forEach((itemI, indexI) => {
             // 如果选中数据跟元数据某一条标识相等，删除对应的源数据
             if (item.indexof === itemI.indexof) {
               this.index = indexI
             }
           })
          })
          if (this.index > 0) {
              let upDate = this.table.addTest[this.index - 1];
              this.table.addTest.splice(this.index - 1, 1);
              this.table.addTest.splice(this.index, 0, upDate);
          } else {
              this.$message.warning('已经是第一条，不可上移!');
          }
       } else {
           this.$message.warning('请在左边框选择一条上移的数据！')
         }
       },
    moveUpward(row, index) {
      if (index > 0) {
          let upData = this.table.addTest[index - 1];
          this.table.addTest.splice(index - 1, 1);
          this.table.addTest.splice(index, 0, upData);
      } else {
        this.$message({message: '已经是第一条，上移失败',type: 'warning'});
      }
    },
    moveDown(row, index) {
      if ((index + 1) == this.table.addTest.length) {
          this.$message({message: '已经是最后一条，下移失败',type: 'warning' });
      } else {
          let downData = this.table.addTest[index + 1];
          this.table.addTest.splice(index + 1, 1);
          this.table.addTest.splice(index, 0, downData);
      }
    },
    downData () {
        if (this.selectList.length === 1) {
             this.selectList.forEach((item, index) => {
             // 遍历源数据
             this.table.list3.forEach((itemI, indexI) => {
             // 如果选中数据跟元数据某一条标识相等，删除对应的源数据
             if (item.indexof === itemI.indexof) {
               this.index = indexI
             }
           })
          })
          if ((this.index) === this.table.list3.length - 1) {
             this.$message.warning('已经是最后一条了，不可下移!');
              // let upDate = this.table.list2[this.index - 1];
              // this.table.list2.splice(this.index - 1, 1);
              // this.table.list2.splice(this.index, 0, upDate);
          } else {
             let downDate = this.table.list3[this.index + 1];
             this.table.list3.splice(this.index + 1, 1);
             this.table.list3.splice(this.index, 0, downDate);
          }
         } else {
           this.$message.warning('请在左边框选择一条下移的数据！')
         }
       },
       downData2 () {
        if (this.addList.length === 1) {
             this.addList.forEach((item, index) => {
             // 遍历源数据
             this.table.addTest.forEach((itemI, indexI) => {
             // 如果选中数据跟元数据某一条标识相等，删除对应的源数据
             if (item.indexof === itemI.indexof) {
               this.index = indexI
             }
           })
          })
          if ((this.index) === this.table.addTest.length - 1) {
             this.$message.warning('已经是最后一条了，不可下移!');
              // let upDate = this.table.list2[this.index - 1];
              // this.table.list2.splice(this.index - 1, 1);
              // this.table.list2.splice(this.index, 0, upDate);
          } else {
             let downDate = this.table.addTest[this.index + 1];
             this.table.addTest.splice(this.index + 1, 1);
             this.table.addTest.splice(this.index, 0, downDate);
          }
         } else {
           this.$message.warning('请在左边框选择一条下移的数据！')
         }
       },
       rightData () {
         if (this.testList.length > 0) {
            let newnewList = []
            newnewList = JSON.parse(JSON.stringify(this.testList))
            newnewList.map(item =>{
              this.table.list3.push(item)
            })
            for (let i = 0; i < this.table.list3.length; i++) {
             this.table.list3[i].indexof = i
            }
         } else {
           this.$message.warning('请在左边框勾选您要选择的测试任务！')
         }
       },
       rightData2 (row) {
         this.addTask.push(row)
         this.table.addTest.push(row)
        //  if (this.testList2.length > 0) {
        //     let newnewList = []
        //     newnewList = JSON.parse(JSON.stringify(this.testList2))
        //     newnewList.map(item =>{
        //       this.table.addTest.push(item)
        //     })
        //     for (let i = 0; i < this.table.addTest.length; i++) {
        //      this.table.addTest[i].indexof = i
        //     }
        //  } else {
        //    this.$message.warning('请在左边框勾选您要选择的测试任务！')
        //  }
       },
       leftData2 (index,row) {
         if (row.taskNo) {
            this.$message.warning('不可删除原有数据！')
            return false
         }
         this.table.addTest.splice(index, 1);
         let ind = this.addTask.findIndex(val => {
           val.id == row.id
         })
         this.addTask.splice(ind,1)
        //  let flag = false
        //  if (this.addList.length > 0) {
        //  this.addList.forEach((item, index) => {
        //   flag =  item.taskNo ? true : false
        //   if (flag) {
        //     this.$message.warning('不可删除原有数据！')
        //     return false
        //   }

        //   // 遍历源数据
        //  this.table.addTest .forEach((itemI, indexI) => {
        //     // 如果选中数据跟元数据某一条标识相等，删除对应的源数据
        //     if (item.indexof === itemI.indexof) {
        //       this.table.addTest.splice(indexI, 1)
        //     }
        //   })
        // })
        //  } else {
        //    this.$message.warning('请在右边边框勾选您要删除的任务！')
        //  }
       },
       leftData () {
         if (this.selectList.length > 0) {
         this.selectList.forEach((item, index) => {
          // 遍历源数据
         this.table.list3.forEach((itemI, indexI) => {
            // 如果选中数据跟元数据某一条标识相等，删除对应的源数据
            if (item.indexof === itemI.indexof) {
              this.table.list3.splice(indexI, 1)
            }
          })
        })
         } else {
           this.$message.warning('请在右边边框勾选您要删除的任务！')
         }
       },
      handleSelectionTest (val) {
         this.testNumber = val.length;
         this.testList = val;
       },
       selectionTest (val) {
         this.testNumbers = val.length;
         this.testList2 = val;
       },
       handleSelectionTest2 (val) {
         this.selectNumber = val.length;
         this.selectList = val;
       },
       addSelectionTest2 (val) {
         this.selectNumbers = val.length;
         this.addList = val;
       },
       getDataLists(){
         this.pageTest.pageNum = 1
         this.getDataListTest()
       },
       getDataListTest () {
          let obj = {
            object:{
              validFlag:1,
              testItemName:this.testItemName
            },
            pageIndex:this.pageTest.pageNum,
            pageSize:this.pageTest.pageSize
          }
        this.dataLoading = true;
        this.axios.post('pass/baseManagement/v1/limsstdtestitems/queryLimsStdTestItemPage',obj,{individualType: 'json'}).then(res => {
              this.dataLoading = false;
              this.table.listTest = res.data.list;
              this.pageTest.totalPage = res.data.total;
            }).catch(e => {
              this.dataLoading = false;
            });
       },
       getDataLists2() {
         this.pageTests.pageNum = 1
         this.getDataListTest2()
       },
       getDataListTest2 () {
          let obj = {
            object:{
              validFlag:1,
              testItemName:this.testItemName2
            },
            pageIndex:this.pageTests.pageNum,
            pageSize:this.pageTests.pageSize
        }
        this.dataLoading = true;
         this.axios.post('pass/baseManagement/v1/limsstdtestitems/queryLimsStdTestItemPage',obj,{individualType: 'json'})
            .then(res => {
              this.dataLoading = false;
              this.table.listTests = res.data.list;
              this.pageTests.totalPage = res.data.total;
            }).catch(e => {
              this.dataLoading = false;
            });
       },
       pageSizeTest (size) {
         this.pageTest.pageSize = size;
         this.getDataListTest();
       },
    SizeTest (size) {
         this.pageTests.pageSize = size;
         this.getDataListTest2();
       },
    pageChangeTest (index) {
      this.pageTests.pageNum = index;
      this.getDataListTest2();
    },
    pageCurrentTest (index) {
      this.pageTest.pageNum = index;
      this.getDataListTest();
    },
    addDataCase(){
      if (this.table.list3.length <= 0) {
        this.$message.warning('请先选择数据右移到选择任务表中')
        return
      }
      this.table.list3.forEach(item => {
          //  item.taskNo = this.saveObj.taskNo;
           item.taskName = this.saveObj.taskName;
          //  item.updateMan = this.userName;
          //  item.updateNo = this.userId;
         })
        this.formData4.taskName = this.saveObj.taskName;
        this.formData4.testPlanNo = this.saveObj.testPlanNo;
        this.formData4.testPlanName = this.saveObj.testPlanName;
          this.dialogTableVisible3 = false;
          this.dialogTableVisible4 = true
    },
    addTarget(){
      let _this = this;
      _this.$refs['monitorForm4'].validate((valid) => {
          if (valid) {
            this.formData4.createMan = userName
            this.formData4.createNo = userId
            this.formData4.stdName = this.getCode(this.formData4.stdNo,this.stdNameType,'stdNo','stdName')
            this.formData4.gradeName = this.getCode(this.formData4.gradeNo,this.gradeNameType,'gradeNo','gradeName')
            this.formData4.judgeTypeName = this.getCode(this.formData4.judgeTypeCode,this.judgeTypeNameType,'baseCode','baseName')
            let obj = {
              limsStdTask:this.formData2,
              limsStdTaskDS:this.table.list3,
              limsStdIndex:this.formData4
            }
            _this.axios.post('pass/baseManagement/v1/limsstdtasks/saveLimsStdTaskAll',obj, {individualType: 'json'}).then(res => {
              if (res.succeed) {
                _this.dialogTableVisible4 = false;
                this.$message.success('测试指标集添加成功')
                this.searchData()
                this.cancel()
                } else {
                 this.$message.error(res.message)
                }
                }).catch(e => {
                 this.$message.error(e.message)
               })
          }
         })
    },
    modifyTarget(){

    },
    cancel(){
      this.formData = {}
      this.tableType =0,
      this.tableTypeDsc ='新增测试计划信息',
      this.tableType2 =0,
      this.tableTypeDsc2 ='新增测试任务集',
      this.formData2 ={},
      this.dialogTableVisible2 = false,
      this.tableTypeDsc3 ='新增测试方案集',
      this.saveObj ={},
      this.dialogTableVisible3 = false,
      this.tableType4 =0,
      this.tableTypeDsc4 ='新增测试指标集',
      this.formData4 ={indexName:'默认指标集'}
      this.dialogTableVisible4 = false
      this.table.list3 = [],
      this.saveObj = {},
        this.addTask = []
    },
    closeDialog () {
      this.tableType2 =0;
      this.tableTypeDsc2 = '新增测试任务集'
    },
    refresh () {
      this.getDataList4();
      this.getDataList(this.taskNo)
      // this.getDataList2 (this.taskNoD);
      this.getDataList3(this.testItemNo);
    },
    refresh4 () {
    //   this.getDataList4();
      this.getDataList(this.taskNo)
      // this.getDataList2 (this.taskNoD);
      this.getDataList3(this.testItemNo);
    },
    refresh2 () {
      this.getDataList2 (this.taskNoD);
    },
    refresh3 () {
      this.getDataList3(this.testItemNo);
    },
    refresh4 (solutionSet) {
      let _this = this;
      // _this.showFlag4 = false
      _this.Params = null
      _this.Params7 = solutionSet
      console.log('solutionSet',_this.Params7)
      if (_this.Params7 !== undefined) {
      _this.showFlag6 = !_this.showFlag6
      }
    },
    refresh5 () {
      let _this = this;
      _this.showFlag7 = !_this.showFlag7
      // if (_this.Params4 !== undefined) {
      // _this.showFlag5 = !_this.showFlag5
      // }
    },
    addData () {
      let _this = this;
       if (_this.multipleSelection5.length !== 1) {
        this.$message.warning('请勾选一条测试方案集数据！')
      } else {
      _this.showFlag = !_this.showFlag;
      _this.Params = null;
      _this.Params2 = _this.multipleSelection5;
      }
    },
    modifyData () {
      let _this = this;
      if (_this.multipleSelection.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        _this.showFlag = !_this.showFlag;
        _this.Params = _this.multipleSelection[0];
        _this.Params2 = null;
      }
    },
    //删除测试任务数据
    deleteTest () {
      if (this.multipleSelection.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
        return
      }
      let tempArr = []
      this.multipleSelection.map(item =>{
        tempArr.push(item.id)
      })
      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.axios.post('pass/baseManagement/v1/limsstdtaskds/deleteLimsStdTaskDs', tempArr, {individualType: 'json'}).then(res => {
            if (res.code == 0 || res.code == 200) {
             this.$message.success(res.message);
             this.refresh()
            } else {
             this.$message.error(res.message)
            }
            }).catch(e => {
             this.$message.error(e.message)
          })
        }).catch(() => {});

    },
    // 启用
    recoverData () {
       let _this = this;
        if (_this.multipleSelection.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection.length; j++) {
          if (_this.multipleSelection[j].validFlag === '1') {
          this.$message.warning('请勾选状态为已停用的数据！')
          return
          }
        }
        this.btnLoading1 = true
        for (var i = 0; i < _this.multipleSelection.length; i++) {
        _this.multipleSelection[i].updateMan = userName;
        _this.multipleSelection[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdtaskds/recover', _this.multipleSelection, {individualType: 'json'}).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            _this.refresh()
          } else {
            this.$message.error(res.message)
          }
          this.btnLoading1 = false
        }).catch(e => {
          this.$message.error(e.message)
          this.btnLoading1 = false
       })
      }
    },
    // 停用
    deleteData () {
       let _this = this;
        if (_this.multipleSelection.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection.length; j++) {
          if (_this.multipleSelection[j].validFlag === '0') {
          this.$message.warning('请勾选状态为已启用的数据！')
          return
          }
        }
        this.btnLoading1 = true
        for (var i = 0; i < _this.multipleSelection.length; i++) {
        _this.multipleSelection[i].updateMan = userName;
        _this.multipleSelection[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdtaskds/abolish', _this.multipleSelection, {individualType: 'json'}).then(res => {
          if (res.succeed) {
          this.$message.success('停用成功');
          _this.refresh()
          } else {
          this.$message.error(res.message)
          }
          this.btnLoading1 = false
        }).catch(e => {
          this.btnLoading1 = false
          this.$message.error(e.message)
       })
      }
    },
    searchData () {
        this.dataLoading4 = true;
        this.page.pageNum = 1;
        this.page4.pageNum = 1;
        this.page4.pageSize = 100
        this.getDataList4()
      },
    reset () {
      let _this = this;
      _this.search.taskName = '';
      _this.search.testPlanNo = '';
      _this.searchData();
    },
    addData2 () {
      if (this.multipleSelection.length !== 1) {
        this.$message.warning('请勾选一条测试任务数据！');
        return
      }
      this.fxData = Object.assign({},this.multipleSelection[0])
      this.fxdialogTableVisible = true
    },
    modifyData2 () {
      let _this = this;
       if (_this.multipleSelection2.length !== 1) {
        this.$message.warning('请选择您要修改的数据！');
      } else {
        _this.showFlag3 = !_this.showFlag3;
        _this.Params3 = _this.multipleSelection2;
      }
    },
    recoverData2 () {
      let _this = this;
        if (_this.multipleSelection2.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection2.length; j++) {
          if (_this.multipleSelection2[j].validFlag === '1') {
          this.$message.warning('请勾选状态为已停用的数据！')
          return
          }
        }
        _this.dialogTableVisible2 = false;
        for (var i = 0; i < _this.multipleSelection2.length; i++) {
        _this.multipleSelection2[i].updateMan = userName;
        _this.multipleSelection2[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdindexds/recover', _this.multipleSelection2, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.$message.success('启用成功');
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    //删除指标集
    deleteIndex () {
      if (this.multipleSelection2.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
        return
      }
      let tempArr = []
      this.multipleSelection2.map(item =>{
        tempArr.push(item.id)
      })
      this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.axios.post('pass/baseManagement/v1/limsstdindexds/delectLimsStdIndexDs', tempArr, {individualType: 'json'}).then(res => {
            if (res.code == 0 || res.code == 200) {
             this.$message.success(res.message);
             this.getDataList2 (this.taskNoD);
            } else {
             this.$message.error(res.message)
            }
          }).catch(e => {
            this.$message.error(e.message)
          })
        }).catch(() => {});
    },
    deleteData2 () {
       let _this = this;
        if (_this.multipleSelection2.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection2.length; j++) {
          if (_this.multipleSelection2[j].validFlag === '0') {
          this.$message.warning('请勾选状态为已启用的数据！')
          return
          }
        }
        _this.dialogTableVisible2 = false;
        for (var i = 0; i < _this.multipleSelection2.length; i++) {
        _this.multipleSelection2[i].updateMan = userName;
        _this.multipleSelection2[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdindexds/abolish', _this.multipleSelection2, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.$message.success('停用成功');
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    addData3 () {
      let _this = this;
       if (_this.multipleSelection.length !== 1) {
        this.$message.warning('请选择一条测试项目数据！');
      } else {
      _this.showFlag4 = !_this.showFlag4;
      _this.Params4 = this.multipleSelection;
      _this.Params5 = null;
      }
    },
    modifyData3 () {
      let _this = this;
      if (_this.multipleSelection3.length !== 1) {
        this.$message.warning('请选择您要修改的数据！');
      } else {
      _this.showFlag4 = !_this.showFlag4;
      _this.Params4 = null;
      _this.Params5 = this.multipleSelection3;
      }
    },
    recoverData3 () {
       let _this = this;
        if (_this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection3.length; j++) {
          if (_this.multipleSelection3[j].validFlag === '1') {
          this.$message.warning('请勾选状态为已停用的数据！')
          return
          }
        }
        _this.dialogTableVisible3 = false;
        for (var i = 0; i < _this.multipleSelection3.length; i++) {
        _this.multipleSelection3[i].updateMan = userName;
        _this.multipleSelection3[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdtestmatchs/recover', _this.multipleSelection3, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.$message.success('启用成功');
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    deleteData3 () {
        let _this = this;
        if (_this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection3.length; j++) {
          if (_this.multipleSelection3[j].validFlag === '0') {
          this.$message.warning('请勾选状态为已启用的数据！')
          return
          }
        }
        _this.dialogTableVisible3 = false;
        for (var i = 0; i < _this.multipleSelection3.length; i++) {
        _this.multipleSelection3[i].updateMan = userName;
        _this.multipleSelection3[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdtestmatchs/abolish', _this.multipleSelection3, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.$message.success('停用成功');
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    addData4 () {
      let _this = this;
      _this.showFlag5 = !_this.showFlag5;
      _this.Params6 = null;
      _this.Params8 = null;
    },
    addPlan(){
      if (this.multipleSelection5.length !== 1) {
        this.$message.warning('请选择您要新增的主数据！');
        return
      }
      this.table.addTest = JSON.parse(JSON.stringify(this.table.list))
      this.table.addTest.sort((a,b)=>{
        return a.doOrder - b.doOrder
      })
      this.testShow = true
    },
    modifyData4 () {
      let _this = this;
      if (_this.multipleSelection5.length !== 1) {
        this.$message.warning('请选择您要修改的数据！');
        return
      }
      this.tableType2 =1,
      this.tableTypeDsc2 ='修改测试任务集',
      this.formData2 = Object.assign({},this.multipleSelection5[0])
      this.dialogTableVisible2 = true
    },
    recoverData4 () {
       let _this = this;
        if (_this.multipleSelection5.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection5.length; j++) {
          if (_this.multipleSelection5[j].validFlag === '1') {
          this.$message.warning('请勾选状态为已停用的数据！')
          return
          }
        }
        for (var i = 0; i < _this.multipleSelection5.length; i++) {
        _this.multipleSelection5[i].updateMan = userName;
        _this.multipleSelection5[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdtasks/recover', _this.multipleSelection5, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.$message.success('启用成功');
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    deleteData4 () {
        let _this = this;
        if (_this.multipleSelection5.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
      } else {
        for (var j= 0; j < _this.multipleSelection5.length; j++) {
          if (_this.multipleSelection5[j].validFlag === '0') {
          this.$message.warning('请勾选状态为已启用的数据！')
          return
          }
        }
        for (var i = 0; i < _this.multipleSelection5.length; i++) {
        _this.multipleSelection5[i].updateMan = userName;
        _this.multipleSelection5[i].updateNo = userId
        }
        _this.axios.post('pass/baseManagement/v1/limsstdtasks/abolish', _this.multipleSelection5, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.$message.success('停用成功');
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    copyData4 () {
      let _this = this;
      if (_this.multipleSelection5.length != 1) {
        this.$message.warning('请勾选一条您要复制的数据！')
        return
      }
      let obj = Object.assign({},_this.multipleSelection5[0])
      obj.taskNo = null
      obj.id = null
      _this.axios.post('pass/baseManagement/v1/limsstdtasks/copyLimsStdTaskAll?id='+this.multipleSelection5[0].id, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.$message.success('复制成功')
         _this.refresh ()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
      })
    },
    searchData2(){
      this.fxpage.pageNum = 1
      this.getList()
    },
    getList () {
        this.fxdataLoading = true;
        let obj = {
          object:{
            anlyItemName:this.anlyItemName,
            validFlag:1
          },
          pageIndex:this.fxpage.pageNum,
          pageSize:this.fxpage.pageSize
        }
        this.axios.post('pass/baseManagement/v1/limsstdanlyitems/queryLimsStdAnlyItemPage/',obj,{individualType: 'json'}).then(res => {
          this.fxdataLoading = false;
          this.fxlist = res.data.list;
          this.fxlist.forEach(item =>{
            item.validFlag1 = item.validFlag == 1 ? '有效' : item.validFlag == 0 ? '无效' : ''
            item.isCompute1 = item.isCompute == 1 ? '是' : item.isCompute == 0 ? '否' : ''
            item.isMid1 = item.isMid == 1 ? '是' : item.isMid == 0 ? '否' : ''
            item.isReport1 =  item.isReport == 1 ? '是' : item.isReport == 0 ? '否' : ''
            item.isLogin1 = item.isLogin == 1 ? '是' : item.isLogin == 0 ? '否' : ''
            item.isAlarm1 = item.isAlarm == 1 ? '是' : item.isAlarm == 0 ? '否' : ''
            item.isRare1 = item.isRare == 1 ? '是' : item.isRare == 0 ? '否' : ''
          })
          this.fxpage.totalPage = res.data.total;
        }).catch(e => {
          this.fxdataLoading = false;
        });
      },
    fxaddData () {
      let _this = this;
      if(_this.checkList.length <= 0){
        this.$message.warning('请先添加数据到右边的表格中')
        return
      }
      this.checkList.forEach(item =>{
        item.indexNo = this.fxData.indexNo
        item.taskNoD = this.fxData.taskNoD
        item.testItemNo = this.fxData.testItemNo
        item.testItemName = this.fxData.testItemName
      })
      this.axios.post('pass/baseManagement/v1/limsstdindexds/addLimsStdIndexDs', this.checkList, {individualType: 'json'}).then(res => {
         if (res.succeed) {
          this.fxdialogTableVisible = false;
          this.$message.success('添加成功')
          this.getDataList2 (this.taskNoD);
         } else {
          this.$message.error(res.message)
         }
         }).catch(e => {
          this.$message.error(e.message)
        })
    },
    checkRow(row){
      this.checkList.push(row)
    },
    removeItem(index){
      this.checkList.splice(index,1)
    },
    fxtableRowClassName ({
        row, column, rowIndex, columnIndex
      }) {
        if (columnIndex === 4) {
        if (row.validFlag !== '1') {
          return 'error-row';
        }
        return '';
        }
    },
    fxcloseDialog () {
      this.checkList = []
      this.anlyItemName = ''
    },
    fxcancel () {
      this.checkList = []
      this.anlyItemName = ''
      this.fxdialogTableVisible = false
      },
    fxpageSizeChange (size) {
        this.fxpage.pageSize = size;
        this.getList();
      },
    fxpageCurrentChange (index) {
      this.fxpage.pageNum = index;
      this.getList();
    },
    handleSelectionChange4 (val) {
      this.multipleSelection5 = val;
      if (val.length > 0) {
        this.taskNo = val[val.length-1].taskNo
        this.getDataList(this.taskNo);
      }
    },
    pageSizeChange4 (size) {
      this.page4.pageSize = size;
      this.getDataList4();
    },
    pageCurrentChange4 (index) {
      this.page4.pageNum = index;
      this.getDataList4();
    },
    handleSelectionChange (val) {
      this.multipleSelection = val;
       if (val.length > 0) {
        this.testItemNo = val[val.length-1].testItemNo;
        this.taskNoD = val[val.length-1].taskNoD;
        // this.getDataList2 (this.taskNoD);
        this.getDataList3 (this.testItemNo);
      }
    },
    pageSizeChange (size) {
      this.page.pageSize = size;
      this.getDataList(this.taskNo);
    },
    pageCurrentChange (index) {
      this.page.pageNum = index;
      this.getDataList(this.taskNo);
    },
    handleSelectionChange2 (val) {
      this.multipleSelection2 = val;
    },
    pageSizeChange2 (size) {
      this.page2.pageSize = size;
      this.getDataList2 (this.taskNoD);
    },
    pageCurrentChange2 (index) {
      this.page2.pageNum = index;
      this.getDataList2 (this.taskNoD);
    },
    handleSelectionChange3 (val) {
      this.multipleSelection3 = val;
    },
    pageSizeChange3 (size) {
      this.pagebz.pageSize = size;
      this.getDataList3(this.testItemNo);
    },
    pageCurrentChange3 (index) {
      this.pagebz.pageNum = index;
      this.getDataList3(this.testItemNo);
    },
    handleCurrentChange2 (val) {
        if (val.taskNo === null) {
        this.taskNo = '';
      } else {
        this.taskNo = val.taskNo;
      }
      this.getDataList (this.taskNo);
    },
    handleCurrentChange (val) {
      if(val) {
        this.testItemNo = val.testItemNo ? val.testItemNo : '';
        this.taskNoD = val.taskNoD ? val.taskNoD : ''
        // this.getDataList2 (this.taskNoD);
        this.getDataList3 (this.testItemNo);
      }
    },
    addScreen () {
      this.$nextTick(() => {
          let ss = document.createElement('div');
          ss.innerHTML = '筛选';
          ss.style = 'text-align: center;'
          this.$refs.dataTable.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
       });
    },
    addScreen2 () {
      this.$nextTick(() => {
          let ss = document.createElement('div');
          ss.innerHTML = '筛选';
          ss.style = 'text-align: center;'
          this.$refs.dataTable2.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
       });
    },
    addScreen3 () {
      this.$nextTick(() => {
          let ss = document.createElement('div');
          ss.innerHTML = '筛选';
          ss.style = 'text-align: center;'
          this.$refs.dataTable3.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
       });
    },
    addScreen4 () {
      this.$nextTick(() => {
          let ss = document.createElement('div');
          ss.innerHTML = '筛选';
          ss.style = 'text-align: center;'
          this.$refs.dataTable4.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
       });
    },
     getDataList4 () {
      this.dataLoading4 = true
      let obj = {
        object:{taskName:this.search.taskName,testPlanNo:this.search.testPlanNo},
        pageIndex:this.page4.pageNum,
        pageSize:this.page4.pageSize,
      }
      this.axios.post('pass/baseManagement/v1/limsstdtasks/queryLimsStdTaskPage',obj, {individualType: 'json'})
            .then(res => {
              this.dataLoading4 = false;
              this.table.list4 = res.data.list;
              for (let i = 0; i < this.table.list4.length; i++) {
              if (this.table.list4[i].validFlag === '0') {
                this.table.list4[i].validFlag1 = '无效'
              } else if (this.table.list4[i].validFlag === '1') {
                this.table.list4[i].validFlag1 = '有效'
              }
              }
              this.page4.totalPage = res.data.total;
            }).catch(e => {
              this.dataLoading4 = false;
            });
    },
    getDataList (taskNo) {
      this.dataLoading = true;
      if (taskNo === null || taskNo === '') {
        this.table.list = [];
        this.dataLoading = false;
        return 0
      }
      let obj = {
        object:{taskNo:taskNo},
        pageIndex:this.page.pageNum,
        pageSize:this.page.pageSize,
      }
      this.axios.post('pass/baseManagement/v1/limsstdtaskds/queryLimsStdTaskDListByTaskNo?taskNo='+taskNo,{individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.table.list = res.data;
          this.page.totalPage = res.data.total;
          this.table.list.sort((a,b)=>{
            return a.doOrder - b.doOrder
          })
          this.table.list.forEach(item =>{
            item.validFlag1 = item.validFlag == 0 ? '无效' : item.validFlag == 1 ? '有效' : ''
            item.isTest1 = item.isTest == 0 ? '否' : item.isTest == 1 ? '是' : ''
            item.isRefer1 = item.isRefer == 0 ? '否' : item.isRefer == 1 ? '是' : ''
            item.isCtrlName = item.isCtrl == 0 ? '否' : item.isCtrl == 1 ? '是' : ''
            item.isAutoName = item.isAuto == 0 ? '否' : item.isAuto == 1 ? '是' : ''
            item.isSonName = item.isSon == 0 ? '否' : item.isSon == 1 ? '是' : ''
            item.isSynName = item.isSyn == 0 ? '否' : item.isSyn == 1 ? '是' : ''
            item.isMsg1 = item.isMsg == 0 ? '否' : item.isMsg == 1 ? '是' : ''
            item.isIndex1 = item.isIndex == 0 ? '否' : item.isIndex == 1 ? '是' : ''
          })
        }
        this.dataLoading = false;
      }).catch(e => {
        this.dataLoading = false;
      });
    },
     getDataList2 (taskNoD) {
      this.dataLoading2 = true;
        let obj = {
          object:{
            taskNoD: taskNoD ? taskNoD : ''
          },
          pageIndex:this.page2.pageNum,
          pageSize:this.page2.pageSize
        }
        this.axios.post('pass/baseManagement/v1/limsstdindexds/queryLimsStdIndexDPage',obj, {individualType: 'json'}).then(res => {
              this.dataLoading2= false;
              this.table.list2 = res.data.list;
              for (let i = 0; i < this.table.list2.length; i++) {
                  if (this.table.list2[i].validFlag === '0') {
                    this.table.list2[i].validFlag1 = '无效'
                  } else if (this.table.list2[i].validFlag === '1') {
                    this.table.list2[i].validFlag1 = '有效'
                  }
              }
              for (let i = 0; i < this.table.list2.length; i++) {
              if (this.table.list2[i].isCompute === '0') {
                this.table.list2[i].isCompute1 = '否'
              } else if (this.table.list2[i].isCompute === '1') {
                this.table.list2[i].isCompute1 = '是'
              }
              }
              for (let i = 0; i < this.table.list2.length; i++) {
              if (this.table.list2[i].isMid === '0') {
                this.table.list2[i].isMid1 = '否'
              } else if (this.table.list2[i].isMid === '1') {
                this.table.list2[i].isMid1 = '是'
              }
              }
              for (let i = 0; i < this.table.list2.length; i++) {
              if (this.table.list2[i].isReport === '0') {
                this.table.list2[i].isReport1 = '否'
              } else if (this.table.list2[i].isReport === '1') {
                this.table.list2[i].isReport1 = '是'
              }
              }
              for (let i = 0; i < this.table.list2.length; i++) {
              if (this.table.list2[i].isLogin === '0') {
                this.table.list2[i].isLogin1 = '否'
              } else if (this.table.list2[i].isLogin === '1') {
                this.table.list2[i].isLogin1 = '是'
              }
              }
              for (let i = 0; i < this.table.list2.length; i++) {
              if (this.table.list2[i].isAlarm === '0') {
                this.table.list2[i].isAlarm1 = '否'
              } else if (this.table.list2[i].isAlarm === '1') {
                this.table.list2[i].isAlarm1 = '是'
              }
              }
              for (let i = 0; i < this.table.list2.length; i++) {
              if (this.table.list2[i].isRare === '0') {
                this.table.list2[i].isRare1 = '否'
              } else if (this.table.list2[i].isRare === '1') {
                this.table.list2[i].isRare1 = '是'
              }
              }
              this.page2.totalPage = res.data.total;
            }).catch(e => {
              this.dataLoading2 = false;
            });
    },
     getDataList3 (testItemNo) {
      this.dataLoading3 = true;
      if (testItemNo === null || testItemNo === '') {
        this.table.listbz = [];
        this.dataLoading3 = false;
        return 0
      } else {
      let obj = {
          object:{
            testItemNo: this.testItemNo ? this.testItemNo : ''
          },
          pageIndex:this.pagebz.pageNum,
          pageSize:this.pagebz.pageSize
        }
        this.axios.post('pass/baseManagement/v1/limsstdtestmatchs/queryLimsStdTestMatchPage',obj, {individualType: 'json'}).then(res => {
              this.dataLoading3 = false;
              this.table.listbz = res.data.list;
              for (let i = 0; i < this.table.listbz.length; i++) {
                   if (this.table.listbz[i].validFlag === '0') {
                     this.table.listbz[i].validFlag1 = '无效'
                   } else if (this.table.listbz[i].validFlag === '1') {
                     this.table.listbz[i].validFlag1 = '有效'
                   }
               }
              this.pagebz.totalPage = res.data.total;
            }).catch(e => {
              this.dataLoading3 = false;
            });
      }
    },
    tableRowClassName ({
        row, column, rowIndex, columnIndex
      }) {
        if (row.validFlag !== '1') {
          return 'error-row';
        }
        return '';
      },
    tableRowClassName2 ({row, column, rowIndex, columnIndex}) {
      if (row.validFlag !== '1') {
        return 'error-row';
      }
      return '';
    },
    tableRowClassName3 ({row, column, rowIndex, columnIndex}) {
      if (row.validFlag !== '1') {
        return 'error-row';
      }
      return '';
    },
    tableRowClassName4 ({row, column, rowIndex, columnIndex}) {
      if (row.validFlag !== '1') {
        return 'error-row';
      }
      return '';
    },
    tableHeaderCellStyle () {
      return 'color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;'
    }
  }
}
</script>
<style  scoped>
</style>
