loulijun2021
2023-10-23 e7d48e5d05e8575163e3508a1adda24f7c9141e4
src/views/basicSettings/storageList.vue
@@ -61,8 +61,15 @@
        <div
          style=" width:calc(100% - 300px);"
        >
          <div class="bodyTopButtonGroup">
          <div class="bodyTopButtonGroup" style="justify-content: space-between">
            <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
            <el-button
              v-waves
              type="success"
              icon="el-icon-download"
              @click="$router.push('./../systemSetting/dataImport?fileCode=7')"
            >导入
            </el-button>
          </div>
          <div class="bodyTopFormGroup">
@@ -511,6 +518,9 @@
    async getTSecLocaTree() {
      const res = await TSecLocaTree()
      this.treeLeftArr = res.data
      this.treeLeftArr.forEach(e => {
        e.name = e.code + ' ' + e.name
      })
      this.stckcodeArr = res.data.filter(i => i.idparent === '-1')
      this.treeLeft = [
        {
@@ -654,7 +664,18 @@
    stckcodeChange(val) {
      this.dialogForm.parentlocacode = ''
      this.parentlocacodeArr = this.treeLeftArr.filter(i => i.idparent === val)
      const res = this.recursiveLookupArray([], val)// 递归查找数组
      this.parentlocacodeArr = res
    },
    recursiveLookupArray(newArr, val) {
      const temp = this.treeLeftArr.filter(i => i.idparent === val)
      if (temp.length > 0 && temp) {
        temp.forEach(i => {
          newArr.push(i)
          this.recursiveLookupArray(newArr, i.code)
        })
      }
      return newArr
    },
    // 递归取子集的所有code