zouyu
2025-03-19 45792b3776cda2e1ada31755ffc226a663f90b48
src/views/business/inspectionOrder/fiberoptic-config.vue
@@ -119,8 +119,8 @@
                    <el-option
                      v-for="(color, i) in colors"
                      :key="i"
                      :label="color.lable"
                      :value="color.value"
                      :label="color.dictLable"
                      :value="color.dictValue"
                    ></el-option>
                  </el-select>
                </template>
@@ -551,8 +551,8 @@
                    <el-option
                      v-for="(color, i) in colors"
                      :key="i"
                      :label="color.lable"
                      :value="color.value"
                      :label="color.dictLable"
                      :value="color.dictValue"
                    ></el-option>
                  </el-select>
                </template>
@@ -796,6 +796,15 @@
</template>
<script>
import { getDicts } from "@/api/system/dict/data";
import {
  getStandTreeBySampleType,
  selectStandardTreeList2,
  selectStandardMethodEnum,
  selectsStandardMethodByFLSSM,
  selectStandardProductList,
} from "@/api/standard/standardLibrary";
import { permute } from "@/api/business/inspectionOrder";
export default {
  props: {
    active: {
@@ -999,8 +1008,8 @@
          let color = this.colors[i];
          for (let j = 0; j < newFiberList.length; j++) {
            let newColor = newFiberList[j];
            if (color.value == newColor[0]) {
              newFiberList[j].push(color.orderNum);
            if (color.dictValue == newColor[0]) {
              newFiberList[j].push(color.dictSort);
            }
          }
        }
@@ -1279,12 +1288,14 @@
      this.$parent.configShow = false;
    },
    getTypeDicts1() {
      this.$axios
        .post(this.$api.enums.selectEnumByCategory, {
          category: "色标",
        })
      getDicts("fiber_color_type")
        .then((res) => {
          this.colors = res.data;
          if (res.code === 200) {
            this.colors = res.data;
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    // 套管数目生成表格数据
@@ -1293,7 +1304,7 @@
      for (let i = 0; i < this.packageInfo.num1; i++) {
        let bushing = {
          ident: this.bushing.length + 1,
          color: this.colors[i].label,
          color: this.colors[i].dictLabel,
          standNum: null,
          testNum: null,
          fibers: [],
@@ -1366,11 +1377,6 @@
            this.multiFiberList = this.fibersList;
            // 默认勾选
            setTimeout(() => {
              // this.selectBushing.forEach(item =>{
              // let rowToSelect =  this.bushing.find(a => a.ident == item.ident)
              // this.$refs.table0.toggleRowSelection(rowToSelect, true)
              // })
              this.multiFiberList.forEach((item) => {
                let rowToSelect = this.fibersList.find(
                  (a) => a.ident == item.ident
@@ -1401,10 +1407,6 @@
            this.addFiber(1);
            // 默认勾选
            setTimeout(() => {
              // this.selectBushing.forEach(item =>{
              // let rowToSelect =  this.bushing.find(a => a.ident == item.ident)
              // this.$refs.table0.toggleRowSelection(rowToSelect, true)
              // })
              this.fiberList.forEach((item) => {
                this.$refs.table3.toggleRowSelection(item, true);
              });
@@ -1446,7 +1448,7 @@
        this.bushing = [];
        for (var i = 0; i < this.packageInfo.num1; i++) {
          let bushing = {
            color: colors2[i].label,
            color: colors2[i].dictLabel,
            standNum: this.packageInfo.standNum,
            testNum: this.packageInfo.testNum,
            fibers: [],
@@ -1486,83 +1488,76 @@
      }
    },
    getStandTreeBySampleType() {
      this.$axios
        .post(this.$api.standardTree.getStandTreeBySampleType, {
          laboratory: "通信产品实验室",
          sampleType: "光纤",
        })
      getStandTreeBySampleType({
        laboratory: "通信产品实验室",
        sampleType: "光纤",
      })
        .then((res) => {
          this.mireModels = [];
          res.data.forEach((a) => {
            this.mireModels.push({
              label: a.model,
              value: a.sample + " - " + a.model,
          if (res.code === 200) {
            this.mireModels = [];
            res.data.forEach((a) => {
              this.mireModels.push({
                label: a.model,
                value: a.sample + " - " + a.model,
              });
            });
          });
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    getStandTreeBySampleType2() {
      this.$axios
        .post(this.$api.standardTree.getStandTreeBySampleType, {
          laboratory: "通信产品实验室",
          sampleType: "光纤带",
        })
      getStandTreeBySampleType({
        laboratory: "通信产品实验室",
        sampleType: "光纤带",
      })
        .then((res) => {
          this.miresModels = [];
          res.data.forEach((a) => {
            this.miresModels.push({
              label: a.model,
              value: a.model,
          if (res.code === 200) {
            this.miresModels = [];
            res.data.forEach((a) => {
              this.miresModels.push({
                label: a.model,
                value: a.model,
              });
            });
          });
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    selectsStandardMethodByFLSSM() {
      this.mireStandards = [];
      this.mireStandardLoading = true;
      this.$axios
        .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree: "中天科技检测中心 - 通信产品实验室 - 光纤 - " + this.mireModel,
        })
      selectsStandardMethodByFLSSM({
        tree: "中天科技检测中心 - 通信产品实验室 - 光纤 - " + this.mireModel,
      })
        .then((res) => {
          this.mireStandardLoading = false;
          this.mireStandards = res.data.standardMethodList;
          if (res.code === 200) {
            this.mireStandardLoading = false;
            this.mireStandards = res.data.standardMethodList;
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    selectsStandardMethodByFLSSM2() {
      this.miresStandards = [];
      this.$axios
        .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree:
            "中天科技检测中心 - 通信产品实验室 - 光纤带 - " + this.miresModel,
        })
      selectsStandardMethodByFLSSM({
        tree: "中天科技检测中心 - 通信产品实验室 - 光纤带 - " + this.miresModel,
      })
        .then((res) => {
          this.miresStandards = res.data.standardMethodList;
          if (res.code === 200) {
            this.miresStandards = res.data.standardMethodList;
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    methodChange(val) {
      // if (val === null || val === '') return
      // this.$axios.post(this.$api.standardTree.selectStandardProductList, {
      //   model: this.mireModel.split(' - ')[1],
      //   standardMethodListId: val,
      //   factory: ''
      // }, {
      //   headers: {
      //     'Content-Type': 'application/json'
      //   }
      // }).then(res => {
      //   res.data.forEach(a => {
      //     a.state = 0
      //   })
      //   this.productList = res.data
      //   setTimeout(() => {
      //     this.productList.forEach(a => {
      //       if (a.state == 1) this.toggleSelection(a)
      //     })
      //     this.addFiber()
      //   }, 200)
      // })
      // 将下拉框值赋值给光纤  监听去除
      if (this.selectFiberList.length == 0) {
        this.$message.error("请选择数据");
@@ -1571,135 +1566,91 @@
      if (val === null || val === "") return;
      if (this.mireStandards == null) return;
      this.$axios
        .post(
          this.$api.standardTree.selectStandardProductList,
          {
            model: this.mireModel.split(" - ")[1],
            standardMethodListId: val,
            factory: "",
          },
          {
            headers: {
              "Content-Type": "application/json",
            },
          }
        )
      selectStandardProductList({
        model: this.mireModel.split(" - ")[1],
        standardMethodListId: val,
        factory: "",
      })
        .then((res) => {
          this.detectionItems = [];
          if (res.data != null && res.data.length != 0) {
            res.data.forEach((a) => {
              a.state = 0;
            });
            this.detectionItems = res.data;
            this.detectionType = 0;
            this.$set(this.detectionItems, "type", 0);
          }
          this.mireStandards.find((a) => a.id == val).code == "委托要求"
            ? (this.isAskOnlyRead = false)
            : (this.isAskOnlyRead = true);
          this.selectFiberList.forEach((item) => {
            this.fiberList.forEach((a) => {
              if (a.ident == item.ident) {
                a.model = this.mireModel.split(" - ")[1]; // 光纤规格
                a.noSplitModel = this.mireModel; // 光纤规格
                if (this.mireStandards != null) {
                  a.standard = this.mireStandards.find(
                    (a) => a.id == this.mireStandard
                  ).code; // 参考标准
          if (res.code === 200) {
            this.detectionItems = [];
            if (res.data != null && res.data.length != 0) {
              res.data.forEach((a) => {
                a.state = 0;
              });
              this.detectionItems = res.data;
              this.detectionType = 0;
              this.$set(this.detectionItems, "type", 0);
            }
            this.mireStandards.find((a) => a.id == val).code == "委托要求"
              ? (this.isAskOnlyRead = false)
              : (this.isAskOnlyRead = true);
            this.selectFiberList.forEach((item) => {
              this.fiberList.forEach((a) => {
                if (a.ident == item.ident) {
                  a.model = this.mireModel.split(" - ")[1]; // 光纤规格
                  a.noSplitModel = this.mireModel; // 光纤规格
                  if (this.mireStandards != null) {
                    a.standard = this.mireStandards.find(
                      (a) => a.id == this.mireStandard
                    ).code; // 参考标准
                  }
                }
              }
              });
            });
          });
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    methodChange2(val) {
      // if (val === null || val === '') return
      // this.$axios.post(this.$api.standardTree.selectStandardProductList, {
      //   model: '',
      //   standardMethodListId: val,
      //   factory: '中天科技检测中心 - 通信产品实验室 - 光纤带 - ' + this.miresModel + ' - ',
      // }, {
      //   headers: {
      //     'Content-Type': 'application/json'
      //   }
      // }).then(res => {
      //   res.data.forEach(a => {
      //     a.state = 0
      //   })
      //   this.productList2 = res.data
      //   setTimeout(() => {
      //     this.productList2.forEach(a => {
      //       if (a.state == 1) this.toggleSelection(a)
      //     })
      //     this.addFibers()
      //   }, 200)
      // })
      if (this.multiFiberList.length == 0) {
        this.$message.error("请选择需要更改的数据");
        return;
      }
      if (val === null || val === "") return;
      this.$axios
        .post(
          this.$api.standardTree.selectStandardProductList,
          {
            model: "",
            standardMethodListId: val,
            factory:
              "中天科技检测中心 - 通信产品实验室 - 光纤带 - " +
              this.miresModel +
              " - ",
          },
          {
            headers: {
              "Content-Type": "application/json",
            },
          }
        )
      selectStandardProductList({
        model: "",
        standardMethodListId: val,
        factory:
          "中天科技检测中心 - 通信产品实验室 - 光纤带 - " +
          this.miresModel +
          " - ",
      })
        .then((res) => {
          // 将获取的检测项信息赋值
          this.detectionItems = [];
          if (res.data != null && res.data.length != 0) {
            res.data.forEach((a) => {
              a.state = 0;
            });
            this.detectionItems = res.data;
            this.detectionType = 1;
            this.$set(this.detectionItems, "type", 1);
            // 判断是否为委托要求
            this.miresStandards.find((a) => a.id == val).code == "委托要求"
              ? (this.isAskOnlyRead = false)
              : (this.isAskOnlyRead = true);
          }
          // 给选中的光纤带赋值
          // for(let i= 0; i < this.fibersList.length; i++){
          //     this.multiFiberList.forEach(item => {
          //       if(this.fibersList[i].ident == item.ident){
          //         this.fibersList[i].model = this.miresModel // 纤带规格
          //         this.fibersList[i].num = this.miresModel.replace('芯','') // 光纤检测量
          //         this.fibersList[i].productList = this.detectionItems // 检测项
          //         this.miresStandards.forEach(a => {
          //           if(a.id == this.miresStandard) {
          //             this.fibersList[i].standard = a.code // 参考标准
          //           }
          //         })
          //       }
          //     })
          // }
          for (let i = 0; i < this.multiFiberList.length; i++) {
            for (let j = 0; j < this.fibersList.length; j++) {
              if (this.multiFiberList[i].ident == this.fibersList[j].ident) {
                this.fibersList[j].model = this.miresModel; // 纤带规格
                this.fibersList[j].num = this.miresModel.replace("芯", ""); // 光纤检测量
                this.miresStandards.forEach((a) => {
                  if (a.id == this.miresStandard) {
                    this.fibersList[j].standard = a.code; // 参考标准
                  }
                });
          if (res.code === 200) {
            // 将获取的检测项信息赋值
            this.detectionItems = [];
            if (res.data != null && res.data.length != 0) {
              res.data.forEach((a) => {
                a.state = 0;
              });
              this.detectionItems = res.data;
              this.detectionType = 1;
              this.$set(this.detectionItems, "type", 1);
              // 判断是否为委托要求
              this.miresStandards.find((a) => a.id == val).code == "委托要求"
                ? (this.isAskOnlyRead = false)
                : (this.isAskOnlyRead = true);
            }
            for (let i = 0; i < this.multiFiberList.length; i++) {
              for (let j = 0; j < this.fibersList.length; j++) {
                if (this.multiFiberList[i].ident == this.fibersList[j].ident) {
                  this.fibersList[j].model = this.miresModel; // 纤带规格
                  this.fibersList[j].num = this.miresModel.replace("芯", ""); // 光纤检测量
                  this.miresStandards.forEach((a) => {
                    if (a.id == this.miresStandard) {
                      this.fibersList[j].standard = a.code; // 参考标准
                    }
                  });
                }
              }
            }
          }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    addFiber(isInspection) {
@@ -1762,7 +1713,7 @@
                let fiber = {
                  ident: this.fiberList.length + 1,
                  bushColor: item.color,
                  color: colors3[count].label,
                  color: colors3[count].dictLabel,
                  model: null,
                  noSplitModel: null,
                  standard: null,
@@ -1775,65 +1726,6 @@
              }
            }
          });
          // this.multiFiberList.forEach((a, index) => {
          //   a.fiber = [];
          //   if (index > 0 && index < this.multiFiberList.length) {
          //     if (
          //       this.multiFiberList[index].color ==
          //       this.multiFiberList[index - 1].color
          //     ) {
          //       // 根据每根管抽检标准量 确定 颜色循环
          //       //let colors3 = colors2.slice(0,this.packageInfo.standNum)
          //       for (var i = 0; i < parseInt(a.num); i++) {
          //         let fiber = {
          //           ident: this.fiberList.length + 1,
          //           bushColor: a.color,
          //           // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
          //           color: colors2[count].label,
          //           model: null,
          //           noSplitModel: null,
          //           standard: null,
          //           fibersIdent: a.ident,
          //           productList: [],
          //         };
          //         this.fiberList.push(fiber);
          //         count++;
          //       }
          //     } else {
          //       // 根据每根管抽检标准量 确定 颜色循环
          //       let colors3 = colors2.slice(0, this.packageInfo.standNum);
          //       for (var i = 0; i < parseInt(a.num); i++) {
          //         let fiber = {
          //           ident: this.fiberList.length + 1,
          //           bushColor: a.color,
          //           // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
          //           color: colors3[i].label,
          //           model: null,
          //           noSplitModel: null,
          //           standard: null,
          //           fibersIdent: a.ident,
          //           productList: [],
          //         };
          //         this.fiberList.push(fiber);
          //       }
          //     }
          //   } else {
          //     for (var i = 0; i < parseInt(a.num); i++) {
          //       let fiber = {
          //         ident: this.fiberList.length + 1,
          //         bushColor: a.color,
          //         // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
          //         color: colors2[i].label,
          //         model: null,
          //         noSplitModel: null,
          //         standard: null,
          //         fibersIdent: a.ident,
          //         productList: [],
          //       };
          //       this.fiberList.push(fiber);
          //     }
          //   }
          // });
        } else {
          let count = 0;
          let colors3 = colors2.slice(0, this.packageInfo.standNum);
@@ -1844,7 +1736,7 @@
                let fiber = {
                  ident: this.fiberList.length + 1,
                  bushColor: item.color,
                  color: colors3[count].label,
                  color: colors3[count].dictLabel,
                  model: null,
                  standard: null,
                  productList: [],
@@ -1880,7 +1772,7 @@
              let fiber = {
                ident: this.fiberList.length + 1,
                bushColor: item.color,
                color: colors3[count].label,
                color: colors3[count].dictLabel,
                model: null,
                standard: null,
                productList: [],
@@ -1889,24 +1781,6 @@
              count++;
              count = count % item.standNum;
            }
            //  else {
            //   for (let i = 0; i < parseInt(item.testNum); i++) {
            //     let fiber = {
            //       ident: this.fiberList.length + 1,
            //       bushColor: item.color,
            //       color:
            //         colors2[
            //           i + parseInt(item.testNum) * index > colors2.length
            //             ? 0
            //             : i + parseInt(item.testNum) * index * index
            //         ].label,
            //       model: null,
            //       standard: null,
            //       productList: [],
            //     };
            //     this.fiberList.push(fiber);
            //   }
            // }
          } else {
            flag = false;
          }
@@ -1917,125 +1791,8 @@
          return;
        }
      }
      // 二代
      // // 是否选择套管
      // if(this.selectBushing.length == 0) {
      //   this.$message.error('未选择套管')
      //   return
      // }
      // this.fiberList = []
      // let flag = true
      // // 按照顺序生成光纤色标
      // let colors2 = []
      // if (this.packageInfo.num1 / this.colors.length > 1) {
      //   let num = this.packageInfo.num1 / this.colors.length
      //   if (this.packageInfo.num1 % this.colors.length > 0) num += 1
      //   for (var i = 0; i < num; i++) {
      //     colors2 = colors2.concat(this.colors)
      //   }
      // } else {
      //   colors2 = colors2.concat(this.colors)
      // }
      // // 根据套管的测试量生成对应的数量的光纤数据
      // this.selectBushing.forEach((item,index) =>{
      //   if(item.testNum != null && item.testNum != ''){
      //     for(let i =0; i < parseInt(item.testNum); i++){
      //       let fiber = {
      //         ident: this.fiberList.length + 1,
      //         bushColor: item.color,
      //         color: colors2[(i+(parseInt(item.testNum)*index))>colors2.length?0:i+(parseInt(item.testNum)*index)*index].label,
      //         model:  null,
      //         standard: null,
      //         productList: []
      //       }
      //       this.fiberList.push(fiber)
      //     }
      //   }else {
      //     flag = false
      //   }
      // })
      // if(!flag){
      //   this.$message.error('请填写光纤检测量')
      //   return
      // }
      // 最初
      // let colors2 = []
      // if (this.packageInfo.num1 / this.colors.length > 1) {
      //   let num = this.packageInfo.num1 / this.colors.length
      //   if (this.packageInfo.num1 % this.colors.length > 0) num += 1
      //   for (var i = 0; i < num; i++) {
      //     colors2 = colors2.concat(this.colors)
      //   }
      // } else {
      //   colors2 = colors2.concat(this.colors)
      // }
      // this.fiberList = []
      // let model = this.mireModel.split(' - ')[1]
      // let standard = this.mireStandards.find(a => a.id == this.mireStandard).code
      // if (this.packageInfo.ismiers) {
      //   if(this.selectFibers.length === 0){
      //     this.$message.error('未选择光纤带')
      //     return
      //   }
      //   this.selectFibers.forEach((a,index) => {
      //     a.fiber = []
      //     for (var i = 0; i < parseInt(a.num); i++) {
      //       let fiber = {
      //         bushColor: a.color,
      //         color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
      //         model: model,
      //         standard: standard,
      //         productList: this.HaveJson(this.productList)
      //       }
      //       a.fiber.push(fiber)
      //       this.fiberList.push(fiber)
      //     }
      //   })
      // } else {
      //   this.selectBushing.forEach((a,index) => {
      //     a.fiber = []
      //     for (var i = 0; i < parseInt(a.testNum); i++) {
      //       let fiber = {
      //         bushColor: a.color,
      //         color: colors2[(i+(parseInt(a.testNum))*index)>colors2.length?0:i+(parseInt(a.testNum))*index].label,
      //         model: model,
      //         standard: standard,
      //         productList: this.HaveJson(this.productList)
      //       }
      //       a.fiber.push(fiber)
      //       this.fiberList.push(fiber)
      //     }
      //   })
      // }
    },
    addFibers() {
      // if(this.selectBushing.length===0){
      //   this.$message.error('未选择套管')
      //   return
      // }
      // this.fibersList = []
      // let standard = this.miresStandards.find(a => a.id == this.miresStandard).code
      // this.packageInfo.ismiers = true
      // this.fiberList = []
      // this.selectBushing.forEach(a => {
      //   a.fiber = []
      //   a.fibers = []
      //   for (var i = 0; i < parseInt(a.testNum); i++) {
      //     let fibers = {
      //       code: null,
      //       color: a.color,
      //       model: this.miresModel,
      //       standard: standard,
      //       num: a.testNum,
      //       productList: this.HaveJson(this.productList2),
      //       fiber: []
      //     }
      //     a.fibers.push(fibers)
      //     this.fibersList.push(fibers)
      //   }
      // })
      if (this.selectBushing.length == 0) {
        this.$message.error("未选择套管");
        return;
@@ -2058,7 +1815,7 @@
          let fibers = {
            ident: this.fibersList.length + 1,
            color: item.color,
            colorShow: item.color + "-" + colors2[i].label,
            colorShow: item.color + "-" + colors2[i].dictLabel,
            code: null,
            model: null,
            standard: null,
@@ -2071,45 +1828,6 @@
      });
    },
    rowClickFiber(row, column, event, type) {
      // console.log("row", row);
      // this.type = type
      // if(this.active===1){
      //   if(type==0){
      //     let standard = null;
      //     try{
      //       standard = this.miresStandards.find(a => a.id == this.miresStandards)
      //     }catch(e){}
      //     if(standard&&standard.code=='委托要求'){
      //       this.isAskOnlyRead = false;
      //     }else{
      //       this.isAskOnlyRead = true;
      //     }
      //   }else{
      //     let standard = null;
      //     try{
      //       standard = this.mireStandards.find(a => a.id == this.mireStandard)
      //     }catch(e){}
      //     if(standard&&standard.code=='委托要求'){
      //       this.isAskOnlyRead = false;
      //     }else{
      //       this.isAskOnlyRead = true;
      //     }
      //   }
      // }
      // if(this.type==1){
      //   if (this.active !== 1) {
      //     this.sampleIds = []
      //     this.sampleIds.push(row.id)
      //   }
      // }
      // this.currentDetectionItems = row
      // this.detectionItems = row.productList
      // if(this.detectionItems === null) return
      // setTimeout(() => {
      //   this.detectionItems.forEach(a => {
      //     if (a.state == 1) this.toggleSelection(a)
      //   })
      // }, 200)
      if (type == 1) {
        this.fiberList = row.fiber;
        if (
@@ -2129,64 +1847,60 @@
              (a) => a.code == row.standard
            ).id;
          }
          this.$axios
            .post(
              this.$api.standardTree.selectStandardProductList,
              {
                model: "",
                standardMethodListId: this.miresStandard,
                factory:
                  "中天科技检测中心 - 通信产品实验室 - 光纤带 - " +
                  this.miresModel +
                  " - ",
              },
              {
                headers: {
                  "Content-Type": "application/json",
                },
              }
            )
          selectStandardProductList({
            model: "",
            standardMethodListId: this.miresStandard,
            factory:
              "中天科技检测中心 - 通信产品实验室 - 光纤带 - " +
              this.miresModel +
              " - ",
          })
            .then((res) => {
              // 将获取的检测项信息赋值
              this.detectionItems = [];
              if (res.data != null && res.data.length != 0) {
                res.data.forEach((a) => {
                  a.state = 0;
                  this.$set(a, "isFibers", 1);
                });
                // 判断是否为委托要求
                this.miresStandards.find((a) => a.id == this.miresStandard)
                  .code == "委托要求"
                  ? (this.isAskOnlyRead = false)
                  : (this.isAskOnlyRead = true);
                if (!this.isAskOnlyRead) {
                  row.productList.forEach((a) => {
                    res.data.forEach((b) => {
                      if (a.id == b.id) {
                        b.ask = a.ask;
                        b.tell = a.tell;
                      }
                    });
              if (res.code === 200) {
                // 将获取的检测项信息赋值
                this.detectionItems = [];
                if (res.data != null && res.data.length != 0) {
                  res.data.forEach((a) => {
                    a.state = 0;
                    this.$set(a, "isFibers", 1);
                  });
                }
                this.detectionItems = res.data;
                this.detectionType = 1;
                this.$set(this.detectionItems, "type", 1);
                if (row.productList != null && row.productList.length > 0) {
                  let product = JSON.parse(JSON.stringify(row.productList));
                  setTimeout(() => {
                    product.forEach((p) => {
                      let rowToSelect = this.detectionItems.find(
                        (item) => item.id === p.id
                      );
                      if (rowToSelect) {
                        this.toggleSelection(rowToSelect);
                      }
                  // 判断是否为委托要求
                  this.miresStandards.find((a) => a.id == this.miresStandard)
                    .code == "委托要求"
                    ? (this.isAskOnlyRead = false)
                    : (this.isAskOnlyRead = true);
                  if (!this.isAskOnlyRead) {
                    row.productList.forEach((a) => {
                      res.data.forEach((b) => {
                        if (a.id == b.id) {
                          b.ask = a.ask;
                          b.tell = a.tell;
                        }
                      });
                    });
                  }, 200);
                  }
                  this.detectionItems = res.data;
                  this.detectionType = 1;
                  this.$set(this.detectionItems, "type", 1);
                  if (row.productList != null && row.productList.length > 0) {
                    let product = JSON.parse(JSON.stringify(row.productList));
                    setTimeout(() => {
                      product.forEach((p) => {
                        let rowToSelect = this.detectionItems.find(
                          (item) => item.id === p.id
                        );
                        if (rowToSelect) {
                          this.toggleSelection(rowToSelect);
                        }
                      });
                    }, 200);
                  }
                }
              }
            })
            .catch((error) => {
              console.error(error);
            });
        }, 500);
      } else if (type == 0) {
@@ -2207,60 +1921,56 @@
              (a) => a.code == row.standard
            ).id;
          }
          this.$axios
            .post(
              this.$api.standardTree.selectStandardProductList,
              {
                model: this.mireModel.split(" - ")[1],
                standardMethodListId: this.mireStandard,
                factory: "",
              },
              {
                headers: {
                  "Content-Type": "application/json",
                },
              }
            )
          selectStandardProductList({
            model: this.mireModel.split(" - ")[1],
            standardMethodListId: this.mireStandard,
            factory: "",
          })
            .then((res) => {
              this.detectionItems = [];
              if (res.data != null && res.data.length != 0) {
                res.data.forEach((a) => {
                  a.state = 0;
                  this.$set(a, "isFibers", 0);
                });
                // 判断是否为委托要求
                this.mireStandards.find((a) => a.id == this.mireStandard)
                  .code == "委托要求"
                  ? (this.isAskOnlyRead = false)
                  : (this.isAskOnlyRead = true);
                if (!this.isAskOnlyRead) {
                  row.productList.forEach((a) => {
                    res.data.forEach((b) => {
                      if (a.id == b.id) {
                        b.ask = a.ask;
                        b.tell = a.tell;
                      }
                    });
              if (res.code === 200) {
                this.detectionItems = [];
                if (res.data != null && res.data.length != 0) {
                  res.data.forEach((a) => {
                    a.state = 0;
                    this.$set(a, "isFibers", 0);
                  });
                }
                this.detectionItems = res.data;
                this.detectionType = 0;
                this.$set(this.detectionItems, "type", 0);
                if (row.productList != null && row.productList.length > 0) {
                  let product = JSON.parse(JSON.stringify(row.productList));
                  setTimeout(() => {
                    product.forEach((p) => {
                      let rowToSelect = this.detectionItems.find(
                        (item) => item.id === p.id
                      );
                      if (rowToSelect) {
                        this.toggleSelection(rowToSelect);
                      }
                  // 判断是否为委托要求
                  this.mireStandards.find((a) => a.id == this.mireStandard)
                    .code == "委托要求"
                    ? (this.isAskOnlyRead = false)
                    : (this.isAskOnlyRead = true);
                  if (!this.isAskOnlyRead) {
                    row.productList.forEach((a) => {
                      res.data.forEach((b) => {
                        if (a.id == b.id) {
                          b.ask = a.ask;
                          b.tell = a.tell;
                        }
                      });
                    });
                  }, 200);
                  }
                  this.detectionItems = res.data;
                  this.detectionType = 0;
                  this.$set(this.detectionItems, "type", 0);
                  if (row.productList != null && row.productList.length > 0) {
                    let product = JSON.parse(JSON.stringify(row.productList));
                    setTimeout(() => {
                      product.forEach((p) => {
                        let rowToSelect = this.detectionItems.find(
                          (item) => item.id === p.id
                        );
                        if (rowToSelect) {
                          this.toggleSelection(rowToSelect);
                        }
                      });
                    }, 200);
                  }
                }
              }
            })
            .catch((error) => {
              console.error(error);
            });
        }, 500);
      }
@@ -2298,12 +2008,6 @@
            return item;
          });
        }
        // else {
        //   this.currentDetectionItems.productList.map((m) => {
        //     m.state = 1;
        //     return m;
        //   });
        // }
      } else {
        if (this.multiFiberList.length > 0) {
          this.multiFiberList.map((item) => {
@@ -2314,12 +2018,6 @@
            return item;
          });
        }
        // else {
        //   this.currentDetectionItems.productList.map((m) => {
        //     m.state = 0;
        //     return m;
        //   });
        // }
      }
      this.bsmRow3 = [];
      this.detectionItems.forEach((p) => {
@@ -2372,12 +2070,6 @@
            this.bsm2 = false;
          }
        }
        // if (p.ask.includes('RTS')&&p.state === 1) {
        //   p.rts = ''
        //   this.bsm3Val = ''
        //   this.bsm3Dia = true
        //   this.bsmRow3.push(p)
        // }
      });
      if (e.length > 0) {
@@ -2423,28 +2115,8 @@
            this.$message.error("关联项目不能重复");
            return;
          }
          // set.add(JSON.stringify(tempList[i].reverse()))
          // let num2 = set.size
          // if (num1 == num2) {
          //   console.log(111,set);
          //   console.log(111,tempList);
          //   this.$message.error('关联项目不能重复')
          //   return
          // }
        }
        //转换熔接配对的编号
        // let transformList = []
        // for(let i=0;i<this.bsm2Val2.length;i++){
        //   let colorIndex1 = Number(this.bsm2Val2[i][0]-1)
        //   let colorIndex2 = Number(this.bsm2Val2[i][1]-1)
        //   let code1 = this.sampleList[0].sampleCode + '-' + this.fiberList[colorIndex1].bushColor + '-' + this.fiberList[colorIndex1].color
        //   let code2 = this.sampleList[1].sampleCode + '-' + this.fiberList[colorIndex2].bushColor + '-' + this.fiberList[colorIndex2].color
        //   transformList.push([code1,code2])
        // }
        this.isBsm2Val2 = true;
        // console.log(this.bsm2Val2);
        // console.log(transformList);
        // this.$parent.fiberPairing = JSON.stringify(this.bsm2Val2)
      }
      this.bsm1Dia = false;
      this.isBsm2Val2 = false;
@@ -2465,9 +2137,6 @@
        );
      }
      let arr = [...new Set(this.fiberLoss)];
      console.log("list", list);
      console.log("this.fiberLoss", this.fiberLoss);
      console.log("arr", arr);
      row.state = row.state == 1 ? 0 : 1;
      if (this.selectFiberList.length > 0) {
        this.selectFiberList.map((item) => {
@@ -2527,23 +2196,6 @@
            console.log("arr", arr);
            if (this.bsm2) {
              this.computationalPairing(this.selectFiberList.length);
              // 默认展示一对一
              // this.bsm2Up(this.selectFiberList.length);
              // if (this.bsm2Val2.length === 0) {
              //   this.bsm2Val = this.selectFiberList.length;
              //   this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
              //   console.log(222, this.bsm2Val2);
              // } else {
              //   this.bsm2Val = this.selectFiberList.length;
              // }
              // if (this.bsm2Val2.length === 0) {
              //   this.bsm2Val =
              //     ((this.fiberList.length + 1) * this.fiberList.length) / 2;
              //   this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
              //   console.log(222, this.bsm2Val2);
              // } else {
              //   this.bsm2Val = this.fiberPairing.length;
              // }
            }
          }
        } else if (
@@ -2556,15 +2208,6 @@
      } else {
        this.bsm1Dia = false;
      }
      // if (row.ask.includes('RTS')&&row.state === 1) {
      //   this.bsmRow3 = null;
      //   row.rts = ''
      //   this.bsm3Val = ''
      //   this.bsm3Dia = true
      //   this.bsmRow3 = row
      // }else{
      //   this.bsm3Dia = false
      // }
    },
    checkSampleCodeHasNull() {
      const emptyCodeArr = this.sampleList.filter(
@@ -2575,25 +2218,26 @@
    computationalPairing(n, isValue = false) {
      this.bsm1Dia = true;
      this.isLoading = true;
      this.$axios
        .get(this.$api.insOrder.permute + "?num=" + n + "&isValue=" + isValue)
      permute({
        num: n,
        isValue: isValue,
      })
        .then((res) => {
          this.bsm2Val3Length = this.HaveJson(res.data.resultData);
          if (this.bsm2Val2.length === 0) {
            this.bsm2Val = this.selectFiberList.length;
            this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
            console.log(222, this.bsm2Val2);
          } else {
            this.bsm2Val = this.selectFiberList.length;
          if (res.code === 200) {
            this.bsm2Val3Length = this.HaveJson(res.data.resultData);
            if (this.bsm2Val2.length === 0) {
              this.bsm2Val = this.selectFiberList.length;
              this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
            } else {
              this.bsm2Val = this.selectFiberList.length;
            }
            this.bsm2Up(this.selectFiberList.length);
            this.isLoading = false;
          }
          this.bsm2Up(this.selectFiberList.length);
          this.isLoading = false;
        })
        .catch((error) => {
          console.error(error);
        });
      // const nums = [];
      // for (let i = 1; i <= n; i++) {
      //   nums.push(i);
      // }
      // this.bsm2Val3 = this.HaveJson(this.permute(nums));
    },
    permute(nums) {
      const result = [];
@@ -2632,30 +2276,6 @@
      });
    },
    save() {
      // if(this.bushing.length === 0){
      //   this.$message.error('缺少配置无法保存')
      //   return
      // }
      // for(let a in this.bushing){
      //   if(this.bushing[a].fibers.length===0&&this.bushing[a].fiber.length===0){
      //     this.$message.error(this.bushing[a].color+'管色标套管缺少配置无法保存')
      //     return
      //   }
      // }
      // this.sample.forEach(a=>{
      //   a.bushing = this.bushing
      // })
      // this.$message.success('已保存')
      // this.$emit('saveFiberopticConfig')
      // if(this.inspectionItemST == 1) {
      //   this.$message.success('已保存')
      //   this.sample.forEach(a=>{
      //   a.bushing = this.bushing
      // })
      // this.$emit('saveFiberopticConfig')
      // return
      // }
      let flag = true;
      let flags = true;
@@ -3268,8 +2888,8 @@
          let color = this.colors[i];
          for (let j = 0; j < newFiberList.length; j++) {
            let newColor = newFiberList[j];
            if (color.value == newColor[0]) {
              newFiberList[j].push(color.orderNum);
            if (color.dictValue == newColor[0]) {
              newFiberList[j].push(color.dictSort);
            }
          }
        }
@@ -3297,19 +2917,6 @@
        this.bsm2Val2 = resultList;
        console.log("this.bsm2Val2", this.bsm2Val2);
      } else {
        // if (val == this.bsm2Val3.length) {
        //   this.bsm2Val2 = [];
        //   this.computationalPairing(this.selectFiberList.length,true);
        //   if (this.bsm2Val2.length === 0) {
        //     this.bsm2Val =
        //       ((this.selectFiberList.length + 1) * this.selectFiberList.length) / 2;
        //     this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
        //   } else {
        //     this.bsm2Val = this.selectFiberList.length;
        //   }
        //   this.bsm1DiaLoading = false;
        //   console.log('loading',this,this.bsm1DiaLoading);
        // } else {
        // 一对一
        this.bsm1DiaLoading = true;
        let list = [];
@@ -3352,6 +2959,7 @@
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 15px;
}
.models {
  font-size: 14px;