licp
2024-09-06 bf48d316c05720a0da527c990c45f17e9e69ed6f
新增电路检验功能
已修改4个文件
已添加3个文件
1856 ■■■■■ 文件已修改
src/assets/api/controller.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 205 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/circuit-parameters1.vue 732 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/circuit-parameters2.vue 630 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/circuit.vue 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspect-order-plan.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -193,6 +193,9 @@
  claimInsOrderPlan: "/insOrderPlan/claimInsOrderPlan", //认领检验任务
  doInsOrder: "/insOrderPlan/doInsOrder", //执行检验操作
  saveInsContext: "/insOrderPlan/saveInsContext", //保存检验内容
  saveInsContext2: "/insOrderPlan/saveInsContext2", //保存检验内容
  deleteInsContext: "/insOrderPlan/deleteInsContext", //删除频段
  deleteInsContext2: "/insOrderPlan/deleteInsContext2", //删除频点
  upPlanUser: "/insOrderPlan/upPlanUser", //任务交接
  upPlanUser2: "/insOrderPlan/upPlanUser2", //任务交接
  verifyPlan: "/insOrderPlan/verifyPlan", //复核检验任务
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -253,9 +253,6 @@
      <el-col :span="12" style="padding-left: 20px;text-align: left;" >检验单详情
      </el-col>
      <el-col :span="12" style="text-align: right;">
        <!-- <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">光纤切换</el-button>
        <el-button size="small" type="primary" @click="fiberOpticTapeVisible=true" v-if="fiberOpticTape.length>0">光纤带切换</el-button>
        <el-button size="small" type="primary" @click="bushingVisible=true" v-if="bushing.length>0">套管切换</el-button> -->
        <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">样品切换</el-button>
        <el-button size="small" type="primary" @click="taskVisible=true">任务切换</el-button>
        <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1"
@@ -275,7 +272,7 @@
        </el-form-item>
        <el-form-item label="样品编号:">
          <el-tooltip :disabled="!currentSample.sampleCode" :content="currentSample.sampleCode">
            <el-input clearable v-model="currentSample.sampleCode" disabled size="small" placeholder="请输入" ></el-input>
            <el-input clearable v-model="currentSample.sampleCode" disabled size="small" placeholder="请输入" tooltip></el-input>
          </el-tooltip>
        </el-form-item>
        <el-form-item label="样品名称:">
@@ -283,6 +280,9 @@
        </el-form-item>
        <el-form-item label="样品数量:">
          <el-input clearable v-model="sampleProduct.length" disabled size="small" placeholder="请输入" ></el-input>
        </el-form-item>
        <el-form-item label="试验标准:">
          <span>{{ insOrder.testRequirements?insOrder.testRequirements:'-' }}</span>
        </el-form-item>
        <el-form-item label="下发时间:">
          <el-input clearable v-model="insOrder.sendTime" disabled size="small" placeholder="请输入"></el-input>
@@ -298,7 +298,6 @@
        </el-form-item>
        <el-form-item label="备注:">
          <span style="color:red">{{ insOrder.remark?insOrder.remark:'-' }}</span>
          <!-- <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> -->
        </el-form-item>
      </el-form>
    </div>
@@ -309,6 +308,11 @@
          <el-radio-group v-model="currentTable" size="small">
            <el-radio-button :label="item.templateId" v-for="(item,index) in tableLists" :key="index"
              size="small">{{ item.templateName }}</el-radio-button>
          </el-radio-group>
          <span style="margin-left: 20px;margin-right: 10px;">模板版本:</span>
          <el-radio-group v-model="currentTableState" size="small">
            <el-radio-button label="0" size="small">版本一</el-radio-button>
            <el-radio-button label="1" size="small">版本二</el-radio-button>
          </el-radio-group>
        </div>
        <div style="display: flex;align-items: center;">
