王震
2023-09-09 c37e4efb8a78a0f1bf85cf29a9286cc312469dbe
src/components/view/standard.vue
@@ -19,7 +19,7 @@
        <el-tree :data="list" ref="tree" default-expand-all :props="{ children: 'children', label: 'name' }"
          node-key="id" :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current>
          <div class="custom-tree-node" slot-scope="{ node, data }">
            <span><i :class="`node_i ${data.code != '[4]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
            <span><i :class="`node_i ${data.code != '[5]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
              {{ data.name }}</span>
            <el-button type="text" size="mini" @click.stop="remove(node, data)">
              <i class="el-icon-delete"></i>
@@ -77,7 +77,7 @@
    <div class="bom-add-model">
      <el-dialog title="BOM新增" :visible.sync="bomAddModelVisible" width="30%">
        <el-form>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button @click="bomAddModelVisible = false">取 消</el-button>
@@ -125,17 +125,42 @@
  // },
  mounted() {
    this.selectMaterialTree()
    this.selectAll()
    // this.selectAll()
    this.selectVersion()
  },
  methods: {
    selectDataList() {
            this.list.forEach(a => {
               a.code = '[1]'
               if (a.children != undefined) {
                  a.children.forEach(b => {
                     b.code = '[2]'
                     if (b.children != undefined) {
                        b.children.forEach(c => {
                           c.code = '[3]'
                  if (c.children != undefined) {
                        c.children.forEach(d => {
                           d.code = '[4]'
                  if (d.children != undefined) {
                        d.children.forEach(e => {
                           e.code = '[5]'
                        })
                     }
                        })
                     }
                        })
                     }
                  })
               }
            })
         },
    handleSelectionChange() {
    },
    TYPE(val) {//类型.数据
      console.log(val);
      this.typeselect = val
      // console.log(this.typeselect);
      this.selectVersion()
    },
@@ -192,22 +217,8 @@
          if (idx == 1) {
            arr[idx].name = '半成品'
          }
          el.children.forEach((newEl, newIdx, newArr) => {
            if (newIdx == 0) {
              newArr[newIdx].name = '橡胶连接器'
            }
            if (newIdx == 1) {
              newArr[newIdx].name = '金属连接器'
            }
            if (newIdx == 2) {
              newArr[newIdx].name = '湿插拔电连接器'
            }
            if (newIdx == 3) {
              newArr[newIdx].name = '分支组件'
            }
          })
        })
        console.log(this.list);
        this.selectDataList()
      })
    },
    filterNode(value, data) {