spring
2025-03-06 f2bc9fde40010ddb6fdbc4c36ee9fc0e83af8f03
Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
已添加8个文件
已修改9个文件
8751 ■■■■■ 文件已修改
package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/inspectionOrder.js 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/user.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/basic-container/main.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/AppMain.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/lodop.js 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionOrder/add.vue 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionOrder/cable-config.vue 311 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionOrder/equip-config.vue 591 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionOrder/fiberoptic-config-two.vue 1599 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionOrder/fiberoptic-config.vue 3438 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionOrder/index.vue 1436 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dept/index.vue 189 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/menu/index.vue 270 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/role/index.vue 429 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -66,6 +66,7 @@
    "vue-cropper": "0.5.5",
    "vue-demi": "^0.14.10",
    "vue-meta": "2.4.0",
    "vue-qr": "^4.0.9",
    "vue-router": "3.4.9",
    "vuedraggable": "2.24.3",
    "vuex": "3.6.0",
src/api/business/inspectionOrder.js
src/api/system/user.js
@@ -138,24 +138,24 @@
// èŽ·å–äººäº‹ç³»ç»Ÿç»„ç»‡
export function selectCompaniesList() {
  return request({
    url: "/companies/selectCompaniesList",
    url: "/system/newUser/selectCompaniesList",
    method: "get",
  });
}
// èŽ·å–äººäº‹ç³»ç»Ÿç»„ç»‡ä¸‹çš„äººå‘˜
export function selectSimpleList(data) {
  return request({
    url: "/companies/selectSimpleList",
    method: "post",
    url: "/system/newUser/selectSimpleList",
    method: "get",
    params: data,
  });
}
// èŽ·å–äººäº‹ç³»ç»Ÿç»„ç»‡ä¸‹çš„äººå‘˜
export function addPersonUser(data) {
  return request({
    url: "/companies/addPersonUser",
    url: "/system/newUser/addPersonUser",
    method: "post",
    params: data,
    data: data,
  });
}
// èŽ·å–è§’è‰²
src/components/basic-container/main.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
<template>
  <div :class="{ 'basic-container--block': block }" class="basic-container">
    <!-- <el-card>
      <slot />
    </el-card> -->
    <slot />
  </div>
</template>
<script>
export default {
  name: "BasicContainer",
  props: {
    block: {
      type: Boolean,
      default: false,
    },
  },
};
</script>
<style lang="scss">
.basic-container {
  padding: 15px;
  margin: 10px 15px;
  // border-radius: 10px;
  box-sizing: border-box;
  background-color: #fff;
  .el-card {
    width: 100%;
    box-sizing: border-box;
  }
  &:first-child {
    // padding-top: 0;
  }
  &--block {
    height: 100%;
    .el-card {
      height: 100%;
    }
  }
}
</style>
src/layout/components/AppMain.vue
@@ -50,6 +50,7 @@
  width: 100%;
  position: relative;
  overflow: hidden;
  background: rgb(245, 247, 251);
}
.fixed-header + .app-main {
src/main.js
@@ -49,6 +49,7 @@
import { getToken } from "@/utils/auth";
// æ—¶é—´è½¬æ¢
import Moment from "moment";
import basicContainer from './components/basic-container/main'
// å…¨å±€æ–¹æ³•挂载
Vue.prototype.getDicts = getDicts;
@@ -92,6 +93,8 @@
Vue.component("FileUpload", FileUpload);
Vue.component("ImageUpload", ImageUpload);
Vue.component("ImagePreview", ImagePreview);
// æ³¨å†Œå…¨å±€å®¹å™¨
Vue.component('basicContainer', basicContainer)
Vue.use(directive);
Vue.use(plugins);
src/utils/lodop.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,169 @@
// lodop.js
//= =本JS是加载Lodop插件及CLodop服务的综合示例,可直接使用,建议看懂后融进自己页面程序==
var CreatedOKLodopObject, CLodopIsLocal, CLodopJsState
//= =判断是否需要CLodop(那些不支持插件的浏览器):==
function needCLodop() {
  try {
    var ua = navigator.userAgent
    if (ua.match(/Windows\sPhone/i)) return true
    if (ua.match(/iPhone|iPod|iPad/i)) return true
    if (ua.match(/Android/i)) return true
    if (ua.match(/Edge\D?\d+/i)) return true
    var verTrident = ua.match(/Trident\D?\d+/i)
    var verIE = ua.match(/MSIE\D?\d+/i)
    var verOPR = ua.match(/OPR\D?\d+/i)
    var verFF = ua.match(/Firefox\D?\d+/i)
    var x64 = ua.match(/x64/i)
    if (!verTrident && !verIE && x64) return true
    else if (verFF) {
      verFF = verFF[0].match(/\d+/)
      if (verFF[0] >= 41 || x64) return true
    } else if (verOPR) {
      verOPR = verOPR[0].match(/\d+/)
      if (verOPR[0] >= 32) return true
    } else if (!verTrident && !verIE) {
      var verChrome = ua.match(/Chrome\D?\d+/i)
      if (verChrome) {
        verChrome = verChrome[0].match(/\d+/)
        if (verChrome[0] >= 41) return true
      }
    }
    return false
  } catch (err) {
    return true
  }
}
//= =加载引用CLodop的主JS,用双端口8000和18000(以防其中一个被占):==
function loadCLodop() {
  if (CLodopJsState == 'loading' || CLodopJsState == 'complete') return
  CLodopJsState = 'loading'
  var head =
    document.head ||
    document.getElementsByTagName('head')[0] ||
    document.documentElement
  var JS1 = document.createElement('script')
  var JS2 = document.createElement('script')
  JS1.src = 'http://localhost:8000/CLodopfuncs.js?priority=1'
  JS2.src = 'http://localhost:18000/CLodopfuncs.js'
  JS1.onload = JS2.onload = function() {
    CLodopJsState = 'complete'
  }
  JS1.onerror = JS2.onerror = function(evt) {
    CLodopJsState = 'complete'
  }
  head.insertBefore(JS1, head.firstChild)
  head.insertBefore(JS2, head.firstChild)
  CLodopIsLocal = !!(JS1.src + JS2.src).match(/\/\/localho|\/\/127.0.0./i)
}
if (needCLodop()) {
  loadCLodop()
} // åŠ è½½
//= =获取LODOP对象主过程,判断是否安装、需否升级:==
export default function getLodop(oOBJECT, oEMBED) {
  var strHtmInstall =
    '<br><font color=\'#FF00FF\'>打印控件未安装!点击这里<a href=\'install_lodop32.exe\' target=\'_self\'>执行安装</a>,安装后请刷新页面或重新进入。</font>'
  var strHtmUpdate =
    '<br><font color=\'#FF00FF\'>打印控件需要升级!点击这里<a href=\'install_lodop32.exe\' target=\'_self\'>执行升级</a>,升级后请重新进入。</font>'
  var strHtm64_Install =
    '<br><font color=\'#FF00FF\'>打印控件未安装!点击这里<a href=\'install_lodop64.exe\' target=\'_self\'>执行安装</a>,安装后请刷新页面或重新进入。</font>'
  var strHtm64_Update =
    '<br><font color=\'#FF00FF\'>打印控件需要升级!点击这里<a href=\'install_lodop64.exe\' target=\'_self\'>执行升级</a>,升级后请重新进入。</font>'
  var strHtmFireFox =
    '<br><br><font color=\'#FF00FF\'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>'
  var strHtmChrome =
    '<br><br><font color=\'#FF00FF\'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>'
  var strCLodopInstall_1 =
    '<br><font color=\'#FF00FF\'>Web打印服务CLodop未安装启动,点击这里<a href=\'CLodop_Setup_for_Win32NT.exe\' target=\'_self\'>下载执行安装</a>'
  var strCLodopInstall_2 =
    '<br>(若此前已安装过,可<a href=\'CLodop.protocol:setup\' target=\'_self\'>点这里直接再次启动</a>)'
  var strCLodopInstall_3 = ',成功后请刷新本页面。</font>'
  var strCLodopUpdate =
    '<br><font color=\'#FF00FF\'>Web打印服务CLodop需升级!点击这里<a href=\'CLodop_Setup_for_Win32NT.exe\' target=\'_self\'>执行升级</a>,升级后请刷新页面。</font>'
  var LODOP
  try {
    var ua = navigator.userAgent
    var isIE = !!ua.match(/MSIE/i) || !!ua.match(/Trident/i)
    if (needCLodop()) {
      try {
        LODOP = getCLodop()
      } catch (err) {}
      if (!LODOP && CLodopJsState !== 'complete') {
        if (CLodopJsState == 'loading')
          alert('网页还没下载完毕,请稍等一下再操作.')
        else alert('没有加载CLodop的主js,请先调用loadCLodop过程.')
        return
      }
      if (!LODOP) {
        document.body.innerHTML =
          strCLodopInstall_1 +
          (CLodopIsLocal ? strCLodopInstall_2 : '') +
          strCLodopInstall_3 +
          document.body.innerHTML
        return
      } else {
        if (CLODOP.CVERSION < '4.1.2.3') {
          document.body.innerHTML = strCLodopUpdate + document.body.innerHTML
        }
        if (oEMBED && oEMBED.parentNode) oEMBED.parentNode.removeChild(oEMBED) // æ¸…理旧版无效元素
        if (oOBJECT && oOBJECT.parentNode)
          oOBJECT.parentNode.removeChild(oOBJECT)
      }
    } else {
      var is64IE = isIE && !!ua.match(/x64/i)
      //= =如果页面有Lodop就直接使用,否则新建:==
      if (oOBJECT || oEMBED) {
        if (isIE) LODOP = oOBJECT
        else LODOP = oEMBED
      } else if (!CreatedOKLodopObject) {
        LODOP = document.createElement('object')
        LODOP.setAttribute('width', 0)
        LODOP.setAttribute('height', 0)
        LODOP.setAttribute(
          'style',
          'position:absolute;left:0px;top:-100px;width:0px;height:0px;'
        )
        if (isIE)
          LODOP.setAttribute(
            'classid',
            'clsid:2105C259-1E0C-4534-8141-A753534CB4CA'
          )
        else LODOP.setAttribute('type', 'application/x-print-lodop')
        document.documentElement.appendChild(LODOP)
        CreatedOKLodopObject = LODOP
      } else LODOP = CreatedOKLodopObject
      //= =Lodop插件未安装时提示下载地址:==
      if (!LODOP || !LODOP.VERSION) {
        if (ua.indexOf('Chrome') >= 0)
          document.body.innerHTML = strHtmChrome + document.body.innerHTML
        if (ua.indexOf('Firefox') >= 0)
          document.body.innerHTML = strHtmFireFox + document.body.innerHTML
        document.body.innerHTML =
          (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML
        return LODOP
      }
    }
    if (LODOP.VERSION < '6.2.2.6') {
      if (!needCLodop())
        document.body.innerHTML =
          (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML
    }
    //= ==如下空白位置适合调用统一功能(如注册语句、语言选择等):==
    LODOP.SET_LICENSES(
      '',
      'EE0887D00FCC7D29375A695F728489A6',
      'C94CEE276DB2187AE6B65D56B3FC2848',
      ''
    )
    //= ======================================================
    return LODOP
  } catch (err) {
    alert('getLodop出错:' + err)
  }
}
src/views/business/inspectionOrder/add.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,142 @@
<style scoped>
.ins_order_add {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}
.ins_order_add::-webkit-scrollbar {
  width: 0;
}
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  width: calc(100% - 40px);
  background-color: #fff;
  padding: 5px 40px 5px 0;
}
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
}
.search_label {
  width: 120px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 120px);
}
.node_i {
  color: orange;
  font-size: 18px;
}
.el-select-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pairing {
  text-align: center;
  line-height: 36px;
  margin: 3px 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
.askRts {
  width: 100px;
  font-size: 12px;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.3);
  text-align: center;
  background-color: rgba(0, 0, 0, 0.1);
  outline: none;
  border-radius: 2px;
  line-height: 24px;
  margin-top: 5px;
}
.circulateTable {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.opticalProject {
  width: 38%;
}
.temperatureList {
  width: 60%;
}
.temperatureListTitle {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  line-height: 30px;
}
</style>
<style>
.ins_order_add .el-input-group__append,
.el-input-group__prepend {
  padding: 0 10px;
}
.ins_order_add .el-tree-node__content {
  height: 32px;
  font-size: 14px;
  border-radius: 2px;
}
.ins_order_add
  .el-tree--highlight-current
  .el-tree-node.is-current
  > .el-tree-node__content {
  color: #3a7bfa;
}
.ins_order_add .has-gutter .el-table__cell .cell {
  line-height: 30px;
  background-color: #fafafa;
}
.ins_order_add .has-gutter .el-table__cell {
  background-color: #fafafa !important;
}
.ins_order_add .el-table__row .cell {
  font-size: 12px;
}
.ins_order_add .el-table .warning-row .cell {
  color: #3a7bfa;
}
.ins_order_add .el-select .is-disabled {
  background: transparent !important;
}
.ins_order_add .el-select .is-disabled .el-input__inner {
  background: transparent !important;
}
</style>
<template>
  <div>add</div>
</template>
<script>
export default {};
</script>
src/views/business/inspectionOrder/cable-config.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,311 @@
<template>
  <div class="ins_order_config">
    <div>
      <el-row class="title">
        <el-col :span="6" style="padding-left: 20px;text-align: left;">电缆配置</el-col>
        <el-col :span="18" style="text-align: right;">
          <el-button size="medium" @click="outConfig">
            <span style="color: #3A7BFA;">返 å›ž</span>
          </el-button>
          <el-button size="medium" type="primary" @click="save">保 å­˜</el-button>
        </el-col>
      </el-row>
    </div>
    <div class="search">
      <el-radio-group v-model="currentTab" size="small" style="margin-left: 20px;" @input="changeTab">
        <el-radio-button label="绝缘">绝 ç¼˜</el-radio-button>
        <el-radio-button label="护套">护 å¥—</el-radio-button>
      </el-radio-group>
      <div class="search_thing" v-if="currentTab=='绝缘'">
        <div class="search_label">芯数:</div>
        <el-input size="small" placeholder="请输入" clearable
                        v-model="insulating.num"></el-input>
      </div>
      <div class="search_thing" v-if="currentTab=='绝缘'">
        <div class="search_label">检验标准:</div>
        <el-select v-model="insulating.standardMethodListId" placeholder="请选择检验标准" size="small"
        @change="(value)=>methodChange(value)">
          <el-option v-for="item in standards" :key="item.id" :label="item.code" :value="item.id">
          </el-option>
        </el-select>
      </div>
      <div class="search_thing" v-if="currentTab=='护套'">
        <div class="search_label">检验标准:</div>
        <el-select v-model="sheath.standardMethodListId" placeholder="请选择检验标准" size="small"
        @change="(value)=>methodChange(value)">
          <el-option v-for="item in standards" :key="item.id" :label="item.code" :value="item.id">
          </el-option>
        </el-select>
      </div>
    </div>
    <div class="table">
      <el-table class="el-table" ref="productTable" :data="productList" height="100%" tooltip-effect="dark" border
        @selection-change="selectProduct" style="margin-bottom: 10px;" @select="upProductSelect"
        :row-class-name="tableRowClassName" @select-all="handleAll">
        <el-table-column type="selection" width="65" :selectable="selectable"></el-table-column>
        <el-table-column prop="inspectionItem" label="检验项" min-width="140" show-overflow-tooltip></el-table-column>
        <el-table-column prop="inspectionItemSubclass" label="检验项子项" min-width="140"
          show-overflow-tooltip></el-table-column>
        <el-table-column prop="sonLaboratory" label="子实验室" min-width="130" show-overflow-tooltip></el-table-column>
        <el-table-column prop="methodS" label="试验方法" min-width="120" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="unit" label="计量单位" width="100" show-overflow-tooltip></el-table-column>
        <el-table-column prop="price" label="单价" width="100" show-overflow-tooltip></el-table-column>
        <el-table-column prop="section" label="区间" min-width="120" show-overflow-tooltip></el-table-column>
        <el-table-column prop="ask" label="要求值" min-width="220px">
          <template slot-scope="scope">
            <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea"
              :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)"
              v-if="active==1&&isAskOnlyRead"></el-input>
            <span v-else>{{ scope.row.ask }}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
import { Tree } from 'element-ui'
export default {
  props: {
    active: {
      type: Number,
      default: () => 0
    },
  },
  data(vm) {
      return {
        standardList:[],
        vaule0:'',
        currentTab:'绝缘',
        upIndex:0,
        productList: [],
        productIds: [],
        sample: [],
        tree: '',
        standards: [],
        insulating: {
          standardMethodListId: null,
          insProduct: [],
          num: 1
        },
        sheath: {
          standardMethodListId: null,
          insProduct: []
        },
        isAskOnlyRead: false
      }
  },
  mounted() {
    this.$parent.sampleIds.forEach(a => {
      for (var i = 0; i < this.$parent.sampleList.length; i++) {
        if (this.$parent.sampleList[i].id == a) {
          this.sample.push(this.$parent.sampleList[i])
          if(this.$parent.sampleList[i].insulating !== undefined && this.$parent.sampleList[i].insulating !== null){
            this.insulating = this.$parent.sampleList[i].insulating
          }
          if(this.$parent.sampleList[i].sheath !== undefined && this.$parent.sampleList[i].sheath !== null){
            this.sheath = this.$parent.sampleList[i].sheath
          }
          break
        }
      }
    })
    let obj = this.$parent.addObj
    this.tree = obj.factory + ' - ' + obj.laboratory + ' - ' + obj.sampleType + ' - ' + obj.sample
    this.selectsStandardMethodByFLSSM2()
    this.productList = this.insulating.insProduct
    setTimeout(() => {
      this.productList.forEach(a => {
        if (a.state == 1) this.toggleSelection(a)
      })
    }, 200)
  },
  methods: {
    outConfig() {
      this.$parent.cableConfigShow = false
    },
    selectProduct(val) {
      this.productIds = []
      val.forEach(a => {
        this.productIds.push(a.id)
      })
    },
    upProductSelect(selection, row) {
      row.state = row.state == 1 ? 0 : 1
    },
    handleAll(e) {
      if (e.length > 0) {
        this.productList.map(m => {
          m.state = 1
          return m
        })
      } else {
        this.productList.map(m => {
          m.state = 0
          return m
        })
      }
      this.$nextTick(() => {
        this.$refs.productTable.doLayout()
      })
    },
    tableRowClassName({
      row,
      rowIndex
    }) {
      if (row.state === 0) {
        return 'warning-row';
      }
      return '';
    },
    selectable() {
      if (this.active > 1) {
        return false
      } else {
        return true
      }
    },
    selectsStandardMethodByFLSSM2() {
      this.standards = []
      this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
        tree: this.tree
      }).then(res => {
        this.standards = res.data.standardMethodList
      })
    },
    methodChange(val) {
      if (val === null || val === '') return
      let standard = this.standards.find(a => a.id === val)
      if(standard!=null && standard.code==='委托要求'){
        this.isAskOnlyRead = true
      }else{
        this.isAskOnlyRead = false
      }
      this.$axios.post(this.$api.standardTree.selectStandardProductList, {
        model: this.$parent.addObj.model,
        standardMethodListId: val,
        factory: this.tree + ' - '
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        res.data.forEach(a => {
          a.state = 0
        })
        if(this.currentTab==='绝缘'){
          this.insulating.insProduct = res.data
        }else if(this.currentTab==='护套'){
          this.sheath.insProduct = res.data
        }
        this.productList = res.data
        setTimeout(() => {
          this.productList.forEach(a => {
            if (a.state == 1) this.toggleSelection(a)
          })
        }, 200)
      })
    },
    toggleSelection(row) {
      this.$refs.productTable.toggleRowSelection(row, true);
    },
    save(){
      if(this.insulating.insProduct.length === 0 && this.sheath.insProduct.length === 0){
        this.$message.error('缺少配置无法保存')
        return
      }
      if(this.insulating.insProduct.length !== 0){
        if(this.insulating.num === null || this.insulating.num === '' || this.insulating.num <= 0){
          this.$message.error('缺少芯数无法保存')
          return
        }
      }
      this.sample.forEach(a=>{
        a.insulating = this.insulating
        a.sheath = this.sheath
      })
      this.$message.success('已保存')
    },
    changeTab(val){
      if(val==='绝缘'){
        this.productList = this.insulating.insProduct
      }else if(val==='护套'){
        this.productList = this.sheath.insProduct
      }
      setTimeout(() => {
        this.productList.forEach(a => {
          if (a.state == 1) this.toggleSelection(a)
        })
      }, 200)
    }
  }
}
</script>
<style scoped>
.ins_order_config {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .ins_order_config::-webkit-scrollbar {
    width: 0;
  }
  .title {
    height: 60px;
    line-height: 60px;
  }
  .search {
        background-color: #fff;
        height: 80px;
        display: flex;
        align-items: center;
    }
    .search_thing {
        width: 300px;
        display: flex;
        align-items: center;
    }
    .search_label {
        width: 100px;
        font-size: 14px;
        text-align: right;
    }
    .search_input {
        width: calc(100% - 70px);
    }
  .table {
        margin-top: 10px;
        background-color: #fff;
        width: calc(100% - 40px);
        height: calc(100% - 60px - 80px - 26px - 24px);
        padding: 20px;
    }
</style>
<style>
  .ins_order_config .has-gutter .el-table__cell .cell {
    line-height: 30px;
    background-color: #fafafa;
  }
  .ins_order_config .has-gutter .el-table__cell {
    background-color: #fafafa !important;
  }
  .ins_order_config .el-table__row .cell {
    font-size: 12px;
  }
  .ins_order_config .el-table .warning-row .cell {
    color: #bababa;
  }
</style>
src/views/business/inspectionOrder/equip-config.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,591 @@
<template>
  <div class="ins_order_config">
    <div>
      <el-row class="title">
        <el-col :span="6" style="padding-left: 20px;text-align: left;">子样品配置</el-col>
        <el-col :span="18" style="text-align: right;">
          <el-button size="medium" type="primary" @click="addChild" v-if="active==1">添加子样品</el-button>
          <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-if="active==1">保 å­˜</el-button>
          <el-button size="medium" @click="outConfig">
            <span style="color: #3A7BFA;">返 å›ž</span>
          </el-button>
        </el-col>
      </el-row>
    </div>
    <div class="center">
      <el-table class="el-table sampleTable" ref="sampleTable" :data="sampleList" height="50%" tooltip-effect="dark"
        border highlight-current-row @row-click="rowClick" @current-change="selectSample">
        <!-- <el-table-column type="selection" width="60" :selectable="selectable" v-if="active==1"></el-table-column> -->
        <el-table-column type="index" label="序号" width="65" align="center"></el-table-column>
        <el-table-column prop="sample" label="样品名称" align="center" min-width="100">
          <template slot-scope="scope">
            <el-input size="small" v-model="scope.row.sample" clearable :readonly="active>1"></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="sampleCode" label="样品编号" min-width="140" align="center">
          <template slot-scope="scope">
            <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="不填写则系统自动生成"
              :readonly="active>1"></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="model" label="样品型号" align="center" min-width="100">
          <template slot-scope="scope">
            <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="样品型号"
              size="small" @change="handleChangeModel" :disabled="active>1" style="width: 100%;">
              <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column prop="modelNum" label="型号参数" width="130" align="center" v-if="!(active>1)">
          <template slot-scope="scope">
            <el-input size="small" v-model="scope.row.modelNum" clearable placeholder="非必填"
              @keyup.enter.native="methodChange(scope.row.standardMethodListId, scope.row)"
              @clear="methodChange(scope.row.standardMethodListId, scope.row)"></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="standardMethodListId" label="检验标准" align="center" min-width="100">
          <template slot-scope="scope">
            <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model==null||active>1"
              placeholder="检验标准" size="small" :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)"
              @focus="methodFocus" :readonly="active>1" style="width: 100%;">
              <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
              </el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column prop="num" label="样品数量" align="center" width="90">
        </el-table-column>
        <el-table-column label="操作" width="120">
          <template slot-scope="scope">
            <el-button @click.native.prevent="deleteRow(scope.$index, sampleList)" type="text"
              size="small">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-table class="el-table" ref="productTable" :data="productList" height="50%" tooltip-effect="dark" border
        @selection-change="selectProduct" style="margin-bottom: 10px;" @select="upProductSelect"
        :row-class-name="tableRowClassName" v-loading="getProductLoad" @select-all="handleAll">
        <el-table-column type="selection" width="65" :selectable="selectable" v-if="active==1"></el-table-column>
        <el-table-column prop="inspectionItem" label="检验项" min-width="140" show-overflow-tooltip></el-table-column>
        <el-table-column prop="inspectionItemSubclass" label="检验项子项" min-width="140"
          show-overflow-tooltip></el-table-column>
        <el-table-column prop="sonLaboratory" label="子实验室" min-width="130" show-overflow-tooltip :filters="filters"
          :filter-method="filterHandler"></el-table-column>
        <el-table-column prop="methodS" label="试验方法" min-width="120" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="unit" label="计量单位" width="100" show-overflow-tooltip></el-table-column>
        <el-table-column prop="price" label="单价" width="100" show-overflow-tooltip></el-table-column>
        <el-table-column prop="section" label="区间" min-width="120" show-overflow-tooltip></el-table-column>
        <el-table-column prop="ask" label="要求值" min-width="220px">
          <template slot-scope="scope">
            <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea"
              :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)"
              v-if="active==1&&isAskOnlyRead"></el-input>
            <span v-else>{{ scope.row.ask }}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <el-dialog title="选择子样品" :visible.sync="selectStandardTree" width="400px" @closed="addObj.sampleNum = 1">
      <div class="body" style="height: 60vh;overflow-y: auto;user-select: none;" v-if="selectStandardTree">
        <el-row style="margin-bottom: 10px;">
          <el-col :span="24">
            <label>样品数量:</label>
            <el-input-number v-model="addObj.sampleNum" :min="1" label="请输入数量" size="small"></el-input-number>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-input placeholder="输入关键字进行搜索" suffix-icon="el-icon-search" v-model="search" size="small"
              style="margin-bottom: 5px;" clearable @blur="searchFilter" @clear="searchFilter"
              @keyup.enter.native="searchFilter"></el-input>
          </el-col>
        </el-row>
        <el-tree :data="list" ref="tree" :props="{ children: 'children', label: 'label' }" node-key="label"
          :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
          @node-collapse="nodeClose" :default-expanded-keys="expandedKeys" @dblclick.native="activeStandardTree">
          <div class="custom-tree-node" slot-scope="{ node, data }">
            <el-row>
              <el-col :span="24">
                <span><i
                    :class="`node_i ${data.children != undefined ? (data.code==='[1]'?'el-icon-folder-opened':'el-icon-folder') : 'el-icon-tickets'}`"></i>
                  {{ data.code }} {{ data.label }}</span>
              </el-col>
            </el-row>
          </div>
        </el-tree>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="selectStandardTree = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="activeStandardTree">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog title="检测到特殊项,请作出以下选择" :visible.sync="bsm1Dia" width="500px" :show-close="false"
      :before-close="beforeClose">
      <div class="body" style="max-height: 60vh;">
        <el-row v-if="bsm1">
          <el-col class="search_thing" :span="22">
            <div class="search_label"><span class="required-span">* </span>护套密度:</div>
            <div class="search_input">
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio v-for="(a, ai) in JSON.parse(bsmRow.section)" :key="ai" :label="a"></el-radio>
              </el-radio-group>
            </div>
          </el-col>
          <el-col class="search_thing" :span="22">
            <div class="search_label">要求值:</div>
            <div class="search_input" v-show="bsm1Val!==null&&bsm1Val!==''">
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio v-for="(a, ai) in JSON.parse(bsmRow.section)" :key="ai"
                  :label="a">{{JSON.parse(bsmRow.ask)[ai]}}</el-radio>
              </el-radio-group>
            </div>
          </el-col>
        </el-row>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  export default {
    props: {
      active: {
        type: Number,
        default: () => 0
      },
    },
    data() {
      return {
        saveLoad: false,
        sampleList: [],
        productList: [],
        getProductLoad: false,
        filters: [],
        sampleIds: [],
        isAskOnlyRead: false,
        selectStandardTree: false,
        search: '',
        expandedKeys: [],
        addObj: {
          sampleNum: 1,
        },
        selectTree: null,
        models: [],
        sample: {
          sampleCode: null,
          laboratory: null,
          factory: null,
          sampleType: null,
          sample: null,
          model: null,
          modelNum: null,
          sampleNum: 1,
          isLeave: 0,
          unit: null
        },
        currentMethod: null,
        methods: [],
        methodLoad: false,
        sampleId: null,
        bsmRow: null,
        bsm1: false,
        bsm1Val: null,
        bsm1Dia: false,
        list: [],
        parentSample: []
      }
    },
    mounted() {
      this.selectStandardTreeList()
      this.selectStandardMethods()
      this.$parent.sampleIds.forEach(a => {
        for (var i = 0; i < this.$parent.sampleList.length; i++) {
          if (this.$parent.sampleList[i].id == a) {
            this.sampleList = this.$parent.sampleList[i].childSampleList
            this.parentSample.push(this.$parent.sampleList[i])
            break
          }
        }
      })
    },
    methods: {
      selectStandardTreeList() {
        this.$axios.get(this.$api.standardTree.selectStandardTreeList).then(res => {
          this.list = res.data
          this.list.forEach(a => {
            this.expandedKeys.push(a.label)
          })
        })
      },
      save() {
        if (this.sampleList.length === 0) {
          this.$message.error('缺少配置无法保存')
          return
        }
        this.parentSample.forEach(a => {
          a.childSampleList = this.sampleList
        })
        this.$message.success('已保存')
      },
      deleteRow(index, rows) {
        this.productList = []
        rows.splice(index, 1);
      },
      outConfig() {
        this.$parent.equipConfigShow = false
      },
      addChild() {
        this.selectStandardTree = true
      },
      selectSample(val) {
        if (val === null) return
        this.sampleIds = [val.id]
      },
      rowClick(row, column, event) {
        this.currentMethod = row
        let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
        if (obj && obj.code == '委托要求') {
          this.isAskOnlyRead = true
        } else {
          this.isAskOnlyRead = false
        }
        this.sampleId = row.id
        if (this.active !== 1) {
          this.sampleIds = []
          this.sampleIds.push(row.id)
        }
        this.productList = row.insProduct
        setTimeout(() => {
          this.productList.forEach(a => {
            if (a.state == 1) this.toggleSelection(a)
          })
        }, 200)
      },
      toggleSelection(row) {
        this.$refs.productTable.toggleRowSelection(row, true);
      },
      selectable() {
        if (this.active > 1) {
          return false
        } else {
          return true
        }
      },
      handleChangeModel(e) {
        let num = this.selectTree.split('-').length;
        if (num != 5) {
          this.selectTree = this.selectTree + ' - ' + e
        } else {
          let arr = this.selectTree.split('-')
          let arr0 = arr.slice(0, arr.length - 1)
          this.selectTree = arr0.join('-') + '- ' + e
        }
      },
      methodChange(val, row) {
        if (val === null || val === '') return
        this.currentMethod = row
        let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
        if (obj && obj.code == '委托要求') {
          this.isAskOnlyRead = true
        } else {
          this.isAskOnlyRead = false
        }
        this.getProductLoad = true
        this.$axios.post(this.$api.standardTree.selectStandardProductList, {
          model: row.model + '-' + row.modelNum,
          standardMethodListId: val,
          factory: this.selectTree,
        }, {
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          res.data.forEach(a => {
            a.state = 0
          })
          row.insProduct = this.HaveJson(res.data)
          this.getProductLoad = false
          this.productList = row.insProduct
          this.$refs.sampleTable.setCurrentRow(row)
          setTimeout(() => {
            this.productList.forEach(a => {
              if (a.state == 1) this.toggleSelection(a)
            })
          }, 200)
        })
      },
      methodFocus() {
        this.selectsStandardMethodByFLSSM()
      },
      selectStandardMethods() {
        this.$axios.get(this.$api.standardTree.selectStandardMethodEnum).then(res => {
          this.methods = res.data
        })
      },
      selectsStandardMethodByFLSSM() {
        this.methodLoad = true
        this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree: this.selectTree
        }).then(res => {
          this.methodLoad = false
          try {
            if (res.data.standardMethodList.length == 0 && this.selectTree.split('-').length == 5) {
              let arr = this.selectTree.split('-')
              let arr0 = arr.slice(0, arr.length - 1)
              let selectTree = arr0.join('-').substring(0, arr0.join('-').length - 1)
              this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
                tree: selectTree
              }).then(ress => {
                this.methods = ress.data.standardMethodList
              })
            } else {
              this.methods = res.data.standardMethodList
            }
          } catch (e) {}
        })
      },
      selectProduct(val) {
        this.productIds = []
        val.forEach(a => {
          this.productIds.push(a.id)
        })
      },
      upProductSelect(selection, row) {
        row.state = row.state == 1 ? 0 : 1
        if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 1) {
          if (row.section.indexOf('[') > -1) {
            this.bsmRow = this.HaveJson(row)
          }
          this.bsm1 = true
          this.bsm1Dia = true
        } else if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 0) {
          this.bsm1 = false
        }
        this.sampleList.map(item => {
          if (this.sampleIds.indexOf(item.id) > -1) {
            item.insProduct.map(m => {
              if (m.id == row.id) {
                m.state = row.state;
              }
              return m;
            })
          }
          return item
        })
      },
      tableRowClassName({
        row,
        rowIndex
      }) {
        if (row.state === 0) {
          return 'warning-row';
        }
        return '';
      },
      handleAll(e) {
        if (e.length > 0) {
          this.productList.map(m => {
            m.state = 1
            return m
          })
        } else {
          this.productList.map(m => {
            m.state = 0
            return m
          })
        }
        this.productList.forEach(p => {
          if (p.bsm === '1' && p.section !== '' && p.section !== null && p.state === 1) {
            if (p.section.indexOf('[') > -1) {
              this.bsmRow = this.HaveJson(p)
            }
            this.bsm1 = true
            this.bsm1Dia = true
          } else if (p.bsm === '1' && p.section !== '' && p.section !== null && p.state === 0) {
            this.bsm1 = false
          }
        })
        if (e.length > 0) {
          this.sampleList.map(item => {
            if (this.sampleIds.indexOf(item.id) > -1) {
              item.insProduct.map(m => {
                m.state = 1
                return m;
              })
            }
            return item
          })
        } else {
          this.sampleList.map(item => {
            if (this.sampleIds.indexOf(item.id) > -1) {
              item.insProduct.map(m => {
                m.state = 0
                return m;
              })
            }
            return item
          })
        }
        this.$nextTick(() => {
          this.$refs.productTable.doLayout()
        })
      },
      filterHandler(value, row, column) {
        const property = column['property'];
        return row[property] === value;
      },
      requestChange(e, row) {
        this.sampleList.map(item => {
          if (this.sampleIds.indexOf(item.id) > -1) {
            item.insProduct.map(m => {
              if (m.id == row.id) {
                m.ask = e;
              }
              return m;
            })
          }
          return item
        })
      },
      activeStandardTree() {
        let trees = this.selectTree.split(" - ")
        if (trees.length < 4) {
          this.$message.error('未选择子产品')
          return
        }
        this.addObj.factory = trees[0]
        this.addObj.laboratory = trees[1]
        this.addObj.sampleType = trees[2]
        if(trees[3]===''){
          this.addObj.sample = (trees[4] == undefined ? null : trees[4])
        }else if(trees[3]===undefined){
          this.addObj.sample = trees[2]
        }else{
          this.addObj.sample = trees[3]
        }
        this.addObj.model = (trees[4] == undefined ? null : trees[4])
        this.selectStandardTree = false
        this.sample.joinName = null
        this.sample.joinModel = null
        this.sample.joinNum = 1
        this.sample.sample = this.addObj.sample
        this.sample.model = this.addObj.model
        this.sample.unit = this.addObj.unit
        this.sample.standardMethodListId = null
        this.sample.insProduct = []
        this.sample.id = this.count
        this.sample.num = this.addObj.sampleNum
        this.sampleList.push(this.HaveJson(this.sample))
        this.count++
        this.$refs.sampleTable.doLayout()
      },
      searchFilter() {
        this.$refs.tree.filter(this.search)
      },
      filterNode(value, data) {
        if (!value) return true;
        return data.label.indexOf(value) !== -1;
      },
      handleNodeClick(val, node, el) {
        this.selectTree = ''
        this.models = val.children
        this.getNodeParent(node)
        this.selectTree = this.selectTree.replace(' - ', '')
        let data = this.selectTree.split(' - ')
        let data2 = ''
        for (let index = data.length - 1; index >= 0; index--) {
          data2 += " - " + data[index]
        }
        this.selectTree = data2.replace(' - ', '')
      },
      getNodeParent(val) {
        if (val.parent != null) {
          if (val.data.children === null) {
            this.selectTree += ' - ' + val.label + ' - ' + ''
          } else {
            this.selectTree += ' - ' + val.label
          }
          this.getNodeParent(val.parent)
        }
      },
      nodeOpen(data, node, el) {
        $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
      },
      nodeClose(data, node, el) {
        $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
      },
      beforeClose(done) {
        if (this.bsm1) {
          if (this.bsm1Val === null || this.bsm1Val === '') {
            this.$message.error('特殊项目必须处理')
            return
          }
        }
        done()
      },
      upBsm1(val) {
        let sections = JSON.parse(this.bsmRow.section);
        let asks = JSON.parse(this.bsmRow.ask);
        let tells = JSON.parse(this.bsmRow.tell);
        let manHours = JSON.parse(this.bsmRow.manHour);
        let prices = JSON.parse(this.bsmRow.price);
        for (var a in sections) {
          if (val === sections[a]) {
            this.productList.forEach(p => {
              if (p.id === this.bsmRow.id) {
                p.section = sections[a]
                p.ask = asks[a]
                p.tell = tells[a]
                p.manHour = manHours[a]
                p.price = prices[a]
              }
            })
            break
          }
        }
      },
    }
  }
