<template>
    <div class="examination">
     <el-dialog @close="closeDialog" :visible.sync="dialogTableVisible" customClass="customWidth_standas">
        <div slot="title" class="titleBox">
        <i :class="tableType === 0? 'el-icon-document':'el-icon-edit-outline'" style="font-size: 20px"></i>
        <span style="margin-left:10px;font-size:18px">{{tableTypeDsc}}</span>
        </div>
         <el-form :model="formData" label-width="80px" :rules="monitorForm.monitorRules" ref="monitorForm">
         <table class="common-table-style4">
           <tr>
             <td colspan="2">
               <el-form-item v-if="seenNo" prop="testPlanName" label="测试计划">
                 <el-input v-model="formData.testPlanName" readOnly disabled size="small" style="width: 100%;"></el-input>
               </el-form-item>
               <el-form-item v-if="!seenNo" prop="testPlanNameTypeIndex" label="测试计划">
                <el-select v-model="testPlanNameTypeIndex" filterable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in testPlanNameType" :key="index" :label="item.testPlanName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
              </td>
             <td colspan="2">
               <el-form-item v-if="seenNo" prop="taskName" label="测试任务">
                 <el-input v-model="formData.taskName" readOnly disabled size="small" style="width: 100%;"></el-input>
               </el-form-item>
               <el-form-item v-if="!seenNo" prop="taskNameTypeIndex" label="测试任务">
               <el-select v-model="taskNameTypeIndex" filterable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in taskNameType" :key="index" :label="item.taskName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
            </tr>
           <tr>
             <td colspan="2">
             <el-form-item prop="indexName" label="指标名称">
             <el-input v-model="formData.indexName" placeholder="请输入" size="small" style="width: 100%;"></el-input>
             </el-form-item>
             </td>
             <td colspan="2">
               <el-form-item prop="stdNameTypeIndex" label="产品标准">
               <el-select v-model="stdNameTypeIndex" filterable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in stdNameType" :key="index" :label="item.stdName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
           </tr>
            <tr>
             <td colspan="2">
               <el-form-item prop="gradeNameTypeIndex" label="牌号">
               <el-select v-model="gradeNameTypeIndex" filterable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in gradeNameType" :key="index" :label="item.gradeName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <td colspan="2">
               <el-form-item prop="judgeTypeNameTypeIndex" label="判定类型">
               <el-select v-model="judgeTypeNameTypeIndex" filterable collapse-tags size="small" style="width: 100%;">
                  <el-option v-for="(item,index) in judgeTypeNameType" :key="index" :label="item.baseName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
            </tr>
            <tr>
             <td>
               <el-form-item prop="prdThkMin" label="厚度最小">
               <el-input v-model="formData.prdThkMin" size="small" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="thkMinSign" label="厚度最小符">
               <!-- <el-input v-model="thkMinSign" size="small" readonly disabled></el-input> -->
                <el-select v-model="thkMinSignTypeIndex" filterable collapse-tags size="small">
                  <el-option v-for="(item,index) in minSignType" :key="index" :label="item.minSign"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="prdThkMax" label="厚度最大">
               <el-input v-model="formData.prdThkMax" size="small" style="width: 100%;" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="thkMaxSign" label="厚度最大符">
               <!-- <el-input v-model="thkMaxSign" size="small" readonly disabled style="width: 100%;"></el-input> -->
               <el-select v-model="thkMaxSignTypeIndex" filterable collapse-tags size="small">
                  <el-option v-for="(item,index) in maxSignType" :key="index" :label="item.maxSign"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
            </tr>
             <tr>
             <td>
               <el-form-item prop="prdWthMin" label="宽度最小">
               <el-input v-model="formData.prdWthMin" size="small" style="width: 100%;" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="wthMinSign" label="宽度最小符">
               <!-- <el-input v-model="wthMinSign" size="small" readonly disabled style="width: 100%;"></el-input> -->
               <el-select v-model="wthMinSignTypeIndex" filterable collapse-tags size="small">
                  <el-option v-for="(item,index) in minSignType" :key="index" :label="item.minSign"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="prdWthMax" label="宽度最大">
               <el-input v-model="formData.prdWthMax" size="small" style="width: 100%;" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="wthMaxSign" label="宽度最大符">
               <!-- <el-input v-model="wthMaxSign" size="small" readonly disabled style="width: 100%;"></el-input> -->
               <el-select v-model="wthMaxSignTypeIndex" filterable collapse-tags size="small">
                  <el-option v-for="(item,index) in maxSignType" :key="index" :label="item.maxSign"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             </tr>
             <tr>

             <td>
               <el-form-item prop="prdLenMin" label="长度最小">
               <el-input v-model="formData.prdLenMin" size="small" style="width: 100%;" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="lenMinSign" label="长度最小符">
               <!-- <el-input v-model="lenMinSign" size="small" readonly disabled style="width: 100%;"></el-input> -->
                <el-select v-model="lenMinSignTypeIndex" filterable collapse-tags size="small">
                  <el-option v-for="(item,index) in minSignType" :key="index" :label="item.minSign"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="prdLenMax" label="长度最大">
               <el-input v-model="formData.prdLenMax" size="small" style="width: 100%;" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="lenMaxSign" label="长度最大符">
               <!-- <el-input v-model="lenMaxSign" size="small" readonly disabled style="width: 100%;"></el-input> -->
               <el-select v-model="lenMaxSignTypeIndex" filterable collapse-tags size="small">
                  <el-option v-for="(item,index) in maxSignType" :key="index" :label="item.maxSign"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             </tr>
            <tr>
             <td colspan="5">
               <el-form-item prop="memo" label="备注">
               <el-input v-model="memo" size="small" style="width: 100%;" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
            </tr>
         </table>
         </el-form>
       <span slot="footer" class="dialog-footer">
        <el-button type="goon" icon="el-icon-check" size="mini" @click="tableType === 0 ? addData():modifyData()">确定</el-button>
        <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button>
      </span>
    </el-dialog>
    </div>
