XiaoRuby
2023-09-11 e0ff382cd71d451190021e3ed12af99b9a965ee9
src/components/view/standard.vue
@@ -20,7 +20,7 @@
          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 != '[5]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
              {{ data.name }}</span>
              {{ data.code }}{{ data.name }}</span>
            <el-button type="text" size="mini" @click.stop="remove(node, data)">
              <i class="el-icon-delete"></i>
            </el-button>
@@ -57,15 +57,10 @@
        </div>
        <div v-if="this.typeselect == 1">技术指标</div>
        <div v-if="this.typeselect == 2">
          <material  :tableType="tableType" :tableData="tableData"></material>
          <bom  :tableType="tableType" :tableData="tableData"></bom>
        </div>
        <div v-if="this.typeselect == 3">生产工艺</div>
        <!-- <div class="table">
          <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
        </div> -->
        <!-- <div class="table">
          <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
        </div> -->
      </div>
    </div>
@@ -73,7 +68,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>
@@ -87,8 +82,9 @@
<script>
import technology from "./standard-table/technology.vue"
import material from "./standard-table/material.vue"
import bom from "./standard-table/bom.vue"
export default {
  components: { technology,material },
  components: { technology,material,bom },
  data() {
    return {
@@ -119,8 +115,8 @@
  //   }
  // },
  mounted() {
    this.tableType=0
    this.selectMaterialTree()
    // this.selectAll()
    this.selectVersion()
  },
  methods: {
@@ -153,18 +149,18 @@
    },
    TYPE(val) {//类型.数据
      console.log(val);
      // console.log(val);
      this.typeselect = val
      // console.log(this.typeselect);
      console.log(this.typeselect);
      this.selectVersion()
    },
    handleNodeClick(val) {//树的值
      console.log(val);
      // console.log(val);
      this.returntree = val
    },
    selectVersion() {//版本
      this.$axios.get(this.$api.url.selectVersion, {
    async selectVersion() {//版本
      let v=await this.$axios.get(this.$api.url.selectVersion, {
        params: {
          specificationsId: this.returntree.id,
          type: this.typeselect,
@@ -174,8 +170,12 @@
        this.version = this.verdata.map(el => {
          return el = `v${el}`
        })
        console.log(this.verdata);
        // console.log("版本");
        return this.verdata[0]
      })
      this.character=v
      this.VER="v"+v
      this.selectAll()
    },
    //右侧数据
    selectAll() {
@@ -187,6 +187,7 @@
        }
      }).then(res => {
        let arr = res.data;
        console.log(arr);
        for(var i=0;i<arr.length;i++){
            arr[i].id = "0" + i;
        }
@@ -194,9 +195,9 @@
      })
    },
    verevent(val) {
      console.log(val);
      // console.log(val);
      let cc = val.replace('v', '')
      console.log(cc);
      // console.log(cc);
      this.character = cc
      this.selectAll()
      // const { v, ...newObj } = val;
@@ -205,8 +206,8 @@
    },
    //五级树
    selectMaterialTree() {
      this.$axios.get(this.$api.url.selectTreeByMaterial).then(res => {
        this.list = res.data
      this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => {
        this.list=res.data
        this.list.forEach((el, idx, arr) => {
          if (idx == 0) {
            arr[idx].name = '成品'