</script>
<style scoped>
  .ins_order_config {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .ins_order_config::-webkit-scrollbar {
    width: 0;
  }
  .title {
    height: 60px;
    line-height: 60px;
  }
  .center {
    width: 100%;
    height: calc(100% - 60px);
  }
  >>>.all-disabled .el-checkbox__input .el-checkbox__inner {
    background-color: #edf2fc;
    border-color: #dcdfe6;
    cursor: not-allowed;
  }
  .node_i {
    color: orange;
    font-size: 18px;
  }
  .el-select-dropdown__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
</style>
src/views/business/inspectionOrder/fiberoptic-config-two.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1599 @@
<template>
  <div class="ins_order_config">
    <div>
      <el-row class="title">
        <el-col :span="6" style="padding-left: 20px;text-align: left;">光纤配置</el-col>
        <el-col :span="18" style="text-align: right;">
          <!-- <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-if="active==1">保 å­˜</el-button> -->
          <el-button size="medium" @click="outConfig">
            <span style="color: #3A7BFA;">返 å›ž</span>
          </el-button>
        </el-col>
      </el-row>
    </div>
    <div class="center">
      <el-row :gutter="10" style="margin-bottom: 10px;">
        <el-col :span="9">
          <div class="grid-content">
            <h5>套管</h5>
            <div
              style="display: flex;align-items: center;justify-content: space-between;padding: 0 12px;box-sizing: border-box;">
              <div class="search-item">
                <label style="width: 70px;">样品型号</label>
                <span class="models" :title="models">{{models}}</span>
              </div>
              <el-radio-group v-model="packageInfo.radio" size="small" @change="isInspection()" :disabled="active!=1">
                <el-radio :label="0">全检</el-radio>
                <el-radio :label="1">抽检</el-radio>
              </el-radio-group>
            </div>
            <div
              style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;">
              <div class="search-item" style="margin-right: 10px;">
                <label>套管数目</label>
                <el-input v-model="packageInfo.num1" placeholder="请输入" size="small" @blur="addBushing" :disabled="active!=1"></el-input>
              </div>
              <div class="search-item" style="margin-right: 10px;">
                <label style="width: 100px">每根管抽检标准量</label>
                <el-input v-model="packageInfo.standNum" placeholder="请输入" size="small" @blur="addStandNum" :disabled="active!=1" style="width:70px"></el-input>
              </div>
              <div class="search-item">
                <label style="width: 100px">每根管抽检检测量</label>
                <el-input v-model="packageInfo.testNum" placeholder="请输入" size="small" @blur="addTestNum"
                style="width:70px"
                  :disabled="packageInfo.radio===0||active!=1"></el-input>
              </div>
            </div>
            <el-table ref="table0" :data="bushing" tooltip-effect="dark" style="width: 100%" height="203px" size="small"
              @selection-change="handleSelectionChange1"
              :header-cell-class-name="setClassName0">
              <!-- <el-table-column
              type="selection"
              width="45"
              :selectable="()=>(active==1)">
              </el-table-column> -->
              <el-table-column label="管色标" show-overflow-tooltip>
                <template slot-scope="scope">
                  <el-select v-model="scope.row.color" size="mini" :disabled="active!=1" allow-create filterable >
                    <el-option v-for="(color,i) in colors" :key="i" :label="color.lable"
                      :value="color.value"></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column prop="standNum" label="标量" show-overflow-tooltip align="center">
              </el-table-column>
              <el-table-column prop="testNum" label="测试量" show-overflow-tooltip align="center">
              </el-table-column>
            </el-table>
          </div>
        </el-col>
        <el-col :span="15">
          <div class="grid-content">
            <h5>检测项信息</h5>
            <el-table ref="productTable" :data="detectionItems" tooltip-effect="dark" style="width: 100%"
            :row-class-name="tableRowClassName"
            :header-cell-class-name="setClassName"
            height="283px"
              size="small" @selection-change="handleSelectionChange2"
              @select-all="handleAll"
              @select="upProductSelect"
              >
              <!-- <el-table-column type="selection" width="55"
              :selectable="()=>((currentDetectionItems||this.selectFiberList.length > 0 || this.multiFiberList.length > 0)&&active==1)">
              </el-table-column> -->
              <el-table-column label="实验室" show-overflow-tooltip prop="sonLaboratory" ></el-table-column>
              <el-table-column prop="inspectionItem" label="检验项" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="inspectionItemSubclass" label="检验项子项" show-overflow-tooltip width="100px">
              </el-table-column>
              <el-table-column prop="methodS" label="试验方法" min-width="90" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="price" label="单价" width="70" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="unit" label="单位" width="70" show-overflow-tooltip>
              </el-table-column>
              <!-- <el-table-column prop="manDay" label="预计时间" width="90" show-overflow-tooltip>
              </el-table-column> -->
              <el-table-column prop="ask" label="检测要求" show-overflow-tooltip width="200px">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.ask" placeholder="请输入" size="small" :disabled="active!=1" v-if="!isAskOnlyRead"></el-input>
                  <span v-else>{{ scope.row.ask }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="tell" label="要求描述" show-overflow-tooltip width="150">
              </el-table-column>
            </el-table>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12" v-if="packageInfo.ismiers">
          <div class="grid-content">
            <h5>光纤带
              <el-button size="mini" type="primary" class="btns" @click="addFibers"
                 v-if="active==1">生成光纤带</el-button>
              <!-- <el-button size="mini" class="btns" @click="clearFibers" :disabled="selectBushing.length === 0" v-if="active==1">清除</el-button> -->
            </h5>
            <div
              style="display: flex;align-items: center;justify-content: space-between;margin:4px 0 6px 0;padding: 0 12px;box-sizing: border-box;">
              <!-- <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">纤带类型</label>
                <el-select v-model="miresModel" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="selectBushing.length===0||active!=1"
                  >
                  <el-option v-for="(item,a) in miresModels" :key="a" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </div> -->
              <!-- <div class="search-item" style="width: 50%;">
                <label style="width: 80px;">参考标准</label>
                <el-select v-model="miresStandard" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="miresModel===null||active!=1" @focus="selectsStandardMethodByFLSSM2()"
                  @change="(value)=>methodChange2(value)">
                  <el-option v-for="item in miresStandards" :key="item.id" :label="item.code" :value="item.id">
                  </el-option>
                </el-select>
              </div> -->
              <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">纤带类型</label>
                <el-select v-model="miresModel" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="selectBushing.length===0||active!=1"
                  >
                  <el-option v-for="(item,a) in miresModels" :key="a" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 50%;">
                <label style="width: 80px;">参考标准</label>
                <el-select v-model="miresStandard" placeholder="请选择" size="small" style="width: 100%;"
                :disabled="miresModel===null||active!=1"
                 @focus="selectsStandardMethodByFLSSM2()"
                  @change="(value)=>methodChange2(value)">
                  <el-option v-for="item in miresStandards" :key="item.id" :label="item.code" :value="item.id">
                  </el-option>
                </el-select>
              </div>
            </div>
            <el-table ref="table2" :data="fibersList" tooltip-effect="dark" style="width: 100%" height="270px"
              size="small" @selection-change="handleSelectionChange" highlight-current-row @row-click="(row, column, event)=>rowClickFiber(row, column, event,1)"
              :header-cell-class-name="setClassName0">
              <!-- <el-table-column
              type="selection"
              width="55"
              :selectable="()=>(active==1)">
              </el-table-column> -->
              <el-table-column prop="color" label="管套色标" width="90" align="center">
              </el-table-column>
              <el-table-column prop="code" label="光纤带编号" show-overflow-tooltip align="center">
                <!-- <template slot-scope="scope">
                  <el-input v-model="scope.row.code" placeholder="请输入" size="mini" ></el-input>
                </template> -->
              </el-table-column>
              <el-table-column prop="model" label="光纤带规格" show-overflow-tooltip align="center">
                <!-- <template slot-scope="scope">
                  <el-input v-model="scope.row.model" placeholder="请输入" size="mini" ></el-input>
                </template> -->
              </el-table-column>
              <el-table-column prop="standard" label="参考标准" show-overflow-tooltip align="center">
                <!-- <template slot-scope="scope">
                  <el-input v-model="scope.row.standard" placeholder="请输入" size="mini" ></el-input>
                </template> -->
              </el-table-column>
              <el-table-column prop="num" label="光纤检测量" show-overflow-tooltip align="center">
                <!-- <template slot-scope="scope">
                  <el-input v-model="scope.row.num" placeholder="请输入" size="mini" ></el-input>
                </template> -->
              </el-table-column>
            </el-table>
          </div>
        </el-col>
        <el-col :span="!packageInfo.ismiers?24:12">
          <div class="grid-content">
            <h5>光纤
              <el-button size="mini" type="primary" class="btns" @click="addFiber"
                 v-if="active==1">光纤配色</el-button>
              </h5>
            <div
              style="display: flex;align-items: center;justify-content: space-between;margin: 4px 0 6px 0;padding: 0 12px;box-sizing: border-box;">
              <!-- <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">光纤类型</label>
                <el-select v-model="mireModel" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="selectBushing.length===0||active!=1">
                  <el-option v-for="(item,a) in mireModels" :key="a" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 50%;">
                <label style="width: 80px;">参考标准</label>
                <el-select v-model="mireStandard" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="mireModel===null||active!=1" @focus="selectsStandardMethodByFLSSM()"
                  @change="(value)=>methodChange(value)" :loading="mireStandardLoading">
                  <el-option v-for="item in mireStandards" :key="item.id" :label="item.code" :value="item.id">
                  </el-option>
                </el-select>
              </div> -->
              <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">光纤类型</label>
                <el-select v-model="mireModel" placeholder="请选择" size="small" style="width: 100%;"
               >
                  <el-option v-for="(item,a) in mireModels" :key="a" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 50%;">
                <label style="width: 80px;">参考标准</label>
                <el-select v-model="mireStandard" placeholder="请选择" size="small" style="width: 100%;"
                :disabled="mireModel===null||active!=1"
                 @focus="selectsStandardMethodByFLSSM()"
                  @change="(value)=>methodChange(value)" :loading="mireStandardLoading">
                  <el-option v-for="item in mireStandards" :key="item.id" :label="item.code" :value="item.id">
                  </el-option>
                </el-select>
              </div>
            </div>
            <el-table ref="table3" :data="fiberList" tooltip-effect="dark" style="width: 100%" height="270px"
              size="small" highlight-current-row @selection-change="handleSelectionChange4"
              @row-click="(row, column, event)=>rowClickFiber(row, column, event,0)"
              :header-cell-class-name="setClassName0">
              <!-- <el-table-column
              type="selection"
              width="55"
              :selectable="()=>(active==1)">
              </el-table-column> -->
              <el-table-column prop="bushColor" label="管套色标" width="90" align="center">
              </el-table-column>
              <el-table-column prop="color" label="光纤色标" width="120">
                <!-- <template slot-scope="scope">
                  <el-select v-model="scope.row.color" size="mini" :disabled="active!=1" allow-create filterable >
                    <el-option v-for="(color,i) in colors" :key="i" :label="color.lable"
                      :value="color.value"></el-option>
                  </el-select>
                </template> -->
              </el-table-column>
              <el-table-column prop="model" label="光纤规格" show-overflow-tooltip align="center">
              </el-table-column>
              <el-table-column prop="standard" label="参考标准" show-overflow-tooltip align="center">
              </el-table-column>
            </el-table>
          </div>
        </el-col>
      </el-row>
    </div>
    <el-dialog title="检测到特殊项,请作出以下选择" :visible.sync="bsm1Dia" width="500px" :show-close="false" :before-close="beforeClose">
      <div class="body" style="max-height: 60vh;">
        <el-row v-if="bsm1">
          <el-col class="search_thing" :span="22">
            <div class="search_label"><span class="required-span">* </span>护套密度:</div>
            <div class="search_input">
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio v-for="(a, ai) in JSON.parse(bsmRow.section)" :key="ai" :label="a"></el-radio>
              </el-radio-group>
            </div>
          </el-col>
          <el-col class="search_thing" :span="22">
            <div class="search_label">要求值:</div>
            <div class="search_input" v-show="bsm1Val!==null&&bsm1Val!==''">
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio v-for="(a, ai) in JSON.parse(bsmRow.section)" :key="ai"
                  :label="a">{{JSON.parse(bsmRow.ask)[ai]}}</el-radio>
              </el-radio-group>
            </div>
          </el-col>
          <el-col class="search_thing" :span="22">
            <div class="search_label">单价:</div>
            <div class="search_input" v-show="bsm1Val!==null&&bsm1Val!==''">
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio v-for="(a, ai) in JSON.parse(bsmRow.section)" :key="ai"
                  :label="a">{{JSON.parse(bsmRow.price)[ai]}}</el-radio>
              </el-radio-group>
            </div>
          </el-col>
        </el-row>
        <el-row v-if="bsm2">
          <el-col class="search_thing" :span="22">
            <div class="search_label" style="width: 220px;"><span class="required-span">* </span>样品熔接配对数量:</div>
            <div class="search_input">
              <el-input-number size="medium" v-model="bsm2Val" :min="1" :max="bsm2Val3.length" :precision="0" style="width: 70%;"
                :controls="false" @change="bsm2Up"></el-input-number>
              <span>MAX:{{bsm2Val3.length}}</span>
            </div>
          </el-col>
          <el-col style="margin-top: 6px;">
            <el-col v-for="(a,ai) in bsm2Val2" :key="ai">
              <el-col :span="10">
                <el-select v-model="a[0]" placeholder="请选择" size="small" style="width: 100%;">
                  <el-option
                    v-for="(item,index) in sampleList"
                    :key="index"
                    :label="index+1"
                    :value="index+1">
                  </el-option>
                </el-select>
              </el-col>
              <!-- <el-col :span="10" class="pairing">{{a[0]}}</el-col> -->
              <el-col :span="4" class="pairing" style="border: 0;color: rgba(0, 0, 0, 0.2);">——</el-col>
              <el-col :span="10">
                <el-select v-model="a[1]" placeholder="请选择" size="small" style="width: 100%;">
                  <el-option
                    v-for="(item,index) in sampleList"
                    :key="index"
                    :label="index+1"
                    :value="index+1">
                  </el-option>
                </el-select>
              </el-col>
              <!-- <el-col :span="10" class="pairing">{{a[1]}}</el-col> -->
            </el-col>
          </el-col>
        </el-row>
        <!-- <el-row v-if="bsm3">
          <el-col class="search_thing" :span="22" style="display: flex;align-items: center;">
            <div class="search_label"><span class="required-span">* </span>RTS:</div>
            <div class="search_input">
              <el-input size="small" placeholder="请输入" clearable v-model="bsm3Val"></el-input>
            </div>
          </el-col>
        </el-row> -->
      </div>
    </el-dialog>
    <el-dialog title="RTS填写" :visible.sync="bsm3Dia" width="500px" :show-close="false" :before-close="beforeClose0">
      <el-row>
        <el-col class="search_thing" :span="22" style="display: flex;align-items: center;">
          <div class="search_label"><span class="required-span">* </span>RTS:</div>
          <div class="search_input">
            <el-input size="small" placeholder="请输入" clearable v-model="bsm3Val"></el-input>
          </div>
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>
<script>
import { set } from 'vue'
  export default {
    props: {
      active: {
        type: Number,
        default: () => 0
      },
    },
    data() {
      return {
        detectionType: null,
        detectionSelect: [],
        selectFiberList: [],
        type:1,
        saveLoad: false,
        packageInfo: {
          radio: 1,
          num1: null,
          standNum: null,
          testNum: null,
          ismiers: false
        },
        tableData: [],
        tape: {
          value: ''
        },
        options: [],
        sample: [],
        models: '',
        colors: [],
        wires: [],
        bushing: [],
        mireModels: [],
        mireModel: null,
        mireStandard: [],
        mireStandards: null,
        miresModels: [],
        miresModel: null,
        miresStandard: [],
        miresStandards: null,
        selectBushing: [],
        productList: [],
        productList2: [],
        fiberList: [],
        fibersList: [],
        selectFibers: [],
        detectionItems: [],
        currentDetectionItems:null,
        mireStandardLoading:false,
        multiFiberList:[],
        isAskOnlyRead:true,
        bsm1Dia: false,
        bsmRow: null,
        bsm1: false,
        bsm1Val: null,
        bsm2: false,
        bsm2Val: null,
        bsm2Dia: false,
        bsm2Val2: [],
        bsm2Val3: [],
        sampleIds:[],
        bsm3Val: null,
        bsmRow3: null,
        bsm3Dia: false,
        sorted: false
      }
    },
    computed: {
      isAllDisabled() {
        return this.multiFiberList.length > 0||this.currentDetectionItems||this.active!=1
      },
    },
    watch: {
      // mireModel(val1,val0) {
      //   if(val1!=val0){
      //     this.mireStandards = []
      //     this.fiberList = []
      //     this.multiFiberList = []
      //     this.detectionItems = []
      //     this.currentDetectionItems = null;
      //   }
      // },
      // mireStandard(val1,val0) {
      //   if(val1!=val0){
      //     this.fiberList = []
      //     this.multiFiberList = []
      //     this.detectionItems = []
      //     this.currentDetectionItems = null;
      //   }
      // }
    },
    mounted() {
      this.$parent.sampleIds.forEach(a => {
        for (var i = 0; i < this.$parent.sampleList.length; i++) {
          if (this.$parent.sampleList[i].id == a) {
            this.sample.push(this.$parent.sampleList[i])
            this.models += (',' + this.$parent.sampleList[i].model)
            break
          }
        }
      })
      console.log(111, this.sample);
      this.models = this.models.replace(',', '')
      this.packageInfo.ismiers = this.models.split(',').every(e=>(e.indexOf('d')>-1||e.indexOf('D')>-1)&&!e.includes('ADSS'))
      if(this.sample[0].bushing === undefined || this.sample[0].bushing === null){
        this.bushing = []
      }else{
        this.bushing = this.HaveJson(this.sample[0].bushing)
        this.packageInfo.num1 = this.sample[0].bushing.length
        this.packageInfo.standNum = this.sample[0].bushing[0].standNum
        this.packageInfo.testNum = this.sample[0].bushing[0].testNum
        this.bushing.forEach(a=>{
          if(a.fibers==null || a.fibers.length ==0)a.fibers=[]
          if(a.fiber==null || a.fiber.length == 0)a.fiber=[]
          // åˆ¤æ–­æ˜¯å¦å«æœ‰å…‰çº¤å¸¦
          if(this.packageInfo.ismiers){
            // this.fibersList = [] // æ–°å¢ž
            // this.fiberList = []  // æ–°å¢ž
            if(a.fibers.length>0){
              a.fibers.sort((a,b)=>a.id-b.id)
              a.fibers.forEach(b=>{
                this.$set(b,'color',a.color)
              // å…‰çº¤å¸¦
              this.fibersList.push(b)
              // å…‰çº¤
              b.fiber.forEach(c=>{
                this.fiberList.push(c)
              })
            })
            } else {
              a.fiber.forEach(b=>{
              this.fiberList.push(b)
            })
            }
          }else{
           // this.fiberList = []
            a.fiber.forEach(b=>{
              this.fiberList.push(b)
            })
          }
        })
      }
      this.getTypeDicts1()
      this.getStandTreeBySampleType()
      this.getStandTreeBySampleType2()
      this.selectsStandardMethodByFLSSM2()
    },
    methods: {
      handleSelectionChange(val) {
        // this.selectFibers = val
        this.multiFiberList = val
      },
      handleSelectionChange1(val) {
        this.selectBushing = val
      },
      handleSelectionChange2(val){
        this.detectionSelect = val
        // èµ‹å€¼æ£€æµ‹é¡¹ä¿¡æ¯ å…‰çº¤å¸¦
        if(this.detectionItems.type == 1) {
          this.multiFiberList.forEach(item => {
            this.fibersList.forEach(a => {
              if(a.ident == item.ident){
                a.productList  =  []
                this.fibersList.find(a => a.ident == item.ident).productList = this.detectionSelect
              }
            })
          })
      }
      if(this.detectionItems.type == 0) {
        // èµ‹å€¼æ£€æµ‹é¡¹ä¿¡æ¯ å…‰çº¤
        console.log('000',this.selectFiberList);
        this.selectFiberList.forEach(item => {
            this.fiberList.forEach(a => {
              if(a.ident == item.ident){
                a.productList  =  []
                this.fiberList.find(a => a.ident == item.ident).productList = this.detectionSelect
              }
            })
          })
        }
      },
      handleSelectionChange4(val){
        this.selectFiberList = val
      },
      outConfig() {
        this.$parent.configShow = false
      },
      getTypeDicts1() {
        this.$axios.post(this.$api.enums.selectEnumByCategory, {
          category: "色标"
        }).then(res => {
          this.colors = res.data
        })
      },
      // å¥—管数目生成表格数据
      addBushing() {
        this.bushing = []
        for(let i = 0; i < this.packageInfo.num1; i++){
          let bushing = {
            ident: this.bushing.length + 1,
            color: this.colors[i].label,
            standNum: null,
            testNum: null,
            fibers: [],
            fiber: []
          }
          this.bushing.push(bushing)
        }
      },
      // å¥—管标准量赋值
      addStandNum() {
        if(this.selectBushing.length > 0) {
          this.bushing.forEach(item => {
          this.selectBushing.forEach(a => {
            if(item.ident == a.ident) {
              item.standNum = this.packageInfo.standNum
            }
          })
        })
        }
      },
      // å¥—管检测量赋值
      addTestNum() {
        if(this.selectBushing.length > 0) {
          this.bushing.forEach(item => {
          this.selectBushing.forEach(a => {
            if(item.ident == a.ident) {
              item.testNum = this.packageInfo.testNum
            }
          })
        })
        }
      },
      isInspection() {
        this.fiberList = []
        this.fibersList = []
        this.detectionItems = []
        // é¡µé¢æ˜¯å¦å«æœ‰å…‰çº¤å¸¦
        if(this.packageInfo.ismiers) {
          // å…¨æ£€
          if (this.packageInfo.radio == 0) {
          // æ ¹æ®æ ‡å‡†é‡èµ‹å€¼æ£€æµ‹é‡
          if(parseInt(this.packageInfo.standNum) > 0 ) {
            // ç»™å…‰çº¤å¸¦èµ‹å€¼
            this.packageInfo.testNum = this.packageInfo.standNum
            this.selectBushing = this.bushing
            this.addFibers()
            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)
              this.$refs.table2.toggleRowSelection(rowToSelect, true)
              })
            }, 200)
        }
      }
        }else {
          if(this.packageInfo.radio == 0) {
            if(parseInt(this.packageInfo.standNum) > 0 ) {
              this.packageInfo.testNum = this.packageInfo.standNum
              this.selectBushing = this.bushing
              this.addFiber()
              // é»˜è®¤å‹¾é€‰
            setTimeout(() => {
              this.selectBushing.forEach(item =>{
              let rowToSelect =  this.bushing.find(a => a.ident == item.ident)
              this.$refs.table0.toggleRowSelection(rowToSelect, true)
              })
            }, 200)
            }
          }
        }
      },
      upNum() {
        this.fiberList = []
        this.fibersList = []
        this.detectionItems = []
        if (this.packageInfo.radio === 0) {
          this.packageInfo.testNum = this.packageInfo.standNum
        }
        if (parseInt(this.packageInfo.standNum) < parseInt(this.packageInfo.testNum)) {
          this.packageInfo.testNum = this.packageInfo.standNum
        }
        if (this.packageInfo.num1 !== null && this.packageInfo.num1 !== '' &&
          this.packageInfo.standNum !== null && this.packageInfo.standNum !== '' &&
          this.packageInfo.testNum != null && this.packageInfo.testNum !== '') {
          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.bushing = []
          for (var i = 0; i < this.packageInfo.num1; i++) {
            let bushing = {
              color: colors2[i].label,
              standNum: this.packageInfo.standNum,
              testNum: this.packageInfo.testNum,
              fibers: [],
              fiber: []
            }
            this.bushing.push(bushing)
          }
          // ç»™å…‰çº¤å¸¦èµ‹å€¼
          if(this.selectBushing.length===0){
            this.selectBushing = this.bushing
        }
        // this.miresModels çº¤å¸¦ç±»åž‹
        // this.miresStandards å‚考标准
        this.fibersList = []
        this.packageInfo.ismiers = true
        this.fiberList = []
        this.selectBushing.forEach(a => {
          a.fiber = []
          a.fibers = []
              for(let j = 0; j < parseInt(a.testNum); j++){
                let fibers = {
                  id: this.fibersList.length + 1,
                  code: null,
                  color: a.color,
                  model: null,
                  standard: null,
                  num: a.testNum,
                  productList: this.HaveJson(this.productList2),
                  fiber: []
                }
                a.fibers.push(fibers)
                this.fibersList.push(fibers)
              }
        })
      } else {
          this.bushing = []
        }
      },
      getStandTreeBySampleType() {
        this.$axios.post(this.$api.standardTree.getStandTreeBySampleType, {
          laboratory: '通信产品实验室',
          sampleType: '光纤'
        }).then(res => {
          this.mireModels = []
          res.data.forEach(a => {
            this.mireModels.push({
              label: a.model,
              value: a.sample + ' - ' + a.model
            })
          })
        })
      },
      getStandTreeBySampleType2() {
        this.$axios.post(this.$api.standardTree.getStandTreeBySampleType, {
          laboratory: '通信产品实验室',
          sampleType: '光纤带'
        }).then(res => {
          this.miresModels = []
          res.data.forEach(a => {
            this.miresModels.push({
              label: a.model,
              value: a.model
            })
          })
        })
      },
      selectsStandardMethodByFLSSM() {
        this.mireStandards = []
        this.mireStandardLoading = true
        this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree: '中天科技检测中心 - é€šä¿¡äº§å“å®žéªŒå®¤ - å…‰çº¤ - ' + this.mireModel
        }).then(res => {
          this.mireStandardLoading = false
          this.mireStandards = res.data.standardMethodList
        })
      },
      selectsStandardMethodByFLSSM2() {
        this.miresStandards = []
        this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree: '中天科技检测中心 - é€šä¿¡äº§å“å®žéªŒå®¤ - å…‰çº¤å¸¦ - ' + this.miresModel
        }).then(res => {
          this.miresStandards = res.data.standardMethodList
        })
      },
      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('请选择数据')
            return
          }
          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 (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'
          }
        }).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)
          }
        })
      },
      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'
          }
        }).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)
          }
          // ç»™é€‰ä¸­çš„光纤带赋值
        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 // å‚考标准
                  }
                })
              }
            })
        }
      })
      },
      addFiber() {
        // æœ€æ–°
        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 = []
        // é€‰æ‹©äº†å…‰çº¤å¸¦
        if (this.packageInfo.ismiers) {
          if(this.multiFiberList.length != 0){
          this.multiFiberList.forEach((a,index) => {
            a.fiber = []
            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,
                model: null,
                noSplitModel: null,
                standard: null,
                fibersIdent: a.ident,
                productList: []
              }
              this.fiberList.push(fiber)
            }
          })
        } else {
          this.selectBushing.forEach((a,index) => {
            a.fiber = []
            for (var i = 0; i < parseInt(a.testNum); i++) {
              let fiber = {
                ident: this.fiberList.length + 1,
                bushColor: a.color,
                color: colors2[(i+(parseInt(a.testNum))*index)>colors2.length?0:i+(parseInt(a.testNum))*index].label,
                model: null,
                noSplitModel: null,
                standard: null,
                productList: []
              }
              this.fiberList.push(fiber)
            }
          })
        }
      }else {
        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
        }
      }
        // äºŒä»£
        // // æ˜¯å¦é€‰æ‹©å¥—管
        // 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
        }
        // å¥—管的测试量  *  é€‰æ‹©çš„光纤带数量
        this.fibersList = []
        this.selectBushing.forEach(item => {
          for(let i = 0; i < parseInt(this.packageInfo.testNum); i++){
          let fibers = {
            ident: this.fibersList.length + 1,
            color: item.color,
            code: null,
            model: null,
            standard: null,
            num: null,
            fiber: [],
            productList: []
          }
          this.fibersList.push(fibers)
        }
        })
      },
      rowClickFiber(row, column, event,type){
        console.log('row',row);
        if(type == 1) {
          this.fiberList = row.fiber
          if(row.productList != null && row.productList.length > 0) {
            this.detectionItems = []
            this.detectionItems = row.productList
          }
          if(row.fiber != null && row.fiber.length > 0) {
            this.fiberList = []
            this.fiberList = row.fiber
          }
        }else if (type == 0){
          this.detectionItems = []
          this.detectionItems = row.productList
        }
      //   if(type == 1) {
      //     if((row.model == null || row.model == '') && (row.standard == null || row.standard == '')){
      //       this.detectionItems = []
      //       return
      //     }
      //     if(row.model != null && row.model != ''){
      //     this.miresModel = row.model
      //     this.selectsStandardMethodByFLSSM2()
      //   }
      //   setTimeout(() => {
      //     if(row.standard !=null && row.standard != ''){
      //     this.miresStandard = this.miresStandards.find(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'
      //     }
      //   }).then(res => {
      //     // å°†èŽ·å–çš„æ£€æµ‹é¡¹ä¿¡æ¯èµ‹å€¼
      //     this.detectionItems = []
      //     if(res.data != null && res.data.length != 0){
      //       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)
      //       }
      //     }
      //   })
      //   },1000)
      // }else if(type == 0) {
      //   if((row.noSplitModel == null || row.noSplitModel == '') && (row.standard == null || row.standard == '')){
      //       this.detectionItems = []
      //       return
      //     }
      //   if(row.model != null && row.model != ''){
      //     this.mireModel = row.noSplitModel
      //     this.selectsStandardMethodByFLSSM()
      //   }
      //   setTimeout(() => {
      //     if(row.standard !=null && row.standard != ''){
      //     this.mireStandard = this.mireStandards.find(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'
      //     }
      //   }).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)
      //     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)
      //       }
      //     }
      //   })
      //   },1000);
      // }
    },
      toggleSelection(row) {
        this.$refs.productTable.toggleRowSelection(row, true);
      },
      tableRowClassName({
        row,
        rowIndex
      }) {
        if (row.state === 0) {
          return 'warning-row';
        }
        return '';
      },
      handleAll(e) {
        if (e.length > 0) {
          console.log(this.detectionItems);
          this.detectionItems.map(m => {
            m.state = 1
            return m
          })
        } else {
          this.detectionItems.map(m => {
            m.state = 0
            return m
          })
        }
        if (e.length > 0) {
          if(this.multiFiberList.length > 0){
            this.multiFiberList.map(item => {
              item.productList.map(m=>{
                m.state = 1;
                return m;
              })
              return item
            })
          }else{
          this.currentDetectionItems.productList.map(m=>{
              m.state = 1;
              return m;
            })
          }
        } else {
          if(this.multiFiberList.length > 0){
            this.multiFiberList.map(item => {
              item.productList.map(m=>{
                m.state = 0;
                return m;
              })
              return item
            })
          }else{
            this.currentDetectionItems.productList.map(m=>{
              m.state = 0;
              return m;
            });
          }
        }
        this.bsmRow3 = []
        this.detectionItems.forEach(p => {
          if(this.type==1){
            if (p.bsm === '1' && p.section !== '' && p.section !== null && p.state === 1) {
              if (p.section.indexOf('[') > -1) {
                this.bsmRow = this.HaveJson(p)
              }
              this.bsm1 = true
              this.bsm1Dia = true
            } else if (p.bsm === '1' && p.section !== '' && p.section !== null && p.state === 0) {
              this.bsm1 = false
            }
            if (p.bsm === '1' && p.inspectionItem === '光纤接头损耗' && this.sampleList.length > 1 && p.state === 1) {
              this.bsm2 = true
              this.bsm1Dia = true
              if(this.bsm2Val2.length === 0){
                this.bsm2Val = (this.sampleList.length - 1) * this.sampleList.length / 2
                this.computationalPairing(this.sampleList.length)
                this.bsm2Val2 = this.HaveJson(this.bsm2Val3)
              }
            } else if (p.bsm === '1' && p.inspectionItem === '光纤接头损耗' && p.state === 1) {
              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) {
          this.sampleList.map(item => {
            if (this.sampleIds.indexOf(item.id) > -1) {
              item.insProduct.map(m => {
                m.state = 1
                return m;
              })
            }
            return item
          })
        } else {
          this.sampleList.map(item => {
            if (this.sampleIds.indexOf(item.id) > -1) {
              item.insProduct.map(m => {
                m.state = 0
                return m;
              })
            }
            return item
          })
        }
        this.$nextTick(() => {
          this.$refs.productTable.doLayout()
        })
      },
      upProductSelect(selection, row) {
        row.state = row.state == 1 ? 0 : 1
        if(this.selectFiberList.length > 0){
          this.selectFiberList.map(item => {
            item.productList.map(m=>{
              if(m.id == row.id){
                m.state = row.state;
              }
              return m
            })
            return item
          })
        }else{
          this.currentDetectionItems.productList.map(m=>{
            if(m.id == row.id){
                m.state = row.state;
              }
              return m;
            });
        }
        if(this.type==1){
          if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 1) {
            if (row.section.indexOf('[') > -1) {
              this.bsmRow = this.HaveJson(row)
            }
            this.bsm1 = true
            this.bsm1Dia = true
          } else if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 0) {
            this.bsm1 = false
          }
          if (row.bsm === '1' && row.inspectionItem === '光纤接头损耗' && this.sampleList.length > 1 && row.state === 1) {
          this.bsm2 = true
          this.bsm1Dia = true
            if(this.bsm2Val2.length === 0){
              this.bsm2Val = (this.sampleList.length - 1) * this.sampleList.length / 2
              this.computationalPairing(this.sampleList.length)
              this.bsm2Val2 = this.HaveJson(this.bsm2Val3)
            }
          } else if (row.bsm === '1' && row.inspectionItem === '光纤接头损耗' && row.state === 1) {
            this.bsm2 = false
          }
        }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
        // }
      },
      computationalPairing(n){
        const nums = [];
        for (let i = 1; i <= n; i++) {
          nums.push(i);
        }
        this.bsm2Val3 = this.HaveJson(this.permute(nums))
      },
      setClassName({ column }) {
        if (column.type == 'selection' && !this.isAllDisabled) {
          return 'all-disabled'
        }
      },
      setClassName0({ column }){
        if (column.type == 'selection' && this.active!=1) {
          return 'all-disabled'
        }
      },
      clearFibers(){
        this.packageInfo.ismiers = false
        this.fibersList = []
        this.bushing.forEach(a=>{
          a.fibers = []
        })
      },
      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.bushing.length === 0){
          this.$message.error('缺少套管无法保存')
          return
        }
        this.bushing.forEach(item=>{
          // å¦‚果光纤带有值
          if(this.fibersList.length != 0) {
              this.fibersList.forEach(a=>{
                a.fiber = this.fiberList.filter(b=>b.fibersIdent == a.ident)
              })
              item.fibers = this.fibersList // å…‰çº¤å¸¦
              item.fiber = [] // å…‰çº¤
          }else {
            // å¦‚果光纤带没有值
            item.fibers = [] // å…‰çº¤å¸¦
            item.fiber = this.fiberList // å…‰çº¤
          }
        })
        this.sample.forEach(a=>{
          a.bushing = this.bushing
        })
        this.$message.success('已保存')
        this.$emit("saveFiberopticConfig");
      },
      beforeClose(done){
        if (this.bsm1) {
          if (this.bsm1Val === null || this.bsm1Val === '') {
            this.$message.error('特殊项目必须处理')
            return
          }
        }
        if (this.bsm2) {
          if (this.bsm2Val2.length === 0) {
            this.$message.error('特殊项目必须处理')
            return
          }
          let set = new Set()
          for (let i=0;i<this.bsm2Val2.length;i++){
            let num0 = set.size
            set.add(JSON.stringify(this.bsm2Val2[i]))
            let num1 = set.size
            if(num1==num0){
              this.$message.error('关联项目不能重复')
              return
            }
            set.add(JSON.stringify(this.bsm2Val2[i].reverse()))
            let num2 = set.size
            if(num1==num2){
              this.$message.error('关联项目不能重复')
              return
            }
          }
        }
        done()
      },
      beforeClose0(done){
        if(!this.bsm3Val){
          this.$message.error('RST必须填写')
          return
        }else{
          if(Array.isArray(this.bsmRow3)){
            this.bsmRow3.forEach(item=>{
              item.rts = this.bsm3Val
            })
          }else{
            this.bsmRow3.rts = this.bsm3Val
          }
        }
        done()
      },
      upBsm1(val) {
        let sections = JSON.parse(this.bsmRow.section);
        let asks = JSON.parse(this.bsmRow.ask);
        let tells = JSON.parse(this.bsmRow.tell);
        let manHours = JSON.parse(this.bsmRow.manHour);
        let prices = JSON.parse(this.bsmRow.price);
        for (var a in sections) {
          if (val === sections[a]) {
            this.productList.forEach(p => {
              if (p.id === this.bsmRow.id) {
                p.section = sections[a]
                p.ask = asks[a]
                p.tell = tells[a]
                p.manHour = manHours[a]
                p.price = prices[a]
              }
            })
            break
          }
        }
      },
      bsm2Up(val){
        let list = []
        for(let a=1;a < this.bsm2Val3.length + 1;a++){
          list.push(a)
        }
        let set = new Set()
        let size1 = set.length
        while(set.size < val){
          set.add(Math.ceil(Math.random() * this.bsm2Val3.length))
        }
        this.bsm2Val2 = []
        for(let a of set){
          this.bsm2Val2.push(this.HaveJson(this.bsm2Val3[a-1]))
        }
      }
    }
  }
