Explorar el Código

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into test

yijing hace 1 año
padre
commit
f72c8f07e9

+ 1 - 0
src/api/material/BOM.js

@@ -124,6 +124,7 @@ export async function getBomTreeList(params) {
 export async function getBomGetById(id) {
 export async function getBomGetById(id) {
   const res = await request.get(`/main/bomCategory/getById/${id}`);
   const res = await request.get(`/main/bomCategory/getById/${id}`);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
+    console.log(res.data,'+++++++++++++++++++++++');
     return res.data;
     return res.data;
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));

+ 10 - 5
src/utils/common.js

@@ -2,6 +2,8 @@ import { io } from 'socket.io-client';
 import { getToken, setToken } from './token-util';
 import { getToken, setToken } from './token-util';
 const token = getToken();
 const token = getToken();
 export const init = () => {
 export const init = () => {
+
+
 //   let socket = new WebSocket(
 //   let socket = new WebSocket(
 //     'ws://192.168.1.251:18086/websocket/UnreadNotifyMessageCount'
 //     'ws://192.168.1.251:18086/websocket/UnreadNotifyMessageCount'
 //   );
 //   );
@@ -31,17 +33,20 @@ export const init = () => {
 //   console.log('初始化Socket.io连接', token);
 //   console.log('初始化Socket.io连接', token);
 
 
   let socket = io('ws://192.168.1.251:18086/websocket/UnreadNotifyMessageCount',{
   let socket = io('ws://192.168.1.251:18086/websocket/UnreadNotifyMessageCount',{
-      auth:{
-          authorization:token
-      },
-     transports: ['websocket']
+    extraHeaders: {
+      Authorization: `Bearer ${token}`
+    }
+    //   auth:{
+    //       authorization:token
+    //   },
+    //  transports: ['websocket']
     // transports: ['polling'],
     // transports: ['polling'],
     // extraHeaders: {
     // extraHeaders: {
     //   'Authorization': token
     //   'Authorization': token
     // }
     // }
   }); ///websocket/UnreadNotifyMessageCount
   }); ///websocket/UnreadNotifyMessageCount
 //   socket.disconnect().connect()
 //   socket.disconnect().connect()
-
+  
   console.log('初始化Socket.io连接',socket);
   console.log('初始化Socket.io连接',socket);
 
 
   socket.on('connect', () => {
   socket.on('connect', () => {

+ 5 - 5
src/utils/request.js

@@ -49,13 +49,13 @@ service.interceptors.response.use(
   (res) => {
   (res) => {
     // token 自动续期
     // token 自动续期
 
 
-console.log(res);
+console.log(res,'*******************');
 // && res.config?.showErrorToast !== false
 // && res.config?.showErrorToast !== false
     if (Number(res.data.code) == -1) {
     if (Number(res.data.code) == -1) {
-      // Message.error({
-      //   dangerouslyUseHTMLString: true,
-      //   message:res.data.message}
-      // );
+      Message.error({
+        dangerouslyUseHTMLString: true,
+        message:res.data.message}
+      );
       return res;
       return res;
     }
     }
     if (Number(res.data.code) == 500 ) {
     if (Number(res.data.code) == 500 ) {

+ 159 - 0
src/views/material/BOMmanage/components/AssetTree/group.vue

@@ -0,0 +1,159 @@
+<template>
+  <div class="tree-wrapper">
+    <el-tree
+      :data="treeList"
+      :props="defaultProps"
+      v-loading="treeLoading"
+      :node-key="nodeKey"
+      ref="tree"
+      :highlight-current="true"
+      :expand-on-click-node="false"
+      @node-click="handleNodeClick"
+      v-bind="$attrs"
+      :default-expand-all="defaultExpandAll"
+    >
+    </el-tree>
+  </div>
+</template>
+
+<script>
+  import { getTreeByGroup } from '@/api/classifyManage';
+  // let originId = '';
+  // let originType = '';
+  export default {
+    props: {
+      // treeList私有化处理
+      treeFormate: {
+        type: Function,
+        default: null
+      },
+      defaultProps: {
+        type: Object,
+        default: function () {
+          return {
+            children: 'children',
+            value: 'id',
+            label: 'name'
+          };
+        }
+      },
+      defaultExpandAll: {
+        type: Boolean,
+        default: function () {
+          return true;
+        }
+      },
+      // 初始请求treeList
+      init: {
+        type: Boolean,
+        default: true
+      },
+      type: {
+        type: String,
+        default: true
+      },
+      nodeKey: {
+        type: String,
+        default: 'id'
+      }
+      // appendRoot: {
+      //   type: Boolean,
+      //   default: false
+      // },
+    },
+    data() {
+      return {
+        treeList: [],
+        treeLoading: false,
+        parentName: '',
+        parentId: '',
+        currentKey: ''
+      };
+    },
+    mounted() {
+      if (this.init) {
+        this.getTreeData();
+      }
+    },
+    methods: {
+      getInstance() {
+        return this.$refs.tree;
+      },
+      // 获取树结构数据
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+
+          const res = await getTreeByGroup({type: this.type});
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+            this.$emit('setRootId', res.data[0].id);
+            if (this.treeFormate) {
+              this.treeList = this.treeFormate(this.treeList);
+            }
+            this.$nextTick(() => {
+              // 默认高亮第一级树节点
+              if (this.treeList[0]) {
+                this.setCurrentKey(this.treeList[0].id);
+                this.handleNodeClick(
+                  this.treeList[0],
+                  this.$refs.tree.getCurrentNode()
+                );
+              }
+            });
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
+      // 递归 - 往树children里面添加parentName
+      // _setParentName (tree) {
+      //   let data = tree;
+      //   for (let i = 0; i < data.length; i++) {
+      //     if (data[i].parentId === '0') {
+      //       this.parentName = data[i].name;
+      //       originId = data[i].id;
+      //       originType = data[i].type;
+      //     }
+
+      //     data[i]['originId'] = originId;
+      //     data[i]['originType'] = originType;
+      //     data[i]['parentId'] = data[i]['parentId'];
+      //     if (data[i].children && data[i].children.length > 0) {
+      //       this._setParentName(data[i].children);
+      //     }
+      //   }
+      //   return data;
+      // },
+
+      handleNodeClick(data, node) {
+        this.$emit('handleNodeClick', data, node);
+      },
+      // 设置默认高亮行
+      setCurrentKey(id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      },
+
+      // 获取树的选中状态
+      getSelectList() {
+        const selectList = this.$refs.tree.getCurrentNode();
+        return selectList;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-wrapper {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+
+    :deep(.el-tree) {
+      display: inline-block;
+      min-width: 100%;
+    }
+  }
+</style>

+ 143 - 0
src/views/material/BOMmanage/components/AssetTree/index.vue

@@ -0,0 +1,143 @@
+<template>
+  <div class="tree-wrapper">
+    <el-tree
+      :data="treeList"
+      :props="defaultProps"
+      v-loading="treeLoading"
+      :node-key="nodeKey"
+      ref="tree"
+      :highlight-current="true"
+      :expand-on-click-node="false"
+      @node-click="handleNodeClick"
+      v-bind="$attrs"
+      :default-expand-all="defaultExpandAll"
+    >
+    </el-tree>
+  </div>
+</template>
+
+<script>
+  import { getTreeByPid } from '@/api/classifyManage';
+  // let originId = '';
+  // let originType = '';
+  export default {
+    props: {
+      // treeList私有化处理
+      treeFormate: {
+        type: Function,
+        default: null
+      },
+      defaultProps: {
+        type: Object,
+        default: function () {
+          return {
+            children: 'children',
+            value: 'id',
+            label: 'name'
+          };
+        }
+      },
+      defaultExpandAll: {
+        type: Boolean,
+        default: function () {
+          return true;
+        }
+      },
+      // 初始请求treeList
+      init: {
+        type: Boolean,
+        default: true
+      },
+      id: {
+        type: String,
+        default: '0'
+      },
+      nodeKey: {
+        type: String,
+        default: 'id'
+      }
+      // appendRoot: {
+      //   type: Boolean,
+      //   default: false
+      // },
+    },
+    data() {
+      return {
+        treeList: [],
+        treeLoading: false,
+        parentName: '',
+        parentId: '',
+        currentKey: ''
+      };
+    },
+    mounted() {
+      if (this.init) {
+        this.getTreeData();
+      }
+    },
+    methods: {
+      getInstance() {
+        return this.$refs.tree;
+      },
+      // 获取树结构数据
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+
+          const res = await getTreeByPid(20250317001);
+
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+            this.$emit('setRootId', res.data[0].id);
+            if (this.treeFormate) {
+              this.treeList = this.treeFormate(this.treeList);
+            }
+            this.$nextTick(() => {
+              // 默认高亮第一级树节点
+              if (this.treeList[0]) {
+                this.setCurrentKey(this.treeList[0].id);
+                this.handleNodeClick(
+                  this.treeList[0],
+                  this.$refs.tree.getCurrentNode()
+                );
+              }
+            });
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
+
+
+      handleNodeClick(data, node) {
+        
+        this.$emit('handleNodeClick', data, node);
+      },
+      // 设置默认高亮行
+      setCurrentKey(id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      },
+
+      // 获取树的选中状态
+      getSelectList() {
+        const selectList = this.$refs.tree.getCurrentNode();
+        return selectList;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-wrapper {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+
+    :deep(.el-tree) {
+      display: inline-block;
+      min-width: 100%;
+    }
+  }
+</style>

+ 7 - 7
src/views/material/BOMmanage/components/attribute.vue

@@ -1,5 +1,6 @@
 <template>
 <template>
   <div>
   <div>
+    
     <el-form
     <el-form
       label-width="100px"
       label-width="100px"
       :rules="rules"
       :rules="rules"
@@ -127,7 +128,7 @@
         <el-col :span="8" label-width="100px">
         <el-col :span="8" label-width="100px">
           <el-form-item label="生产类型:" prop="produceType">
           <el-form-item label="生产类型:" prop="produceType">
             <el-select
             <el-select
-              v-model="attributeData.produceType"
+              v-model="attributeData?.category.produceType"
                disabled
                disabled
               filterable
               filterable
               multiple
               multiple
@@ -142,14 +143,12 @@
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
-
+   
         <el-col :span="8" label-width="100px">
         <el-col :span="8" label-width="100px">
           <el-form-item label="属性类型:" prop="attributeType">
           <el-form-item label="属性类型:" prop="attributeType">
             <el-select
             <el-select
-              v-model="attributeData.attributeType"
+              v-model="attributeData.category.attributeType"
               disabled
               disabled
-              filterable
-              multiple
               class="ele-block"
               class="ele-block"
             >
             >
               <el-option
               <el-option
@@ -330,7 +329,7 @@
             value: 2
             value: 2
           },
           },
           {
           {
-            label: '零',
+            label: '零',
             value: 3
             value: 3
           },{
           },{
             label: '原材料',
             label: '原材料',
@@ -357,6 +356,7 @@
     methods: {
     methods: {
       async getDictList(code) {
       async getDictList(code) {
         let { data: res } = await getByCode(code);
         let { data: res } = await getByCode(code);
+
         this.dictList = res.map((item) => {
         this.dictList = res.map((item) => {
           let values = Object.keys(item);
           let values = Object.keys(item);
           return {
           return {
@@ -388,7 +388,7 @@
 
 
     watch: {
     watch: {
       attributeData(val) {
       attributeData(val) {
-        console.log(Object.prototype.hasOwnProperty.call(val, 'category'));
+        console.log(val,'11111111111111');
         if (Object.prototype.hasOwnProperty.call(val, 'category')) {
         if (Object.prototype.hasOwnProperty.call(val, 'category')) {
           this.category = val.category;
           this.category = val.category;
           this.attributeData.produceType = val.category.produceType;
           this.attributeData.produceType = val.category.produceType;

+ 294 - 0
src/views/material/BOMmanage/components/clientDialog.vue

@@ -0,0 +1,294 @@
+<template>
+  <ele-modal
+    v-if="visible"
+    :visible.sync="visible"
+    title="工厂列表"
+    width="70%"
+    :centered="true"
+    :close-on-click-modal="false"
+    append-to-body
+    :maxable="true"
+  >
+    <el-form :model="params" label-width="100px">
+      <el-row>
+        <el-col :span="6">
+          <el-form-item label="编码/代号:" prop="codeOrSerialNo">
+            <el-input
+              clearable
+              v-model="params.codeOrSerialNo"
+              placeholder="请输入"
+              maxlength="50"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="客户名称:" prop="name">
+            <el-input
+              clearable
+              placeholder="请输入"
+              v-model.trim="params.name"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="是否启用:" prop="codeOrSerialNo">
+            <el-select
+              v-model="params.status"
+              placeholder="请选择"
+              class="w100"
+              clearable
+            >
+              <el-option
+                v-for="item in statusList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6" style="text-align: right">
+          <el-button type="primary" @click="search">查询</el-button>
+          <el-button icon="el-icon-refresh-left" @click="reset">重置</el-button>
+        </el-col>
+      </el-row>
+    </el-form>
+    <el-container class="assets-dialog">
+      <el-aside width="200px" style="max-height:calc(100vh - 345px)" class="wrapper-assets">
+        <AssetTree
+          @handleNodeClick="handleNodeClick"
+          id="17"
+          :isFirstRefreshTable="false"
+          ref="treeList"
+        />
+      </el-aside>
+      <el-main>
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 405px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :current.sync="current"
+          :highlight-current-row="true"
+          @current-change="handleCurrentChange"
+          cache-key="eomContactPageTable"
+        >
+          <template v-slot:current="{row,_index}">
+            <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+          </template>
+        </ele-pro-table>
+      </el-main>
+    </el-container>
+
+    <div slot="footer">
+      <el-button type="primary" @click="confirm">确定</el-button>
+      <el-button @click="visible = false">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getTreeByPid } from '@/api/classifyManage';
+  import { getVendorPageList } from '@/api/factoryModel';
+  import AssetTree from './AssetTree';
+  export default {
+    components: { AssetTree },
+    data() {
+      return {
+        params: {},
+        visible: false,
+        radio: '',
+        statusList: [
+          { value: 1, label: '启用' },
+          { value: 2, label: '禁用' }
+        ],
+        delVisible: false,
+        // 加载状态
+        loading: false,
+        columns: [
+          {
+            width: 55,
+            columnKey: 'current',
+            slot: 'current',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '工厂编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'name',
+            label: '工厂名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'serialNo',
+            label: '工厂代号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'phone',
+            label: '客户电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'addressName',
+            label: '工厂地址',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              let addr =
+                '' + _row.addressName
+                  ? _row.addressName.replaceAll(',', '')
+                  : '';
+              addr += _row.address ? _row.address : '';
+              return addr;
+            }
+          },
+          {
+            prop: 'linkName',
+            label: '联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'linkPhone',
+            label: '联系人电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+
+          {
+            prop: 'parentName',
+            label: '上级单位',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return _row.status === 1 ? '启用' : '禁用';
+            }
+          },
+          {
+            prop: 'createUsername',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          }
+        ],
+        current: {},
+        curNodeData: {},
+        treeList: [],
+        treeLoading: false,
+        formData: {},
+        rootTreeId: null,
+        defaultProps: {
+          children: 'children',
+          label: 'name'
+        },
+        showEdit: true
+      };
+    },
+    created() {},
+    methods: {
+      /*  重置 */
+      reset() {
+        this.params = {};
+        this.search();
+      },
+      search() {
+        this.reload({ ...this.params });
+      },
+      handleNodeClick(data, node) {
+        this.curNodeData = data;
+    
+        this.reload({ categoryId: this.curNodeData.id });
+      },
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+      datasource({ page, limit, where, order }) {
+        return getVendorPageList({
+          pageNum: page,
+          size: limit,
+          type: 2,
+          ...where
+        });
+      },
+      handleCurrentChange(row){
+        this.radio = row.id
+      },
+      open() {
+        this.visible = true;
+        this.$nextTick(() => {
+          this.$refs.treeList.getTreeData();
+        });
+      },
+      confirm() {
+        
+        if(this.current.id){
+          this.radio ="";
+          this.$emit('success', this.current);
+          this.visible = false;
+        }else{
+          this.$message.error('请选择工厂');
+        }
+        
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .el-dialog__wrapper {
+    margin-top: 0 !important;
+    ::v-deep .el-aside {
+      background-color: #fff !important;
+      border: 1px solid #ccc;
+      transform: translateY(20px);
+    }
+  }
+
+
+</style>

+ 52 - 6
src/views/material/BOMmanage/components/detailedList.vue

@@ -74,8 +74,20 @@
       </template>
       </template>
 
 
       <template v-slot:factories="{ row }">
       <template v-slot:factories="{ row }">
-        <el-input v-model="row.factories" placeholder="请输入生产厂家" size="mini" style="width: 120px">
+        <div  style="display: flex;">
+          <el-input v-model="row.factories"  placeholder="请选择生产厂家" size="mini" style="width: 120px">
         </el-input>
         </el-input>
+        <!-- disabled -->
+        <!-- <el-button type="primary" @click="factoriesFn(row.code)">选择</el-button> -->
+          <!-- <el-select v-model="row.factories" size="mini" clearable class="ele-block" filterable placeholder="请选择生产厂家">
+            <el-option v-for="(item, index) in sccjList" :key="item.id + index" :value="item.id"
+              :label="item.name"></el-option>
+          </el-select> -->
+        </div>
+        
+
+        <!-- <el-input v-model="row.factories" placeholder="请输入生产厂家" size="mini" style="width: 120px">
+        </el-input> -->
       </template>
       </template>
 
 
       <!-- 表头工具栏 -->
       <!-- 表头工具栏 -->
@@ -90,6 +102,8 @@
     <bomTreeDialog ref="bomTreeDialogRef" @reload="bomClose" />
     <bomTreeDialog ref="bomTreeDialogRef" @reload="bomClose" />
 
 
     <standardOutput ref="standardOutputRefs" @selection="chooseStandardList"></standardOutput>
     <standardOutput ref="standardOutputRefs" @selection="chooseStandardList"></standardOutput>
+
+    <clientDialog ref="clientSelectionRef" @success="confirmSelection"></clientDialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -102,6 +116,9 @@ import {
   updateBatchBOM,
   updateBatchBOM,
   sourceBomVersion
   sourceBomVersion
 } from '@/api/material/BOM';
 } from '@/api/material/BOM';
+
+import clientDialog from "./clientDialog.vue"
+
 import { getByCode } from '@/api/system/dictionary-data';
 import { getByCode } from '@/api/system/dictionary-data';
 
 
 import bomTreeDialog from './bomTreeDialog.vue';
 import bomTreeDialog from './bomTreeDialog.vue';
@@ -109,7 +126,7 @@ import bomTreeDialog from './bomTreeDialog.vue';
 import standardOutput from './standardOutput.vue';
 import standardOutput from './standardOutput.vue';
 export default {
 export default {
   name: 'SystemDictionary',
   name: 'SystemDictionary',
-  components: { BOMSearch, bomTreeDialog, standardOutput },
+  components: { BOMSearch, bomTreeDialog, standardOutput,clientDialog },
 
 
   data() {
   data() {
     return {
     return {
@@ -259,7 +276,7 @@ export default {
           value: 2
           value: 2
         },
         },
         {
         {
-          label: '零',
+          label: '零',
           value: 3
           value: 3
         },
         },
         {
         {
@@ -267,10 +284,11 @@ export default {
           value: 4
           value: 4
         }
         }
       ],
       ],
+      isId: null,
       list: [],//表格数据
       list: [],//表格数据
       newList: [],
       newList: [],
       gysList: [],
       gysList: [],
-
+      sccjList:[],
       newTreeId: null,
       newTreeId: null,
       responsesList: [],
       responsesList: [],
       dictList: []
       dictList: []
@@ -332,6 +350,33 @@ export default {
   },
   },
 
 
   methods: {
   methods: {
+    factoriesFn(code){
+      this.isId = code;
+      this.$refs.clientSelectionRef.open();
+    },
+    // 选择工厂
+    confirmSelection(obj) {
+      let list  = this.list;
+      list.map(v=>{
+       
+        if(v.code == this.isId){
+          v.factories = obj.name;
+        } 
+      });
+      // arr.factories = obj.name;
+      
+
+      this.$nextTick(() => {
+        this.list = [...list];
+        this.$refs.table.setData(this.list)
+        // setTimeout(() => {
+        //   this.$refs.table.setData([...list])
+        // },200)
+      });
+    
+      this.$forceUpdate();
+    },
+
     /* 表格数据源 */
     /* 表格数据源 */
     datasource({ where, page, limit }) {
     datasource({ where, page, limit }) {
       // let that = this;
       // let that = this;
@@ -420,6 +465,7 @@ export default {
         this.gysList = res.list;
         this.gysList = res.list;
       });
       });
     },
     },
+    
 
 
     handleAdd() {
     handleAdd() {
       // // 打开树形对话框
       // // 打开树形对话框
@@ -497,11 +543,11 @@ export default {
           data.map(v => {
           data.map(v => {
             v.id = "";
             v.id = "";
           })
           })
-          console.log(data, '++++++++++++++');
+
           this.list = [...data, ...this.$refs.table.getData()];
           this.list = [...data, ...this.$refs.table.getData()];
           this.$refs.table.setData(this.list)
           this.$refs.table.setData(this.list)
         })
         })
-        console.log(data, '++++++++++++++');
+
       })
       })
 
 
 
 

+ 9 - 4
src/views/material/BOMmanage/detailsPop.vue

@@ -197,6 +197,7 @@
         >
         >
           <!-- // tree 组件 -->
           <!-- // tree 组件 -->
           <div class="ele-border-lighter sys-organization-list">
           <div class="ele-border-lighter sys-organization-list">
+
             <div>
             <div>
               版本号: &nbsp; &nbsp;
               版本号: &nbsp; &nbsp;
               <el-select
               <el-select
@@ -246,7 +247,6 @@
               @tab-click="handleClick"
               @tab-click="handleClick"
             >
             >
               <el-tab-pane label="属性" name="属性">
               <el-tab-pane label="属性" name="属性">
-             
                 <attribute :attributeData="currentNodeData"></attribute>
                 <attribute :attributeData="currentNodeData"></attribute>
               </el-tab-pane>
               </el-tab-pane>
 
 
@@ -451,7 +451,6 @@
       open(row) {
       open(row) {
         this.searchObj = row;
         this.searchObj = row;
 
 
-
         if (Object.prototype.hasOwnProperty.call(row, 'isWt') && row.isWt) {
         if (Object.prototype.hasOwnProperty.call(row, 'isWt') && row.isWt) {
           this.isWt = row.isWt;
           this.isWt = row.isWt;
           this.isFullscreen = false;
           this.isFullscreen = false;
@@ -459,9 +458,9 @@
 
 
         if (Object.prototype.hasOwnProperty.call(row, 'bomType')) {
         if (Object.prototype.hasOwnProperty.call(row, 'bomType')) {
           this.currentNodeData.bomType = row.bomType;
           this.currentNodeData.bomType = row.bomType;
-        
         }
         }
         this.drawer = true;
         this.drawer = true;
+
         this.getTreeData();
         this.getTreeData();
         this.getVersion();
         this.getVersion();
       },
       },
@@ -530,9 +529,15 @@
       handBomDetails(id) {
       handBomDetails(id) {
         if (id) {
         if (id) {
           getBomGetById(id).then((res) => {
           getBomGetById(id).then((res) => {
+
+            console.log(res,'res33333333333333333');
+
+            res.data.attributeType = res.data.category.attributeType;
+
             this.currentNodeData = res.data;
             this.currentNodeData = res.data;
-         
             this.searchObj.versions = this.currentNodeData.versions;
             this.searchObj.versions = this.currentNodeData.versions;
+
+
             this.$forceUpdate();
             this.$forceUpdate();
           });
           });
         } else {
         } else {