</template>
<script>
import {
  getCookie
} from '@/utils/util.js';
import {
  cookieUserId,
  cookieUserName
} from '@/config/config.js';
let userName = getCookie(cookieUserName);
let userId = getCookie(cookieUserId);
export default {
  props: ['showFlag', 'Params', 'Params2'],
    data () {
      var prdWthMaxVerify = (rule, value, callback) => {
	        if(this.formData.prdWthMax){
	          if(Number(this.formData.prdWthMax) > Number(this.formData.prdWthMin)){
	            callback();
	          }else{
	            callback(new Error('上限不能小于下限'));
	          }
	        }else{
	          callback();
          }
       };
        var prdLenMaxVerify = (rule, value, callback) => {
	        if(this.formData.prdLenMax){
	          if(Number(this.formData.prdLenMax) > Number(this.formData.prdLenMin)){
	            callback();
	          }else{
	            callback(new Error('上限不能小于下限'));
	          }
	        }else{
	          callback();
          }
       };
         var prdThkMaxVerify = (rule, value, callback) => {
	        if(this.formData.prdThkMax){
	          if(Number(this.formData.prdThkMax) > Number(this.formData.prdThkMin)){
	            callback();
	          }else{
	            callback(new Error('上限不能小于下限'));
	          }
	        }else{
	          callback();
          }
       };
        return {
            dialogTableVisible: false,
            tableTypeDsc: '新增测试指标集',
            tableType: 0,
            seen: true,
            seenNo: true,
            beInvalid: false,    
            memo: '',
            thkMinSignTypeIndex: 0,
            thkMaxSignTypeIndex: 0,
            wthMinSignTypeIndex: 0,
            wthMaxSignTypeIndex: 0,
            lenMinSignTypeIndex: 0,
            lenMaxSignTypeIndex: 0,
            testPlanNameTypeIndex: 0,//测试计划
            taskNameTypeIndex: 0,//测试任务
            stdNameTypeIndex: 0,//产品标准
            gradeNameTypeIndex: 0,//牌号
            judgeTypeNameTypeIndex: 0,//判定类型
            minSignType: [
              {minSign: '>='},
              {minSign: '>'}
            ],
            maxSignType: [
              {maxSign: '<='},
              {maxSign: '<'}
            ],
            testPlanNameType: [
              // {testPlanNo: '0', testPlanName: '测试计划名称1'},
              // {testPlanNo: '1', testPlanName: '测试计划名称2'}
            ],
            formData: {
              indexName: '',
              prdThkMin: '',
              prdThkMax: '',
              prdWthMin: '',
              prdWthMax: '',
              prdLenMin: '',
              prdLenMax: '',
              taskName: '',
              taskNo: '',
              testPlanName: '',
              testPlanNo: '',
            },
            taskNameType: [],
            stdNameType: [],
            gradeNameType: [],
            judgeTypeNameType: [],
            monitorForm: {
            tableData: [{}],
            monitorRules: {
              prdWthMax: [{ required: true, message: '该项不能为空', trigger: ['blur', 'change'] }, { required: true,validator: prdWthMaxVerify, trigger: 'blur' }],
              prdLenMax: [{ required: true, message: '该项不能为空', trigger: ['blur', 'change'] }, { required: true,validator: prdLenMaxVerify, trigger: 'blur' }],
              prdThkMax: [{ required: true, message: '该项不能为空', trigger: ['blur', 'change'] }, { required: true,validator: prdThkMaxVerify, trigger: 'blur' }],
              prdWthMin: [{ required: true, message: '该项不能为空', trigger: ['blur', 'change'] }],
              prdLenMin: [{ required: true, message: '该项不能为空', trigger: ['blur', 'change'] }],
              prdThkMin: [{ required: true, message: '该项不能为空', trigger: ['blur', 'change'] }],
              indexName: [{ required: true, message: '该项不能为空', trigger: ['blur', 'change'] }],
              }
            }
        }
    },
    mounted () {
      this.gettestPlanNameTypeList ()
      this.gettaskNameType ()
      this.getstdNameType ()
      this.getgradeNameType ()
      this.getjudgeTypeNameType ()
    },
    methods: {
      cancel () {
        let _this = this;
        _this.monitorForm.tableData = [{}]
        _this.dialogTableVisible = false
        _this.formData.indexName =  '',
        _this.memo = '',
        _this.formData.prdThkMin = '',
        _this.formData.prdThkMax = '',
        _this.formData.prdWthMin = '',
        _this.formData.prdWthMax = '',
        _this.formData.prdLenMin = '',
        _this.formData.prdLenMax = '',
        _this.thkMinSignTypeIndex = 0,
        _this.thkMaxSignTypeIndex = 0,
        _this.wthMinSignTypeIndex = 0,
        _this.wthMaxSignTypeIndex = 0,
        _this.lenMinSignTypeIndex = 0,
        _this.lenMaxSignTypeIndex = 0,
        _this.testPlanNameTypeIndex = 0,
        _this.taskNameTypeIndex = 0,
        _this.stdNameTypeIndex = 0,
        _this.gradeNameTypeIndex = 0,
        _this.judgeTypeNameTypeIndex = 0,
        _this.$emit('refresh')
      },
      gettestPlanNameTypeList () {
        this.axios.get('pass/baseManagement/v1/limsstdtestplans/'+ '?validFlag=1')
            .then(res => {
              this.testPlanNameType = res.data;
            })
      },
      gettaskNameType () {
        this.axios.get('pass/baseManagement/v1/limsstdtasks/'+ '?validFlag=1')
            .then(res => {
              this.taskNameType = res.data.list;
            })
      },
      getstdNameType () {
        this.axios.get('pass/baseManagement/v1/limsstdinfos/'+ '?validFlag=1')
            .then(res => {
              this.stdNameType = res.data.list;
            })
      },
      getgradeNameType () {
        this.axios.get('pass/baseManagement/v1/limsbasegrades/'+ '?validFlag=1')
            .then(res => {
              this.gradeNameType = res.data.list;
            })
      },
      getjudgeTypeNameType () {
        this.axios.post("pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",{validFlag:1,baseCode:4816}, {individualType: 'json'}).then(res => {
              this.judgeTypeNameType = res.data
            })
      },
      addData () {
        let _this = this;
         _this.$refs['monitorForm'].validate((valid) => {
          if (valid) {
             _this.dialogTableVisible = false;
             for (var i = 0; i < _this.monitorForm.tableData.length; i++) {
             _this.monitorForm.tableData[i].createMan = userName;
             _this.monitorForm.tableData[i].createNo = userId;
             }
             if (!_this.seenNo) {
             _this.monitorForm.tableData[0].testPlanNo = _this.testPlanNameType[_this.testPlanNameTypeIndex].testPlanNo;
             _this.monitorForm.tableData[0].testPlanName = _this.testPlanNameType[_this.testPlanNameTypeIndex].testPlanName;
             _this.monitorForm.tableData[0].taskNo = _this.taskNameType[_this.taskNameTypeIndex].taskNo;
             _this.monitorForm.tableData[0].taskName = _this.taskNameType[_this.taskNameTypeIndex].taskName;
             } else {
             _this.monitorForm.tableData[0].testPlanNo = _this.Params2.testPlanNo;
             _this.monitorForm.tableData[0].testPlanName = _this.Params2.testPlanName;
             _this.monitorForm.tableData[0].taskNo = _this.Params2.taskNo;
             _this.monitorForm.tableData[0].taskName = _this.Params2.taskName;
             }
             _this.monitorForm.tableData[0].stdNo = _this.stdNameType[_this.stdNameTypeIndex].stdNo;
             _this.monitorForm.tableData[0].stdName = _this.stdNameType[_this.stdNameTypeIndex].stdName;
             _this.monitorForm.tableData[0].gradeNo = _this.gradeNameType[_this.gradeNameTypeIndex].gradeNo;
             _this.monitorForm.tableData[0].gradeName = _this.gradeNameType[_this.gradeNameTypeIndex].gradeName;
             _this.monitorForm.tableData[0].judgeTypeCode = _this.judgeTypeNameType[_this.judgeTypeNameTypeIndex].baseCode;
             _this.monitorForm.tableData[0].judgeTypeName = _this.judgeTypeNameType[_this.judgeTypeNameTypeIndex].baseName;
             _this.monitorForm.tableData[0].indexName = _this.formData.indexName;
             _this.monitorForm.tableData[0].memo = _this.memo;
             _this.monitorForm.tableData[0].thkMinSign = _this.minSignType[_this.thkMinSignTypeIndex].minSign;
             _this.monitorForm.tableData[0].thkMaxSign = _this.maxSignType[_this.thkMaxSignTypeIndex].maxSign;
             _this.monitorForm.tableData[0].prdThkMin = _this.formData.prdThkMin;
             _this.monitorForm.tableData[0].prdThkMax = _this.formData.prdThkMax;
             _this.monitorForm.tableData[0].wthMinSign = _this.minSignType[_this.wthMinSignTypeIndex].minSign;
             _this.monitorForm.tableData[0].wthMaxSign = _this.maxSignType[_this.wthMaxSignTypeIndex].maxSign;
             _this.monitorForm.tableData[0].prdWthMin = _this.formData.prdWthMin;
             _this.monitorForm.tableData[0].prdWthMax = _this.formData.prdWthMax;
             _this.monitorForm.tableData[0].lenMinSign = _this.minSignType[_this.lenMinSignTypeIndex].minSign;
             _this.monitorForm.tableData[0].lenMaxSign = _this.maxSignType[_this.lenMaxSignTypeIndex].maxSign;
             _this.monitorForm.tableData[0].prdLenMin = _this.formData.prdLenMin;
             _this.monitorForm.tableData[0].prdLenMax = _this.formData.prdLenMax;
             _this.axios.post('pass/baseManagement/v1/limsstdindexs/', _this.monitorForm.tableData, {individualType: 'json'}).then(res => {
                if (res.succeed) {
                 this.$message.success('测试指标集添加成功')
                 _this.$emit('refresh')
                } else {
                 this.$message.error(res.message)
                }
                }).catch(e => {
                 this.$message.error(e.message)
               })
          }
         })
      },
      modifyData () {
        let _this = this;
        _this.$refs['monitorForm'].validate((valid) => {
        if (valid) {
        _this.dialogTableVisible = false;
         for (var i = 0; i < _this.monitorForm.tableData.length; i++) {
        _this.monitorForm.tableData[i].updateMan = userName;
        _this.monitorForm.tableData[i].updateNo = userId;
        }
        _this.monitorForm.tableData[0].testPlanNo = _this.testPlanNameType[_this.testPlanNameTypeIndex].testPlanNo;
        _this.monitorForm.tableData[0].testPlanName = _this.testPlanNameType[_this.testPlanNameTypeIndex].testPlanName;
        _this.monitorForm.tableData[0].taskNo = _this.taskNameType[_this.taskNameTypeIndex].taskNo;
        _this.monitorForm.tableData[0].taskName = _this.taskNameType[_this.taskNameTypeIndex].taskName;
        _this.monitorForm.tableData[0].stdNo = _this.stdNameType[_this.stdNameTypeIndex].stdNo;
        _this.monitorForm.tableData[0].stdName = _this.stdNameType[_this.stdNameTypeIndex].stdName;
        _this.monitorForm.tableData[0].gradeNo = _this.gradeNameType[_this.gradeNameTypeIndex].gradeNo;
        _this.monitorForm.tableData[0].gradeName = _this.gradeNameType[_this.gradeNameTypeIndex].gradeName;
        _this.monitorForm.tableData[0].judgeTypeCode = _this.judgeTypeNameType[_this.judgeTypeNameTypeIndex].baseCode;
        _this.monitorForm.tableData[0].judgeTypeName = _this.judgeTypeNameType[_this.judgeTypeNameTypeIndex].baseName;
        _this.monitorForm.tableData[0].indexName = _this.formData.indexName;
        _this.monitorForm.tableData[0].memo = _this.memo;
        _this.monitorForm.tableData[0].thkMinSign = _this.minSignType[_this.thkMinSignTypeIndex].minSign;
        _this.monitorForm.tableData[0].thkMaxSign = _this.maxSignType[_this.thkMaxSignTypeIndex].maxSign;
        _this.monitorForm.tableData[0].prdThkMin = _this.formData.prdThkMin;
        _this.monitorForm.tableData[0].prdThkMax = _this.formData.prdThkMax;
        _this.monitorForm.tableData[0].wthMinSign = _this.minSignType[_this.wthMinSignTypeIndex].minSign;
        _this.monitorForm.tableData[0].wthMaxSign = _this.maxSignType[_this.wthMaxSignTypeIndex].maxSign;
        _this.monitorForm.tableData[0].prdWthMin = _this.formData.prdWthMin;
        _this.monitorForm.tableData[0].prdWthMax = _this.formData.prdWthMax;
        _this.monitorForm.tableData[0].lenMinSign = _this.minSignType[_this.lenMinSignTypeIndex].minSign;
        _this.monitorForm.tableData[0].lenMaxSign = _this.maxSignType[_this.lenMaxSignTypeIndex].maxSign;
        _this.monitorForm.tableData[0].prdLenMin = _this.formData.prdLenMin;
        _this.monitorForm.tableData[0].prdLenMax = _this.formData.prdLenMax;
        _this.axios.put('pass/baseManagement/v1/limsstdindexs/', _this.monitorForm.tableData[0], {individualType: 'json'}).then(res => {
           if (res.succeed) {
            this.$message.success('修改成功')
            _this.$emit('refresh')
           } else {
            this.$message.error(res.message)
           }
           }).catch(e => {
            this.$message.error(e.message)
          })
        }
        })
      },
      renderHeader (h) {
         return (
             <div style="cursor: pointer ;line-height:20px" onClick={() => this.addRow()}>
             <i class="el-icon-plus" style="font-size:20px; color:rgb(18, 52, 243)"></i>
             </div>
         )
      },
     closeDialog () {
       let _this = this;
       _this.monitorForm.tableData = [{}];
       _this.seen = true;
       _this.seenNo = true;
       _this.beInvalid = false;
       _this.formData.indexName =  '',
       _this.memo = '',
       _this.formData.prdThkMin = '',
       _this.formData.prdThkMax = '',
       _this.formData.prdWthMin = '',
       _this.formData.prdWthMax = '',
       _this.formData.prdLenMin = '',
       _this.formData.prdLenMax = '',
       _this.thkMinSignTypeIndex = 0,
       _this.thkMaxSignTypeIndex = 0,
       _this.wthMinSignTypeIndex = 0,
       _this.wthMaxSignTypeIndex = 0,
       _this.lenMinSignTypeIndex = 0,
       _this.lenMaxSignTypeIndex = 0,
       _this.testPlanNameTypeIndex = 0,
       _this.taskNameTypeIndex = 0,
       _this.stdNameTypeIndex = 0,
       _this.gradeNameTypeIndex = 0,
       _this.judgeTypeNameTypeIndex = 0,
       _this.$emit('refresh')
     },
      tableHeaderCellStyle () {
      return 'background-color: rgb(249,249,249) !important;color: rgb(73, 72, 72);border-bottom: 1px solid #DCDFE7;border-top:3px solid #3ac1ea;'
      }
    },
    watch: {
      showFlag (arg) {
        let _this = this;
        _this.dialogTableVisible = true;
        if (_this.Params !== null) {
          _this.monitorForm.tableData[0] = _this.Params[0];
          _this.tableType = 1;
          _this.tableTypeDsc = '修改测试指标集';
          _this.seen = false;
          _this.beInvalid = true;
          _this.seenNo = true;
          _this.formData.indexName = _this.monitorForm.tableData[0].indexName;
          _this.memo = _this.monitorForm.tableData[0].memo;
          _this.formData.prdThkMin = _this.monitorForm.tableData[0].prdThkMin;
          _this.formData.prdThkMax = _this.monitorForm.tableData[0].prdThkMax;
          _this.formData.prdWthMin = _this.monitorForm.tableData[0].prdWthMin;
          _this.formData.prdWthMax = _this.monitorForm.tableData[0].prdWthMax;
          _this.formData.prdLenMin = _this.monitorForm.tableData[0].prdLenMin;
          _this.formData.prdLenMax = _this.monitorForm.tableData[0].prdLenMax;
          _this.formData.taskNo = _this.monitorForm.tableData[0].taskNo;
          _this.formData.taskName = _this.monitorForm.tableData[0].taskName;
          _this.formData.testPlanNo = _this.monitorForm.tableData[0].testPlanNo;
          _this.formData.testPlanName = _this.monitorForm.tableData[0].testPlanName;
          for (let j = 0; j < _this.testPlanNameType.length; j++) {
           if (_this.testPlanNameType[j].testPlanName === _this.monitorForm.tableData[0].testPlanName) {
              _this.testPlanNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.taskNameType.length; j++) {
           if (_this.taskNameType[j].taskName === _this.monitorForm.tableData[0].taskName) {
              _this.taskNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.stdNameType.length; j++) {
           if (_this.stdNameType[j].stdName === _this.monitorForm.tableData[0].stdName) {
              _this.stdNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.gradeNameType.length; j++) {
           if (_this.gradeNameType[j].gradeName === _this.monitorForm.tableData[0].gradeName) {
              _this.gradeNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.judgeTypeNameType.length; j++) {
           if (_this.judgeTypeNameType[j].baseName === _this.monitorForm.tableData[0].judgeTypeName) {
              _this.judgeTypeNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.minSignType.length; j++) {
           if (_this.minSignType[j].minSign === _this.monitorForm.tableData[0].thkMinSign) {
              _this.thkMinSignTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.maxSignType.length; j++) {
           if (_this.maxSignType[j].maxSign === _this.monitorForm.tableData[0].thkMaxSign) {
              _this.thkMaxSignTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.minSignType.length; j++) {
           if (_this.minSignType[j].minSign === _this.monitorForm.tableData[0].wthMinSign) {
              _this.wthMinSignTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.maxSignType.length; j++) {
           if (_this.maxSignType[j].maxSign === _this.monitorForm.tableData[0].wthMaxSign) {
              _this.wthMaxSignTypeIndex = j;
           }
          }
           for (let j = 0; j < _this.minSignType.length; j++) {
           if (_this.minSignType[j].minSign === _this.monitorForm.tableData[0].lenMinSign) {
              _this.lenMinSignTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.maxSignType.length; j++) {
           if (_this.maxSignType[j].maxSign === _this.monitorForm.tableData[0].lenMaxSign) {
              _this.lenMaxSignTypeIndex = j;
           }
          }
        } else {
          _this.tableType = 0;
          if (_this.Params2 !== null) {
          _this.seenNo = true;
          console.log('fwefw',_this.Params2, null)
          _this.formData.taskNo = _this.Params2.taskNo;
          _this.formData.taskName = _this.Params2.taskName;
          _this.formData.testPlanNo = _this.Params2.testPlanNo;
          _this.formData.testPlanName = _this.Params2.testPlanName;
          } else {
          _this.seenNo = false;
          }
          console.log(_this.seenNo)
          _this.tableTypeDsc = '新增测试指标集';
        }
      }
    }
}
</script>
<style lang="less">
.customWidth_standas{
  width: 800px !important
}
</style>