@@ -345,22 +349,12 @@
              <el-tag :type="item.state==1?'success':'danger'" style="float: right;margin-top: 5px;" size="small">{{ item.state==1?'已检':'未检' }}</el-tag>
            </el-option>
          </el-select>
          <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px" style="padding-top: 0;padding-left: 10px;" v-if="PROJECT=='检测中心'">
            <el-form-item label="温度:" style="margin-bottom: 0;">
              <el-input v-model="otherForm.temperature" :disabled="state>1" size="small" placeholder="" style="width: 90px;" @change="m=>subOtherForm(m,'temperature')" ></el-input>
              <span style="margin-left: 4px;">℃</span>
            </el-form-item>
            <el-form-item label="湿度:" style="margin-bottom: 0;">
              <el-input v-model="otherForm.humidity" :disabled="state>1" size="small" placeholder="" style="width: 90px;" @change="m=>subOtherForm(m,'humidity')"></el-input>
              <span style="margin-left: 4px;">%</span>
            </el-form-item>
          </el-form>
          <el-button type="primary" size="small" v-if="(isGet||tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='温度循环检验原始记录'&&temDataAcquisition)&&PROJECT=='检测中心'&&state==1" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">数据采集</el-button>
          <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="(isGet||(tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='温度循环检验原始记录'))&&PROJECT=='检测中心'&&collected&&state==1" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'关闭编辑':'编辑数采'}}</el-button>
        </div>
      </div>
      <!-- å¸¸è§„检验原始记录 -->
      <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('热循环')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('温升试验'))&&(tableLists.find(m=>m.templateId==currentTable).templateName!='弧垂特性检验原始记录')">
      <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(!tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验'))">
        <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index+currentTable+currentSample.id">
          <tbody>
            <tr v-for="(m,i) in item.arr" :key="i">
@@ -803,6 +797,12 @@
          </table>
        </div>
      </div>
      <!-- ç”µè·¯è¯•验 -->
      <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')" style="width: 100%;overflow-x: auto;overflow-y: visible;">
        <!-- <Circuit></Circuit> -->
        <CircuitParameters1 v-if="currentTableState==0" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state"></CircuitParameters1>
        <CircuitParameters2 v-if="currentTableState==1" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state"></CircuitParameters2>
      </div>
      <el-upload :action="action"
      :data="{
        orderId:id
@@ -818,43 +818,6 @@
        :delUrl="$api.insOrderPlan.delfile"
        :key="upIndex" style="height: 100%;margin-top: 16px;"/>
    </div>
    <el-drawer title="光纤切换" :visible.sync="fiberOpticVisible" :size="500">
      <el-table class="el-table" ref="fiberOpticTable" :data="fiberOptic" height="100%" tooltip-effect="dark" border
        highlight-current-row @row-click="handleChangeOptic" :row-class-name="tableRowClassName"
        :current-row-key="currentKey2" :row-key="record=>record.index" v-if="fiberOpticVisible">
        <el-table-column type="index" align="center" label="序号" width="70px" :key="Math.random()">
        </el-table-column>
        <el-table-column prop="bushColor" label="管套色标" min-width="100px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="color" label="光纤色标" min-width="100px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="model" label="光纤规格" min-width="130px" show-overflow-tooltip
         ></el-table-column>
        <el-table-column prop="standard" label="参考标准" width="100px" show-overflow-tooltip></el-table-column>
      </el-table>
    </el-drawer>
    <el-drawer title="光纤带切换" :visible.sync="fiberOpticTapeVisible" :size="500">
      <el-table class="el-table" ref="fiberOpticTapeTable" :data="fiberOpticTape" height="100%" tooltip-effect="dark" border
        highlight-current-row @row-click="handleChangeTape" :row-class-name="tableRowClassName"
        :current-row-key="currentKey1" :row-key="record=>record.index" v-if="fiberOpticTapeVisible">
        <el-table-column type="index" align="center" label="序号" width="70px" :key="Math.random()">
        </el-table-column>
        <el-table-column prop="code" label="光纤带编号" min-width="110px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="model" label="光纤带规格" min-width="110px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="standard" label="参考标准" width="90px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="num" label="光纤检测量" min-width="110px" show-overflow-tooltip
          ></el-table-column>
      </el-table>
    </el-drawer>
    <el-drawer title="套管切换" :visible.sync="bushingVisible" :size="500">
      <el-table class="el-table" ref="bushingTable" :data="bushing" height="100%" tooltip-effect="dark" border
        highlight-current-row @row-click="handleChangeBushing" :row-class-name="tableRowClassName"
        :current-row-key="currentKey0" :row-key="record=>record.index" v-if="bushingVisible">
        <el-table-column type="index" align="center" label="序号" width="70px" :key="Math.random()">
        </el-table-column>
        <el-table-column prop="color" label="管色标" min-width="100px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="standNum" label="标量" min-width="100px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="testNum" label="测试量" min-width="100px" show-overflow-tooltip></el-table-column>
      </el-table>
    </el-drawer>
    <el-drawer title="样品切换" :visible.sync="sampleVisible" :size="500">
      <el-table class="el-table" ref="productTable" :data="sampleProduct" height="100%" tooltip-effect="dark" border
        highlight-current-row @row-click="handleChangeSample" :row-class-name="tableRowClassName"
@@ -955,15 +918,22 @@
<script>
  import ValueTable from '../../tool/value-table.vue'
  import Circuit from './circuit.vue'
  import file from '../../../util/file'
  import excelFunction from '../../../util/excelFountion'
  import CircuitParameters1 from './circuit-parameters1.vue'
  import CircuitParameters2 from './circuit-parameters2.vue'
  export default {
    props: ['sonLaboratory', 'orderId', 'state','inspectorList'],
    components: {
      ValueTable,
      Circuit,
      CircuitParameters1,
      CircuitParameters2
    },
    data() {
      return {
        currentTableState:0,
        sagData: [],
        sagForm: {
          sampleCode: null,
@@ -1088,9 +1058,6 @@
        verifyUser: null,
        personList: [],
        enumList: [],
        fiberOpticVisible:false,
        fiberOpticTapeVisible:false,
        bushingVisible:false,
        fiberOpticTape:[],//光纤带列表
        fiberOptic:[],//光纤列表
        bushing:[],//套管列表
@@ -1112,10 +1079,6 @@
        numOptions:[],
        temperatureOptions:[],
        wareTableData:[],
        otherForm:{
          humidity:null,
          temperature:null,
        },
        equipForm:{
          value0:null,
          code0:null,
@@ -1142,30 +1105,7 @@
        },
        thermalCyclingLoading:false,
        temDataAcquisition:false,
        getData:[
          {
            faName:'波长附加衰减',
            child:[
              {
                name:'1285nm~1330nm',
                arr:[12,13,14,15],
              },
              {
                name:'1525nm~1575nm',
                arr:[12,13,14,15],
              },
            ]
          },
          {
            faName:'截至波长',
            child:[
              {
                name:'截至波长',
                arr:[12,13,14,15],
              }
            ]
          }
        ],
        getData:[],
        getDataIndex:[],
        getDataIndexLoading:false,
        changeType:null,
@@ -1222,14 +1162,6 @@
          this.sampleProduct = res.data.sampleProduct
          this.currentSample = this.HaveJson(this.sampleProduct[0])
          let insProduct = this.HaveJson(this.currentSample.insProduct)
          // æ¸©åº¦ã€æ¹¿åº¦èµ‹å€¼
          if(insProduct&&insProduct.length>0){
            let {temperature,humidity} = insProduct[0];
            this.otherForm = {
              temperature:temperature?temperature:null,
              humidity:humidity?humidity:null,
            }
          }
          // èŽ·å–å½“å‰æ ·å“çš„æ£€éªŒé¡¹
          let list = await this.getCurrentProduct(this.currentSample.id,0)
          this.currentSample.insProduct = this.HaveJson(list)
@@ -2182,25 +2114,6 @@
        this.saveInsContext()
      },
      // çƒ­å¾ªçޝ---结束
      // ä¿å­˜æ¹¿åº¦ã€æ¸©åº¦æ•°æ®
      subOtherForm(m,type){
        let ids = []
        for (let i in this.param) {
          ids.push(i)
        }
        this.$axios.post(this.$api.insOrderPlan.write,{
          [type]:Number(m),
          ids
        }, {
          headers: {
            'Content-Type': 'application/json'
          },
          noQs:true
        }).then(res => {
          if (res.code == 201) return
          this.$message.success('保存成功')
        })
      },
      // æƒé™èŽ·å–
      getPower(){
        let power = JSON.parse(sessionStorage.getItem('power'))
@@ -2243,63 +2156,6 @@
        let res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory)
        this.tableLoading = false;
        return res.data
      },
      handleChangeBushing(row, column, event){
        this.currentBushing = row;
        this.fiberOpticTape = []
        this.currentFiberOpticTape = null;
        this.fiberOptic = []
        this.currentFiberOptic = null;
        if(row.fiber&&row.fiber.length>0){
          // ç›´æŽ¥é…ç½®å…‰çº¤
          this.fiberOptic = row.fiber;
        }else if(row.fibers&&row.fibers.length>0){
          // é…ç½®å…‰çº¤å¸¦åŽï¼Œå†é…ç½®å…‰çº¤
          this.fiberOpticTape = row.fibers;
        }
        this.bushingVisible = false;
        this.currentKey0 = row.index
      },
      async handleChangeOptic(row, column, event){
        this.currentFiberOptic = row;
        this.currentFiberOptic.productList.forEach(a => {
          this.param[a.id] = {
            insValue: [],
            comValue: [],
            resValue: null,
            equipValue: [],
            equipName: [],
            insResult: null
          }
        })
        this.fiberOpticVisible = false;
        let list = await this.getCurrentProduct(row.id,2)
        this.getTableLists0(list)
        this.currentKey2 = row.index
      },
      async handleChangeTape(row, column, event){
        this.currentFiberOpticTape = row;
        this.param = {}
        this.fiberOptic = []
        this.currentFiberOptic = null;
        this.currentFiberOpticTape.productList.forEach(a => {
          this.param[a.id] = {
            insValue: [],
            comValue: [],
            resValue: null,
            equipValue: [],
            equipName: [],
            insResult: null
          }
        })
        this.fiberOpticTapeVisible = false;
        let list = await this.getCurrentProduct(row.id,1)
        this.getTableLists0(list)
        if(row.fiber&&row.fiber.length>0){
          // é…ç½®å…‰çº¤
          this.fiberOptic = row.fiber;
        }
        this.currentKey1 = row.index
      },
      // åˆ‡æ¢æ ·å“
      async handleChangeSample(row, column, event) {
@@ -3357,14 +3213,6 @@
          this.$message.error("请指定复核人员")
          return
        }
        if(!this.otherForm.humidity){
          this.$message.error("请输入湿度")
          return
        }
        if(!this.otherForm.temperature){
          this.$message.error("请输入温度")
          return
        }
        this.addVerifyDia = false
        this.submitLoading = true;
        this.$axios.post(this.$api.insOrderPlan.checkSubmitPlan, {
@@ -3649,7 +3497,6 @@
            insResult: null
          }
        })
        this.fiberOpticTapeVisible = false;
        let list = await this.getCurrentProduct(this.currentFiberOpticTape.id,1)
        this.getTableLists0(list)
        if(this.currentFiberOpticTape.fiber&&this.currentFiberOpticTape.fiber.length>0){
@@ -3742,6 +3589,10 @@
        }else{
          return v
        }
      },
      async getCurrentItem(){
        let list = await this.getCurrentProduct(this.currentSample.id,0)
        this.currentSample.insProduct = this.HaveJson(list)
      }
    }
  }