</script>
<style scoped>
  .ins_order_config {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .ins_order_config::-webkit-scrollbar {
    width: 0;
  }
  .title {
    height: 60px;
    line-height: 60px;
  }
  .center {
    width: 100%;
    height: calc(100% - 60px);
  }
  .grid-content {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.05);
  }
  .grid-content h5 {
    color: #3A7BFA;
    font-weight: 400;
    line-height: 32px;
    padding-left: 16px;
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
  }
  .search-item {
    display: flex;
    align-items: center;
    line-height: 36px;
  }
  .search-item label {
    width: 90px;
    font-size: 12px;
    color: #606266;
    /* text-align: right; */
  }
  .btns {
    margin: 8px 0 8px 10px;
  }
  >>>.el-table th.el-table__cell>.cell {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
  >>>.all-disabled .el-checkbox__input .el-checkbox__inner {
    background-color: #edf2fc;
    border-color: #dcdfe6;
    cursor: not-allowed;
  }
  .models{
    font-size:14px;
    width:320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
</style>
src/views/business/inspectionOrder/fiberoptic-config.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3438 @@
<template>
  <div class="ins_order_config">
    <div>
      <el-row class="title">
        <el-col :span="6" style="padding-left: 20px; text-align: left"
          >光纤配置</el-col
        >
        <el-col :span="18" style="text-align: right">
          <el-button
            size="medium"
            type="primary"
            @click="save"
            :loading="saveLoad"
            v-if="active == 1"
            >保 å­˜</el-button
          >
          <el-button size="medium" @click="outConfig">
            <span style="color: #3a7bfa">返 å›ž</span>
          </el-button>
        </el-col>
      </el-row>
    </div>
    <div class="center">
      <el-row :gutter="10" style="margin-bottom: 10px">
        <el-col :span="9">
          <div class="grid-content">
            <h5>套管</h5>
            <div
              style="
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding: 0 12px;
                box-sizing: border-box;
              "
            >
              <div class="search-item">
                <label style="width: 70px">样品型号</label>
                <span class="models" :title="models">{{ models }}</span>
              </div>
              <el-radio-group
                v-model="packageInfo.radio"
                size="small"
                @change="isInspection()"
                :disabled="active != 1"
              >
                <el-radio :label="0">全检</el-radio>
                <el-radio :label="1">抽检</el-radio>
              </el-radio-group>
            </div>
            <div
              style="
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 8px;
                padding: 0 12px;
                box-sizing: border-box;
              "
            >
              <div class="search-item" style="margin-right: 10px">
                <label>套管数目</label>
                <el-input
                  v-model="packageInfo.num1"
                  placeholder="请输入"
                  size="small"
                  @blur="addBushing"
                  :disabled="active != 1"
                ></el-input>
              </div>
              <div class="search-item" style="margin-right: 10px">
                <label style="width: 100px">每根管抽检标准量</label>
                <el-input
                  v-model="packageInfo.standNum"
                  placeholder="请输入"
                  size="small"
                  @blur="addStandNum"
                  :disabled="packageInfo.radio === 0 || active != 1"
                  style="width: 100px"
                ></el-input>
              </div>
              <div class="search-item">
                <label style="width: 100px">每根管抽检检测量</label>
                <el-input
                  v-model="packageInfo.testNum"
                  placeholder="请输入"
                  size="small"
                  @blur="addTestNum"
                  :disabled="packageInfo.radio === 0 || active != 1"
                  style="width: 70px"
                ></el-input>
              </div>
            </div>
            <el-table
              ref="table0"
              :data="bushing"
              tooltip-effect="dark"
              style="width: 100%"
              height="203px"
              size="small"
              @selection-change="handleSelectionChange1"
              :header-cell-class-name="setClassName0"
            >
              <el-table-column
                type="selection"
                width="45"
                :selectable="() => active == 1"
              >
              </el-table-column>
              <el-table-column label="管色标" show-overflow-tooltip>
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.color"
                    size="mini"
                    :disabled="active != 1"
                    allow-create
                    filterable
                  >
                    <el-option
                      v-for="(color, i) in colors"
                      :key="i"
                      :label="color.lable"
                      :value="color.value"
                    ></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column
                prop="standNum"
                label="标量"
                show-overflow-tooltip
                align="center"
              >
              </el-table-column>
              <el-table-column
                prop="testNum"
                label="测试量"
                show-overflow-tooltip
                align="center"
              >
              </el-table-column>
            </el-table>
          </div>
        </el-col>
        <el-col :span="15">
          <div class="grid-content">
            <h5>检测项信息</h5>
            <el-table
              ref="productTable"
              :data="detectionItems"
              tooltip-effect="dark"
              style="width: 100%"
              :row-class-name="tableRowClassName"
              :header-cell-class-name="setClassName"
              height="283px"
              size="small"
              @selection-change="handleSelectionChange2"
              @select-all="handleAll"
              @select="upProductSelect"
            >
              <el-table-column
                type="selection"
                width="55"
                :selectable="
                  () =>
                    (currentDetectionItems ||
                      this.selectFiberList.length > 0 ||
                      this.multiFiberList.length > 0) &&
                    active == 1
                "
              >
              </el-table-column>
              <el-table-column
                label="实验室"
                show-overflow-tooltip
                min-width="100"
                prop="sonLaboratory"
              ></el-table-column>
              <el-table-column
                prop="inspectionItem"
                label="检验项"
                min-width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="inspectionItemSubclass"
                min-width="100"
                label="检验项子项"
                show-overflow-tooltip
                width="100px"
              >
              </el-table-column>
              <el-table-column
                prop="methodS"
                label="试验方法"
                min-width="90"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="price"
                label="单价"
                width="70"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="unit"
                label="单位"
                width="70"
                show-overflow-tooltip
              >
              </el-table-column>
              <!-- <el-table-column prop="manDay" label="预计时间" width="90" show-overflow-tooltip>
              </el-table-column> -->
              <el-table-column
                prop="ask"
                label="检测要求"
                show-overflow-tooltip
                width="200px"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.ask"
                    placeholder="请输入"
                    size="small"
                    :disabled="active != 1"
                    v-if="!isAskOnlyRead"
                    @change="changeASk(scope.row, 'ask')"
                  ></el-input>
                  <span v-else>{{ scope.row.ask }}</span>
                </template>
              </el-table-column>
              <el-table-column
                prop="tell"
                label="要求描述"
                show-overflow-tooltip
                width="150"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.tell"
                    placeholder="请输入"
                    size="small"
                    :disabled="active != 1"
                    v-if="!isAskOnlyRead"
                    @change="changeASk(scope.row)"
                  ></el-input>
                  <span v-else>{{ scope.row.tell }}</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12" v-if="packageInfo.ismiers">
          <div class="grid-content">
            <h5>
              å…‰çº¤å¸¦
              <el-button
                size="mini"
                type="primary"
                class="btns"
                @click="addFibers"
                v-if="active == 1"
                >生成光纤带</el-button
              >
              <!-- <el-button size="mini" class="btns" @click="clearFibers" :disabled="selectBushing.length === 0" v-if="active==1">清除</el-button> -->
            </h5>
            <div
              style="
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin: 4px 0 6px 0;
                padding: 0 12px;
                box-sizing: border-box;
              "
            >
              <!-- <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">纤带类型</label>
                <el-select v-model="miresModel" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="selectBushing.length===0||active!=1"
                  >
                  <el-option v-for="(item,a) in miresModels" :key="a" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </div> -->
              <!-- <div class="search-item" style="width: 50%;">
                <label style="width: 80px;">参考标准</label>
                <el-select v-model="miresStandard" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="miresModel===null||active!=1" @focus="selectsStandardMethodByFLSSM2()"
                  @change="(value)=>methodChange2(value)">
                  <el-option v-for="item in miresStandards" :key="item.id" :label="item.code" :value="item.id">
                  </el-option>
                </el-select>
              </div> -->
              <div class="search-item" style="width: 30%; margin-right: 16px">
                <label style="width: 80px">纤带类型</label>
                <el-select
                  v-model="miresModel"
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                >
                  <el-option
                    v-for="(item, a) in miresModels"
                    :key="a"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 30%">
                <label style="width: 80px">参考标准</label>
                <el-select
                  v-model="miresStandard"
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                  :disabled="miresModel === null || active != 1"
                  @focus="selectsStandardMethodByFLSSM2()"
                  @change="(value) => methodChange2(value)"
                >
                  <el-option
                    v-for="item in miresStandards"
                    :key="item.id"
                    :label="item.code"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 30%; margin-right: 16px">
                <label>光纤检测量</label>
                <el-input
                  :disabled="miresModel === null || active != 1"
                  v-model="miresNum"
                  placeholder="请输入"
                  size="small"
                  style="width: 100%"
                  @change="miresNumChange"
                ></el-input>
              </div>
            </div>
            <!-- <el-table ref="table2" :data="fibersList" tooltip-effect="dark" style="width: 100%" height="270px"
              size="small" @selection-change="handleSelectionChange" highlight-current-row @row-click="(row, column, event)=>rowClickFiber(row, column, event,1)"
              :header-cell-class-name="setClassName0"> -->
            <el-table
              ref="table2"
              :data="fibersList"
              tooltip-effect="dark"
              style="width: 100%"
              height="270px"
              size="small"
              @selection-change="handleSelectionChange"
              highlight-current-row
              :header-cell-class-name="setClassName0"
            >
              <el-table-column
                type="selection"
                width="55"
                :selectable="() => active == 1"
              >
              </el-table-column>
              <el-table-column
                prop="color"
                label="管套色标"
                width="90"
                align="center"
              >
              </el-table-column>
              <el-table-column
                prop="code"
                label="光纤带编号"
                show-overflow-tooltip
                align="center"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.code"
                    placeholder="请输入"
                    size="mini"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column
                prop="model"
                label="光纤带规格"
                show-overflow-tooltip
                align="center"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.model"
                    placeholder="请输入"
                    size="mini"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column
                prop="standard"
                label="参考标准"
                show-overflow-tooltip
                align="center"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.standard"
                    placeholder="请输入"
                    size="mini"
                  ></el-input>
                </template>
              </el-table-column>
              <el-table-column
                prop="num"
                label="光纤检测量"
                show-overflow-tooltip
                align="center"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.num"
                    placeholder="请输入"
                    size="mini"
                  ></el-input>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-col>
        <el-col :span="!packageInfo.ismiers ? 24 : 12">
          <div class="grid-content">
            <h5>
              å…‰çº¤
              <el-button
                size="mini"
                type="primary"
                class="btns"
                @click="addFiber"
                v-if="active == 1"
                >光纤配色</el-button
              >
            </h5>
            <div
              style="
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin: 4px 0 6px 0;
                padding: 0 12px;
                box-sizing: border-box;
              "
            >
              <!-- <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">光纤类型</label>
                <el-select v-model="mireModel" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="selectBushing.length===0||active!=1">
                  <el-option v-for="(item,a) in mireModels" :key="a" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 50%;">
                <label style="width: 80px;">参考标准</label>
                <el-select v-model="mireStandard" placeholder="请选择" size="small" style="width: 100%;"
                  :disabled="mireModel===null||active!=1" @focus="selectsStandardMethodByFLSSM()"
                  @change="(value)=>methodChange(value)" :loading="mireStandardLoading">
                  <el-option v-for="item in mireStandards" :key="item.id" :label="item.code" :value="item.id">
                  </el-option>
                </el-select>
              </div> -->
              <div class="search-item" style="width: 50%; margin-right: 16px">
                <label style="width: 80px">光纤类型</label>
                <el-select
                  v-model="mireModel"
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                >
                  <el-option
                    v-for="(item, a) in mireModels"
                    :key="a"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 50%">
                <label style="width: 80px">参考标准</label>
                <el-select
                  v-model="mireStandard"
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                  :disabled="mireModel === null || active != 1"
                  @focus="selectsStandardMethodByFLSSM()"
                  @change="(value) => methodChange(value)"
                  :loading="mireStandardLoading"
                >
                  <el-option
                    v-for="item in mireStandards"
                    :key="item.id"
                    :label="item.code"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </div>
            </div>
            <!-- <el-table ref="table3" :data="fiberList" tooltip-effect="dark" style="width: 100%" height="270px"
              size="small" highlight-current-row @selection-change="handleSelectionChange4"
              @row-click="(row, column, event)=>rowClickFiber(row, column, event,0)"
              :header-cell-class-name="setClassName0"> -->
            <el-table
              ref="table3"
              :data="fiberList"
              tooltip-effect="dark"
              style="width: 100%"
              height="270px"
              size="small"
              highlight-current-row
              @selection-change="handleSelectionChange4"
              :header-cell-class-name="setClassName0"
            >
              <el-table-column
                type="selection"
                width="55"
                :selectable="() => active == 1"
              >
              </el-table-column>
              <el-table-column
                prop="bushColor"
                label="管套色标"
                width="90"
                align="center"
              >
              </el-table-column>
              <el-table-column prop="color" label="光纤色标" width="120">
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.color"
                    size="mini"
                    :disabled="active != 1"
                    allow-create
                    filterable
                  >
                    <el-option
                      v-for="(color, i) in colors"
                      :key="i"
                      :label="color.lable"
                      :value="color.value"
                    ></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column
                prop="model"
                label="光纤规格"
                show-overflow-tooltip
                align="center"
              >
              </el-table-column>
              <el-table-column
                prop="standard"
                label="参考标准"
                show-overflow-tooltip
                align="center"
              >
              </el-table-column>
            </el-table>
          </div>
        </el-col>
      </el-row>
    </div>
    <el-dialog
      title="检测到特殊项,请作出以下选择"
      :visible.sync="bsm1Dia"
      width="60%"
      :show-close="false"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      :before-close="beforeClose"
      v-loading.fullscreen.lock="bsm1DiaLoading"
    >
      <div v-if="bsm1" class="body" style="max-height: 60vh; overflow: scroll">
        <el-row>
          <el-col class="search_thing" :span="22">
            <div class="search_label">
              <span class="required-span">* </span>护套密度:
            </div>
            <div class="search_input">
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio
                  v-for="(a, ai) in JSON.parse(bsmRow.section)"
                  :key="ai"
                  :label="a"
                ></el-radio>
              </el-radio-group>
            </div>
          </el-col>
          <el-col class="search_thing" :span="22">
            <div class="search_label">要求值:</div>
            <div
              class="search_input"
              v-show="bsm1Val !== null && bsm1Val !== ''"
            >
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio
                  v-for="(a, ai) in JSON.parse(bsmRow.section)"
                  :key="ai"
                  :label="a"
                  >{{ JSON.parse(bsmRow.ask)[ai] }}</el-radio
                >
              </el-radio-group>
            </div>
          </el-col>
          <el-col class="search_thing" :span="22">
            <div class="search_label">单价:</div>
            <div
              class="search_input"
              v-show="bsm1Val !== null && bsm1Val !== ''"
            >
              <el-radio-group v-model="bsm1Val" @input="upBsm1">
                <el-radio
                  v-for="(a, ai) in JSON.parse(bsmRow.section)"
                  :key="ai"
                  :label="a"
                  >{{ JSON.parse(bsmRow.price)[ai] }}</el-radio
                >
              </el-radio-group>
            </div>
          </el-col>
        </el-row>
        <!-- <el-row v-if="bsm3">
          <el-col class="search_thing" :span="22" style="display: flex;align-items: center;">
            <div class="search_label"><span class="required-span">* </span>RTS:</div>
            <div class="search_input">
              <el-input size="small" placeholder="请输入" clearable v-model="bsm3Val"></el-input>
            </div>
          </el-col>
        </el-row> -->
      </div>
      <div v-if="bsm2">
        <el-row>
          <el-col class="search_thing" :span="24">
            <div class="search_label" style="width: 180px">
              <span class="required-span">* </span>样品熔接配对数量:
            </div>
            <div class="search_input">
              <!-- <el-input-number
                size="medium"
                v-model="bsm2Val"
                :min="1"
                :max="bsm2Val3.length"
                :precision="0"
                style="width: 70%"
                :controls="false"
                @change="bsm2Up"
              ></el-input-number>
              <span>MAX:{{ bsm2Val3.length }}</span> -->
              <el-input-number
                size="medium"
                v-model="bsm2Val"
                :min="1"
                :max="bsm2Val3Length"
                :precision="0"
                style="width: 55%"
                :controls="false"
                @change="bsm2Up"
              ></el-input-number>
              <span>MAX:{{ bsm2Val3Length }}</span>
              <el-switch
                v-model="selfConnectBoolean"
                @change="selfConnect"
                active-color="#13ce66"
                style="margin-left: 20px"
                active-text="是否自接"
              ></el-switch>
            </div>
          </el-col>
        </el-row>
        <div
          class="body"
          style="overflow-y: scroll; min-height: 400px; height: 400px"
        >
          <el-row>
            <el-col :span="11">
              <span>样品A:</span>
            </el-col>
            <el-col :span="11" :offset="2">
              <span>样品B:</span>
            </el-col>
          </el-row>
          <el-row v-for="(a, ai) in bsm2Val2" :key="ai" style="margin: 10px 0">
            <el-col :span="11">
              <el-select
                v-model="a[0]"
                placeholder="请选择"
                size="small"
                style="width: 100%"
              >
                <el-option
                  v-for="(item, index) in fiberList"
                  :key="index"
                  :label="
                    sampleList[0].sampleCode +
                    '-' +
                    item.bushColor +
                    '-' +
                    item.color
                  "
                  :value="index + 1"
                >
                </el-option>
              </el-select>
            </el-col>
            <el-col
              :span="2"
              class="pairing"
              style="text-align: center; border: 0; color: rgba(0, 0, 0, 0.2)"
              >——</el-col
            >
            <el-col :span="11">
              <el-select
                v-model="a[1]"
                placeholder="请选择"
                size="small"
                style="width: 100%"
              >
                <el-option
                  v-for="(item, index) in fiberList"
                  :key="index"
                  :label="
                    sampleList[1].sampleCode +
                    '-' +
                    item.bushColor +
                    '-' +
                    item.color
                  "
                  :value="index + 1"
                >
                </el-option>
              </el-select>
            </el-col>
          </el-row>
        </div>
        <!-- <el-row>
          <el-col style="margin-top: 6px">
            <el-col v-for="(a, ai) in bsm2Val2" :key="ai">
              <el-col :span="10" class="pairing">{{a[0]}}</el-col>
              <el-col :span="10" class="pairing">{{a[1]}}</el-col>
            </el-col>
          </el-col>
        </el-row> -->
      </div>
      <span slot="footer" class="dialog-footer" v-if="bsm2">
        <el-row>
          <el-button type="primary" @click="save1" :loading="saveLoad"
            >ç¡® å®š</el-button
          >
        </el-row>
      </span>
    </el-dialog>
    <el-dialog
      title="RTS填写"
      :visible.sync="bsm3Dia"
      width="500px"
      :show-close="false"
      :before-close="beforeClose0"
    >
      <el-row>
        <el-col
          class="search_thing"
          :span="22"
          style="display: flex; align-items: center"
        >
          <div class="search_label">
            <span class="required-span">* </span>RTS:
          </div>
          <div class="search_input">
            <el-input
              size="small"
              placeholder="请输入"
              clearable
              v-model="bsm3Val"
            ></el-input>
          </div>
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: {
    active: {
      type: Number,
      default: () => 0,
    },
    inspectionItemST: {
      type: Number,
      default: () => 0,
    },
    //保存的光纤熔接配对数组
    fiberPairing: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
  data() {
    return {
      bsm2Val2Copy: [],
      selfConnectBoolean: false,
      loadingText: "加载中",
      bsm1DiaLoading: false,
      bsm2Val3Length: null,
      fiberLoss: [],
      isBsm2Val2: false,
      sampleList: [],
      miresNum: null,
      errOrFiberList: [],
      errOrFiberRibbonList: [],
      detectionType: null,
      detectionSelect: [],
      selectFiberList: [],
      type: 1,
      saveLoad: false,
      packageInfo: {
        radio: 1,
        num1: null,
        standNum: null,
        testNum: null,
        ismiers: false,
      },
      tableData: [],
      tape: {
        value: "",
      },
      options: [],
      sample: [],
      models: "",
      colors: [],
      wires: [],
      bushing: [],
      mireModels: [],
      mireModel: null,
      mireStandard: [],
      mireStandards: null,
      miresModels: [],
      miresModel: null,
      miresStandard: [],
      miresStandards: null,
      selectBushing: [],
      productList: [],
      productList2: [],
      fiberList: [],
      fibersList: [],
      selectFibers: [],
      detectionItems: [],
      currentDetectionItems: null,
      mireStandardLoading: false,
      multiFiberList: [],
      isAskOnlyRead: true,
      bsm1Dia: false,
      bsmRow: null,
      bsm1: false,
      bsm1Val: null,
      bsm2: false,
      bsm2Val: null,
      bsm2Dia: false,
      bsm2Val2: [],
      bsm2Val3: [],
      sampleIds: [],
      bsm3Val: null,
      bsmRow3: null,
      bsm3Dia: false,
      isLoading: false,
    };
  },
  computed: {
    isAllDisabled() {
      return (
        this.multiFiberList.length > 0 ||
        this.currentDetectionItems ||
        this.active != 1
      );
    },
  },
  watch: {
    bsm1Dia(newVal) {
      if (!newVal) {
        this.isLoading = false;
      }
    },
    // mireModel(val1,val0) {
    //   if(val1!=val0){
    //     this.mireStandards = []
    //     this.fiberList = []
    //     this.multiFiberList = []
    //     this.detectionItems = []
    //     this.currentDetectionItems = null;
    //   }
    // },
    // mireStandard(val1,val0) {
    //   if(val1!=val0){
    //     this.fiberList = []
    //     this.multiFiberList = []
    //     this.detectionItems = []
    //     this.currentDetectionItems = null;
    //   }
    // }
  },
  mounted() {
    this.$parent.sampleIds.forEach((a) => {
      for (var i = 0; i < this.$parent.sampleList.length; i++) {
        if (this.$parent.sampleList[i].id == a) {
          this.sample.push(this.$parent.sampleList[i]);
          this.models += "," + this.$parent.sampleList[i].model;
          break;
        }
      }
    });
    this.sampleList = this.$parent.sampleList;
    console.log("this.sample", this.sample);
    this.models = this.models.replace(",", "");
    this.packageInfo.ismiers = this.models
      .split(",")
      .every(
        (e) =>
          (e.indexOf("d") > -1 || e.indexOf("D") > -1) && !e.includes("ADSS")
      );
    if (
      this.sample[0].bushing === undefined ||
      this.sample[0].bushing === null
    ) {
      this.bushing = [];
    } else {
      this.bsm2Val2 = this.fiberPairing;
      this.bushing = this.HaveJson(this.sample[0].bushing);
      this.packageInfo.num1 = this.sample[0].bushing.length;
      this.packageInfo.standNum = this.sample[0].bushing[0].standNum;
      this.packageInfo.testNum = this.sample[0].bushing[0].testNum;
      this.bushing.forEach((a) => {
        if (a.fibers == null || a.fibers.length == 0) a.fibers = [];
        if (a.fiber == null || a.fiber.length == 0) a.fiber = [];
        // åˆ¤æ–­æ˜¯å¦å«æœ‰å…‰çº¤å¸¦
        if (this.packageInfo.ismiers) {
          // this.fibersList = [] // æ–°å¢ž
          // this.fiberList = []  // æ–°å¢ž
          if (a.fibers.length > 0) {
            a.fibers.forEach((b) => {
              // å…‰çº¤å¸¦
              this.fibersList.push(b);
              // å…‰çº¤
              // this.fiberList = []
              // this.fiberList = b.fiber
            });
          } else {
            a.fiber.forEach((b) => {
              this.fiberList.push(b);
            });
          }
        } else {
          //this.fiberList = []
          a.fiber.forEach((b) => {
            this.fiberList.push(b);
          });
        }
      });
    }
    this.getTypeDicts1();
    this.getStandTreeBySampleType();
    this.getStandTreeBySampleType2();
    this.selectsStandardMethodByFLSSM2();
  },
  methods: {
    // è‡ªæŽ¥
    selfConnect() {
      if (this.selfConnectBoolean) {
        // this.bsm2Val2 éœ€è¦çš„æœ€ç»ˆç»“æžœ  this.fiberList ä¸‹æ‹‰æ¡†å†…容
        // è¿‡æ»¤å‡ºå¥—管和色标一致的数据  ä»¥åŠç›¸åº”的下标
        let newFiberList = [];
        let resultList = [];
        for (let i = 0; i < this.fiberList.length; i++) {
          let data = this.fiberList[i];
          if (data.bushColor == data.color) {
            newFiberList.push([data.bushColor, i + 1]);
          }
        }
        // æ ¹æ®å­—典进行一个排序
        for (let i = 0; i < this.colors.length; i++) {
          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);
            }
          }
        }
        newFiberList.sort((o1, o2) => o1[2] - o2[2]);
        // æ ¹æ®è§„则进行赋值  1-2  3-4  5-6 7-8  9-10
        for (let i = 0; i < newFiberList.length; i++) {
          // é¿å…å¤šæ¬¡å¾ªçޝ
          if (newFiberList.length < 2 * i + 1) {
            break;
          }
          if (
            newFiberList.length == 2 * i + 1 &&
            newFiberList.length % 2 != 0
          ) {
            resultList.push([]);
          } else {
            resultList.push([
              newFiberList[2 * i][1],
              newFiberList[2 * i + 1][1],
            ]);
          }
        }
        this.bsm2Val2 = resultList;
        console.log("bsm2", this.bsm2Val2);
        // MAX èµ‹å€¼
        this.bsm2Val3Length = resultList.length;
        this.bsm2Val = resultList.length;
      } else {
        this.computationalPairing(this.selectFiberList.length);
      }
    },
    // ç»Ÿä¸€ä¿®æ”¹å…‰çº¤æ£€æµ‹é‡
    miresNumChange() {
      const regex = /\d+/;
      const match = this.miresModel.match(regex);
      let num = 0;
      if (match) {
        num = Number(match[0]);
      }
      if (num < this.miresNum) {
        this.$message.error("光纤检测量不能大于光纤规格");
        return;
      }
      if (this.miresNum < 0) {
        this.$message.error("光纤检测量不能小于0");
        return;
      }
      this.fibersList.forEach((item) => {
        this.multiFiberList.forEach((a) => {
          if (a.ident == item.ident) {
            item.num = this.miresNum;
          }
        });
      });
    },
    handleSelectionChange(val) {
      // this.selectFibers = val
      this.multiFiberList = val;
      if (val.length > 0) {
        this.rowClickFiber(val[val.length - 1], null, null, 1);
      }
    },
    handleSelectionChange1(val) {
      this.selectBushing = val;
    },
    handleSelectionChange2(val) {
      this.detectionSelect = val;
      // èµ‹å€¼æ£€æµ‹é¡¹ä¿¡æ¯ å…‰çº¤å¸¦
      if (this.detectionItems.type == 1) {
        this.multiFiberList.forEach((item) => {
          this.fibersList.forEach((a) => {
            if (a.ident == item.ident) {
              a.productList = [];
              this.fibersList.find((a) => a.ident == item.ident).productList =
                this.detectionSelect;
            }
          });
        });
      }
      if (this.detectionItems.type == 0) {
        // èµ‹å€¼æ£€æµ‹é¡¹ä¿¡æ¯ å…‰çº¤
        this.selectFiberList.forEach((item) => {
          this.fiberList.forEach((a) => {
            if (a.ident == item.ident) {
              a.productList = [];
              this.fiberList.find((a) => a.ident == item.ident).productList =
                this.detectionSelect;
            }
          });
        });
        // é€‰æ‹©çš„æ—¶å€™å°±å°†fiberList的值赋值给对应的fiberList
        setTimeout(() => {
          if (this.multiFiberList.length > 0) {
            this.multiFiberList.forEach((item) => {
              this.fibersList.forEach((a) => {
                if (a.ident == item.ident) {
                  a.fiber = this.fiberList;
                }
              });
            });
          }
        }, 100);
      }
    },
    handleSelectionChange4(val) {
      this.selectFiberList = val;
      console.log(val);
      if (val != 0) {
        this.rowClickFiber(val[val.length - 1], null, null, 0);
      }
    },
    changeASk(row, type) {
      if (type == "ask") {
        // å¦‚果检测要求含有正负号
        if (row.tell.indexOf("±") != -1) {
          let left = row.tell.substring(0, row.tell.indexOf("±"));
          let right = row.tell.substring(row.tell.indexOf("±") + 1);
          // å¦‚果可以转化为数值
          if (!isNaN(Number(left)) && !isNaN(Number(right))) {
            if (row.ask.indexOf("-") != -1) {
              let left1 = row.ask.substring(0, row.ask.indexOf("-"));
              let right1 = row.ask.substring(row.ask.indexOf("-") + 1);
              if (
                Number(left1) != Number(left) - Number(right) ||
                Number(right1) != Number(left) + Number(right)
              ) {
                //this.$message.error("检测要求不符合要求描述");
                // row.ask =
                //   Number(left) -
                //   Number(right) +
                //   "-" +
                //   (Number(left) + Number(right));
              }
            } else {
              //this.$message.error("检测要求不符合规范");
              // row.ask = left + "-" + right;
              return;
            }
          }
          // å¦‚果要求描述左边不能转化为数值
          else if (isNaN(Number(left)) && !isNaN(Number(right))) {
            const regex = /[~-]/;
            const match = left.match(regex);
            // å·¦è¾¹å«æœ‰ - ~ ç¬¦å·
            if (match) {
              let newLeft = "";
              if (left.includes("(")) {
                newLeft = left.replace("(", "(");
              }
              if (left.includes(")")) {
                newLeft = newLeft.replace(")", ")");
              }
              const regexTwo = /\((\d+(\.\d+)?)([~-])(\d+(\.\d+)?)\)/;
              const matchTwo = newLeft.match(regexTwo);
              let leftTwo = Number(matchTwo[1]) - Number(right);
              let rightTwo = Number(matchTwo[4]) + Number(right);
              console.log(matchTwo);
              console.log(leftTwo, rightTwo);
              console.log(row.ask.indexOf("-"));
              if (row.ask.indexOf("-") != -1) {
                let left1 = row.ask.substring(0, row.ask.indexOf("-"));
                let right1 = row.ask.substring(row.ask.indexOf("-") + 1);
                if (Number(left1) != leftTwo || Number(right1) != rightTwo) {
                  //this.$message.error("检测要求不符合要求描述");
                  // row.ask = leftTwo + "-" + rightTwo;
                }
              } else {
                //this.$message.error("检测要求不符合规范");
                // row.ask = leftTwo + "-" + rightTwo;
                return;
              }
            }
          }
        }
        // å¦‚果要求描述含有≤ < â‰¥ > ç¬¦å·
        const regex = /[≤<≥>]/;
        const match = row.tell.match(regex);
        if (match) {
          // ç¬¦å·ä¸ä¸€è‡´
          if (row.ask.indexOf(match[0]) != 0) {
            //this.$message.error("检测要求不符合要求描述");
            return;
          } else {
            // ç¬¦å·ä¸€è‡´
            // å¦‚果检测要求含有正负号 å¹¶ä¸”含有&号 â‰¥0.69&≤0.76 è¦æ±‚描述
            if (row.tell.indexOf("&") != -1) {
              if (row.ask.indexOf("&") == -1) {
                //this.$message.error("检测要求不符合要求描述");
                // row.ask = row.tell;
                return;
              } else {
                let left = row.tell.substring(0, row.tell.indexOf("&"));
                let right = row.tell.substring(row.tell.indexOf("&") + 1);
                let leftAsk = row.ask.substring(0, row.ask.indexOf("&"));
                let rightAsk = row.ask.substring(row.ask.indexOf("&") + 1);
                if (leftAsk != left || rightAsk != right) {
                  //this.$message.error("检测要求不符合要求描述");
                }
              }
            } else {
              // æ²¡æœ‰&号
              const regex = new RegExp(`${match[0]}(\\d+(\\.\\d+)?)`, "g");
              const matchTow = row.tell.match(regex);
              let right = Number(matchTow[0].split(match[0])[1]);
              let left = row.ask.substring(row.ask.indexOf(match[0]) + 1);
              if (Number(left) != Number(right)) {
                //this.$message.error("检测要求不符合要求描述");
                // row.ask = match[0] + right;
              }
            }
          }
        }
        // å¦‚果要求描述含有范围
        const regexTwo = /[~-]/;
        const matchTwo = row.tell.match(regexTwo);
        const matchAsk = row.ask.match(regexTwo);
        if (matchTwo) {
          let left = row.tell.substring(0, row.tell.indexOf(matchTwo[0]));
          let right = row.tell.substring(row.tell.indexOf(matchTwo[0]) + 1);
          if (!isNaN(Number(left)) && !isNaN(Number(right))) {
            let leftAsk = row.ask.substring(0, row.ask.indexOf(matchAsk[0]));
            let rightAsk = row.ask.substring(row.ask.indexOf(matchAsk[0]) + 1);
            if (
              Number(leftAsk) != Number(left) ||
              Number(rightAsk) != Number(right)
            ) {
              //this.$message.error("检测要求不符合要求描述");
              // row.ask = left + "-" + right;
            }
          }
        }
      }
      // å…ˆå‹¾é€‰çš„æƒ…况下
      this.detectionSelect.forEach((item) => {
        if (item.id == row.id) {
          item.ask = row.ask;
          item.tell = row.tell;
          // å…‰çº¤ 0  å…‰çº¤å¸¦ 1
          if (item.isFibers == 0) {
            this.selectFiberList.forEach((a) => {
              this.fiberList.forEach((b) => {
                if (b.ident == a.ident) {
                  b.productList.forEach((item) => {
                    if (item.id == row.id) {
                      item.ask = row.ask;
                      item.tell = row.tell;
                    }
                  });
                }
              });
            });
          }
          if (item.isFibers == 1) {
            this.multiFiberList.forEach((a) => {
              this.fibersList.forEach((b) => {
                if (b.ident == a.ident) {
                  b.productList.forEach((item) => {
                    if (item.id == row.id) {
                      item.ask = row.ask;
                      item.tell = row.tell;
                    }
                  });
                }
              });
            });
          }
        }
      });
    },
    outConfig() {
      this.$parent.configShow = false;
    },
    getTypeDicts1() {
      this.$axios
        .post(this.$api.enums.selectEnumByCategory, {
          category: "色标",
        })
        .then((res) => {
          this.colors = res.data;
        });
    },
    // å¥—管数目生成表格数据
    addBushing() {
      this.bushing = [];
      for (let i = 0; i < this.packageInfo.num1; i++) {
        let bushing = {
          ident: this.bushing.length + 1,
          color: this.colors[i].label,
          standNum: null,
          testNum: null,
          fibers: [],
          fiber: [],
        };
        this.bushing.push(bushing);
      }
    },
    // å¥—管标准量赋值
    addStandNum() {
      if (this.packageInfo.testNum > this.packageInfo.standNum) {
        this.$message.error("检测量不能大于标准量");
        this.packageInfo.testNum = this.packageInfo.standNum;
      }
      if (this.selectBushing.length > 0) {
        this.bushing.forEach((item) => {
          this.selectBushing.forEach((a) => {
            if (item.ident == a.ident) {
              item.standNum = this.packageInfo.standNum;
            }
          });
        });
      }
    },
    // å¥—管检测量赋值
    addTestNum() {
      if (
        parseInt(this.packageInfo.testNum) > parseInt(this.packageInfo.standNum)
      ) {
        this.packageInfo.testNum = this.packageInfo.standNum;
        this.$message.error("检测量不能大于标准量");
      }
      if (this.selectBushing.length > 0) {
        this.bushing.forEach((item) => {
          this.selectBushing.forEach((a) => {
            if (item.ident == a.ident) {
              item.testNum = this.packageInfo.testNum;
            }
          });
        });
      }
    },
    isInspection() {
      this.fiberList = [];
      this.fibersList = [];
      this.detectionItems = [];
      // é¡µé¢æ˜¯å¦å«æœ‰å…‰çº¤å¸¦
      if (this.packageInfo.ismiers) {
        // å…¨æ£€
        if (this.packageInfo.radio == 0) {
          if (
            this.packageInfo.standNum == null ||
            this.packageInfo.standNum == ""
          ) {
            this.$message.error("请先输入标准量");
            return;
          }
          // æ ¹æ®æ ‡å‡†é‡èµ‹å€¼æ£€æµ‹é‡
          if (parseInt(this.packageInfo.standNum) > 0) {
            this.packageInfo.testNum = this.packageInfo.standNum;
            // ç»™å…‰çº¤å¸¦èµ‹å€¼
            this.bushing.forEach((item) => {
              item.testNum = this.packageInfo.testNum;
              item.standNum = this.packageInfo.standNum;
              this.$refs.table0.toggleRowSelection(item, true);
            });
            this.addFibers();
            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
                );
                this.$refs.table2.toggleRowSelection(rowToSelect, true);
              });
            }, 200);
          }
        }
      } else {
        if (this.packageInfo.radio == 0) {
          if (
            this.packageInfo.standNum == null ||
            this.packageInfo.standNum == ""
          ) {
            this.$message.error("请先输入标准量");
            return;
          }
          if (parseInt(this.packageInfo.standNum) > 0) {
            this.packageInfo.testNum = this.packageInfo.standNum;
            this.bushing.forEach((item) => {
              item.testNum = this.packageInfo.testNum;
              item.standNum = this.packageInfo.standNum;
              this.$refs.table0.toggleRowSelection(item, true);
            });
            console.log(this.bushing);
            this.selectBushing = this.bushing;
            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);
              });
            }, 200);
          }
        }
      }
    },
    upNum() {
      this.fiberList = [];
      this.fibersList = [];
      this.detectionItems = [];
      if (this.packageInfo.radio === 0) {
        this.packageInfo.testNum = this.packageInfo.standNum;
      }
      if (
        parseInt(this.packageInfo.standNum) < parseInt(this.packageInfo.testNum)
      ) {
        this.packageInfo.testNum = this.packageInfo.standNum;
      }
      if (
        this.packageInfo.num1 !== null &&
        this.packageInfo.num1 !== "" &&
        this.packageInfo.standNum !== null &&
        this.packageInfo.standNum !== "" &&
        this.packageInfo.testNum != null &&
        this.packageInfo.testNum !== ""
      ) {
        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.bushing = [];
        for (var i = 0; i < this.packageInfo.num1; i++) {
          let bushing = {
            color: colors2[i].label,
            standNum: this.packageInfo.standNum,
            testNum: this.packageInfo.testNum,
            fibers: [],
            fiber: [],
          };
          this.bushing.push(bushing);
        }
        // ç»™å…‰çº¤å¸¦èµ‹å€¼
        if (this.selectBushing.length === 0) {
          this.selectBushing = this.bushing;
        }
        // this.miresModels çº¤å¸¦ç±»åž‹
        // this.miresStandards å‚考标准
        this.fibersList = [];
        this.packageInfo.ismiers = true;
        this.fiberList = [];
        this.selectBushing.forEach((a) => {
          a.fiber = [];
          a.fibers = [];
          for (let j = 0; j < parseInt(a.testNum); j++) {
            let fibers = {
              id: this.fibersList.length + 1,
              code: null,
              color: a.color,
              model: null,
              standard: null,
              num: a.testNum,
              productList: this.HaveJson(this.productList2),
              fiber: [],
            };
            a.fibers.push(fibers);
            this.fibersList.push(fibers);
          }
        });
      } else {
        this.bushing = [];
      }
    },
    getStandTreeBySampleType() {
      this.$axios
        .post(this.$api.standardTree.getStandTreeBySampleType, {
          laboratory: "通信产品实验室",
          sampleType: "光纤",
        })
        .then((res) => {
          this.mireModels = [];
          res.data.forEach((a) => {
            this.mireModels.push({
              label: a.model,
              value: a.sample + " - " + a.model,
            });
          });
        });
    },
    getStandTreeBySampleType2() {
      this.$axios
        .post(this.$api.standardTree.getStandTreeBySampleType, {
          laboratory: "通信产品实验室",
          sampleType: "光纤带",
        })
        .then((res) => {
          this.miresModels = [];
          res.data.forEach((a) => {
            this.miresModels.push({
              label: a.model,
              value: a.model,
            });
          });
        });
    },
    selectsStandardMethodByFLSSM() {
      this.mireStandards = [];
      this.mireStandardLoading = true;
      this.$axios
        .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree: "中天科技检测中心 - é€šä¿¡äº§å“å®žéªŒå®¤ - å…‰çº¤ - " + this.mireModel,
        })
        .then((res) => {
          this.mireStandardLoading = false;
          this.mireStandards = res.data.standardMethodList;
        });
    },
    selectsStandardMethodByFLSSM2() {
      this.miresStandards = [];
      this.$axios
        .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree:
            "中天科技检测中心 - é€šä¿¡äº§å“å®žéªŒå®¤ - å…‰çº¤å¸¦ - " + this.miresModel,
        })
        .then((res) => {
          this.miresStandards = res.data.standardMethodList;
        });
    },
    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("请选择数据");
        return;
      }
      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",
            },
          }
        )
        .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; // å‚考标准
                }
              }
            });
          });
        });
    },
    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",
            },
          }
        )
        .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; // å‚考标准
                  }
                });
              }
            }
          }
        });
    },
    addFiber(isInspection) {
      //重新光纤配色,清空熔接配对
      this.isBsm2Val2 = false;
      this.bsm2Val2 = [];
      // æœ€æ–°
      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 = [];
      // é€‰æ‹©äº†å…‰çº¤å¸¦
      if (this.packageInfo.ismiers) {
        if (this.multiFiberList.length != 0) {
          let count = 0;
          console.log("this.multiFiberList", this.multiFiberList);
          // æ ¹æ®æ¯æ ¹ç®¡æŠ½æ£€æ ‡å‡†é‡ ç¡®å®š é¢œè‰²å¾ªçޝ
          let groupedByColor = this.multiFiberList.reduce((groups, value) => {
            if (!groups[value.color]) {
              groups[value.color] = Number(value.num);
            } else {
              groups[value.color] += Number(value.num);
            }
            return groups;
          });
          if (groupedByColor[groupedByColor.color]) {
            groupedByColor[groupedByColor.color] =
              groupedByColor[groupedByColor.color] + Number(groupedByColor.num);
          } else {
            this.$set(
              groupedByColor,
              groupedByColor.color,
              Number(groupedByColor.num)
            );
          }
          const regex = /\d+/;
          const match = this.miresModel.match(regex);
          console.log("groupedByColor", groupedByColor);
          this.multiFiberList.forEach((item) => {
            if (groupedByColor[item.color]) {
              // æ‹¿åˆ°å½“前的光纤带规格 ç¡®å®šé¢œè‰²å¾ªçޝ
              let modelNumber = this.packageInfo.standNum;
              if (match) {
                modelNumber = Number(match[0]);
              }
              let colors3 = colors2.slice(0, modelNumber);
              if (item.num == null || item.num == "") {
                item.num = 0;
              }
              // ç¡®å®šé¢œè‰²å¾ªçޝ
              for (var i = 0; i < parseInt(item.num); i++) {
                let fiber = {
                  ident: this.fiberList.length + 1,
                  bushColor: item.color,
                  color: colors3[count].label,
                  model: null,
                  noSplitModel: null,
                  standard: null,
                  fibersIdent: item.ident,
                  productList: [],
                };
                this.fiberList.push(fiber);
                count++;
                count = count % modelNumber;
              }
            }
          });
          // 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);
          this.selectBushing.forEach((item, index) => {
            if (item.testNum != null && item.testNum != "") {
              item.standNum = Number(item.standNum);
              for (let i = 0; i < parseInt(item.testNum); i++) {
                let fiber = {
                  ident: this.fiberList.length + 1,
                  bushColor: item.color,
                  color: colors3[count].label,
                  model: null,
                  standard: null,
                  productList: [],
                };
                this.fiberList.push(fiber);
                count++;
                count = count % this.packageInfo.standNum;
              }
            }
          });
        }
      } else {
        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);
        }
        let colors3 = colors2.slice(0, this.packageInfo.standNum);
        let count = 0;
        // æ ¹æ®å¥—管的测试量生成对应的数量的光纤数据
        this.selectBushing.forEach((item, index) => {
          if (item.testNum != null && item.testNum != "") {
            item.standNum = Number(item.standNum);
            for (let i = 0; i < parseInt(item.testNum); i++) {
              let fiber = {
                ident: this.fiberList.length + 1,
                bushColor: item.color,
                color: colors3[count].label,
                model: null,
                standard: null,
                productList: [],
              };
              this.fiberList.push(fiber);
              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;
          }
        });
        if (!flag) {
          this.$message.error("请填写光纤检测量");
          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;
      }
      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);
      }
      colors2 = colors2.splice(0, this.packageInfo.standNum);
      // å¥—管的测试量  *  é€‰æ‹©çš„光纤带数量
      this.fibersList = [];
      this.selectBushing.forEach((item) => {
        for (let i = 0; i < parseInt(this.packageInfo.testNum); i++) {
          let fibers = {
            ident: this.fibersList.length + 1,
            color: item.color,
            colorShow: item.color + "-" + colors2[i].label,
            code: null,
            model: null,
            standard: null,
            num: null,
            fiber: [],
            productList: [],
          };
          this.fibersList.push(fibers);
        }
      });
    },
    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 (
          (row.model == null || row.model == "") &&
          (row.standard == null || row.standard == "")
        ) {
          this.detectionItems = [];
          return;
        }
        if (row.model != null && row.model != "") {
          this.miresModel = row.model;
          this.selectsStandardMethodByFLSSM2();
        }
        setTimeout(() => {
          if (row.standard != null && row.standard != "") {
            this.miresStandard = this.miresStandards.find(
              (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",
                },
              }
            )
            .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;
                      }
                    });
                  });
                }
                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);
                }
              }
            });
        }, 500);
      } else if (type == 0) {
        if (
          (row.noSplitModel == null || row.noSplitModel == "") &&
          (row.standard == null || row.standard == "")
        ) {
          this.detectionItems = [];
          return;
        }
        if (row.model != null && row.model != "") {
          this.mireModel = row.noSplitModel;
          this.selectsStandardMethodByFLSSM();
        }
        setTimeout(() => {
          if (row.standard != null && row.standard != "") {
            this.mireStandard = this.mireStandards.find(
              (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",
                },
              }
            )
            .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;
                      }
                    });
                  });
                }
                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);
                }
              }
            });
        }, 500);
      }
    },
    toggleSelection(row) {
      this.$refs.productTable.toggleRowSelection(row, true);
      this.upProductSelect(null, row);
    },
    tableRowClassName({ row, rowIndex }) {
      if (row.state === 0) {
        return "warning-row";
      }
      return "";
    },
    handleAll(e) {
      if (e.length > 0) {
        console.log(this.detectionItems);
        this.detectionItems.map((m) => {
          m.state = 1;
          return m;
        });
      } else {
        this.detectionItems.map((m) => {
          m.state = 0;
          return m;
        });
      }
      if (e.length > 0) {
        if (this.multiFiberList.length > 0) {
          this.multiFiberList.map((item) => {
            item.productList.map((m) => {
              m.state = 1;
              return m;
            });
            return item;
          });
        }
        // else {
        //   this.currentDetectionItems.productList.map((m) => {
        //     m.state = 1;
        //     return m;
        //   });
        // }
      } else {
        if (this.multiFiberList.length > 0) {
          this.multiFiberList.map((item) => {
            item.productList.map((m) => {
              m.state = 0;
              return m;
            });
            return item;
          });
        }
        // else {
        //   this.currentDetectionItems.productList.map((m) => {
        //     m.state = 0;
        //     return m;
        //   });
        // }
      }
      this.bsmRow3 = [];
      this.detectionItems.forEach((p) => {
        if (this.type == 1) {
          if (
            p.bsm === "1" &&
            p.section !== "" &&
            p.section !== null &&
            p.state === 1
          ) {
            if (p.section.indexOf("[") > -1) {
              this.bsmRow = this.HaveJson(p);
            }
            this.bsm1 = true;
            this.bsm1Dia = true;
          } else if (
            p.bsm === "1" &&
            p.section !== "" &&
            p.section !== null &&
            p.state === 0
          ) {
            this.bsm1 = false;
          }
          if (
            p.bsm === "1" &&
            p.inspectionItem === "光纤接头损耗" &&
            this.sampleList.length > 1 &&
            p.state === 1 &&
            !this.isBsm2Val2
          ) {
            if (this.checkSampleCodeHasNull()) {
              this.$message.error("熔接配对的样品编号不能为空");
              return;
            }
            this.bsm2 = true;
            this.bsm1Dia = true;
            if (this.bsm2Val2.length === 0) {
              this.bsm2Val =
                ((this.selectFiberList.length + 1) *
                  this.selectFiberList.length) /
                2;
              this.computationalPairing(this.selectFiberList.length);
              this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
            }
          } else if (
            p.bsm === "1" &&
            p.inspectionItem === "光纤接头损耗" &&
            p.state === 1
          ) {
            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) {
        this.sampleList.map((item) => {
          if (this.sampleIds.indexOf(item.id) > -1) {
            item.insProduct.map((m) => {
              m.state = 1;
              return m;
            });
          }
          return item;
        });
      } else {
        this.sampleList.map((item) => {
          if (this.sampleIds.indexOf(item.id) > -1) {
            item.insProduct.map((m) => {
              m.state = 0;
              return m;
            });
          }
          return item;
        });
      }
      this.$nextTick(() => {
        this.$refs.productTable.doLayout();
      });
    },
    save1() {
      if (this.bsm2) {
        if (this.bsm2Val2.length === 0) {
          this.$message.error("特殊项目必须处理");
          return;
        }
        const tempList = this.HaveJson(this.bsm2Val2);
        let set = new Set();
        for (let i = 0; i < tempList.length; i++) {
          let num0 = set.size;
          set.add(JSON.stringify(tempList[i]));
          let num1 = set.size;
          if (num1 == num0) {
            console.log(set);
            console.log(tempList);
            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;
      this.fiberLoss = [];
    },
    upProductSelect(selection, row) {
      let list = this.detectionSelect.filter(
        (item) => item.inspectionItem == "光纤接头损耗"
      );
      if (list.length > 0) {
        this.fiberLoss = list.map(
          (item) => item.inspectionItem + "" + item.inspectionItemSubclass
        );
      }
      if (row.inspectionItem == "光纤接头损耗") {
        this.fiberLoss.push(
          row.inspectionItem + "" + row.inspectionItemSubclass
        );
      }
      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) => {
          item.productList.map((m) => {
            if (m.id == row.id) {
              m.state = row.state;
            }
            return m;
          });
          return item;
        });
      } else {
        this.currentDetectionItems.productList.map((m) => {
          if (m.id == row.id) {
            m.state = row.state;
          }
          return m;
        });
      }
      if (this.type == 1) {
        if (
          row.bsm === "1" &&
          row.section !== "" &&
          row.section !== null &&
          row.state === 1
        ) {
          if (row.section.indexOf("[") > -1) {
            this.bsmRow = this.HaveJson(row);
          }
          this.bsm1 = true;
          this.bsm1Dia = true;
        } else if (
          row.bsm === "1" &&
          row.section !== "" &&
          row.section !== null &&
          row.state === 0
        ) {
          this.bsm1 = false;
        }
        if (
          row.bsm === "1" &&
          row.inspectionItem === "光纤接头损耗" &&
          row.state === 1 &&
          !this.isBsm2Val2
        ) {
          if (this.sampleList.length < 2) {
            this.$message.error("样品数量不足够进行配对操作");
            return;
          } else {
            if (this.checkSampleCodeHasNull()) {
              this.$message.error("熔接配对的样品编号不能为空");
              return;
            }
            // this.bsm2 = true;
            // this.bsm1Dia = true;
            arr.length == 3 ? (this.bsm2 = true) : (this.bsm2 = false);
            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 (
          row.bsm === "1" &&
          row.inspectionItem === "光纤接头损耗" &&
          row.state === 1
        ) {
          this.bsm2 = false;
        }
      } 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(
        (ele) => ele.sampleCode == null
      );
      return emptyCodeArr.length > 0;
    },
    computationalPairing(n, isValue = false) {
      this.bsm1Dia = true;
      this.isLoading = true;
      this.$axios
        .get(this.$api.insOrder.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;
          }
          this.bsm2Up(this.selectFiberList.length);
          this.isLoading = false;
        });
      // const nums = [];
      // for (let i = 1; i <= n; i++) {
      //   nums.push(i);
      // }
      // this.bsm2Val3 = this.HaveJson(this.permute(nums));
    },
    permute(nums) {
      const result = [];
      function backtrack(temp, nums) {
        if (temp.length === 2) {
          result.push([...temp]);
          return;
        }
        for (let i = 0; i < nums.length; i++) {
          // if (temp.includes(nums[i])) continue;
          // é¿å…é‡å¤æ•°å­—
          if (temp.length > 0 && nums[i] < temp[temp.length - 1]) continue; // è§„定顺序,避免重复组合
          temp.push(nums[i]);
          backtrack(temp, nums);
          temp.pop();
        }
      }
      backtrack([], nums);
      return result;
    },
    setClassName({ column }) {
      if (column.type == "selection" && !this.isAllDisabled) {
        return "all-disabled";
      }
    },
    setClassName0({ column }) {
      if (column.type == "selection" && this.active != 1) {
        return "all-disabled";
      }
    },
    clearFibers() {
      this.packageInfo.ismiers = false;
      this.fibersList = [];
      this.bushing.forEach((a) => {
        a.fibers = [];
      });
    },
    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;
      // å…‰çº¤æ£€æµ‹é¡¹ä¿¡æ¯æ ¡éªŒ
      this.fiberList.forEach((item) => {
        if (item.productList.length > 0) {
          item.productList.forEach((row) => {
            // å¦‚果检测要求或者要求描述为空
            if (row.ask == null || row.ask == "") {
              this.errOrFiberList.push(
                "光纤管套色标" +
                  item.color +
                  " " +
                  row.inspectionItem +
                  " " +
                  row.inspectionItemSubclass
              );
            }
            if (row.tell == null || row.tell == "") {
              this.errOrFiberList.push(
                "光纤管套色标" +
                  item.color +
                  " " +
                  row.inspectionItem +
                  " " +
                  row.inspectionItemSubclass
              );
            }
            // å¦‚果检测要求含有正负号
            if (row.tell.indexOf("±") != -1) {
              let left = row.tell.substring(0, row.tell.indexOf("±"));
              let right = row.tell.substring(row.tell.indexOf("±") + 1);
              // å¦‚果可以转化为数值
              if (!isNaN(Number(left)) && !isNaN(Number(right))) {
                if (row.ask.indexOf("-") != -1) {
                  let left1 = row.ask.substring(0, row.ask.indexOf("-"));
                  let right1 = row.ask.substring(row.ask.indexOf("-") + 1);
                  if (
                    Number(left1) != Number(left) - Number(right) ||
                    Number(right1) != Number(left) + Number(right)
                  ) {
                    //this.$message.error("11111");
                    this.errOrFiberList.push(
                      "光纤管套色标" +
                        item.color +
                        " " +
                        row.inspectionItem +
                        " " +
                        row.inspectionItemSubclass
                    );
                    flag = false;
                  }
                } else {
                  //this.$message.error("2222");
                  this.errOrFiberList.push(
                    "光纤管套色标" +
                      item.color +
                      " " +
                      row.inspectionItem +
                      " " +
                      row.inspectionItemSubclass
                  );
                  flag = false;
                }
              }
              // å¦‚果要求描述左边不能转化为数值
              else if (isNaN(Number(left)) && !isNaN(Number(right))) {
                const regex = /[~-]/;
                const match = left.match(regex);
                // å·¦è¾¹å«æœ‰ - ~ ç¬¦å·
                if (match) {
                  let newLeft = "";
                  if (left.includes("(")) {
                    newLeft = left.replace("(", "(");
                  }
                  if (left.includes(")")) {
                    newLeft = newLeft.replace(")", ")");
                  }
                  const regexTwo = /\((\d+(\.\d+)?)([~-])(\d+(\.\d+)?)\)/;
                  const matchTwo = newLeft.match(regexTwo);
                  let leftTwo = Number(matchTwo[1]) - Number(right);
                  let rightTwo = Number(
                    Number(matchTwo[4]) + Number(right)
                  ).toFixed(6);
                  if (row.ask.indexOf("-") != -1) {
                    let left1 = row.ask.substring(0, row.ask.indexOf("-"));
                    let right1 = row.ask.substring(row.ask.indexOf("-") + 1);
                    if (
                      Number(left1) != leftTwo ||
                      Number(right1) != rightTwo
                    ) {
                      //this.$message.error("33333");
                      this.errOrFiberList.push(
                        "光纤管套色标" +
                          item.color +
                          " " +
                          row.inspectionItem +
                          " " +
                          row.inspectionItemSubclass
                      );
                      flag = false;
                    }
                  } else {
                    //this.$message.error("44444");
                    this.errOrFiberList.push(
                      "光纤管套色标" +
                        item.color +
                        " " +
                        row.inspectionItem +
                        " " +
                        row.inspectionItemSubclass
                    );
                    flag = false;
                  }
                }
              }
            }
            // å¦‚果检测要求含有≤ < â‰¥ > ç¬¦å·
            const regex = /[≤<≥>]/;
            const match = row.tell.match(regex);
            if (match) {
              // ç¬¦å·ä¸ä¸€è‡´
              if (row.ask.indexOf(match[0]) != 0) {
                //this.$message.error("555555");
                this.errOrFiberList.push(
                  "光纤管套色标" +
                    item.color +
                    " " +
                    row.inspectionItem +
                    " " +
                    row.inspectionItemSubclass
                );
                flag = false;
              } else {
                // ç¬¦å·ä¸€è‡´
                // å¦‚果检测要求含有正负号 å¹¶ä¸”含有&号 â‰¥0.69&≤0.76 è¦æ±‚描述
                if (row.tell.indexOf("&") != -1) {
                  if (row.ask.indexOf("&") == -1) {
                    //this.$message.error("检测要求不符合要求描述");
                    // row.ask = row.tell;
                    this.errOrFiberList.push(
                      "光纤管套色标" +
                        item.color +
                        " " +
                        row.inspectionItem +
                        " " +
                        row.inspectionItemSubclass
                    );
                  } else {
                    let left = row.tell.substring(0, row.tell.indexOf("&"));
                    let right = row.tell.substring(row.tell.indexOf("&") + 1);
                    let leftAsk = row.ask.substring(0, row.ask.indexOf("&"));
                    let rightAsk = row.ask.substring(row.ask.indexOf("&") + 1);
                    console.log("&", left, right, leftAsk, rightAsk);
                    if (leftAsk != left || rightAsk != right) {
                      //this.$message.error("88888");
                      this.errOrFiberList.push(
                        "光纤管套色标" +
                          item.color +
                          " " +
                          row.inspectionItem +
                          " " +
                          row.inspectionItemSubclass
                      );
                      flag = false;
                    }
                  }
                } else {
                  const regex = new RegExp(`${match[0]}(\\d+(\\.\\d+)?)`, "g");
                  const matchTow = row.tell.match(regex);
                  let right = Number(matchTow[0].split(match[0])[1]);
                  let left = row.ask.substring(row.ask.indexOf(match[0]) + 1);
                  if (Number(left) != Number(right)) {
                    //this.$message.error("666666");
                    this.errOrFiberList.push(
                      "光纤管套色标" +
                        item.color +
                        " " +
                        row.inspectionItem +
                        " " +
                        row.inspectionItemSubclass
                    );
                    flag = false;
                  }
                }
              }
            }
            // å¦‚果要求描述含有范围
            const regexTwo = /[~-]/;
            const matchTwo = row.tell.match(regexTwo);
            const matchAsk = row.ask.match(regexTwo);
            if (matchTwo) {
              let left = row.tell.substring(0, row.tell.indexOf(matchTwo[0]));
              let right = row.tell.substring(row.tell.indexOf(matchTwo[0]) + 1);
              if (!isNaN(Number(left)) && !isNaN(Number(right))) {
                let leftAsk = row.ask.substring(
                  0,
                  row.ask.indexOf(matchAsk[0])
                );
                let rightAsk = row.ask.substring(
                  row.ask.indexOf(matchAsk[0]) + 1
                );
                if (
                  Number(leftAsk) != Number(left) ||
                  Number(rightAsk) != Number(right)
                ) {
                  //this.$message.error("777777");
                  this.errOrFiberList.push(
                    "光纤管套色标" +
                      item.color +
                      " " +
                      row.inspectionItem +
                      " " +
                      row.inspectionItemSubclass
                  );
                  flag = false;
                }
              }
            }
          });
        }
      });
      // å…‰çº¤å¸¦æ£€æµ‹é¡¹ä¿¡æ¯æ ¡éªŒ
      this.fibersList.forEach((item) => {
        if (item.productList.length > 0) {
          item.productList.forEach((row) => {
            if (row.ask == null || row.ask == "") {
              this.errOrFiberRibbonList.push(
                "光纤带" +
                  item.color +
                  " " +
                  row.inspectionItem +
                  " " +
                  row.inspectionItemSubclass
              );
            }
            if (row.tell == null || row.tell == "") {
              this.errOrFiberRibbonList.push(
                "光纤带" +
                  item.color +
                  " " +
                  row.inspectionItem +
                  " " +
                  row.inspectionItemSubclass
              );
            }
            // å¦‚果检测要求含有正负号
            if (row.tell.indexOf("±") != -1) {
              let left = row.tell.substring(0, row.tell.indexOf("±"));
              let right = row.tell.substring(row.tell.indexOf("±") + 1);
              // å¦‚果可以转化为数值
              if (!isNaN(Number(left)) && !isNaN(Number(right))) {
                if (row.ask.indexOf("-") != -1) {
                  let left1 = row.ask.substring(0, row.ask.indexOf("-"));
                  let right1 = row.ask.substring(row.ask.indexOf("-") + 1);
                  if (
                    Number(left1) != Number(left) - Number(right) ||
                    Number(right1) != Number(left) + Number(right)
                  ) {
                    // this.$message.error('11111')
                    this.errOrFiberRibbonList.push(
                      "光纤带" +
                        item.colorShow +
                        " " +
                        row.inspectionItem +
                        " " +
                        row.inspectionItemSubclass
                    );
                    flags = false;
                  }
                } else {
                  // this.$message.error('2222')
                  this.errOrFiberRibbonList.push(
                    "光纤带" +
                      item.colorShow +
                      " " +
                      row.inspectionItem +
                      " " +
                      row.inspectionItemSubclass
                  );
                  flags = false;
                }
              }
              // å¦‚果要求描述左边不能转化为数值
              else if (isNaN(Number(left)) && !isNaN(Number(right))) {
                const regex = /[~-]/;
                const match = left.match(regex);
                // å·¦è¾¹å«æœ‰ - ~ ç¬¦å·
                if (match) {
                  let newLeft = "";
                  if (left.includes("(")) {
                    newLeft = left.replace("(", "(");
                  }
                  if (left.includes(")")) {
                    newLeft = newLeft.replace(")", ")");
                  }
                  const regexTwo = /\((\d+(\.\d+)?)([~-])(\d+(\.\d+)?)\)/;
                  const matchTwo = newLeft.match(regexTwo);
                  let leftTwo = Number(matchTwo[1]) - Number(right);
                  let rightTwo = Number(matchTwo[4]) + Number(right);
                  if (row.ask.indexOf("-") != -1) {
                    let left1 = row.ask.substring(0, row.ask.indexOf("-"));
                    let right1 = row.ask.substring(row.ask.indexOf("-") + 1);
                    if (
                      Number(left1) != leftTwo ||
                      Number(right1) != rightTwo
                    ) {
                      // this.$message.error('33333')
                      this.errOrFiberRibbonList.push(
                        "光纤带" +
                          item.colorShow +
                          " " +
                          row.inspectionItem +
                          " " +
                          row.inspectionItemSubclass
                      );
                      flags = false;
                    }
                  } else {
                    // this.$message.error('44444')
                    this.errOrFiberRibbonList.push(
                      "光纤带" +
                        item.colorShow +
                        " " +
                        row.inspectionItem +
                        " " +
                        row.inspectionItemSubclass
                    );
                    flags = false;
                  }
                }
              }
            }
            // å¦‚果检测要求含有≤ < â‰¥ > ç¬¦å·
            const regex = /[≤<≥>]/;
            const match = row.tell.match(regex);
            if (match) {
              // ç¬¦å·ä¸ä¸€è‡´
              if (row.ask.indexOf(match[0]) != 0) {
                // this.$message.error('555555')
                this.errOrFiberRibbonList.push(
                  "光纤带" +
                    item.colorShow +
                    " " +
                    row.inspectionItem +
                    " " +
                    row.inspectionItemSubclass
                );
                flags = false;
              } else {
                // ç¬¦å·ä¸€è‡´
                if (row.tell.indexOf("&") != -1) {
                  if (row.ask.indexOf("&") == -1) {
                    // this.$message.error("检测要求不符合要求描述");
                    // row.ask = row.tell;
                  } else {
                    let left = row.tell.substring(0, row.tell.indexOf("&"));
                    let right = row.tell.substring(row.tell.indexOf("&") + 1);
                    let leftAsk = row.ask.substring(0, row.ask.indexOf("&"));
                    let rightAsk = row.ask.substring(row.ask.indexOf("&") + 1);
                    console.log("&", left, right, leftAsk, rightAsk);
                    if (leftAsk != left || rightAsk != right) {
                      this.errOrFiberRibbonList.push(
                        "光纤带" +
                          item.colorShow +
                          " " +
                          row.inspectionItem +
                          " " +
                          row.inspectionItemSubclass
                      );
                      flags = false;
                    }
                  }
                } else {
                  const regex = new RegExp(`${match[0]}(\\d+(\\.\\d+)?)`, "g");
                  const matchTow = row.tell.match(regex);
                  let right = Number(matchTow[0].split(match[0])[1]);
                  let left = row.ask.substring(row.ask.indexOf(match[0]) + 1);
                  if (Number(left) != Number(right)) {
                    // this.$message.error('666666')
                    this.errOrFiberRibbonList.push(
                      "光纤带" +
                        item.colorShow +
                        " " +
                        row.inspectionItem +
                        " " +
                        row.inspectionItemSubclass
                    );
                    flags = false;
                  }
                }
              }
            }
            // å¦‚果要求描述含有范围
            const regexTwo = /[~-]/;
            const matchTwo = row.tell.match(regexTwo);
            const matchAsk = row.ask.match(regexTwo);
            if (matchTwo) {
              let left = row.tell.substring(0, row.tell.indexOf(matchTwo[0]));
              let right = row.tell.substring(row.tell.indexOf(matchTwo[0]) + 1);
              if (!isNaN(Number(left)) && !isNaN(Number(right))) {
                let leftAsk = row.ask.substring(
                  0,
                  row.ask.indexOf(matchAsk[0])
                );
                let rightAsk = row.ask.substring(
                  row.ask.indexOf(matchAsk[0]) + 1
                );
                if (
                  Number(leftAsk) != Number(left) ||
                  Number(rightAsk) != Number(right)
                ) {
                  // this.$message.error('777777')
                  this.errOrFiberRibbonList.push(
                    "光纤带" +
                      item.colorShow +
                      " " +
                      row.inspectionItem +
                      " " +
                      row.inspectionItemSubclass
                  );
                  flags = false;
                }
              }
            }
          });
        }
      });
      if (this.bushing.length === 0) {
        this.$message.error("缺少套管无法保存");
        return;
      }
      this.bushing.forEach((item) => {
        // å¦‚果光纤带有值
        if (this.fibersList.length != 0) {
          // this.fibersList.forEach(a=>{
          //   a.fiber = this.fiberList
          // })
          // item.fibers = this.fibersList // å…‰çº¤å¸¦
          let fibersFilter = this.fibersList.filter(
            (a) => item.color == a.color
          );
          fibersFilter.forEach((aa) => {
            aa.fiber = aa.fiber.filter((b) => b.bushColor == aa.color);
          });
          item.fibers = fibersFilter;
          item.fiber = []; // å…‰çº¤
        } else {
          // å¦‚果光纤带没有值
          item.fibers = []; // å…‰çº¤å¸¦
          item.fiber = this.fiberList.filter((a) => item.color == a.bushColor); // å…‰çº¤
          //item.fiber = this.fiberList // å…‰çº¤
        }
      });
      if (!flag || !flags) {
        // æ¶ˆæ¯æç¤º
        this.errOrFiberRibbonList = [...new Set(this.errOrFiberRibbonList)];
        this.errOrFiberList = [...new Set(this.errOrFiberList)];
        let list = [...this.errOrFiberRibbonList, ...this.errOrFiberList];
        let newData = [];
        const h = this.$createElement;
        for (let i in list) {
          const lastChar = list[i].slice(-1);
          if (lastChar == "-") {
            list[i] = list[i].slice(0, -1);
          }
          newData.push(
            h(
              "p",
              { style: "font-size: 14px;color: red;" },
              Number(i) + 1 + "、" + list[i]
            )
          );
        }
        newData.push(
          h(
            "p",
            {
              style:
                "font-size: 16px;color:#000;margin-top:12px;overflow-y: auto;max-height:80vh",
            },
            "以上项目检测要求与要求描述不匹配,确定保存?"
          )
        );
        this.$confirm("提示", {
          title: "提示",
          message: h("div", null, newData),
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "",
        })
          .then(() => {
            this.$message.success("已保存");
            this.sample.forEach((a) => {
              a.bushing = this.bushing;
            });
            this.$emit("saveFiberopticConfig", eventData);
            console.log("this.sample", this.sample);
            // æ¸…空错误消息
            this.errOrFiberList = [];
            this.errOrFiberRibbonList = [];
          })
          .catch(() => {
            // æ¸…空错误消息
            this.errOrFiberList = [];
            this.errOrFiberRibbonList = [];
          });
      } else {
        this.$message.success("已保存");
        this.sample.forEach((a) => {
          a.bushing = this.bushing;
        });
        let eventData = {
          bushing: this.bushing,
          fiberPairing: this.bsm2Val2,
        };
        this.$emit("saveFiberopticConfig", eventData);
        console.log("this.sample", this.sample);
      }
    },
    beforeClose(done) {
      if (this.bsm1) {
        if (this.bsm1Val === null || this.bsm1Val === "") {
          this.$message.error("特殊项目必须处理");
          return;
        }
      }
      if (this.bsm2) {
        if (this.bsm2Val2.length === 0) {
          this.$message.error("特殊项目必须处理");
          return;
        }
        let set = new Set();
        for (let i = 0; i < this.bsm2Val2.length; i++) {
          let num0 = set.size;
          set.add(JSON.stringify(this.bsm2Val2[i]));
          let num1 = set.size;
          if (num1 == num0) {
            this.$message.error("关联项目不能重复");
            return;
          }
          set.add(JSON.stringify(this.bsm2Val2[i].reverse()));
          let num2 = set.size;
          if (num1 == num2) {
            this.$message.error("关联项目不能重复");
            return;
          }
        }
      }
      this.isBsm2Val2 = true;
      done();
    },
    beforeClose0(done) {
      if (!this.bsm3Val) {
        this.$message.error("RST必须填写");
        return;
      } else {
        if (Array.isArray(this.bsmRow3)) {
          this.bsmRow3.forEach((item) => {
            item.rts = this.bsm3Val;
          });
        } else {
          this.bsmRow3.rts = this.bsm3Val;
        }
      }
      done();
    },
    upBsm1(val) {
      let sections = JSON.parse(this.bsmRow.section);
      let asks = JSON.parse(this.bsmRow.ask);
      let tells = JSON.parse(this.bsmRow.tell);
      let manHours = JSON.parse(this.bsmRow.manHour);
      let prices = JSON.parse(this.bsmRow.price);
      for (var a in sections) {
        if (val === sections[a]) {
          this.productList.forEach((p) => {
            if (p.id === this.bsmRow.id) {
              p.section = sections[a];
              p.ask = asks[a];
              p.tell = tells[a];
              p.manHour = manHours[a];
              p.price = prices[a];
            }
          });
          break;
        }
      }
    },
    bsm2Up(val) {
      if (this.selfConnectBoolean) {
        this.bsm2Val2 = [];
        // this.bsm2Val2 éœ€è¦çš„æœ€ç»ˆç»“æžœ  this.fiberList ä¸‹æ‹‰æ¡†å†…容
        // è¿‡æ»¤å‡ºå¥—管和色标一致的数据  ä»¥åŠç›¸åº”的下标
        let newFiberList = [];
        let resultList = [];
        for (let i = 0; i < this.fiberList.length; i++) {
          let data = this.fiberList[i];
          if (data.bushColor == data.color) {
            newFiberList.push([data.bushColor, i + 1]);
          }
        }
        // æ ¹æ®å­—典进行一个排序
        for (let i = 0; i < this.colors.length; i++) {
          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);
            }
          }
        }
        newFiberList.sort((o1, o2) => o1[2] - o2[2]);
        // æ ¹æ®è§„则进行赋值  1-2  3-4  5-6 7-8  9-10
        for (let i = 0; i < newFiberList.length; i++) {
          // é¿å…å¤šæ¬¡å¾ªçޝ
          if (newFiberList.length < 2 * i + 1) {
            break;
          }
          if (
            newFiberList.length == 2 * i + 1 &&
            newFiberList.length % 2 != 0
          ) {
            resultList.push([]);
          } else {
            resultList.push([
              newFiberList[2 * i][1],
              newFiberList[2 * i + 1][1],
            ]);
          }
        }
        resultList.length = val;
        console.log("resultList", resultList);
        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 = [];
        let length = this.selectFiberList.length;
        if (val) {
          let num = 0;
          if (val > length) {
            num = length;
          } else {
            num = val;
          }
          for (let i = 1; i <= num; i++) {
            list.push([i, i]);
          }
        }
        // å‰©ä½™çš„æŒ‰ç…§è§„则来执行
        if (val > length) {
          for (let i = 1; i <= length; i++) {
            for (let j = 1; j <= length; j++) {
              if (list.length < val) {
                if (i < j) {
                  list.push([i, j]);
                }
              }
            }
          }
        }
        this.bsm2Val2 = list;
        this.bsm1DiaLoading = false;
      }
      //}
    },
  },
};
</script>
<style scoped>
.ins_order_config {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}
.models {
  font-size: 14px;
  width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ins_order_config::-webkit-scrollbar {
  width: 0;
}
.title {
  height: 60px;
  line-height: 60px;
}
.center {
  width: 100%;
  height: calc(100% - 60px);
}
.grid-content {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.05);
}
.grid-content h5 {
  color: #3a7bfa;
  font-weight: 400;
  line-height: 32px;
  padding-left: 16px;
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
}
.search {
  width: calc(100% - 40px);
  background-color: #fff;
  padding: 5px 40px 5px 0;
}
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
}
.search_label {
  width: 120px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 120px);
}
.search-item {
  display: flex;
  align-items: center;
  line-height: 36px;
}
.search-item label {
  width: 90px;
  font-size: 12px;
  color: #606266;
  /* text-align: right; */
}
.btns {
  margin: 8px 0 8px 10px;
}
>>> .el-table th.el-table__cell > .cell {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}
>>> .all-disabled .el-checkbox__input .el-checkbox__inner {
  background-color: #edf2fc;
  border-color: #dcdfe6;
  cursor: not-allowed;
}
</style>
src/views/business/inspectionOrder/index.vue
@@ -1,9 +1,1439 @@
<template>
  <div>检验下单</div>
  <div>
    <div>
      <el-row class="title">
        <el-col :span="12" style="padding-left: 20px; text-align: left"
          >检验下单</el-col
        >
        <el-col :span="12" style="text-align: right">
          <el-button
            size="medium"
            type="primary"
            @click="dialogVisible1 = true"
            :loading="exportCheckedLoading"
            >导出检验结果</el-button
          >
          <el-button size="medium" type="primary" @click="print"
            >标签打印</el-button
          >
          <el-button size="medium" type="primary" @click="playOrder(1)"
            >下单</el-button
          >
        </el-col>
      </el-row>
    </div>
    <basic-container>
      <div class="search" :style="`height: ${more ? 130 : 80}px;`">
        <el-row :gutter="10" style="width: 100%">
          <el-col :span="20" style="display: flex; flex-wrap: wrap">
            <div class="search_thing" style="width: 20%">
              <div class="search_label">委托编号:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.entrustCode"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" style="width: 20%">
              <div class="search_label" style="width: 120px">
                å¤–部委托编号:
              </div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.outEntrustCode"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" style="width: 20%">
              <div class="search_label">样品名称:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.sampleName"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" style="width: 20%">
              <div class="search_label">样品型号:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.sampleModel"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" style="width: 20%">
              <div class="search_label">样品编号:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.sampleCode"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" style="width: 40%" v-if="more">
              <div class="search_label">下单时间:</div>
              <div class="search_input">
                <el-date-picker
                  style="width: 100%"
                  v-model="componentData.entity.startAndEndTime"
                  type="daterange"
                  size="small"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  value-format="yyyy-MM-dd"
                  clearable
                  placeholder="选择日期"
                >
                </el-date-picker>
              </div>
            </div>
            <div class="search_thing" style="width: 20%" v-if="more">
              <div class="search_label">下单人:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.name"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" style="width: 20%" v-if="more">
              <div class="search_label">工程名称:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.engineering"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
            <div class="search_thing" style="width: 20%" v-if="more">
              <div class="search_label">生产单位:</div>
              <div class="search_input">
                <el-input
                  size="small"
                  placeholder="请输入"
                  clearable
                  v-model="componentData.entity.production"
                  @keyup.enter.native="refreshTable()"
                ></el-input>
              </div>
            </div>
          </el-col>
          <el-col :span="4">
            <div class="search_thing">
              <el-button
                type="text"
                :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
                style="color: #3a7bfa"
                @click="more = !more"
                >{{ !more ? "更多" : "收起" }}</el-button
              >
              <el-button size="small" @click="refresh()">重 ç½®</el-button>
              <el-button size="small" type="primary" @click="refreshTable()"
                >查 è¯¢</el-button
              >
            </div>
          </el-col>
        </el-row>
      </div>
    </basic-container>
    <basic-container>
      <div style="width: 100%; height: 100%" v-show="active == 0">
        <div class="table">
          <ul class="tab">
            <li
              v-for="(m, i) in tabList"
              :key="i + 'afgh'"
              :class="{ active: i == tabIndex }"
              @click="handleTab(m, i)"
            >
              {{ m.label }}
            </li>
          </ul>
          <!-- <ValueTable
          :style="getStyle()"
          ref="ValueTable"
          :url="$api.insOrder.selectInsOrderParameter"
          :componentData="componentData"
          :upIndex="upIndex"
          @getTableData="getTableData"
        /> -->
          <lims-table
            :tableData="tableData"
            @pagination="pagination"
            :column="column"
            :page="page"
            :tableLoading="tableLoading"
          ></lims-table>
        </div>
        <!-- å®¡æ ¸ -->
        <el-dialog
          title="下单审核"
          :visible.sync="verifyDialogVisible"
          width="30%"
          :before-close="handleClose"
        >
          <p style="font-size: 16px; color: #333333" v-if="!isPass">
            å§”托编号<span style="color: #34bd66">ZTMS2023071001</span
            >的信息是否通过
          </p>
          <el-form
            :label-position="labelPosition"
            :model="formData"
            label-width="150px"
            ref="ruleForm"
            v-else
          >
            <el-form-item label="请输入样品库位号:">
              <el-input
                v-model="formData.specificationModel"
                size="small"
                style="width: 60%"
              ></el-input>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-row v-if="!isPass">
              <el-button @click="handleClose">退 å›ž</el-button>
              <el-button type="primary" @click="submitForm" :loading="upLoad"
                >通 è¿‡</el-button
              >
            </el-row>
            <el-row v-else>
              <el-button @click="handleClose">返 å›ž</el-button>
              <el-button type="primary" @click="submitForm" :loading="upLoad"
                >ç¡® å®š</el-button
              >
            </el-row>
          </span>
        </el-dialog>
        <!-- æ’¤é”€ -->
        <el-dialog
          title="下单撤销"
          :visible.sync="quashDialogVisible"
          width="30%"
          :before-close="handleClose"
        >
          <p style="font-size: 16px; color: #333333" v-if="!isQuash">
            å§”托编号<span style="color: #34bd66">{{
              this.insOrderRow.entrustCode
            }}</span
            >的信息是否撤销
          </p>
          <el-form
            :label-position="labelPosition"
            :model="formData"
            label-width="150px"
            ref="ruleForm"
            v-else
          >
            <el-form-item label="请输入撤销原因:">
              <el-input
                v-model="formData.specificationModel"
                size="small"
                style="width: 60%"
              ></el-input>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-row v-if="!isQuash">
              <el-button @click="handleClose">取 æ¶ˆ</el-button>
              <el-button type="primary" @click="submitForm" :loading="upLoad"
                >ç¡® å®š</el-button
              >
            </el-row>
            <el-row v-else>
              <el-button @click="handleClose">返 å›ž</el-button>
              <el-button type="primary" @click="submitForm" :loading="upLoad"
                >ç¡® å®š</el-button
              >
            </el-row>
          </span>
        </el-dialog>
        <!-- ä¸‹å‘ -->
        <el-dialog
          title="检验分配"
          :visible.sync="issuedDialogVisible"
          width="400px"
          :before-close="handleClose"
        >
          <div class="body" style="max-height: 60vh">
            <el-row>
              <el-col class="search_thing" style="width: 95%">
                <div class="search_label">
                  <span class="required-span">* </span>约定时间:
                </div>
                <div class="search_input">
                  <el-date-picker
                    size="small"
                    v-model="distributeData.appointed"
                    type="date"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd"
                    style="width: 100%"
                    format="yyyy-MM-dd"
                  >
                  </el-date-picker>
                </div>
              </el-col>
              <el-col class="search_thing" style="width: 95%">
                <div class="search_label">
                  <span class="required-span" v-show="distributeData.type == 2"
                    >* </span
                  >指派人员:
                </div>
                <div class="search_input">
                  <el-select
                    v-model="distributeData.userId"
                    placeholder="请选择"
                    size="small"
                    style="width: 100%"
                    clearable
                    filterable
                    @change="changeUser"
                  >
                    <el-option-group
                      v-for="(item, index) in Object.keys(personList)"
                      :key="index"
                      :label="item"
                    >
                      <el-option
                        v-for="op in personList[item]"
                        :key="op.id"
                        :label="op.name"
                        :value="op.id"
                      >
                      </el-option>
                    </el-option-group>
                  </el-select>
                </div>
              </el-col>
              <el-col
                class="search_thing"
                style="width: 95%"
                v-if="distributeData.userId"
              >
                <div class="search_label">
                  <span class="required-span">* </span>试验室:
                </div>
                <div class="search_input">
                  <el-select
                    v-model="distributeData.sonLaboratory"
                    placeholder="请选择11"
                    size="small"
                    style="width: 100%"
                    clearable
                    filterable
                  >
                    <el-option
                      v-for="(item, i) in sonLaboratoryList"
                      :key="i + 'oooo'"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </div>
              </el-col>
            </el-row>
          </div>
          <span slot="footer" class="dialog-footer">
            <el-row>
              <el-button @click="handleClose2">取 æ¶ˆ</el-button>
              <el-button type="primary" @click="submitForm2" :loading="upLoad"
                >ç¡® å®š</el-button
              >
            </el-row>
          </span>
        </el-dialog>
        <el-dialog
          title="数据查看"
          :visible.sync="dataDialogVisible"
          width="100%"
          fullscreen
        >
          <div style="height: 80vh; overflow-y: auto" v-if="dataDialogVisible">
            <ValueTable
              ref="ValueTableDataLook"
              :rowKey="'insProductId'"
              :url="$api.insOrder.selectSampleAndProductByOrderId"
              :componentData="componentDataDataLook"
            />
          </div>
        </el-dialog>
        <el-dialog
          top="5vh"
          :title="deleteTilte"
          :visible.sync="deleteDialogVisible"
          :before-close="handleCloseDelete"
          width="80%"
        >
          <div class="table-container" v-if="deleteDialogVisible">
            <!-- <ValueTable
            ref="ValueTableDataDelete"
            :url="
              $api.insOrder.selectNoProducts +
              '?orderId=' +
              orderId +
              '&ids=' +
              this.revocationInsProductIds
            "
            :componentData="componentDataDelete"
            :isColumnWidth="true"
          /> -->
            <el-table
              height="500px"
              ref="revokeTable"
              @select="handleSelectionChange"
              @select-all="handleSelectionAll"
              :data="treeTableData"
              style="width: 100%"
              row-key="id"
              border
              lazy
              :load="load"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
            >
              <el-table-column
                v-if="deleteTilte == '撤销'"
                type="selection"
                width="55"
              ></el-table-column>
              <el-table-column
                prop="sampleCode"
                label="样品编号"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="inspectionItem"
                label="检验项"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="inspectionItemSubclass"
                label="检验子项"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="sampleType"
                label="样品分类"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column prop="sample" label="样品" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="model" label="型号" show-overflow-tooltip>
              </el-table-column>
              <el-table-column
                prop="sonLaboratory"
                label="试验室"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column prop="tell" label="要求值" show-overflow-tooltip>
              </el-table-column>
            </el-table>
          </div>
          <span slot="footer" class="dialog-footer">
            <el-row>
              <el-button @click="handleNo">{{
                deleteTilte == "撤销" ? "取 æ¶ˆ" : "不通过"
              }}</el-button>
              <el-button
                type="primary"
                @click="submitDelete"
                :loading="printLoading"
                >{{ deleteTilte == "撤销" ? "ç¡® å®š" : "通 è¿‡" }}</el-button
              >
            </el-row>
          </span>
        </el-dialog>
        <!-- æ•°æ®æŸ¥çœ‹è¯¦æƒ… -->
        <el-dialog
          title="查看详情"
          :visible.sync="dialogVisible"
          width="70%"
          :before-close="handleClose3"
        >
          <el-table
            v-if="type == '单根垂直燃烧' || type == '松套管'"
            :data="viewDetailsList"
            height="400px"
            border
            style="width: 100%"
          >
            <el-table-column
              type="index"
              label="序号"
              width="80px"
            ></el-table-column>
            <el-table-column
              prop="entrustCode"
              label="委托单号"
            ></el-table-column>
            <el-table-column
              prop="sampleCode"
              label="样品编号"
            ></el-table-column>
            <el-table-column prop="color" label="套管"></el-table-column>
            <!-- <el-table-column prop="inspectionItem" label="检验项"></el-table-column> -->
            <el-table-column prop="insValue" label="检验结果"></el-table-column>
          </el-table>
          <el-table
            v-if="type == '抗拉强度'"
            :data="viewDetailsList"
            height="400px"
            border
            style="width: 100%"
          >
            <el-table-column
              type="index"
              label="序号"
              width="80px"
            ></el-table-column>
            <el-table-column
              prop="inspectionItem"
              label="检验项"
            ></el-table-column>
            <el-table-column
              prop="inspectionItemSubclass"
              label="检验子项"
            ></el-table-column>
            <el-table-column prop="width" label="宽度"></el-table-column>
            <el-table-column prop="thickness" label="厚度"></el-table-column>
            <el-table-column prop="testValue" label="检验值"></el-table-column>
          </el-table>
          <el-table
            v-if="type == '断裂伸长率'"
            :data="viewDetailsList"
            height="400px"
            border
            style="width: 100%"
          >
            <el-table-column
              type="index"
              label="序号"
              width="80px"
            ></el-table-column>
            <el-table-column
              prop="inspectionItem"
              label="检验项"
            ></el-table-column>
            <el-table-column
              prop="inspectionItemSubclass"
              label="检验子项"
            ></el-table-column>
            <el-table-column
              v-for="(v, i) in tableHeader"
              :key="i"
              :prop="`testValue${i}`"
              :label="`检验值${i + 1}`"
            ></el-table-column>
          </el-table>
        </el-dialog>
        <!-- å¯¼å‡ºå·²æ£€æ•°æ® -->
        <el-dialog
          title="选择日期"
          :visible.sync="dialogVisible1"
          width="30%"
          :before-close="handleClose4"
        >
          <span>下单日期:&nbsp;</span>
          <el-date-picker
            v-model="exportCheckedDate"
            type="daterange"
            size="small"
            value-format="yyyy-MM-dd"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          >
          </el-date-picker>
          <span slot="footer" class="dialog-footer">
            <el-button @click="handleClose4">取 æ¶ˆ</el-button>
            <el-button type="primary" @click="exportChecked()">ç¡® å®š</el-button>
          </span>
        </el-dialog>
      </div>
      <div style="width: 100%; height: 100%" v-if="active > 0">
        <Add
          :active="active"
          :currentId="currentId"
          v-if="active < 4"
          :examine="examine"
        />
      </div>
      <el-dialog
        title="标签打印"
        :visible.sync="printDialogVisible"
        width="40%"
        top="5vh"
      >
        <div
          style="width: 100%; height: 400px; overflow-y: auto"
          v-loading="loadPint"
        >
          <div class="dia_body">
            <el-checkbox
              style="margin: 10px 5px"
              :indeterminate="isIndeterminate"
              v-model="checkAll"
              @change="handleCheckAllChange"
              >全选</el-checkbox
            >
            <el-checkbox-group
              @change="changePrintCode()"
              v-model="checkIndexList"
            >
              <el-card
                class="box-card"
                v-for="(item, i) in qrData"
                :key="i + 'wwwww'"
                style="margin-bottom: 15px; font-size: 16px !important"
              >
                <el-checkbox
                  :label="i"
                  :key="i"
                  style="position: relative; top: -20px; left: 5px"
                  ><br
                /></el-checkbox>
                <div>
                  <el-row style="font-size: 14px; padding-left: 20px">
                    <el-col style="font-weight: bold">{{ item.pName }}</el-col>
                  </el-row>
                  <div style="display: flex">
                    <div>
                      <el-col :span="8" :offset="4">
                        <vueQr
                          :text="
                            'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' +
                            item.id +
                            '&type=sample'
                          "
                          :size="140"
                          :margin="2"
                        ></vueQr>
                      </el-col>
                    </div>
                    <div style="margin-left: 50px; width: 100%">
                      <el-row>
                        <el-col
                          style="
                            font-weight: bold;
                            text-align: left;
                            font-size: 14px;
                          "
                          ><span>样品编号:&nbsp; </span
                          >{{ item.sampleCode }}</el-col
                        >
                      </el-row>
                      <el-row style="margin-top: 1px; font-size: 14px">
                        <el-col style="font-weight: bold; text-align: left"
                          ><span>委托单号:&nbsp; </span>{{ item.code }}</el-col
                        >
                      </el-row>
                      <el-row style="margin-top: 1px; font-size: 14px">
                        <el-col style="font-weight: bold; text-align: left"
                          ><span>规格型号:&nbsp; </span>{{ item.model }}</el-col
                        >
                      </el-row>
                      <el-row style="margin-top: 1px; font-size: 14px">
                        <el-col style="font-weight: bold; text-align: left"
                          ><span>样品名称:&nbsp; </span
                          >{{ item.sample }}</el-col
                        >
                      </el-row>
                      <el-row
                        style="margin-top: 1px; font-size: 14px"
                        class="ellipsis-multiline"
                      >
                        <el-col style="font-weight: bold; text-align: left"
                          ><span>检测项目:&nbsp; </span>{{ item.item }}</el-col
                        >
                      </el-row>
                      <el-row style="margin-top: 2px; font-size: 14px">
                        <el-col
                          style="
                            font-weight: bold;
                            display: flex;
                            align-items: center;
                          "
                          ><span>样品状态:&nbsp; </span
                          ><el-radio-group
                            :value="item.insState"
                            style="margin-top: 7px; margin-left: 4px"
                            disabled
                          >
                            <el-radio
                              :label="0"
                              style="font-weight: bold; margin-right: 7px"
                              >待检</el-radio
                            >
                            <el-radio
                              :label="1"
                              style="font-weight: bold; margin-right: 7px"
                              >在检</el-radio
                            >
                            <el-radio
                              :label="2"
                              style="font-weight: bold; margin-right: 7px"
                              >已检</el-radio
                            > </el-radio-group
                          ><el-radio
                            :label="1"
                            style="font-weight: bold; margin-top: 7px"
                            v-model="item.isLeave"
                            disabled
                            >留样</el-radio
                          ></el-col
                        >
                      </el-row>
                    </div>
                  </div>
                </div>
              </el-card>
            </el-checkbox-group>
          </div>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-row>
            <el-button @click="printDialogVisible = false">取 æ¶ˆ</el-button>
            <el-button
              type="primary"
              @click="submitPrint"
              :loading="printLoading"
              >打 å°</el-button
            >
          </el-row>
        </span>
      </el-dialog>
      <div
        class="el-dialog__body"
        style="
          overflow-y: auto;
          margin-top: 0;
          position: fixed;
          top: 999px;
          z-index: 99999;
          display: none;
        "
      >
        <div id="printMOrder" class="printMOrder" ref="printMOrder">
          <el-card
            class="box-card"
            v-for="(item, i) in checkDataList"
            :key="i + 'uuuuu'"
            style="
              font-size: 0.2cm !important;
              page-break-after: always;
              color: #000;
              box-shadow: none;
              margin: 0 !important;
              padding: 0 !important;
            "
          >
            <div style="display: flex">
              <div>
                <el-col :span="10" :offset="2">
                  <vueQr
                    :text="
                      'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' +
                      item.id +
                      '&type=sample'
                    "
                    :size="60"
                    :margin="2"
                  ></vueQr>
                </el-col>
              </div>
              <div style="margin-left: 0.32cm; line-height: 0.22cm">
                <el-row>
                  <el-col
                    style="font-size: 0.2cm; width: 4cm"
                    class="single-line-ellipsis"
                    ><span>样品编号:&nbsp; </span>{{ item.sampleCode }}</el-col
                  >
                </el-row>
                <el-row style="font-size: 0.2cm">
                  <el-col><span>委托单号:&nbsp; </span>{{ item.code }}</el-col>
                </el-row>
                <el-row style="font-size: 0.2cm">
                  <el-col><span>规格型号:&nbsp; </span>{{ item.model }}</el-col>
                </el-row>
                <el-row style="font-size: 0.2cm">
                  <el-col
                    ><span>样品名称:&nbsp; </span>{{ item.sample }}</el-col
                  >
                </el-row>
                <el-row style="font-size: 0.2cm; width: 4cm">
                  <el-col class="ellipsis-multiline"
                    ><span>检测项目:&nbsp; </span>{{ item.item }}</el-col
                  >
                </el-row>
                <el-row style="margin-top: 0.01cm; font-size: 0.2cm">
                  <el-col style="display: flex; align-items: center"
                    ><span>样品状态:&nbsp; </span>
                    <span style="white-space: nowrap"
                      ><span v-if="item.insState == 0">√</span
                      ><span class="scor" v-if="item.insState != 0"></span>待检
                      <span v-if="item.insState == 1">√</span
                      ><span class="scor" v-if="item.insState != 1"></span>在检
                      <span v-if="item.insState == 2">√</span
                      ><span class="scor" v-if="item.insState != 2"></span>已检
                      <span v-if="item.isLeave == 1">√</span
                      ><span class="scor" v-if="item.isLeave != 1"></span
                      >留样</span
                    >
                  </el-col>
                </el-row>
              </div>
            </div>
          </el-card>
        </div>
      </div>
    </basic-container>
  </div>
