licp
2024-05-08 f310bae9037704212a5626ed26a32bd4182a3508
src/components/view/b1-sample.vue
@@ -292,7 +292,7 @@
        <el-button type="primary" @click="confirmExport" :loading="upLoadExport">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="库位维护" :visible.sync="keepVisible" width="350px">
    <el-dialog title="库位维护" :visible.sync="keepVisible" width="350px" :append-to-body="true">
      <el-tree :data="warehouse" ref="tree" :props="{ children: 'warehouseShelfList', label: 'name' }" node-key="id"
        :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
        @node-collapse="nodeClose" :default-expanded-keys="expandedKeys" v-if="keepVisible"
@@ -302,7 +302,7 @@
            <el-col :span="20">
              <span><i
                  :class="`node_i ${node.level<2 ? 'el-icon-folder-opened': 'el-icon-tickets'}`"></i>
                {{ data.name }}{{ node.level }}</span>
                {{ data.name }}</span>
            </el-col>
            <el-col :span="4" v-if="node.level<3">
              <el-button type="text" size="mini" icon="el-icon-edit" @click.stop="handleEdit(data,node.level)">
@@ -895,6 +895,12 @@
              this.entity.shelfId = this.shelf[0].id
              this.handleShelf(this.entity.shelfId)
            }
          }else if(this.warehouse.length>0){
            this.warehouseChange(this.entity.warehouseId)
            if(this.shelf.length>0){
              this.entity.shelfId = this.shelf[0].id
              this.handleShelf(this.entity.shelfId)
            }
          }
        })
      },
@@ -979,6 +985,7 @@
            }).then(res => {
            this.upLoadWarehouse = false;
            this.warehouseVisible = false
            // this.keepVisible = false
            this.currentEdit = null;
            if (res.code == 201) {
              this.$message.error('修改失败')
@@ -986,6 +993,8 @@
            }
            this.$message.success('修改成功')
            this.selectList()
            this.name = ''
            this.warehouseChange(this.entity.warehouseId)
          })
        }else{
          // 新增仓库
@@ -1000,10 +1009,10 @@
            }
            this.$message.success('添加成功')
            this.selectList()
            this.name = ''
            this.warehouseChange(this.entity.warehouseId)
          })
        }
        this.name = ''
        this.warehouseChange(this.entity.warehouseId)
      },
      // 添加/修改货架
      confirmShelves() {
@@ -1031,11 +1040,12 @@
            }).then(res => {
            this.upLoadShelves = false;
            this.shelvesVisible = false
            // this.keepVisible = false
            if (res.code == 201) {
              this.$message.error('添加失败')
              this.$message.error('修改失败')
              return
            }
            this.$message.success('添加成功')
            this.$message.success('修改成功')
            this.selectList()
            this.currentEdit ={};
          })
@@ -1070,6 +1080,7 @@
      },
      nodeOpen(data, node, el) {
        $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
        this.selectTree[node.level-1] = data.id;
      },
      nodeClose(data, node, el) {
        $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')