src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,732 @@
<template>
  <div class="circuit-parameters">
    <el-divider></el-divider>
    <el-row :gutter="5" style="width: calc(100% - 1px);margin-bottom: 10px;">
      <el-col :span="17">
        <el-row>
          <el-col :span="23" style="display: flex;flex-wrap: wrap;">
            <table border="1" cellpadding="10" style="margin: 0 10px 10px 0;" v-for="(item,index) in insProductNew" :key="index + 'ppp'" v-show="isMore?true:(index<3?true:false)">
              <tr>
                <td style="text-align: center;background: #F0F1F5;">
                  <el-tooltip effect="dark" :content="item.inspectionItemSubclass" placement="top-start"><span style="display: inline-block;width: 95px;" class="single-line-ellipsis">{{ item.inspectionItemSubclass }}</span>
                  </el-tooltip>
                </td>
                <td>
                  <el-input size="small" placeholder="设备名称" v-model="item.equipName" style="width: 95px;" readonly></el-input>
                </td>
                <td>
                  <el-select v-model="item.equipValue" placeholder="设备编码" size="small" style="width: 95px;"  :disabled="state>1" @focus="methodFocus(item)" @change="m=>handleEquip(m,item)">
                    <el-option
                      v-for="m in item.equipOptions"
                      :key="m.value"
                      :label="m.value"
                      :value="m.value">
                    </el-option>
                  </el-select>
                </td>
              </tr>
            </table>
          </el-col>
          <el-col :span="1" v-show="insProductNew.length>3">
            <el-button icon="el-icon-arrow-down" type="text" @click="isMore=true" v-if="!isMore">更多</el-button>
            <el-button icon="el-icon-arrow-up" type="text" @click="isMore=false" v-if="isMore">收起</el-button>
          </el-col>
        </el-row>
      </el-col>
      <el-col :span="7">
        <div style="display: flex;align-items: center;justify-content: flex-end;" class="btns">
          <el-button type="primary" size="small" @click="addList(allBandList)" :disabled="state>1">添加频段</el-button>
          <el-button size="small" @click="deleteList(allBandList.length-1,allBandList,'删除频段')" :disabled="state>1">删除频段</el-button>
          <el-button type="primary" size="small" @click="addList(angleList)" :disabled="state>1">添加角度</el-button>
          <el-button size="small" @click="deleteList(angleList.length-1,angleList)" :disabled="state>1">删除角度</el-button>
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="5" style="font-size: 18px;font-weight: 700;background: #F0F1F5;padding: 16px 0;box-sizing: border-box;width: 100%;">
      <el-col :span="2">
        <div style="text-align: center;">检验项目</div>
      </el-col>
      <el-col :span="2">
        <div style="text-align: center;">单位</div>
      </el-col>
      <el-col :span="2">
        <div style="text-align: center;">标准要求</div>
      </el-col>
      <el-col :span="16">
        <div style="text-align: center;">检验结果</div>
      </el-col>
      <el-col :span="2">
        <div style="text-align: center;">结论</div>
      </el-col>
    </el-row>
    <div class="circuit-parameters-item" v-for="(h,y) in allBandList" :key="y+'ooo'">
      <div class="circuit-parameters-item-title">
        <span>频段:</span>
        <el-select v-model="h.band" placeholder="请选择" size="small" style="width: 200px;" :disabled="state>1">
          <el-option
            v-for="item in bandList"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
        <el-button type="primary" size="small" @click="addList(h.projectList,'互调')" style="margin-left: 16px;" :disabled="state>1">添加互调</el-button>
        <el-button size="small" @click="deleteList(0,h.projectList,'互调')" :disabled="state>1">删除互调</el-button>
        <el-button type="primary" size="small" @click="save(h,y)" :disabled="state>1" :loading="loading[y]">保 å­˜</el-button>
      </div>
      <el-divider></el-divider>
      <div class="circuit-parameters-item-content">
        <template v-for="(n,j) in h.projectList">
          <!-- ç”µåŽ‹é©»æ³¢æ¯” -->
          <el-row :gutter="5" style="margin: 12px 0 0;display: flex;align-items: center;" v-if="n.inspectionItemSubclass.includes('驻波比')||n.inspectionItemSubclass.includes('隔离度')">
            <el-col :span="2">
              <div style="text-align: center;">{{ n.inspectionItemSubclass }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.unit }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.tell }}</div>
            </el-col>
            <el-col :span="16">
              <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
                <table border="1" cellpadding="10" class="thermal-table">
                  <tr>
                    <td>端口</td>
                    <td v-for="(item,index) in n.portList" :key="index+'aaa'">
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="端口" v-model="item.value" :disabled="state>1"></el-input>
                      </div>
                    </td>
                    <td :rowspan="n.angleList.length+1">
                      <el-button icon="el-icon-minus" circle size="mini" type="danger"
                      @click="deleteList(n.portList.length-1,n.portList)" :disabled="state>1"></el-button>
                      <el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addList(n.portList)" :disabled="state>1"></el-button>
                    </td>
                  </tr>
                  <tr v-for="(item,index) in n.angleList" :key="index + 'eee'">
                    <td>
                      <el-input size="small" placeholder="角度" v-model="item.value" @blur="handleAngle(item.value,index)" :disabled="state>1"></el-input>
                    </td>
                    <td v-for="(m,i) in n.portList" :key="i+'ggg'">
                      <el-input size="small" placeholder="最差值" v-model="n.value[index][i]" v-if="n.value[index]" :disabled="state>1"></el-input>
                    </td>
                  </tr>
                </table>
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              </div>
            </el-col>
          </el-row>
          <!-- äº’è°ƒ -->
          <el-row :gutter="5" style="margin: 12px 0 0;display: flex;align-items: center;" v-if="n.inspectionItemSubclass.includes('互调')">
            <el-col :span="2">
              <div style="text-align: center;">{{ n.inspectionItemSubclass }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.unit }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.tell }}</div>
            </el-col>
            <el-col :span="16">
              <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
                <table border="1" cellpadding="10" class="thermal-table">
                  <tr>
                    <td>频点</td>
                    <td :colspan="n.portList.length+1">
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="频点" v-model="n.often" :disabled="state>1" @blur="handlePort(n)"></el-input>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td>角度</td>
                    <td v-for="(item,index) in n.portList" :key="index+'fff'">
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="端口" v-model="item.value" :disabled="state>1"></el-input>
                      </div>
                    </td>
                    <td :rowspan="n.angleList.length+1">
                      <el-button icon="el-icon-minus" circle size="mini" type="danger"
                      @click="deleteList(n.portList.length-1,n.portList)" :disabled="state>1"></el-button>
                      <el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addList(n.portList)" :disabled="state>1"></el-button>
                    </td>
                  </tr>
                  <tr v-for="(item,index) in n.angleList" :key="index + 'eee'">
                    <td>
                      <el-input size="small" placeholder="角度" v-model="item.value" :disabled="state>1" @blur="handleAngle(item.value,index)"></el-input>
                    </td>
                    <td v-for="(m,i) in n.portList" :key="i+'ggg'">
                      <el-input size="small" placeholder="最差值" v-model="n.value[index][i]" v-if="n.value[index]" :disabled="state>1"></el-input>
                    </td>
                  </tr>
                </table>
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              </div>
            </el-col>
          </el-row>
          <!-- å¹…度偏差/最大相位偏差 -->
          <el-row :gutter="5" style="margin: 12px 0 0;display: flex;align-items: center;" v-if="n.inspectionItemSubclass.includes('偏差')">
            <el-col :span="2">
              <div style="text-align: center;">{{ n.inspectionItemSubclass }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.unit }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.tell }}</div>
            </el-col>
            <el-col :span="16">
              <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
                <table border="1" cellpadding="10" class="thermal-table">
                  <tr>
                    <td>频段</td>
                    <td v-for="(item,index) in n.portList" :key="index+'aaa'">
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="端口" v-model="item.value" :disabled="state>1"></el-input>
                      </div>
                    </td>
                    <td :rowspan="n.angleList.length+1">
                      <el-button icon="el-icon-minus" circle size="mini" type="danger"
                      @click="deleteList(n.portList.length-1,n.portList)" :disabled="state>1"></el-button>
                      <el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addList(n.portList)" :disabled="state>1"></el-button>
                    </td>
                  </tr>
                  <tr v-for="(item,index) in n.angleList" :key="index + 'eee'">
                    <td>
                      <el-input size="small" placeholder="角度" v-model="item.value" :disabled="state>1" @blur="handleAngle(item.value,index)"></el-input>
                    </td>
                    <td v-for="(m,i) in n.portList" :key="i+'ggg'">
                      <el-input size="small" placeholder="最差值" v-model="n.value[index][i]" v-if="n.value[index]" :disabled="state>1"></el-input>
                    </td>
                  </tr>
                </table>
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              </div>
            </el-col>
          </el-row>
          <!-- æœ€å¤§è€¦åˆåº¦/最小耦合度 -->
          <el-row :gutter="5" style="margin: 12px 0 0;display: flex;align-items: center;" v-if="n.inspectionItemSubclass.includes('耦合度')">
            <el-col :span="2">
              <div style="text-align: center;">{{ n.inspectionItemSubclass }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.unit }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.tell }}</div>
            </el-col>
            <el-col :span="16">
              <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
                <table border="1" cellpadding="10" class="thermal-table">
                  <tr>
                    <td>角度</td>
                    <td>
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="频点" v-model="n.often" :disabled="state>1" @blur="handlePort(n)"></el-input>
                      </div>
                    </td>
                  </tr>
                  <tr v-for="(item,index) in n.angleList" :key="index + 'eee'">
                    <td>
                      <el-input size="small" placeholder="角度" v-model="item.value" :disabled="state>1" @blur="handleAngle(item.value,index)"></el-input>
                    </td>
                    <td>
                      <el-input size="small" placeholder="最差值" v-model="n.value[index][0]" :disabled="state>1"></el-input>
                    </td>
                  </tr>
                </table>
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              </div>
            </el-col>
          </el-row>
          <el-divider v-if="j!=h.projectList.length-1"></el-divider>
        </template>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props:['insProduct','orderId','sampleId','state'],
  data() {
    return {
      value: "",
      bandList:[],
      portList:[
        {
          value:'1',
        },
        {
          value:'2',
        },
        {
          value:'3',
        },
        {
          value:'4',
        },
      ],
      angleList:[
        {
          value:''
        }
      ],
      projectList:[
        {
          name:'电压驻波比',
          unit:'/',
          tell:'≤1.45',
          result:'',
          conclusion:'合格',
          portList:[],
          angleList:[],
          value:[],//双层数组
        },
        {
          name:'同极化隔离度',
          unit:'dB',
          tell:'≤1.45',
          result:'',
          conclusion:'合格',
          portList:[],
          angleList:[],
          value:[],//双层数组
        },
        {
          name:'互调',
          band:'2100MHz',
          unit:'dB',
          tell:'≤1.45',
          result:'',
          conclusion:'合格',
          portList:[],
          angleList:[],
          value:[],//双层数组
        },
        {
          name:'偏差',
          unit:'dB',
          tell:'≤1.45',
          result:'',
          conclusion:'合格',
          portList:[],
          angleList:[],
          value:[],//双层数组
        },
        {
          name:'最大耦合度',
          unit:'dB',
          band:'2100MHz',
          tell:'≤1.45',
          result:'',
          conclusion:'合格',
          portList:[],
          angleList:[],
          value:[],//双层数组
          resValue:''
        },
      ],
      allBandList:[],//频段
      insProductNew:[],
      isMore:false,
      loading:{}
    };
  },
  watch: {
    // è§’度数量变化时,更新所有频段下面的所有项目下的所有端口和角度
    angleList(val) {
      this.allBandList.forEach(item => {
        item.projectList.forEach(m => {
          if(m.angleList.length!==val.length){
            m.angleList = JSON.parse(JSON.stringify(this.angleList))
          }
          if(m.inspectionItemSubclass.includes('耦合度')){
            for(let i = 0;i<m.angleList.length;i++){
              if(!m.value[i]){
                this.$set(m.value,i, [])
              }
              if(!m.value[i][0]){
                m.value[i][0] = ''
              }
            }
          }else{
            for(let i = 0;i<m.angleList.length;i++){
              if(!m.value[i]){
                this.$set(m.value,i, [])
              }
              for(let j=0;j<m.portList.length;j++){
                if(!(m.value[i][j]===''||m.value[i][j])){
                  m.value[i].push('')
                }
              }
            }
          }
        })
      })
      console.log(this.allBandList)
    }
  },
  mounted() {
    this.getTypeDicts()
    this.initData()
  },
  methods: {
    // å­—典获取数据
    getTypeDicts() {
      this.$axios.post(this.$api.enums.selectEnumByCategory, {
        category: "电路试验波段"
      }).then(res => {
        this.bandList = res.data
      })
    },
    // åˆå§‹åŒ–数据
    initData(){
      // å¤„理项目
      this.insProductNew = JSON.parse(JSON.stringify(this.insProduct))
      this.insProductNew.forEach(async item => {
        // èŽ·å–è®¾å¤‡åˆ—è¡¨
        item.equipOptions = await this.getEquipOptions(item)
      })
      if(this.insProductNew[0].insProductResult2&&this.insProductNew[0].insProductResult2.length>0){
        // å·²ç»å­˜åœ¨å€¼æ—¶ï¼Œèµ‹å€¼
        let bandList = this.insProductNew[0].insProductResult2.map(m=>m.frequency)
        bandList = Array.from(new Set(bandList))
        this.allBandList = []
        for(let i = 0;i<bandList.length;i++){
          let arr = []
          this.insProductNew.forEach(item => {
            let equipNameList = []
            let equipValueList = []
            item.insProductResult2.forEach(n => {
              if(n.frequency===bandList[i]){
                // èµ‹å€¼é¡µé¢è®¾å¤‡åç§°å’Œå€¼
                if(n.equipValue){
                  equipNameList.push(n.equipName)
                  equipValueList.push(n.equipValue)
                }
                // ä»¥ä¸‹ä¸ºèµ‹å€¼åˆ—表信息
                let portList = []
                let angleList = []
                if(n.port&&n.port.split(',').length>0){
                  n.port.split(',').forEach(m=>{
                    portList.push({value:m})
                  })
                }
                if(n.angle&&n.angle.split(',').length>0){
                  n.angle.split(',').forEach(m=>{
                    angleList.push({value:m})
                  })
                  this.angleList = angleList
                }
                let obj = {
                  inspectionItemSubclass: item.inspectionItemSubclass,
                  unit:item.unit,
                  tell:item.tell,
                  result:n.result,
                  id:item.id,
                  often:n.often,
                  equipName:n.equipName,
                  equipValue:n.equipValue,
                  frequency:n.frequency
                }
                this.$set(obj,'portList', n.port?portList:[])
                this.$set(obj,'angleList', n.angle?angleList:[])
                this.$set(obj,'value', JSON.parse(n.value))
                arr.push(obj)
              }
            })
            if(equipValueList.length>0){
              this.$delete(item,'equipName')
              this.$delete(item,'equipValue')
              this.$set(item,'equipName',equipNameList[equipNameList.length-1])
              this.$set(item,'equipValue',equipValueList[equipValueList.length-1])
            }
          })
          this.$set(this.allBandList,i, {
            band: bandList[i],
            projectList: arr
          })
        }
      }else{
        // æ²¡æœ‰å€¼æ—¶ï¼Œåˆå§‹åŒ–页面
        this.insProductNew.forEach(async item => {
          // èµ‹å€¼è®¾å¤‡
          item.equipName = ''
          item.equipValue = ''
          // èµ‹å€¼ç«¯å£å’Œè§’度
          item.portList = JSON.parse(JSON.stringify(this.portList))
          item.angleList = JSON.parse(JSON.stringify(this.angleList))
          // èµ‹å€¼ç»“论
          item.result = ''
          // èµ‹å€¼æœ€å·®å€¼
          item.value = []
          if(item.inspectionItemSubclass.includes('耦合度')){
            for(let i = 0;i<item.angleList.length;i++){
              item.value.push([''])
            }
          }else{
            for(let i = 0;i<item.angleList.length;i++){
              item.value.push([])
              for(let j=0;j<item.portList.length;j++){
                item.value[i].push('')
              }
            }
          }
        })
        // åˆå§‹åŒ–频段
        this.allBandList.push(
          {
            band:'',
            projectList: JSON.parse(JSON.stringify(this.insProductNew))
          }
        )
      }
    },
    // åˆ é™¤æ•°ç»„
    deleteList(index,list,type){
      if(list.length>1){
        if(type=='互调'){
          let index = null;
          let num = 0;
          list.forEach((m,i)=>{
            if(m.inspectionItemSubclass.includes('互调')){
              index = i;
              num++
            }
          })
          if(num==1){
            this.$message({
              type: 'warning',
              message: '不能删除最后一个互调'
            });
          }else{
            if(list[index].frequency){
              this.$confirm(`是否确定删除 ${list[index].often} é¢‘点数据?`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
              }).then(() => {
                this.$axios.post(this.$api.insOrderPlan.deleteInsContext2, {
                  frequency:list[index].frequency,
                  productId:list[index].id,
                  often:list[index].often
                }).then(res => {
                  if (res.code === 201) {
                    this.$message.error('删除失败')
                    return
                  }
                  this.$message.success('已删除')
                  list.splice(index, 1)
                }).catch(err => {
                  console.log(err)
                })
              }).catch(() => {})
            }else{
              list.splice(index, 1)
            }
          }
        }else if(type=='删除频段'){
          this.$confirm(`是否确定删除 ${list[index].band} é¢‘段数据?`, "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            this.$axios.post(this.$api.insOrderPlan.deleteInsContext, {
              frequency:list[index].band,
              productIds:list[index].projectList.map(m=>m.id)
            }, {
            headers: {
              'Content-Type': 'application/json'
            },
            noQs:true}).then(res => {
              if (res.code === 201) {
                this.$message.error('删除失败')
                return
              }
              this.$message.success('已删除')
              list.splice(index, 1)
            }).catch(err => {
              console.log(err)
            })
          }).catch(() => {})
        }else{
          list.splice(index, 1)
        }
      }else{
        this.$message({
          type: 'warning',
          message: '不能删除最后一个'
        });
      }
    },
    // æ·»åŠ æ•°ç»„
    addList(list,type){
      if(type=='互调'){
        let obj = null;
        let index = null;
        list.forEach((m,i)=>{
          if(m.inspectionItemSubclass.includes('互调')){
            obj = JSON.parse(JSON.stringify(m));
            index = i;
          }
        })
        list.splice(index+1, 0, obj)
      }else{
        let obj = JSON.parse(JSON.stringify(list[0]));
        list.push(obj)
      }
    },
    // èŽ·å–è®¾å¤‡é€‰é¡¹ id:为检验项id
    async getEquipOptions(m) {
      let arr = []
      let res = await this.$axios.post(this.$api.deviceScope.selectDeviceByCategory, {
        inspectionItem: m.inspectionItem,
        inspectionItemSubclass: m.inspectionItemSubclass
      })
      if (res.code === 200 && res.data) {
        arr = res.data.map(m => {
          m.value = m.managementNumber
          m.label = m.deviceName
          return m
        })
      }
      return arr
    },
    async methodFocus(item){
      this.$delete(item, 'equipOptions')
      this.$set(item, 'equipOptions', await this.getEquipOptions(item))
    },
    handleEquip(m,item){
      this.$delete(item, 'equipValue')
      this.$set(item, 'equipValue', m)
      this.$delete(item, 'equipName')
      this.$set(item, 'equipName', item.equipOptions.find(m=>m.value==item.equipValue).label)
    },
    // ç»Ÿä¸€ä¿®æ”¹è§’度,如果角度没有带°,则拼接一个
    handleAngle(e,index){
      if(!e){
        return
      }
      let val = e
      if(!val.includes('°')){
        val = val + '°'
      }
      this.allBandList.forEach(item=>{
        item.projectList.forEach(m=>{
          m.angleList.forEach((n,i)=>{
            if(index==i){
              n.value = val
            }
          })
        })
      })
    },
    handlePort(n){
      if(!n.often){
        return
      }
      if(!n.often.includes('MHz')){
        n.often = n.often + 'MHz'
      }
    },
    save(h,y) {
      let arr = h.projectList.map(item=>{
        let obj = {
          insProductId:item.id,
          equipValue:this.insProductNew.find(m=>m.id==item.id).equipValue,
          equipName:this.insProductNew.find(m=>m.id==item.id).equipName,
          port:item.portList.map(m=>m.value).join(','),
          angle:item.angleList.map(m=>m.value).join(','),
          value:JSON.stringify(item.value),
          often:item.often
        }
        return obj
      })
      this.$delete(this.loading, y)
      this.$set( this.loading, y, true)
      this.$axios.post(this.$api.insOrderPlan.saveInsContext2, {
        orderId:this.orderId,
        sampleId:this.sampleId,
        sonLaboratory:h.projectList[0].sonLaboratory,
        frequency:h.band,
        insProductResult2s:arr
      }, {
      headers: {
        'Content-Type': 'application/json'
      },
      noQs:true}).then(res => {
        this.$set( this.loading, y, false)
        // this.loading[y] = false
        if (res.code === 201) {
          this.$message.error('保存失败')
          return
        }
        for(let i=0;i<res.data.length;i++){
          h.projectList[i].result = res.data[i]
        }
        this.$message.success('已保存')
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>
<style scoped>
.circuit-parameters{
  position: relative;
  overflow: visible;
}
.circuit-parameters-item{
  margin-bottom: 10px;
  border: 1px solid #eee;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 8px;
}
.circuit-parameters-item-title{
  display: flex;
  align-items: center;
}
.thermal-table{
  min-width: calc(100% - 10px);
  table-layout: fixed;
}
.thermal-table td,.thermal-table th {
  min-width: 70px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 5px;
}
.thermal-table .el-input{
  display: flex;
  align-items: center;
}
.equip{
  display: flex;
  align-items: center;
}
.red{
  color: red;
}
.green{
  color: green;
}
</style>
src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,630 @@
<template>
  <div class="circuit-parameters">
    <el-divider></el-divider>
    <el-row :gutter="5" style="width: calc(100% - 1px);margin-bottom: 10px;">
      <el-col :span="17">
        <el-row>
          <el-col :span="23" style="display: flex;flex-wrap: wrap;">
            <table border="1" cellpadding="10" style="margin: 0 10px 10px 0;" v-for="(item,index) in insProductNew" :key="index + 'ppp'" v-show="isMore?true:(index<3?true:false)">
              <tr>
                <td style="text-align: center;background: #F0F1F5;">
                  <el-tooltip effect="dark" :content="item.inspectionItemSubclass" placement="top-start"><span style="display: inline-block;width: 95px;" class="single-line-ellipsis">{{ item.inspectionItemSubclass }}</span>
                  </el-tooltip>
                </td>
                <td>
                  <el-input size="small" placeholder="设备名称" v-model="item.equipName" style="width: 95px;" readonly></el-input>
                </td>
                <td>
                  <el-select v-model="item.equipValue" placeholder="设备编码" size="small" style="width: 95px;"  :disabled="state>1" @focus="methodFocus(item)" @change="m=>handleEquip(m,item)">
                    <el-option
                      v-for="m in item.equipOptions"
                      :key="m.value"
                      :label="m.value"
                      :value="m.value">
                    </el-option>
                  </el-select>
                </td>
              </tr>
            </table>
          </el-col>
          <el-col :span="1" v-show="insProductNew.length>3">
            <el-button icon="el-icon-arrow-down" type="text" @click="isMore=true" v-if="!isMore">更多</el-button>
            <el-button icon="el-icon-arrow-up" type="text" @click="isMore=false" v-if="isMore">收起</el-button>
          </el-col>
        </el-row>
      </el-col>
      <el-col :span="7">
        <div style="display: flex;align-items: center;justify-content: flex-end;" class="btns">
          <el-button type="primary" size="small" @click="addList(allBandList)" :disabled="state>1">添加频段</el-button>
          <el-button size="small" @click="deleteList(allBandList.length-1,allBandList,'删除频段')" :disabled="state>1">删除频段</el-button>
          <el-button type="primary" size="small" @click="addList(angleList)" v-if="!(state>1)&&intermodulationNum>0">添加角度</el-button>
          <el-button size="small" @click="deleteList(angleList.length-1,angleList)" v-if="!(state>1)&&intermodulationNum>0">删除角度</el-button>
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="5" style="font-size: 18px;font-weight: 700;background: #F0F1F5;padding: 16px 0;box-sizing: border-box;width: 100%;">
      <el-col :span="2">
        <div style="text-align: center;">检验项目</div>
      </el-col>
      <el-col :span="2">
        <div style="text-align: center;">单位</div>
      </el-col>
      <el-col :span="2">
        <div style="text-align: center;">标准要求</div>
      </el-col>
      <el-col :span="16">
        <div style="text-align: center;">检验结果</div>
      </el-col>
      <el-col :span="2">
        <div style="text-align: center;">结论</div>
      </el-col>
    </el-row>
    <div class="circuit-parameters-item" v-for="(h,y) in allBandList" :key="y+'ooo'">
      <div class="circuit-parameters-item-title">
        <span>频段:</span>
        <el-select v-model="h.band" placeholder="请选择" size="small" style="width: 200px;" :disabled="state>1">
          <el-option
            v-for="item in bandList"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
        <el-button type="primary" size="small" @click="addList(h.projectList,'互调')" style="margin-left: 16px;" v-if="intermodulationNum>0&&!(state>1)">添加互调</el-button>
        <el-button size="small" @click="deleteList(0,h.projectList,'互调')" v-if="intermodulationNum>0&&!(state>1)">删除互调</el-button>
        <el-button type="primary" size="small" @click="save(h,y)" :disabled="state>1" :loading="loading[y]" style="margin-left: 16px;">保 å­˜</el-button>
      </div>
      <el-divider></el-divider>
      <div class="circuit-parameters-item-content">
        <template v-for="(n,j) in h.projectList">
          <!-- ç”µåŽ‹é©»æ³¢æ¯”/同极化隔离度/异极化隔离度 -->
          <el-row :gutter="5" style="margin: 12px 0 0;display: flex;align-items: center;" v-if="n.inspectionItemSubclass.includes('驻波比')||n.inspectionItemSubclass.includes('隔离度')">
            <el-col :span="2">
              <div style="text-align: center;">{{ n.inspectionItemSubclass }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.unit }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.tell }}</div>
            </el-col>
            <el-col :span="16">
              <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
                <table border="1" cellpadding="10" class="thermal-table">
                  <tr>
                    <td>端口</td>
                    <td v-for="(item,index) in n.portList" :key="index+'aaa'">
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="端口" v-model="item.value" :disabled="state>1"></el-input>
                      </div>
                    </td>
                    <td :rowspan="n.angleList.length+1">
                      <el-button icon="el-icon-minus" circle size="mini" type="danger"
                      @click="deleteList(n.portList.length-1,n.portList)" :disabled="state>1"></el-button>
                      <el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addList(n.portList)" :disabled="state>1"></el-button>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <span>最差值</span>
                    </td>
                    <td v-for="(m,i) in n.portList" :key="i+'ggg'">
                      <el-input size="small" placeholder="最差值" v-model="n.value[0][i]" v-if="n.value" :disabled="state>1"></el-input>
                    </td>
                  </tr>
                </table>
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              </div>
            </el-col>
          </el-row>
          <!-- äº’è°ƒ -->
          <el-row :gutter="5" style="margin: 12px 0 0;display: flex;align-items: center;" v-if="n.inspectionItemSubclass.includes('互调')">
            <el-col :span="2">
              <div style="text-align: center;">{{ n.inspectionItemSubclass }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.unit }}</div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;">{{ n.tell }}</div>
            </el-col>
            <el-col :span="16">
              <div class="content" style="text-align: center;width: 100%;overflow-x: auto;">
                <table border="1" cellpadding="10" class="thermal-table">
                  <tr>
                    <td>频点</td>
                    <td :colspan="n.portList.length+1">
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="频点" v-model="n.often" :disabled="state>1" @blur="handlePort(n)"></el-input>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td>角度</td>
                    <td v-for="(item,index) in n.portList" :key="index+'fff'">
                      <div style="display: flex;align-items: center;">
                        <el-input size="small" placeholder="端口" v-model="item.value" :disabled="state>1"></el-input>
                      </div>
                    </td>
                    <td :rowspan="n.angleList.length+1">
                      <el-button icon="el-icon-minus" circle size="mini" type="danger"
                      @click="deleteList(n.portList.length-1,n.portList)" :disabled="state>1"></el-button>
                      <el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addList(n.portList)" :disabled="state>1"></el-button>
                    </td>
                  </tr>
                  <tr v-for="(item,index) in n.angleList" :key="index + 'eee'">
                    <td>
                      <el-input size="small" placeholder="角度" v-model="item.value" :disabled="state>1" @blur="handleAngle(item.value,index)"></el-input>
                    </td>
                    <td v-for="(m,i) in n.portList" :key="i+'ggg'">
                      <el-input size="small" placeholder="最差值" v-model="n.value[index][i]" v-if="n.value[index]" :disabled="state>1"></el-input>
                    </td>
                  </tr>
                </table>
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              </div>
            </el-col>
          </el-row>
          <el-divider v-if="j!=h.projectList.length-1"></el-divider>
        </template>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props:['insProduct','orderId','sampleId','state'],
  data() {
    return {
      value: "",
      bandList:[],
      portList:[
        {
          value:'1',
        },
        {
          value:'2',
        },
        {
          value:'3',
        },
        {
          value:'4',
        },
      ],
      angleList:[
        {
          value:''
        }
      ],
      projectList:[
        {
          inspectionItemSubclass:'电压驻波比',
          unit:'/',
          tell:'≤1.45',
          result:0,
          portList:[],
          angleList:[],
          value:[],//双层数组
        },
        {
          inspectionItemSubclass:'同极化隔离度',
          unit:'dB',
          tell:'≤1.45',
          result:0,
          portList:[],
          angleList:[],
          value:[],//双层数组
        },
        {
          inspectionItemSubclass:'互调',
          often:'',//互调特有字段
          unit:'dB',
          tell:'≤1.45',
          result:0,
          portList:[],
          angleList:[],
          value:[],//双层数组
        },
      ],
      allBandList:[],//频段
      isMore:false,
      insProductNew:[],
      intermodulationNum:0,//互调检验项目的数量
      loading:{}
    };
  },
  watch: {
    // è§’度数量变化时,更新所有频段下面的所有项目下的所有端口和角度
    angleList(val) {
      this.allBandList.forEach(item => {
        item.projectList.forEach(m => {
          if(m.angleList.length!==val.length){
            m.angleList = JSON.parse(JSON.stringify(this.angleList))
          }
          if(m.inspectionItemSubclass.includes('互调')){
            for(let i = 0;i<m.angleList.length;i++){
              if(!m.value[i]){
                this.$set(m.value,i, [])
              }
              for(let j=0;j<m.portList.length;j++){
                if(!m.value[i][j]){
                  m.value[i].push('')
                }
              }
            }
          }else{
            for(let j=0;j<m.portList.length;j++){
              if(!m.value[0][j]){
                m.value[0].push('')
              }
            }
          }
        })
      })
    }
  },
  mounted() {
    this.getTypeDicts()
    this.initData()
  },
  methods: {
    // å­—典获取数据
    getTypeDicts() {
      this.$axios.post(this.$api.enums.selectEnumByCategory, {
        category: "电路试验波段"
      }).then(res => {
        this.bandList = res.data
      })
    },
    // åˆå§‹åŒ–数据
    initData(){
      // å¤„理项目
      this.insProductNew = JSON.parse(JSON.stringify(this.insProduct))
      this.insProductNew.forEach(async item => {
        // èŽ·å–è®¾å¤‡åˆ—è¡¨
        item.equipOptions = await this.getEquipOptions(item)
      })
      if(this.insProductNew[0].insProductResult2&&this.insProductNew[0].insProductResult2.length>0){
        // å·²ç»å­˜åœ¨å€¼æ—¶ï¼Œèµ‹å€¼
        let bandList = this.insProductNew[0].insProductResult2.map(m=>m.frequency)
        bandList = Array.from(new Set(bandList))
        this.allBandList = []
        for(let i = 0;i<bandList.length;i++){
          let arr = []
          this.insProductNew.forEach(item => {
            if(item.inspectionItemSubclass.includes('互调')){
              this.intermodulationNum++
            }
            let equipNameList = []
            let equipValueList = []
            item.insProductResult2.forEach(n => {
              if(n.frequency===bandList[i]){
                // èµ‹å€¼é¡µé¢è®¾å¤‡åç§°å’Œå€¼
                if(n.equipValue){
                  equipNameList.push(n.equipName)
                  equipValueList.push(n.equipValue)
                }
                // ä»¥ä¸‹ä¸ºèµ‹å€¼åˆ—表信息
                let portList = []
                let angleList = []
                if(n.port&&n.port.split(',').length>0){
                  n.port.split(',').forEach(m=>{
                    portList.push({value:m})
                  })
                }
                if(n.angle&&n.angle.split(',').length>0){
                  n.angle.split(',').forEach(m=>{
                    angleList.push({value:m})
                  })
                  this.angleList = angleList
                }
                let obj = {
                  inspectionItemSubclass: item.inspectionItemSubclass,
                  unit:item.unit,
                  tell:item.tell,
                  result:n.result,
                  id:item.id,
                  often:n.often,
                  equipName:n.equipName,
                  equipValue:n.equipValue,
                  frequency:n.frequency
                }
                this.$set(obj,'portList', n.port?portList:[])
                this.$set(obj,'angleList', n.angle?angleList:[])
                this.$set(obj,'value', JSON.parse(n.value))
                arr.push(obj)
              }
            })
            if(equipValueList.length>0){
              this.$delete(item,'equipName')
              this.$delete(item,'equipValue')
              this.$set(item,'equipName',equipNameList[equipNameList.length-1])
              this.$set(item,'equipValue',equipValueList[equipValueList.length-1])
            }
          })
          this.$set(this.allBandList,i, {
            band: bandList[i],
            projectList: arr
          })
        }
      }else{
        // æ²¡æœ‰å€¼æ—¶ï¼Œåˆå§‹åŒ–页面
        this.insProductNew.forEach(async item => {
          // æ˜¯å¦å­˜åœ¨äº’调检验项目
          if(item.inspectionItemSubclass.includes('互调')){
            this.intermodulationNum++
          }
          // èµ‹å€¼è®¾å¤‡
          item.equipName = ''
          item.equipValue = ''
          // èµ‹å€¼ç«¯å£å’Œè§’度
          item.portList = JSON.parse(JSON.stringify(this.portList))
          item.angleList = JSON.parse(JSON.stringify(this.angleList))
          // èµ‹å€¼ç»“论
          item.result = ''
          // èµ‹å€¼æœ€å·®å€¼
          item.value = []
          if(item.inspectionItemSubclass.includes('互调')){
            for(let i = 0;i<item.angleList.length;i++){
              item.value.push([])
              for(let j=0;j<item.portList.length;j++){
                item.value[i].push('')
              }
            }
          }else{
            item.value.push([])
            for(let j=0;j<item.portList.length;j++){
              item.value[0].push('')
            }
          }
        })
        // åˆå§‹åŒ–频段
        this.allBandList.push(
          {
            band:'',
            projectList: JSON.parse(JSON.stringify(this.insProductNew))
          }
        )
      }
    },
    // åˆ é™¤æ•°ç»„
    deleteList(index,list,type){
      if(list.length>1){
        if(type=='互调'){
          let index = null;
          let num = 0;
          list.forEach((m,i)=>{
            if(m.inspectionItemSubclass.includes('互调')){
              index = i;
              num++
            }
          })
          if(num==1){
            this.$message({
              type: 'warning',
              message: '不能删除最后一个互调'
            });
          }else{
            if(list[index].frequency){
              this.$confirm(`是否确定删除 ${list[index].often} é¢‘点数据?`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
              }).then(() => {
                this.$axios.post(this.$api.insOrderPlan.deleteInsContext2, {
                  frequency:list[index].frequency,
                  productId:list[index].id,
                  often:list[index].often
                }).then(res => {
                  if (res.code === 201) {
                    this.$message.error('删除失败')
                    return
                  }
                  this.$message.success('已删除')
                  list.splice(index, 1)
                }).catch(err => {
                  console.log(err)
                })
              }).catch(() => {})
            }else{
              list.splice(index, 1)
            }
          }
        }else if(type=='删除频段'){
          this.$confirm(`是否确定删除 ${list[index].band} é¢‘段数据?`, "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            this.$axios.post(this.$api.insOrderPlan.deleteInsContext, {
              frequency:list[index].band,
              productIds:list[index].projectList.map(m=>m.id)
            }, {
            headers: {
              'Content-Type': 'application/json'
            },
            noQs:true}).then(res => {
              if (res.code === 201) {
                this.$message.error('删除失败')
                return
              }
              this.$message.success('已删除')
              list.splice(index, 1)
            }).catch(err => {
              console.log(err)
            })
          }).catch(() => {})
        }else{
          list.splice(index, 1)
        }
      }else{
        this.$message({
          type: 'warning',
          message: '不能删除最后一个'
        });
      }
    },
    // æ·»åŠ æ•°ç»„
    addList(list,type){
      if(type=='互调'){
        let obj = null;
        let index = null;
        list.forEach((m,i)=>{
          if(m.inspectionItemSubclass.includes('互调')){
            obj = JSON.parse(JSON.stringify(m));
            index = i;
          }
        })
        list.splice(index+1, 0, obj)
      }else{
        let obj = JSON.parse(JSON.stringify(list[0]));
        list.push(obj)
      }
    },
    // èŽ·å–è®¾å¤‡é€‰é¡¹ id:为检验项id
    async getEquipOptions(m) {
      let arr = []
      let res = await this.$axios.post(this.$api.deviceScope.selectDeviceByCategory, {
        inspectionItem: m.inspectionItem,
        inspectionItemSubclass: m.inspectionItemSubclass
      })
      if (res.code === 200 && res.data) {
        arr = res.data.map(m => {
          m.value = m.managementNumber
          m.label = m.deviceName
          return m
        })
      }
      return arr
    },
    // ç»Ÿä¸€ä¿®æ”¹è§’度,如果角度没有带°,则拼接一个
    handleAngle(e,index){
      if(!e){
        return
      }
      let val = e
      if(!val.includes('°')){
        val = val + '°'
      }
      this.allBandList.forEach(item=>{
        item.projectList.forEach(m=>{
          if(m.inspectionItemSubclass.includes('互调')){
            m.angleList.forEach((n,i)=>{
              if(index==i){
                n.value = val
              }
            })
          }
        })
      })
    },
    handlePort(n){
      if(!n.often){
        return
      }
      if(!n.often.includes('MHz')){
        n.often = n.often + 'MHz'
      }
    },
    async methodFocus(item){
      this.$delete(item, 'equipOptions')
      this.$set(item, 'equipOptions', await this.getEquipOptions(item))
    },
    handleEquip(m,item){
      this.$delete(item, 'equipValue')
      this.$set(item, 'equipValue', m)
      this.$delete(item, 'equipName')
      this.$set(item, 'equipName', item.equipOptions.find(m=>m.value==item.equipValue).label)
    },
    save(h,y) {
      let arr = h.projectList.map(item=>{
        let obj = {
          insProductId:item.id,
          equipValue:this.insProductNew.find(m=>m.id==item.id).equipValue,
          equipName:this.insProductNew.find(m=>m.id==item.id).equipName,
          port:item.portList.map(m=>m.value).join(','),
          angle:item.angleList.map(m=>m.value).join(','),
          value:JSON.stringify(item.value),
          often:item.often
        }
        return obj
      })
      this.$delete(this.loading, y)
      this.$set( this.loading, y, true)
      // this.loading[y] = true
      this.$axios.post(this.$api.insOrderPlan.saveInsContext2, {
        orderId:this.orderId,
        sampleId:this.sampleId,
        sonLaboratory:h.projectList[0].sonLaboratory,
        frequency:h.band,
        insProductResult2s:arr
      }, {
      headers: {
        'Content-Type': 'application/json'
      },
      noQs:true}).then(res => {
        this.$set( this.loading, y, false)
        // this.loading[y] = false
        if (res.code === 201) {
          this.$message.error('保存失败')
          return
        }
        for(let i=0;i<res.data.length;i++){
          h.projectList[i].result = res.data[i]
        }
        this.$message.success('已保存')
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>
<style scoped>
.circuit-parameters-item{
  margin-bottom: 10px;
  border: 1px solid #eee;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 8px;
}
.circuit-parameters-item-title{
  display: flex;
  align-items: center;
}
.thermal-table{
  min-width: calc(100% - 10px);
  table-layout: fixed;
}
.thermal-table td,.thermal-table th {
  min-width: 70px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 5px;
}
.thermal-table .el-input{
  display: flex;
  align-items: center;
}
.equip{
  display: flex;
  align-items: center;
}
.red{
  color: red;
}
.green{
  color: green;
}
</style>
src/components/do/b1-inspect-order-plan/circuit.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,278 @@
<template>
  <div class="circuit">
    <table border="1" cellpadding="10" class="thermal-table">
      <tr>
        <th :colspan="typeList0.length+4" style="font-size: 18px;">室外分布100-D宽频射灯天线</th>
      </tr>
      <tr>
        <td class="title">样品编号</td>
        <td>1111</td>
        <td class="title">样品型号</td>
        <td>22222</td>
        <td class="title">试验标准</td>
        <td :colspan="typeList0.length">电信</td>
      </tr>
      <tr>
        <td class="title">检验项目</td>
        <td class="title">单位</td>
        <td class="title">标准要求</td>
        <td :colspan="typeList0.length+1" class="title">检验结果</td>
      </tr>
      <!-- é©»æ³¢æ¯” -->
      <template>
        <tr>
          <td :rowspan="roadList0.length+2">电压驻波比</td>
          <td :rowspan="roadList0.length+2">/</td>
          <td :rowspan="roadList0.length+2">≤1.5</td>
          <td class="title">最差值</td>
          <td v-for="(item,index) in typeList0" :key="index+'ooo'"><span style="display: inline-block;width: 40%;">{{ item.label }}</span><el-button icon="el-icon-minus" circle size="mini" type="danger" style="margin-left: 4px;" @click="deleteList(index,'端口')"></el-button><el-button icon="el-icon-plus" circle size="mini" type="primary" v-if="index==typeList0.length-1" @click="addInfo('端口')"></el-button></td>
        </tr>
        <tr v-for="(item,index) in roadList0" :key="index+'iiii'">
          <td><span style="display: inline-block;width: 70%;">{{ item.label }}</span><el-button icon="el-icon-minus" circle size="mini" type="danger" @click="deleteList(index,'波段')"></el-button></td>
          <td v-for="(m,i) in typeList0" :key="i+'aaa'">
            <el-input clearable size="small" placeholder="" v-model="value" :disabled="state>1"></el-input>
          </td>
        </tr>
        <tr>
          <td><span style="display: inline-block;width: 70%;" class="title">驻波比最差值</span><el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addInfo('波段')"></el-button></td>
          <td v-for="(m,i) in typeList0" :key="i+'bbb'">
            <span>0</span>
          </td>
        </tr>
      </template>
      <!-- éš”离 -->
      <template>
        <tr>
          <td :rowspan="roadList0.length+2">隔离</td>
          <td :rowspan="roadList0.length+2">dB</td>
          <td :rowspan="roadList0.length+2">≤-25</td>
        </tr>
        <tr v-for="(item,index) in roadList0" :key="index+'eee'">
          <td>{{ item.label }}</td>
          <td :colspan="index<isolationList.length-1?2:(typeList0.length/2>0?3:2)" v-for="(item,index) in isolationList" :key="index+'sss'"><el-input clearable size="small" placeholder="" v-model="item.value" :disabled="state>1"></el-input></td>
        </tr>
        <tr>
          <td class="title">隔离最差值</td>
          <td :colspan="index<isolationList.length-1?2:(typeList0.length/2>0?3:2)" v-for="(item,index) in isolationList" :key="index+'ggg'">{{ item.compValue }}</td>
        </tr>
      </template>
      <!-- äº’è°ƒ -->
      <template>
        <tr>
          <td :rowspan="bandList0.length+2">互调37dBm</td>
          <td :rowspan="bandList0.length+2">dBm</td>
          <td :rowspan="bandList0.length+2">≤-107</td>
        </tr>
        <tr v-for="(item,index) in bandList0" :key="index+'yyy'">
          <td><span style="display: inline-block;width: 70%;">{{ item.label }}</span><el-button icon="el-icon-minus" circle size="mini" type="danger" @click="deleteList(index,'频段')"></el-button></td>
          <td v-for="(m,i) in typeList0" :key="i+'ccc'"><el-input clearable size="small" placeholder="" v-model="value" :disabled="state>1"></el-input></td>
        </tr>
        <tr>
          <td class="title"><span style="display: inline-block;width: 70%;">互调最差值</span><el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addInfo('频段')"></el-button></td>
          <td v-for="(m,i) in typeList0" :key="i+'hhh'">0</td>
        </tr>
      </template>
    </table>
    <el-dialog
      :title="'选择添加'+currentType"
      :visible.sync="dialogVisible"
      width="20%">
      <el-checkbox-group v-model="checkList" v-if="currentType=='波段'">
        <el-checkbox :label="item.label" v-for="(item,index) in roadList1" :key="index+'lll'">{{ item.label }}</el-checkbox>
      </el-checkbox-group>
      <el-checkbox-group v-model="checkList" v-if="currentType=='频段'">
        <el-checkbox :label="item.label" v-for="(item,index) in bandList1" :key="index+'tttt'">{{ item.label }}</el-checkbox>
      </el-checkbox-group>
      <el-checkbox-group v-model="checkList" v-if="currentType=='端口'">
        <el-checkbox :label="item.label" v-for="(item,index) in typeList1" :key="index+'uuuu'">{{ item.label }}</el-checkbox>
      </el-checkbox-group>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="handleSure">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      roadList:[],
      typeList:[],
      bandList:[],
      typeList0:[],
      roadList0:[],
      bandList0:[],
      typeList1:[],
      roadList1:[],
      bandList1:[],
      isolationList:[
        {
          compValue:'',
          value:''
        }
      ],
      state: 1,
      value:'',
      dialogVisible:false,
      currentType:'',//波段,频段,端口
      checkList:[],
    }
  },
  watch:{
    roadList0(val){
      this.roadList1 = this.roadList.filter(item=>{
        return !val.find(m=>m.id==item.id)
      })
    },
    typeList0(val){
      this.typeList1 = this.typeList.filter(item=>{
        return !val.find(m=>m.id==item.id)
      })
      this.isolationList = []
      if(val.length<2){
        this.isolationList = [{compValue:'',value:''}]
      }else{
        let num = Math.floor(val.length/2)
        for(let i=0;i<num;i++){
          this.isolationList.push({compValue:'',value:''})
        }
      }
      console.log(this.isolationList)
    },
    bandList0(val){
      this.bandList1 = this.bandList.filter(item=>{
        return !val.find(m=>m.id==item.id)
      })
    },
    dialogVisible(val){
      if(!val){
        this.checkList = []
      }
    }
  },
  mounted() {
    this.getTypeDicts()
  },
  methods: {
    getTypeDicts() {
      this.$axios.post(this.$api.enums.selectEnumByCategory, {
        category: "电路试验波段"
      }).then(res => {
        this.roadList = res.data
        this.roadList0 = this.HaveJson(this.roadList)
      })
      this.$axios.post(this.$api.enums.selectEnumByCategory, {
        category: "电路试验端口"
      }).then(res => {
        this.typeList = res.data
        this.typeList0 = this.HaveJson(this.typeList)
      })
      this.$axios.post(this.$api.enums.selectEnumByCategory, {
        category: "电路试验频段"
      }).then(res => {
        this.bandList = res.data
        this.bandList0 = this.HaveJson(this.bandList)
      })
    },
    deleteList(index,type) {
      switch(type){
        case '波段':
          if(this.roadList0.length>1){
            this.roadList0.splice(index, 1)
          }else{
            this.$message.error('至少保留一条数据')
          }
          break;
        case '频段':
          if(this.bandList0.length>1){
            this.bandList0.splice(index, 1)
          }else{
            this.$message.error('至少保留一条数据')
          }
          break;
        case '端口':
          if(this.typeList0.length>1){
            this.typeList0.splice(index, 1)
          }else{
            this.$message.error('至少保留一条数据')
          }
          break;
      }
    },
    handleSure(){
      switch(this.currentType){
        case '波段':
          this.roadList.forEach((item,index)=>{
            let obj = this.checkList.find(m=>m==item.label)
            if(obj){
              this.roadList0.push(item)
            }
          })
          this.roadList0 = this.handleSortById(this.roadList0)
          break;
        case '频段':
          this.bandList.forEach((item,index)=>{
            let obj = this.checkList.find(m=>m==item.label)
            if(obj){
              this.bandList0.push(item)
            }
          })
          this.bandList0 = this.handleSortById(this.bandList0)
          break;
        case '端口':
          this.typeList.forEach((item,index)=>{
            let obj = this.checkList.find(m=>m==item.label)
            if(obj){
              this.typeList0.push(item)
            }
          })
          this.typeList0 = this.handleSortById(this.typeList0)
          break;
      }
      this.dialogVisible = false
    },
    // æ ¹æ®Id排序
    handleSortById(arr){
      return arr.sort((a,b)=>{
        if(a.id>b.id){
          return 1;
        }else if(a.id<b.id){
          return -1;
        }else {
          return 0;
        }
      })
    },
    addInfo(type){
      this.currentType = type
      this.dialogVisible = true
    },
  }
}
</script>
<style scoped>
.thermal-table{
  min-width: calc(100% - 10px);
  margin: 5px 5px 20px;
  table-layout: fixed;
}
.thermal-table td,.thermal-table th {
  min-width: 150px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 5px;
}
.thermal-table .el-input{
  display: flex;
  align-items: center;
}
.title{
  color: #000 !important;
  font-weight: 700 !important;
}
</style>
src/components/view/b1-inspect-order-plan.vue
@@ -201,7 +201,7 @@
            width="100px"
          >
          <template slot-scope="scope">
              <el-tag :type="typeList.find(m=>m.value==scope.row.insState).type" size="small">{{ typeList.find(m=>m.value==scope.row.insState).label }}</el-tag>
              <el-tag :type="insStateList.find(m=>m.value==scope.row.insState).type" size="small">{{ insStateList.find(m=>m.value==scope.row.insState).label }}</el-tag>
            </template></el-table-column>
          <el-table-column
            prop="userName"
@@ -502,7 +502,7 @@
        loading:false,
        currentTime: null,
        sonLaboratoryList:[],
        tableData: null,
        tableData: [],
        page:{
          current:1,
          size:20,
src/main.js
@@ -20,7 +20,7 @@
//本地
// Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
// const javaApi = 'http://127.0.0.1:8001';
const javaApi = 'http://192.168.212.249:8001';
const javaApi = 'http://192.168.159.249:8001';
// //通信测试库
// Vue.prototype.LOCATIONVUE = "http://10.1.13.77:8080";
@@ -28,7 +28,7 @@
//云
// Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
// const javaApi = 'http://114.132.189.42:1234';
// const javaApi = 'http://10.1.13.77/:1234';
// //检测中心正式库
// Vue.prototype.LOCATIONVUE = "http://10.1.200.86:8080";