</template>
<script>
export default {};
import limsTable from "@/components/Table/lims-table.vue";
import {
  addCustom,
  selectCustomPageList,
  delCustomById,
  upCustom,
} from "@/api/business/inspectionOrder";
import vueQr from "vue-qr";
import getLodop from "@/utils/lodop";
import Add from "./add.vue";
export default {
  components: {
    limsTable,
    Add,
    vueQr,
  },
  data() {
    return {
      tableData: [],
      page: {
        total: 0,
        size: 10,
        current: 0,
      },
      tableLoading: false,
      column: [
        { label: "委托编号", prop: "entrustCode" },
        { label: "外部委托编号", prop: "outEntrustCode" },
        { label: "委托单位", prop: "company" },
        { label: "样品名称", prop: "sampleName" },
        { label: "样品编号", prop: "sampleCode" },
        { label: "样品型号", prop: "sampleModel" },
        { label: "样品数量", prop: "sampleNum" },
        { label: "检验进度%", prop: "insProgress" },
        { label: "紧急程度", prop: "type" },
        { label: "备注", prop: "remark" },
        { label: "制单人", prop: "custom" },
        { label: "约定时间", prop: "appointed" },
        { label: "下单时间", prop: "createTime" },
        { label: "下发时间", prop: "sendTime" },
        { label: "退回理由", prop: "tell" },
        { label: "委托人", prop: "prepareUser" },
        { label: "撤销日期", prop: "revocationTime" },
        {
          dataType: "action",
          fixed: "right",
          label: "操作",
          operation: [
            {
              name: "数据查看",
              type: "text",
              clickFun: (row) => {},
            },
            {
              name: "报告下载",
              type: "text",
              clickFun: (row) => {},
            },
            {
              name: "审核",
              type: "text",
              clickFun: (row) => {},
            },
            {
              name: "撤销",
              type: "text",
              clickFun: (row) => {},
            },
            {
              name: "撤销审核",
              type: "text",
              clickFun: (row) => {},
            },
            {
              name: "分配",
              type: "text",
              clickFun: (row) => {},
            },
          ],
        },
      ],
      //old
      tableHeader: [],
      type: "",
      revokeDataAll: [],
      revokeData: [],
      treeTableData: [],
      treeTableData2: [],
      exportCheckedDate: [],
      exportCheckedLoading: false,
      dialogVisible1: false,
      dialogVisible: false,
      viewDetailsList: [],
      deleteTilte: "撤销",
      examine: null,
      deleteList: [],
      loadPint: false,
      checkAll: false,
      isIndeterminate: true,
      printLoading: false,
      printDialogVisible: false,
      //是否审核通过  true是 false不是
      isPass: false,
      //是否审核撤销  true是 false不是
      isQuash: false,
      verifyDialogVisible: false,
      quashDialogVisible: false,
      issuedDialogVisible: false,
      dataDialogVisible: false,
      formData: {},
      formData0: {},
      formData1: {},
      distributeData: {
        orderId: "",
        sampleId: "",
        appointed: "",
        userId: null,
        sonLaboratory: "",
      },
      // äººå‘˜åˆ—表
      personList: [],
      currentTableData: [],
      componentData: {
        entity: {
          entrustCode: null,
          sample: null,
          sampleName: null,
          sampleModel: null,
          sampleCode: null,
          outEntrustCode: null,
          state: 0,
          name: null,
          engineering: null,
          production: null,
          startAndEndTime: [],
          // orderBy: {
          //     field: '',
          //     order: ''
          // }
        },
        isIndex: true,
        showSelect: true,
        select: true,
        selectMethod: "selectMethod",
        do: [
          {
            id: "dataLook",
            font: "数据查看",
            type: "text",
            method: "handleDataLook",
            disabFun: (row, index) => {
              return row.state != 1 && row.state != 4;
            },
          },
          {
            id: "download",
            font: "报告下载",
            type: "text",
            method: "download",
            disabFun: (row, index) => {
              return row.state != 4 || row.isRatify != 1;
            },
          },
          {
            id: "verify",
            font: "审核",
            type: "text",
            method: "handleVerify",
            disabFun: (row, index) => {
              return row.state != 0;
            },
          },
          {
            id: "quash",
            font: "撤销",
            type: "text",
            method: "handlEquash",
            disabFun: (row, index) => {
              return row.state != 1 && row.state != 0;
            },
          },
          {
            id: "quashCheck",
            font: "撤销审核",
            type: "text",
            method: "handlEquashCheck",
            disabFun: (row, index) => {
              return (
                (row.state != 1 && row.state != 0) ||
                this.tabIndex != 1 ||
                row.isRevocation != 1
              );
            },
          },
          {
            font: "分配",
            type: "text",
            method: "handleIssued",
            disabFun: (row, index) => {
              return (
                row.state != 1 ||
                (row.entrustCode != null &&
                  Number(row.assign) > 0 &&
                  row.inspectId != null)
              );
            },
          },
        ],
        linkEvent: {
          sampleName: {
            method: "selectAllByOne",
          },
        },
        tagField: {
          type: {
            select: [
              {
                value: 0,
                type: "success",
                label: "普通",
              },
              {
                value: 1,
                type: "warning",
                label: "优先",
              },
              {
                value: 2,
                type: "danger",
                label: "紧急",
              },
            ],
          },
          createUser: {
            select: [],
          },
          orderType: {
            select: [],
          },
          processing: {
            select: [
              {
                value: 1,
                label: "实验室处理",
              },
              {
                value: 0,
                label: "委托单位取回",
              },
            ],
          },
          isLeave: {
            select: [
              {
                value: 1,
                label: "留样",
              },
              {
                value: 0,
                label: "不留样",
              },
            ],
          },
          send: {
            select: [
              {
                value: 1,
                label: "自取",
              },
              {
                value: 0,
                label: "其他",
              },
            ],
          },
        },
        selectField: {},
        requiredAdd: [],
        requiredUp: [],
        needSort: ["createTime", "sendTime", "type", "appointed"],
      },
      orderId: "",
      revocationInsProductIds: "",
      componentDataDataLook: {
        isPage: false,
        entity: {
          id: 0,
          orderBy: {
            field: "sampleCode",
            order: "asc",
          },
        },
        isIndex: false,
        showSelect: false,
        select: false,
        do: [
          {
            id: "",
            font: "查看",
            type: "text",
            method: "viewDetails",
            showFun: (row, index) => {
              return (
                row.inspectionItem == "单根垂直燃烧" ||
                row.inspectionItem.includes("松套管") ||
                row.inspectionItemSubclass.includes("松套管") ||
                (row.inspectionItem == "抗拉强度" &&
                  (row.inspectionItemSubclass == "热老化处理前" ||
                    row.inspectionItemSubclass == "热老化处理后")) ||
                (row.inspectionItem == "断裂伸长率" &&
                  (row.inspectionItemSubclass == "热老化处理前" ||
                    row.inspectionItemSubclass == "热老化处理后"))
              );
            },
          },
        ],
        tagField: {
          insState: {
            select: [],
          },
          insResult: {
            select: [
              {
                value: 1,
                label: "合格",
                type: "success",
              },
              {
                value: 0,
                label: "不合格",
                type: "danger",
              },
              {
                value: 3,
                label: "不判定",
                type: "",
              },
            ],
          },
        },
        selectField: {},
        spanConfig: {
          rows: [
            // {
            //   name: "entrustCode",
            //   index: 0,
            // },
            // {
            //   name: "sampleCode",
            //   index: 1,
            // },
          ],
        },
        requiredAdd: [],
        requiredUp: [],
      },
      componentDataDelete: {
        entity: {
          // orderId: '',
          // orderBy: {
          //     field: 'sampleCode',
          //     order: 'asc'
          // }
        },
        isPage: false,
        isIndex: false,
        showSelect: true,
        select: true,
        selectMethod: "selectDelete",
        do: [],
        tagField: {
          insState: {
            select: [],
          },
          insResult: {
            select: [
              {
                value: 1,
                label: "合格",
                type: "success",
              },
              {
                value: 0,
                label: "不合格",
                type: "danger",
              },
            ],
          },
        },
        selectField: {},
        spanConfig: {},
        requiredAdd: [],
        requiredUp: [],
      },
      deleteDialogVisible: false,
      entityCopy: {},
      upIndex: 0,
      upLoad: false,
      tabList: [
        {
          label: "待审核",
          value: 0,
        },
        {
          label: "待检验",
          value: 1,
        },
        {
          label: "已检验",
          value: 4,
        },
        {
          label: "退回",
          value: 2,
        },
        {
          label: "撤销",
          value: 3,
        },
      ],
      tabIndex: 0,
      active: 0, //1:下单,2:查看,3:审核,4:光纤配置,默认为0
      currentId: null,
      more: false,
      insOrderRow: {},
      checkIndexList: [],
      checkDataList: [
        {
          sampleCode: "11111",
        },
      ],
      qrData: [],
      multipleSelection: [],
      sonLaboratoryList: [],
      queryCount: 0,
    };
  },
  methods: {
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
  },
};
</script>
<style></style>
<style scope>
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  background-color: #fff;
  height: 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
  width: 100px;
}
.search_label {
  width: 90px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 90px);
}
.table {
  /* margin-top: 10px;
  background-color: #fff;
  width: calc(100% - 40px);
  height: calc(100% - 60px - 80px - 10px - 40px);
  padding: 20px; */
}
.tab {
  list-style-type: none;
  display: flex;
  margin-bottom: 12px;
}
.tab li {
  line-height: 24px;
  padding: 6px 14px;
  font-size: 14px;
  color: #333333;
  border: 1px solid #eeeeee;
  cursor: pointer;
}
.tab li:nth-child(1) {
  border-radius: 8px 0 0 8px;
}
.tab li:nth-child(5) {
  border-radius: 0 8px 8px 0;
}
.tab li.active {
  border-color: #3a7bfa;
  color: #3a7bfa;
}
.el-form-item {
  margin-bottom: 16px;
}
.box-card >>> .el-radio__inner {
  border-radius: 2px !important;
}
.box-card >>> .el-radio__input.is-checked .el-radio__inner::after {
  content: "";
  width: 8px;
  height: 3px;
  border: 1px solid white;
  border-top: transparent;
  border-right: transparent;
  text-align: center;
  display: block;
  position: absolute;
  top: 3px;
  left: 2px;
  transform: rotate(-45deg);
  border-radius: 0px;
  background: none;
}
>>> .el-radio__label {
  color: #000 !important;
}
.el-dialog__body >>> .el-radio__label {
  font-size: 8px;
}
.el-dialog__body >>> .el-radio__input.is-checked .el-radio__inner::after {
  content: "";
  width: 4px;
  height: 3px;
  border: 1px solid #000;
  border-top: transparent;
  border-right: transparent;
  text-align: center;
  display: block;
  position: absolute;
  top: 1px;
  left: 2px;
  transform: rotate(-45deg);
  border-radius: 0px;
  background: none;
}
>>> .el-radio__input.is-disabled.is-checked .el-radio__inner {
  background: #3a7bfa;
}
.el-dialog__body >>> .el-radio__input.is-disabled.is-checked .el-radio__inner {
  background: transparent;
}
.el-dialog__body >>> .el-radio__inner {
  width: 8px !important;
  height: 8px !important;
}
.el-dialog__body >>> .el-radio__label {
  padding-left: 2px !important;
}
.el-dialog__body >>> .el-card__body {
  padding: 0 !important;
}
.el-dialog__body >>> .el-card {
  border: none;
}
.el-dialog__body >>> .el-radio__input.is-disabled .el-radio__inner {
  border-color: #000 !important;
}
.el-dialog__body >>> .el-radio__input.is-disabled.is-checked .el-radio__inner {
  border: none !important;
}
.scor {
  width: 0.01cm;
  height: 0.01cm;
  border-radius: 1px;
  border: 1px solid #000;
  display: inline-block;
}
.ellipsis-multiline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  max-height: 3em; /* é«˜åº¦ä¸ºå­—体大小的两倍 */
  line-height: 1.5em; /* è¡Œé«˜ */
  height: 3em; /* é«˜åº¦ä¸ºè¡Œé«˜çš„两倍 */
}
.table-container {
  height: 70vh;
  overflow-y: auto;
}
.table-container.el-table {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>
src/views/system/dept/index.vue
@@ -1,6 +1,12 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
    >
      <el-form-item label="部门名称" prop="deptName">
        <el-input
          v-model="queryParams.deptName"
@@ -10,7 +16,11 @@
        />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="部门状态" clearable>
        <el-select
          v-model="queryParams.status"
          placeholder="部门状态"
          clearable
        >
          <el-option
            v-for="dict in dict.type.sys_normal_disable"
            :key="dict.value"
@@ -20,8 +30,16 @@
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查 è¯¢</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重 ç½®</el-button>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >查 è¯¢</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重 ç½®</el-button
        >
      </el-form-item>
    </el-form>
@@ -34,7 +52,8 @@
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:dept:add']"
        >新增</el-button>
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
@@ -43,9 +62,13 @@
          icon="el-icon-sort"
          size="mini"
          @click="toggleExpandAll"
        >展开/折叠</el-button>
          >展开/折叠</el-button
        >
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <el-table
@@ -54,21 +77,41 @@
      :data="deptList"
      row-key="deptId"
      :default-expand-all="isExpandAll"
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
    >
      <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
      <el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
      <el-table-column
        prop="deptName"
        label="部门名称"
        width="260"
      ></el-table-column>
      <el-table-column
        prop="orderNum"
        label="排序"
        width="200"
      ></el-table-column>
      <el-table-column prop="status" label="状态" width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
          <dict-tag
            :options="dict.type.sys_normal_disable"
            :value="scope.row.status"
          />
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="200">
      <el-table-column
        label="创建时间"
        align="center"
        prop="createTime"
        width="200"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
@@ -76,14 +119,16 @@
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:dept:edit']"
          >修改</el-button>
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-plus"
            @click="handleAdd(scope.row)"
            v-hasPermi="['system:dept:add']"
          >新增</el-button>
            >新增</el-button
          >
          <el-button
            v-if="scope.row.parentId != 0"
            size="mini"
@@ -91,7 +136,8 @@
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:dept:remove']"
          >删除</el-button>
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
@@ -102,7 +148,12 @@
        <el-row>
          <el-col :span="24" v-if="form.parentId !== 0">
            <el-form-item label="上级部门" prop="parentId">
              <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
              <treeselect
                v-model="form.parentId"
                :options="deptOptions"
                :normalizer="normalizer"
                placeholder="选择上级部门"
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -114,26 +165,42 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="显示排序" prop="orderNum">
              <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
              <el-input-number
                v-model="form.orderNum"
                controls-position="right"
                :min="0"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="负责人" prop="leader">
              <el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
              <el-input
                v-model="form.leader"
                placeholder="请输入负责人"
                maxlength="20"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系电话" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
              <el-input
                v-model="form.phone"
                placeholder="请输入联系电话"
                maxlength="11"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="邮箱" prop="email">
              <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
              <el-input
                v-model="form.email"
                placeholder="请输入邮箱"
                maxlength="50"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -143,7 +210,8 @@
                  v-for="dict in dict.type.sys_normal_disable"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
                  >{{ dict.label }}</el-radio
                >
              </el-radio-group>
            </el-form-item>
          </el-col>
@@ -158,13 +226,20 @@
</template>
<script>
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
import {
  listDept,
  getDept,
  delDept,
  addDept,
  updateDept,
  listDeptExcludeChild,
} from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  name: "Dept",
  dicts: ['sys_normal_disable'],
  dicts: ["sys_normal_disable"],
  components: { Treeselect },
  data() {
    return {
@@ -187,36 +262,36 @@
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        deptName: undefined,
        status: undefined
        status: undefined,
      },
      // è¡¨å•参数
      form: {},
      // è¡¨å•校验
      rules: {
        parentId: [
          { required: true, message: "上级部门不能为空", trigger: "blur" }
          { required: true, message: "上级部门不能为空", trigger: "blur" },
        ],
        deptName: [
          { required: true, message: "部门名称不能为空", trigger: "blur" }
          { required: true, message: "部门名称不能为空", trigger: "blur" },
        ],
        orderNum: [
          { required: true, message: "显示排序不能为空", trigger: "blur" }
          { required: true, message: "显示排序不能为空", trigger: "blur" },
        ],
        email: [
          {
            type: "email",
            message: "请输入正确的邮箱地址",
            trigger: ["blur", "change"]
          }
            trigger: ["blur", "change"],
          },
        ],
        phone: [
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: "请输入正确的手机号码",
            trigger: "blur"
          }
        ]
      }
            trigger: "blur",
          },
        ],
      },
    };
  },
  created() {
@@ -226,7 +301,7 @@
    /** æŸ¥è¯¢éƒ¨é—¨åˆ—表 */
    getList() {
      this.loading = true;
      listDept(this.queryParams).then(response => {
      listDept(this.queryParams).then((response) => {
        this.deptList = this.handleTree(response.data, "deptId");
        this.loading = false;
      });
@@ -239,7 +314,7 @@
      return {
        id: node.deptId,
        label: node.deptName,
        children: node.children
        children: node.children,
      };
    },
    // å–消按钮
@@ -257,7 +332,7 @@
        leader: undefined,
        phone: undefined,
        email: undefined,
        status: "0"
        status: "0",
      };
      this.resetForm("form");
    },
@@ -278,7 +353,7 @@
      }
      this.open = true;
      this.title = "添加部门";
      listDept().then(response => {
      listDept().then((response) => {
        this.deptOptions = this.handleTree(response.data, "deptId");
      });
    },
@@ -293,31 +368,35 @@
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.reset();
      getDept(row.deptId).then(response => {
      getDept(row.deptId).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改部门";
        listDeptExcludeChild(row.deptId).then(response => {
        listDeptExcludeChild(row.deptId).then((response) => {
          this.deptOptions = this.handleTree(response.data, "deptId");
          if (this.deptOptions.length == 0) {
            const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] };
            const noResultsOptions = {
              deptId: this.form.parentId,
              deptName: this.form.parentName,
              children: [],
            };
            this.deptOptions.push(noResultsOptions);
          }
        });
      });
    },
    /** æäº¤æŒ‰é’® */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.deptId != undefined) {
            updateDept(this.form).then(response => {
            updateDept(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDept(this.form).then(response => {
            addDept(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
@@ -328,13 +407,17 @@
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      this.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
        return delDept(row.deptId);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    }
  }
      this.$modal
        .confirm('是否确认删除名称为"' + row.deptName + '"的数据项?')
        .then(function () {
          return delDept(row.deptId);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
  },
};
</script>
src/views/system/menu/index.vue
@@ -1,6 +1,12 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
    >
      <el-form-item label="菜单名称" prop="menuName">
        <el-input
          v-model="queryParams.menuName"
@@ -10,7 +16,11 @@
        />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
        <el-select
          v-model="queryParams.status"
          placeholder="菜单状态"
          clearable
        >
          <el-option
            v-for="dict in dict.type.sys_normal_disable"
            :key="dict.value"
@@ -20,8 +30,16 @@
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查 è¯¢</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重 ç½®</el-button>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >查 è¯¢</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重 ç½®</el-button
        >
      </el-form-item>
    </el-form>
@@ -34,7 +52,8 @@
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:menu:add']"
        >新增</el-button>
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
@@ -43,9 +62,13 @@
          icon="el-icon-sort"
          size="mini"
          @click="toggleExpandAll"
        >展开/折叠</el-button>
          >展开/折叠</el-button
        >
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <el-table
@@ -54,20 +77,40 @@
      :data="menuList"
      row-key="menuId"
      :default-expand-all="isExpandAll"
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
    >
      <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
      <el-table-column
        prop="menuName"
        label="菜单名称"
        :show-overflow-tooltip="true"
        width="160"
      ></el-table-column>
      <el-table-column prop="icon" label="图标" align="center" width="100">
        <template slot-scope="scope">
          <svg-icon :icon-class="scope.row.icon" />
        </template>
      </el-table-column>
      <el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
      <el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column
        prop="orderNum"
        label="排序"
        width="60"
      ></el-table-column>
      <el-table-column
        prop="perms"
        label="权限标识"
        :show-overflow-tooltip="true"
      ></el-table-column>
      <el-table-column
        prop="component"
        label="组件路径"
        :show-overflow-tooltip="true"
      ></el-table-column>
      <el-table-column prop="status" label="状态" width="80">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
          <dict-tag
            :options="dict.type.sys_normal_disable"
            :value="scope.row.status"
          />
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime">
@@ -75,7 +118,11 @@
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
@@ -83,21 +130,24 @@
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:menu:edit']"
          >修改</el-button>
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-plus"
            @click="handleAdd(scope.row)"
            v-hasPermi="['system:menu:add']"
          >新增</el-button>
            >新增</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:menu:remove']"
          >删除</el-button>
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
@@ -138,15 +188,28 @@
                trigger="click"
                @show="$refs['iconSelect'].reset()"
              >
                <IconSelect ref="iconSelect" @selected="selected" :active-icon="form.icon" />
                <el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
                <IconSelect
                  ref="iconSelect"
                  @selected="selected"
                  :active-icon="form.icon"
                />
                <el-input
                  slot="reference"
                  v-model="form.icon"
                  placeholder="点击选择图标"
                  readonly
                >
                  <svg-icon
                    v-if="form.icon"
                    slot="prefix"
                    :icon-class="form.icon"
                    style="width: 25px;"
                    style="width: 25px"
                  />
                  <i v-else slot="prefix" class="el-icon-search el-input__icon" />
                  <i
                    v-else
                    slot="prefix"
                    class="el-icon-search el-input__icon"
                  />
                </el-input>
              </el-popover>
            </el-form-item>
@@ -160,7 +223,11 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="显示排序" prop="orderNum">
              <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
              <el-input-number
                v-model="form.orderNum"
                controls-position="right"
                :min="0"
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -168,8 +235,11 @@
          <el-col :span="12" v-if="form.menuType != 'F'">
            <el-form-item prop="isFrame">
              <span slot="label">
                <el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content="选择是外链则路由地址需要以`http(s)://`开头"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                æ˜¯å¦å¤–链
              </span>
@@ -182,8 +252,11 @@
          <el-col :span="12" v-if="form.menuType != 'F'">
            <el-form-item prop="path">
              <span slot="label">
                <el-tooltip content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头" placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                è·¯ç”±åœ°å€
              </span>
@@ -195,8 +268,11 @@
          <el-col :span="12" v-if="form.menuType == 'C'">
            <el-form-item prop="component">
              <span slot="label">
                <el-tooltip content="访问的组件路径,如:`system/user/index`,默认在`views`目录下" placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content="访问的组件路径,如:`system/user/index`,默认在`views`目录下"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                ç»„件路径
              </span>
@@ -205,10 +281,17 @@
          </el-col>
          <el-col :span="12" v-if="form.menuType != 'M'">
            <el-form-item prop="perms">
              <el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
              <el-input
                v-model="form.perms"
                placeholder="请输入权限标识"
                maxlength="100"
              />
              <span slot="label">
                <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                æƒé™å­—符
              </span>
@@ -218,10 +301,17 @@
        <el-row>
          <el-col :span="12" v-if="form.menuType == 'C'">
            <el-form-item prop="query">
              <el-input v-model="form.query" placeholder="请输入路由参数" maxlength="255" />
              <el-input
                v-model="form.query"
                placeholder="请输入路由参数"
                maxlength="255"
              />
              <span slot="label">
                <el-tooltip content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`' placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`'
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                è·¯ç”±å‚æ•°
              </span>
@@ -230,8 +320,11 @@
          <el-col :span="12" v-if="form.menuType == 'C'">
            <el-form-item prop="isCache">
              <span slot="label">
                <el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                æ˜¯å¦ç¼“å­˜
              </span>
@@ -246,8 +339,11 @@
          <el-col :span="12" v-if="form.menuType != 'F'">
            <el-form-item prop="visible">
              <span slot="label">
                <el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                æ˜¾ç¤ºçŠ¶æ€
              </span>
@@ -256,15 +352,19 @@
                  v-for="dict in dict.type.sys_show_hide"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
                  >{{ dict.label }}</el-radio
                >
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="status">
              <span slot="label">
                <el-tooltip content="选择停用则路由将不会出现在侧边栏,也不能被访问" placement="top">
                <i class="el-icon-question"></i>
                <el-tooltip
                  content="选择停用则路由将不会出现在侧边栏,也不能被访问"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                èœå•状态
              </span>
@@ -273,8 +373,30 @@
                  v-for="dict in dict.type.sys_normal_disable"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
                  >{{ dict.label }}</el-radio
                >
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="form.menuType != 'M'">
            <el-form-item prop="status">
              <span slot="label">
                <el-tooltip
                  content="选择只看我按钮,在角色管理处可配置只看我的数据权限"
                  placement="top"
                >
                  <i class="el-icon-question"></i>
                </el-tooltip>
                åªçœ‹æˆ‘按钮
              </span>
              <el-switch
                v-model="form.isRersonalButton"
                inactive-text="不显示"
                active-text="显示"
                :inactive-value="0"
                :active-value="1"
              >
              </el-switch>
            </el-form-item>
          </el-col>
        </el-row>
@@ -288,14 +410,20 @@
</template>
<script>
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
import {
  listMenu,
  getMenu,
  delMenu,
  addMenu,
  updateMenu,
} from "@/api/system/menu";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import IconSelect from "@/components/IconSelect";
export default {
  name: "Menu",
  dicts: ['sys_show_hide', 'sys_normal_disable'],
  dicts: ["sys_show_hide", "sys_normal_disable"],
  components: { Treeselect, IconSelect },
  data() {
    return {
@@ -318,22 +446,22 @@
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        menuName: undefined,
        visible: undefined
        visible: undefined,
      },
      // è¡¨å•参数
      form: {},
      // è¡¨å•校验
      rules: {
        menuName: [
          { required: true, message: "菜单名称不能为空", trigger: "blur" }
          { required: true, message: "菜单名称不能为空", trigger: "blur" },
        ],
        orderNum: [
          { required: true, message: "菜单顺序不能为空", trigger: "blur" }
          { required: true, message: "菜单顺序不能为空", trigger: "blur" },
        ],
        path: [
          { required: true, message: "路由地址不能为空", trigger: "blur" }
        ]
      }
          { required: true, message: "路由地址不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
@@ -347,7 +475,7 @@
    /** æŸ¥è¯¢èœå•列表 */
    getList() {
      this.loading = true;
      listMenu(this.queryParams).then(response => {
      listMenu(this.queryParams).then((response) => {
        this.menuList = this.handleTree(response.data, "menuId");
        this.loading = false;
      });
@@ -360,14 +488,14 @@
      return {
        id: node.menuId,
        label: node.menuName,
        children: node.children
        children: node.children,
      };
    },
    /** æŸ¥è¯¢èœå•下拉树结构 */
    getTreeselect() {
      listMenu().then(response => {
      listMenu().then((response) => {
        this.menuOptions = [];
        const menu = { menuId: 0, menuName: '主类目', children: [] };
        const menu = { menuId: 0, menuName: "主类目", children: [] };
        menu.children = this.handleTree(response.data, "menuId");
        this.menuOptions.push(menu);
      });
@@ -389,7 +517,8 @@
        isFrame: "1",
        isCache: "0",
        visible: "0",
        status: "0"
        status: "0",
        isRersonalButton: 0,
      };
      this.resetForm("form");
    },
@@ -426,24 +555,25 @@
    handleUpdate(row) {
      this.reset();
      this.getTreeselect();
      getMenu(row.menuId).then(response => {
      getMenu(row.menuId).then((response) => {
        this.form = response.data;
        this.form.isRersonalButton = Number(this.form.isRersonalButton);
        this.open = true;
        this.title = "修改菜单";
      });
    },
    /** æäº¤æŒ‰é’® */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.menuId != undefined) {
            updateMenu(this.form).then(response => {
            updateMenu(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addMenu(this.form).then(response => {
            addMenu(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
@@ -454,13 +584,17 @@
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
        return delMenu(row.menuId);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    }
  }
      this.$modal
        .confirm('是否确认删除名称为"' + row.menuName + '"的数据项?')
        .then(function () {
          return delMenu(row.menuId);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
  },
};
</script>
src/views/system/role/index.vue
@@ -2,7 +2,13 @@
  <div class="app-container">
    <div class="search">
      <div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
        <el-form
          :model="queryParams"
          ref="queryForm"
          size="small"
          :inline="true"
          v-show="showSearch"
        >
          <el-form-item label="角色名称" prop="roleName">
            <el-input
              v-model="queryParams.roleName"
@@ -48,21 +54,50 @@
            ></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查 è¯¢</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重 ç½®</el-button>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="handleQuery"
              >查 è¯¢</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
              >重 ç½®</el-button
            >
          </el-form-item>
        </el-form>
      </div>
      <div class="addButton mb8">
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:role:add']">新增</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:role:add']"
          >新增</el-button
        >
      </div>
    </div>
    <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
    <el-table
      v-loading="loading"
      :data="roleList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="角色编号" prop="roleId" width="120" />
      <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
      <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
      <el-table-column
        label="角色名称"
        prop="roleName"
        :show-overflow-tooltip="true"
        width="150"
      />
      <el-table-column
        label="权限字符"
        prop="roleKey"
        :show-overflow-tooltip="true"
        width="150"
      />
      <el-table-column label="显示顺序" prop="roleSort" width="100" />
      <el-table-column label="状态" align="center" width="100">
        <template slot-scope="scope">
@@ -74,12 +109,21 @@
          ></el-switch>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
      <el-table-column
        label="创建时间"
        align="center"
        prop="createTime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope" v-if="scope.row.roleId !== 1">
          <el-button
            size="mini"
@@ -87,35 +131,38 @@
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:role:edit']"
          >修改</el-button>
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:role:remove']"
          >删除</el-button>
            >删除</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row)"
          >详细</el-button>
<!--          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">-->
<!--            <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>-->
<!--            <el-dropdown-menu slot="dropdown">-->
<!--              <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"-->
<!--                v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item>-->
<!--              <el-dropdown-item command="handleAuthUser" icon="el-icon-user"-->
<!--                v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item>-->
<!--            </el-dropdown-menu>-->
<!--          </el-dropdown>-->
            >详细</el-button
          >
          <!--          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">-->
          <!--            <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>-->
          <!--            <el-dropdown-menu slot="dropdown">-->
          <!--              <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"-->
          <!--                v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item>-->
          <!--              <el-dropdown-item command="handleAuthUser" icon="el-icon-user"-->
          <!--                v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item>-->
          <!--            </el-dropdown-menu>-->
          <!--          </el-dropdown>-->
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
@@ -126,33 +173,68 @@
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="角色名称" prop="roleName">
          <el-input v-model="form.roleName" placeholder="请输入角色名称" :disabled="title === '查看角色'"/>
          <el-input
            v-model="form.roleName"
            placeholder="请输入角色名称"
            :disabled="title === '查看角色'"
          />
        </el-form-item>
        <el-form-item prop="roleKey">
          <span slot="label">
            <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
            <el-tooltip
              content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)"
              placement="top"
            >
              <i class="el-icon-question"></i>
            </el-tooltip>
            æƒé™å­—符
          </span>
          <el-input v-model="form.roleKey" placeholder="请输入权限字符"  :disabled="title === '查看角色'"/>
          <el-input
            v-model="form.roleKey"
            placeholder="请输入权限字符"
            :disabled="title === '查看角色'"
          />
        </el-form-item>
        <el-form-item label="角色顺序" prop="roleSort">
          <el-input-number v-model="form.roleSort" controls-position="right" :min="0"  :disabled="title === '查看角色'"/>
          <el-input-number
            v-model="form.roleSort"
            controls-position="right"
            :min="0"
            :disabled="title === '查看角色'"
          />
        </el-form-item>
        <el-form-item label="状态">
          <el-radio-group v-model="form.status" :disabled="title === '查看角色'">
          <el-radio-group
            v-model="form.status"
            :disabled="title === '查看角色'"
          >
            <el-radio
              v-for="dict in dict.type.sys_normal_disable"
              :key="dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
              >{{ dict.label }}</el-radio
            >
          </el-radio-group>
        </el-form-item>
        <el-form-item label="菜单权限">
          <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')" v-if="title !== '查看角色'">展开/折叠</el-checkbox>
          <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')" v-if="title !== '查看角色'">全选/全不选</el-checkbox>
          <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')" v-if="title !== '查看角色'">父子联动</el-checkbox>
          <el-checkbox
            v-model="menuExpand"
            @change="handleCheckedTreeExpand($event, 'menu')"
            v-if="title !== '查看角色'"
            >展开/折叠</el-checkbox
          >
          <el-checkbox
            v-model="menuNodeAll"
            @change="handleCheckedTreeNodeAll($event, 'menu')"
            v-if="title !== '查看角色'"
            >全选/全不选</el-checkbox
          >
          <el-checkbox
            v-model="form.menuCheckStrictly"
            @change="handleCheckedTreeConnect($event, 'menu')"
            v-if="title !== '查看角色'"
            >父子联动</el-checkbox
          >
          <el-tree
            :disabled="title === '查看角色'"
            class="tree-border"
@@ -163,23 +245,53 @@
            :check-strictly="!form.menuCheckStrictly"
            empty-text="加载中,请稍候"
            :props="defaultProps"
          ></el-tree>
          >
            <span class="custom-tree-node" slot-scope="{ node, data }">
              <span>{{ node.label }}</span>
              <span>
                <el-checkbox
                  v-model="data.isRersonal"
                  :true-label="1"
                  :false-label="0"
                  v-if="data.isRersonalButton == 1"
                  @change="(m) => chooseMe(m, data)"
                  :disabled="title === '查看角色'"
                  >只看我</el-checkbox
                >
              </span>
            </span>
          </el-tree>
        </el-form-item>
        <el-form-item label="备注">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :disabled="title === '查看角色'"></el-input>
          <el-input
            v-model="form.remark"
            type="textarea"
            placeholder="请输入内容"
            :disabled="title === '查看角色'"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="submitForm" v-if="title !== '查看角色'">ç¡® å®š</el-button>
        <el-button
          type="primary"
          @click="submitForm"
          v-if="title !== '查看角色'"
          >ç¡® å®š</el-button
        >
      </div>
    </el-dialog>
    <!-- åˆ†é…è§’色数据权限对话框 -->
    <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
    <el-dialog
      :title="title"
      :visible.sync="openDataScope"
      width="500px"
      append-to-body
    >
      <el-form :model="form" label-width="80px">
        <el-form-item label="角色名称">
          <el-input v-model="form.roleName" :disabled="true"/>
          <el-input v-model="form.roleName" :disabled="true" />
        </el-form-item>
        <el-form-item label="权限字符">
          <el-input v-model="form.roleKey" :disabled="true" />
@@ -195,9 +307,21 @@
          </el-select>
        </el-form-item>
        <el-form-item label="数据权限" v-show="form.dataScope == 2">
          <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
          <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
          <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
          <el-checkbox
            v-model="deptExpand"
            @change="handleCheckedTreeExpand($event, 'dept')"
            >展开/折叠</el-checkbox
          >
          <el-checkbox
            v-model="deptNodeAll"
            @change="handleCheckedTreeNodeAll($event, 'dept')"
            >全选/全不选</el-checkbox
          >
          <el-checkbox
            v-model="form.deptCheckStrictly"
            @change="handleCheckedTreeConnect($event, 'dept')"
            >父子联动</el-checkbox
          >
          <el-tree
            class="tree-border"
            :data="deptOptions"
@@ -220,14 +344,28 @@
</template>
<script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import {
  listRole,
  getRole,
  delRole,
  addRole,
  updateRole,
  dataScope,
  changeRoleStatus,
  deptTreeSelect,
} from "@/api/system/role";
import {
  treeselect as menuTreeselect,
  roleMenuTreeselect,
} from "@/api/system/menu";
export default {
  name: "Role",
  dicts: ['sys_normal_disable'],
  dicts: ["sys_normal_disable"],
  data() {
    return {
      // åªçœ‹æˆ‘数组
      isRersonalMenuIds: [],
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
@@ -258,24 +396,24 @@
      dataScopeOptions: [
        {
          value: "1",
          label: "全部数据权限"
          label: "全部数据权限",
        },
        {
          value: "2",
          label: "自定数据权限"
          label: "自定数据权限",
        },
        {
          value: "3",
          label: "本部门数据权限"
          label: "本部门数据权限",
        },
        {
          value: "4",
          label: "本部门及以下数据权限"
          label: "本部门及以下数据权限",
        },
        {
          value: "5",
          label: "仅本人数据权限"
        }
          label: "仅本人数据权限",
        },
      ],
      // èœå•列表
      menuOptions: [],
@@ -287,36 +425,46 @@
        pageSize: 10,
        roleName: undefined,
        roleKey: undefined,
        status: undefined
        status: undefined,
      },
      // è¡¨å•参数
      form: {},
      defaultProps: {
        children: "children",
        label: "label"
        label: "label",
      },
      // è¡¨å•校验
      rules: {
        roleName: [
          { required: true, message: "角色名称不能为空", trigger: "blur" }
          { required: true, message: "角色名称不能为空", trigger: "blur" },
        ],
        roleKey: [
          { required: true, message: "权限字符不能为空", trigger: "blur" }
          { required: true, message: "权限字符不能为空", trigger: "blur" },
        ],
        roleSort: [
          { required: true, message: "角色顺序不能为空", trigger: "blur" }
        ]
      }
          { required: true, message: "角色顺序不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    // åªçœ‹æˆ‘
    chooseMe(val, data) {
      let index = this.isRersonalMenuIds.findIndex((m) => m == data.id);
      if (index < 0 && val == 1) {
        this.isRersonalMenuIds.push(data.id);
      } else if (val == 0 && index > -1) {
        this.isRersonalMenuIds.splice(index, 1);
      }
    },
    /** æŸ¥è¯¢è§’色列表 */
    getList() {
      this.loading = true;
      listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
      listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
        (response) => {
          this.roleList = response.rows;
          this.total = response.total;
          this.loading = false;
@@ -325,7 +473,7 @@
    },
    /** æŸ¥è¯¢èœå•树结构 */
    getMenuTreeselect() {
      menuTreeselect().then(response => {
      menuTreeselect().then((response) => {
        this.menuOptions = response.data;
      });
    },
@@ -349,14 +497,14 @@
    },
    /** æ ¹æ®è§’色ID查询菜单树结构 */
    getRoleMenuTreeselect(roleId) {
      return roleMenuTreeselect(roleId).then(response => {
      return roleMenuTreeselect(roleId).then((response) => {
        this.menuOptions = response.menus;
        return response;
      });
    },
    /** æ ¹æ®è§’色ID查询部门树结构 */
    getDeptTree(roleId) {
      return deptTreeSelect(roleId).then(response => {
      return deptTreeSelect(roleId).then((response) => {
        this.deptOptions = response.depts;
        return response;
      });
@@ -364,13 +512,17 @@
    // è§’色状态修改
    handleStatusChange(row) {
      let text = row.status === "0" ? "启用" : "停用";
      this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
        return changeRoleStatus(row.roleId, row.status);
      }).then(() => {
        this.$modal.msgSuccess(text + "成功");
      }).catch(function() {
        row.status = row.status === "0" ? "1" : "0";
      });
      this.$modal
        .confirm('确认要"' + text + '""' + row.roleName + '"角色吗?')
        .then(function () {
          return changeRoleStatus(row.roleId, row.status);
        })
        .then(() => {
          this.$modal.msgSuccess(text + "成功");
        })
        .catch(function () {
          row.status = row.status === "0" ? "1" : "0";
        });
    },
    // å–消按钮
    cancel() {
@@ -387,22 +539,23 @@
      if (this.$refs.menu != undefined) {
        this.$refs.menu.setCheckedKeys([]);
      }
      this.menuExpand = false,
      this.menuNodeAll = false,
      this.deptExpand = true,
      this.deptNodeAll = false,
      this.form = {
        roleId: undefined,
        roleName: undefined,
        roleKey: undefined,
        roleSort: 0,
        status: "0",
        menuIds: [],
        deptIds: [],
        menuCheckStrictly: true,
        deptCheckStrictly: true,
        remark: undefined
      };
      (this.menuExpand = false),
        (this.menuNodeAll = false),
        (this.deptExpand = true),
        (this.deptNodeAll = false),
        (this.form = {
          roleId: undefined,
          roleName: undefined,
          roleKey: undefined,
          roleSort: 0,
          status: "0",
          menuIds: [],
          deptIds: [],
          isRersonalMenuIds: [],
          menuCheckStrictly: true,
          deptCheckStrictly: true,
          remark: undefined,
        });
      this.resetForm("form");
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
@@ -418,9 +571,9 @@
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.roleId)
      this.single = selection.length!=1
      this.multiple = !selection.length
      this.ids = selection.map((item) => item.roleId);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
    // æ›´å¤šæ“ä½œè§¦å‘
    handleCommand(command, row) {
@@ -437,12 +590,12 @@
    },
    // æ ‘权限(展开/折叠)
    handleCheckedTreeExpand(value, type) {
      if (type == 'menu') {
      if (type == "menu") {
        let treeList = this.menuOptions;
        for (let i = 0; i < treeList.length; i++) {
          this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
        }
      } else if (type == 'dept') {
      } else if (type == "dept") {
        let treeList = this.deptOptions;
        for (let i = 0; i < treeList.length; i++) {
          this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
@@ -451,18 +604,18 @@
    },
    // æ ‘权限(全选/全不选)
    handleCheckedTreeNodeAll(value, type) {
      if (type == 'menu') {
        this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
      } else if (type == 'dept') {
        this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
      if (type == "menu") {
        this.$refs.menu.setCheckedNodes(value ? this.menuOptions : []);
      } else if (type == "dept") {
        this.$refs.dept.setCheckedNodes(value ? this.deptOptions : []);
      }
    },
    // æ ‘权限(父子联动)
    handleCheckedTreeConnect(value, type) {
      if (type == 'menu') {
        this.form.menuCheckStrictly = value ? true: false;
      } else if (type == 'dept') {
        this.form.deptCheckStrictly = value ? true: false;
      if (type == "menu") {
        this.form.menuCheckStrictly = value ? true : false;
      } else if (type == "dept") {
        this.form.deptCheckStrictly = value ? true : false;
      }
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
@@ -475,48 +628,48 @@
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.reset();
      const roleId = row.roleId || this.ids
      const roleId = row.roleId || this.ids;
      const roleMenu = this.getRoleMenuTreeselect(roleId);
      getRole(roleId).then(response => {
      getRole(roleId).then((response) => {
        this.form = response.data;
        this.open = true;
        this.$nextTick(() => {
          roleMenu.then(res => {
            let checkedKeys = res.checkedKeys
          roleMenu.then((res) => {
            let checkedKeys = res.checkedKeys;
            checkedKeys.forEach((v) => {
                this.$nextTick(()=>{
                    this.$refs.menu.setChecked(v, true ,false);
                })
            })
              this.$nextTick(() => {
                this.$refs.menu.setChecked(v, true, false);
              });
            });
          });
        });
      });
      this.title = "修改角色";
    },
    // æŸ¥çœ‹è§’色详情
    handleView (row) {
    handleView(row) {
      this.title = "查看角色";
      this.reset();
      const roleId = row.roleId || this.ids
      const roleId = row.roleId || this.ids;
      const roleMenu = this.getRoleMenuTreeselect(roleId);
      getRole(roleId).then(response => {
      getRole(roleId).then((response) => {
        this.form = response.data;
        this.open = true;
        this.$nextTick(() => {
          roleMenu.then(res => {
            let checkedKeys = res.checkedKeys
          roleMenu.then((res) => {
            let checkedKeys = res.checkedKeys;
            checkedKeys.forEach((v) => {
              this.$nextTick(()=>{
                this.$refs.menu.setChecked(v, true ,false);
              })
            })
              this.$nextTick(() => {
                this.$refs.menu.setChecked(v, true, false);
              });
            });
          });
        });
      });
    },
    /** é€‰æ‹©è§’色权限范围触发 */
    dataScopeSelectChange(value) {
      if(value !== '2') {
      if (value !== "2") {
        this.$refs.dept.setCheckedKeys([]);
      }
    },
@@ -524,11 +677,11 @@
    handleDataScope(row) {
      this.reset();
      const deptTreeSelect = this.getDeptTree(row.roleId);
      getRole(row.roleId).then(response => {
      getRole(row.roleId).then((response) => {
        this.form = response.data;
        this.openDataScope = true;
        this.$nextTick(() => {
          deptTreeSelect.then(res => {
          deptTreeSelect.then((res) => {
            this.$refs.dept.setCheckedKeys(res.checkedKeys);
          });
        });
@@ -536,24 +689,26 @@
      this.title = "分配数据权限";
    },
    /** åˆ†é…ç”¨æˆ·æ“ä½œ */
    handleAuthUser: function(row) {
    handleAuthUser: function (row) {
      const roleId = row.roleId;
      this.$router.push("/system/role-auth/user/" + roleId);
    },
    /** æäº¤æŒ‰é’® */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.roleId != undefined) {
            this.form.menuIds = this.getMenuAllCheckedKeys();
            updateRole(this.form).then(response => {
            this.form.isRersonalMenuIds = this.isRersonalMenuIds;
            updateRole(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            this.form.menuIds = this.getMenuAllCheckedKeys();
            addRole(this.form).then(response => {
            this.form.isRersonalMenuIds = this.isRersonalMenuIds;
            addRole(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
@@ -563,10 +718,10 @@
      });
    },
    /** æäº¤æŒ‰é’®ï¼ˆæ•°æ®æƒé™ï¼‰ */
    submitDataScope: function() {
    submitDataScope: function () {
      if (this.form.roleId != undefined) {
        this.form.deptIds = this.getDeptAllCheckedKeys();
        dataScope(this.form).then(response => {
        dataScope(this.form).then((response) => {
          this.$modal.msgSuccess("修改成功");
          this.openDataScope = false;
          this.getList();
@@ -576,20 +731,28 @@
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const roleIds = row.roleId || this.ids;
      this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
        return delRole(roleIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
      this.$modal
        .confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?')
        .then(function () {
          return delRole(roleIds);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('system/role/export', {
        ...this.queryParams
      }, `role_${new Date().getTime()}.xlsx`)
    }
  }
      this.download(
        "system/role/export",
        {
          ...this.queryParams,
        },
        `role_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
src/views/system/user/index.vue
@@ -6,7 +6,7 @@
        class="default-theme"
      >
        <!--部门数据-->
        <pane size="12">
        <pane size="14">
          <el-col>
            <div class="head-container addButton">
              <el-input
@@ -17,7 +17,7 @@
                prefix-icon="el-icon-search"
                style="margin-bottom: 20px"
              />
              <el-button
              <!-- <el-button
                style="margin-left: 4px"
                type="primary"
                plain
@@ -25,7 +25,7 @@
                size="mini"
                circle
                @click="addSchema"
              ></el-button>
              ></el-button> -->
            </div>
            <div class="head-container">
              <el-tree
@@ -43,7 +43,7 @@
          </el-col>
        </pane>
        <!--用户数据-->
        <pane size="88">
        <pane size="86">
          <div class="search_form">
            <div>
              <el-form
@@ -297,9 +297,19 @@
                  v-for="item in postOptions"
                  :key="item.id"
                  :label="item.company"
                  :value="item.id + ''"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="归属部门" prop="deptId">
              <treeselect
                v-model="form.deptId"
                :options="enabledDeptOptions"
                :show-count="true"
                placeholder="请选择归属部门"
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -310,14 +320,15 @@
                class="avatar-uploader"
                :action="uploadAction"
                :show-file-list="false"
                :headers="upload.headers"
                accept=".png, .jpg, .jpeg, .gif"
                :on-error="handleUploadError"
                :on-success="handleUploadSuccess"
                :before-upload="handleBeforeUpload"
              >
                <img
                  v-if="signatureUrl"
                  :src="signatureUrl"
                  v-if="form.signatureUrl"
                  :src="javaApi + '/img/' + form.signatureUrl"
                  class="avatar"
                  alt=""
                />
@@ -331,14 +342,15 @@
                class="avatar-uploader"
                :action="uploadAction"
                :show-file-list="false"
                :headers="upload.headers"
                accept=".png, .jpg, .jpeg, .gif"
                :on-error="handleUploadError1"
                :on-success="handleUploadSuccess1"
                :before-upload="handleBeforeUpload1"
              >
                <img
                  v-if="pictureUrl"
                  :src="pictureUrl"
                  v-if="form.pictureUrl"
                  :src="javaApi + '/img/' + form.pictureUrl"
                  class="avatar"
                  alt=""
                />
@@ -423,7 +435,7 @@
            <el-tree
              :data="datathirdParty"
              node-key="companyId"
              :props="defaultProps"
              :props="companyProps"
              @node-click="nodeClick2"
              style="height: calc(100% - 42px)"
              @node-expand="nodeOpen0"
@@ -462,8 +474,7 @@
              <el-table-column type="selection" width="50"> </el-table-column>
              <el-table-column prop="employeeID" label="员工号">
              </el-table-column>
              <el-table-column prop="nickName" label="员工姓名">
              </el-table-column>
              <el-table-column prop="name" label="员工姓名"> </el-table-column>
              <el-table-column prop="department" label="部门" min-width="200">
              </el-table-column>
              <el-table-column
@@ -586,6 +597,10 @@
        children: "children",
        label: "label",
      },
      companyProps: {
        children: "children",
        label: "companyName",
      },
      // ç”¨æˆ·å¯¼å…¥å‚æ•°
      upload: {
        // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚(用户导入)
@@ -602,8 +617,6 @@
        url: process.env.VUE_APP_BASE_API + "/system/user/importData",
      },
      uploadAction: process.env.VUE_APP_BASE_API + "/deviceScope/uploadFile",
      signatureUrl: "",
      pictureUrl: "",
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
@@ -627,12 +640,14 @@
      rules: {
        nickName: [{ required: true, message: "请填写姓名", trigger: "blur" }],
        userName: [{ required: true, message: "请填写账号", trigger: "blur" }],
        nameEn: [{ required: true, message: "请输入姓名EN", trigger: "blur" }],
        // nameEn: [
        //   { required: true, message: "请输入姓名EN", trigger: "blur" }
        // ],
        status: [{ required: true, message: "请选择状态", trigger: "change" }],
        roleIds: [{ required: true, message: "请选择角色", trigger: "change" }],
        password: [
          { required: true, message: "密码不能为空", trigger: "blur" },
        ],
        // password: [
        //   { required: true, message: "密码不能为空", trigger: "blur" },
        // ],
        phonenumber: [
          {
            required: true,
@@ -660,6 +675,7 @@
        fatherId: 10001,
        nickName: "",
      },
      multipleSelection: [],
    };
  },
  watch: {
@@ -781,7 +797,11 @@
        status: "0",
        company: "",
        roleIds: [],
        signatureUrl: "",
        pictureUrl: "",
      };
      // this.signatureUrl = '';
      // this.pictureUrl = ''
      this.resetForm("form");
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
@@ -802,6 +822,7 @@
      this.ids = selection.map((item) => item.userId);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
      this.multipleSelection = selection;
    },
    // æ›´å¤šæ“ä½œè§¦å‘
    handleCommand(command, row) {
@@ -840,8 +861,8 @@
        .catch(() => {
          this.thirdPartyLoading = false;
        });
      if (this.componentData.entity.roleId > 10000)
        this.$message.warning("由于未选中具体角色,新增用户将成为默认角色");
      // if (this.componentData.entity.roleId > 10000)
      //   this.$message.warning("由于未选中具体角色,新增用户将成为默认角色");
    },
    tranListToTreeData(list, rootValue) {
      const arr = [];
@@ -889,7 +910,7 @@
      }
    },
    nodeOpen0(data, node, el) {
      this.currentCompaniesList[node.level - nodeOpen01] = data.id;
      this.currentCompaniesList[node.level - 1] = data.id;
    },
    filterNode2(value, data) {
      if (!value) return true;
@@ -902,12 +923,6 @@
      if (this.currentCompaniesList.length === 0) {
        return this.$message.error("请选择组织");
      }
      /* for (let index = this.currentCompaniesList.length-1; index >1; index--) {
        let obj = this.multipleSelection.find(a=>a.companyId==this.currentCompaniesList[index])
        if(!obj){
          this.currentCompaniesList.splice(index,1)
        }
      } */
      let arr = [];
      this.currentCompaniesList.forEach((b) => {
        let obj = this.companiesList.find((a) => a.companyId == b);
@@ -917,7 +932,7 @@
      addPersonUser({
        company: arr,
        person: this.multipleSelection,
        roleId: this.componentData.entity.roleId,
        roleId: null,
      })
        .then((res) => {
          if (res.code === 201) {
@@ -938,6 +953,7 @@
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.reset();
      this.form.deptId = this.queryParams.deptId;
      this.open = true;
      selectCustomEnum().then((res) => {
        this.postOptions = res.data;
@@ -956,6 +972,7 @@
      const userId = row.userId || this.ids;
      getUser(userId).then((response) => {
        this.form = response.data;
        this.form.password = "";
        this.roleOptions = response.roles;
        this.$set(this.form, "roleIds", response.roleIds);
        this.open = true;
@@ -1075,18 +1092,14 @@
      // å¦‚果上传成功
      if (res.code == 200) {
        // èŽ·å–å¯Œæ–‡æœ¬ç»„ä»¶å®žä¾‹
        let quill = this.Quill;
        // èŽ·å–å…‰æ ‡æ‰€åœ¨ä½ç½®
        let length = quill.getSelection().index;
        // æ’入图片  res.url为服务器返回的图片地址
        quill.insertEmbed(
          length,
          "image",
          process.env.VUE_APP_BASE_API + res.fileName
        );
        // è°ƒæ•´å…‰æ ‡åˆ°æœ€åŽ
        quill.setSelection(length + 1);
        this.signatureUrl = res.data.url;
        // let quill = this.Quill;
        // // èŽ·å–å…‰æ ‡æ‰€åœ¨ä½ç½®
        // let length = quill.getSelection().index;
        // // æ’入图片  res.url为服务器返回的图片地址
        // quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
        // // è°ƒæ•´å…‰æ ‡åˆ°æœ€åŽ
        // quill.setSelection(length + 1);
        this.form.signatureUrl = res.data.url;
      } else {
        this.$message.error("图片插入失败");
      }
@@ -1117,18 +1130,14 @@
      // å¦‚果上传成功
      if (res.code == 200) {
        // èŽ·å–å¯Œæ–‡æœ¬ç»„ä»¶å®žä¾‹
        let quill = this.Quill;
        // èŽ·å–å…‰æ ‡æ‰€åœ¨ä½ç½®
        let length = quill.getSelection().index;
        // æ’入图片  res.url为服务器返回的图片地址
        quill.insertEmbed(
          length,
          "image",
          process.env.VUE_APP_BASE_API + res.fileName
        );
        // è°ƒæ•´å…‰æ ‡åˆ°æœ€åŽ
        quill.setSelection(length + 1);
        this.pictureUrl = res.data.url;
        // let quill = this.Quill;
        // // èŽ·å–å…‰æ ‡æ‰€åœ¨ä½ç½®
        // let length = quill.getSelection().index;
        // // æ’入图片  res.url为服务器返回的图片地址
        // quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
        // // è°ƒæ•´å…‰æ ‡åˆ°æœ€åŽ
        // quill.setSelection(length + 1);
        this.form.pictureUrl = res.data.url;
      } else {
        this.$message.error("图片插入失败");
      }
@@ -1144,10 +1153,12 @@
.search_form {
  display: flex;
  justify-content: space-between;
  .options_button {
    margin-top: 3px;
  }
}
.avatar-uploader ::v-deep .el-upload {
  border: 1px dashed #666666;
  border-radius: 6px;
@@ -1155,9 +1166,11 @@
  position: relative;
  overflow: hidden;
}
.avatar-uploader ::v-deep .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 20px;
  color: #8c939d;
@@ -1166,11 +1179,13 @@
  line-height: 90px;
  text-align: center;
}
.avatar {
  width: 90px;
  height: 90px;
  display: block;
}
.addButton {
  display: flex;
  align-items: flex-start;