Kaynağa Gözat

设备管理

quwangxin 2 yıl önce
ebeveyn
işleme
96bc987544

+ 13 - 13
src/views/classifyManage/treeClassify/details.vue

@@ -24,7 +24,7 @@
                 type="warning"
                 icon="el-icon-edit"
                 class="ele-btn-icon"
-                :disabled="!current"
+                :disabled="!current.id || current.id == rootId"
                 @click="openEdit(false)"
               >
                 编辑节点
@@ -158,7 +158,7 @@
       ListEdit
     },
     mixins: [dictMixins],
-    data() {
+    data () {
       return {
         loading: false,
         current: {},
@@ -174,13 +174,13 @@
 
     computed: {
       // 是否开启响应式布局
-      styleResponsive() {
+      styleResponsive () {
         return this.$store.state.theme.styleResponsive;
       },
-      rootId() {
+      rootId () {
         return this.$route.query.id;
       },
-      fullName() {
+      fullName () {
         let str = '';
         let codeStr = '';
         let node = this.curNode;
@@ -196,7 +196,7 @@
         );
       }
     },
-    created() {
+    created () {
       this.requestDict('类型用途');
       this.requestDict('分隔符');
       this.getTree().then(() => {
@@ -206,7 +206,7 @@
       });
     },
     methods: {
-      async reload(isEdit) {
+      async reload (isEdit) {
         if (isEdit) {
           this.getTree().then(() => {
             this.getDetail(this.current.id);
@@ -215,10 +215,10 @@
           this.getTree();
         }
       },
-      handlOpen() {
+      handlOpen () {
         this.$refs.addDialog.open();
       },
-      deleteCategory() {
+      deleteCategory () {
         this.$confirm('确定要删除选中节点吗?', '提示', {
           type: 'warning'
         }).then(async () => {
@@ -233,7 +233,7 @@
           }
         });
       },
-      async getTree() {
+      async getTree () {
         const res = await getTreeByPid(this.rootId);
 
         if (res.code == '0') {
@@ -243,7 +243,7 @@
 
         return Promise.reject();
       },
-      async getDetail(id) {
+      async getDetail (id) {
         this.loading = true;
         const res = await getInfoById(id);
         this.loading = false;
@@ -254,10 +254,10 @@
           });
         }
       },
-      openEdit(isAdd = true) {
+      openEdit (isAdd = true) {
         this.$refs.editRef.open(isAdd ? null : this.current, this.current);
       },
-      handleNodeClick(data, node) {
+      handleNodeClick (data, node) {
         this.curNode = node;
         this.getDetail(data.id);
       }

+ 2 - 2
src/views/classifyManage/treeClassify/index.vue

@@ -4,7 +4,7 @@
       <!-- 条件区 -->
       <classify-manage-search @search="reload" />
       <ele-pro-table ref="table" :columns="columns" :datasource="datasource">
-        <template v-slot:toolbar>
+        <!-- <template v-slot:toolbar>
           <el-button
             size="small"
             type="primary"
@@ -14,7 +14,7 @@
           >
             新建
           </el-button>
-        </template>
+        </template> -->
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link

+ 95 - 0
src/views/equipmentManage/components/equipment-search.vue

@@ -0,0 +1,95 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <el-form-item label="设备编码">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <el-form-item label="设备名称">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <el-form-item label="牌号">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <el-form-item label="型号">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
+        <el-form-item>
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh"
+            class="ele-btn-icon"
+            size="medium"
+            >重置</el-button
+          >
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        appType: ''
+      };
+      return {
+        options: [
+          { value: 0, label: '全部' },
+          { value: 1, label: '业务字典' },
+          { value: 2, label: '数据字典' }
+        ],
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search () {
+        if (this.where.appType === 0) {
+          this.where.appType = '';
+        }
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset () {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 360 - 0
src/views/equipmentManage/components/link-material-dialog.vue

@@ -0,0 +1,360 @@
+<template>
+  <ele-modal :visible.sync="visible" title="" width="80%" @close="cancel">
+    <el-row :gutter="40">
+      <el-col :span="12">
+        <headerTitle>
+          <template v-slot:title>
+            可选
+            <el-button
+              type="primary"
+              class="ml20"
+              size="mini"
+              @click="handleConect"
+              >关联</el-button
+            >
+            <el-button
+              type="primary"
+              size="mini"
+              icon="icon-search"
+              @click="reload"
+              >搜索</el-button
+            >
+          </template>
+        </headerTitle>
+        <el-form label-width="100px">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item :label="`分类`">
+                <categorySelect
+                  :pid="type"
+                  :key="type"
+                  v-model="where.categoryLevelGroupId"
+                />
+                <!-- <el-input
+                  placeholder="请输入"
+                  clearable
+                  v-model="where.categoryLevelGroupId"
+                ></el-input> -->
+              </el-form-item></el-col
+            >
+            <el-col :span="12">
+              <el-form-item :label="`编码`">
+                <el-input
+                  placeholder="请输入"
+                  clearable
+                  v-model="where.code"
+                ></el-input></el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item :label="`名称`">
+                <el-input
+                  placeholder="请输入"
+                  clearable
+                  v-model="where.name"
+                ></el-input></el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item label="型号">
+                <el-input
+                  placeholder="请输入"
+                  clearable
+                  v-model="where.modelType"
+                ></el-input></el-form-item
+            ></el-col>
+          </el-row>
+        </el-form>
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasourceShow"
+          :selection.sync="selection"
+          cache-key="link-material-dialog"
+          height="45vh"
+          :initLoad="false"
+          :need-page="false"
+        >
+        </ele-pro-table>
+      </el-col>
+      <el-col :span="12">
+        <headerTitle
+          ><template v-slot:title
+            >已关联
+            <el-button
+              type="primary"
+              class="ml20"
+              size="mini"
+              @click="handleCancelConect"
+              >取消关联</el-button
+            >
+            <el-button
+              type="primary"
+              size="mini"
+              icon="icon-search"
+              @click="reloadRight"
+              >搜索</el-button
+            ></template
+          ></headerTitle
+        >
+        <el-form label-width="100px">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item :label="`分类`">
+                <categorySelect
+                  :pid="type"
+                  :key="type"
+                  v-model="whereRight.categoryLevelGroupId"
+                /> </el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item :label="`编码`">
+                <el-input
+                  clearable
+                  placeholder="请输入"
+                  v-model="whereRight.code"
+                ></el-input></el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item :label="`名称`">
+                <el-input
+                  clearable
+                  placeholder="请输入"
+                  v-model="whereRight.name"
+                ></el-input></el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item label="型号">
+                <el-input
+                  clearable
+                  placeholder="请输入"
+                  v-model="whereRight.modelType"
+                ></el-input></el-form-item
+            ></el-col>
+          </el-row>
+        </el-form>
+        <ele-pro-table
+          ref="tableRight"
+          :columns="columnsRight"
+          :datasource="datasourceRightShow"
+          :selection.sync="selectionRight"
+          height="45vh"
+          :initLoad="false"
+          :need-page="false"
+          cache-key="link-material-dialog-right"
+        >
+        </ele-pro-table
+      ></el-col>
+    </el-row>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import {
+    getRelatesInformationList,
+    unassociated,
+    productTieUpMaterial
+  } from '@/api/material/product.js';
+  import dictMixins from '@/mixins/dictMixins';
+  import categorySelect from '@/components/CommomSelect/category-select.vue';
+  export default {
+    mixins: [dictMixins],
+    components: { categorySelect },
+    data () {
+      return {
+        visible: false,
+        row: {},
+        datasource: [],
+        datasourceShow: [],
+        datasourceRightShow: [],
+        datasourceRight: [],
+        selectionRight: [],
+        selection: [],
+        whereRight: {},
+        where: {},
+        type: '',
+        idMap: {
+          6: '1678278090828136449',
+          5: '1678277781556936705'
+        }
+      };
+    },
+    created () {
+      this.requestDict('类型用途');
+    },
+    computed: {
+      catogaryName () {
+        return this.getDictValue('类型用途', this.type);
+      },
+      dict () {},
+      columns () {
+        return [
+          {
+            type: 'selection',
+            align: 'center'
+          },
+          {
+            label: `${this.catogaryName}分类`,
+            prop: 'categoryLevelGroupName'
+          },
+          {
+            label: `${this.catogaryName}编码`,
+            prop: 'code'
+          },
+          {
+            label: `${this.catogaryName}名称`,
+            prop: 'name'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          }
+        ];
+      },
+      columnsRight () {
+        return [
+          {
+            type: 'selection',
+            align: 'center'
+          },
+          {
+            label: `${this.catogaryName}分类`,
+            prop: 'categoryLevelGroupName'
+          },
+          {
+            label: `${this.catogaryName}编码`,
+            prop: 'code'
+          },
+          {
+            label: `${this.catogaryName}名称`,
+            prop: 'name'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          }
+        ];
+      }
+    },
+    methods: {
+      open (type, row) {
+        this.type = type;
+        this.row = row;
+        this.getDatasource();
+        this.getDatasourceRight();
+        this.visible = true;
+      },
+      cancel () {
+        this.visible = false;
+      },
+      async save () {
+        if (!this.datasourceRightShow.length) {
+          return this.$message.error('请添加关联数据');
+        }
+        const params = {
+          mainCategoryId: this.row.categoryLevelId,
+          mainCategoryLevelRootId: this.row.categoryLevelGroupId,
+          materialDetailsPOList: this.datasourceRightShow.map((i) => ({
+            ...i,
+            categoryLevelRootId: this.type
+          }))
+        };
+        await productTieUpMaterial(params);
+        this.cancel();
+        this.$message.success('操作成功!');
+        this.$emit('success');
+      },
+      handleConect () {
+        if (!this.selection.length) {
+          return this.$message.error('请选择关联数据');
+        }
+        this.datasource = this.datasource.filter((i) =>
+          this.selection.find((t) => t.categoryId != i.categoryId)
+        );
+        this.datasourceShow = this.datasourceShow.filter((i) =>
+          this.selection.find((t) => t.categoryId != i.categoryId)
+        );
+
+        this.datasourceRightShow.push(...this.selection);
+        this.datasourceRight.push(...this.selection);
+
+        this.selection = [];
+      },
+      handleCancelConect () {
+        if (!this.selectionRight.length) {
+          return this.$message.error('请选择取消关联数据');
+        }
+
+        this.datasourceRight = this.datasourceRight.filter((i) =>
+          this.selectionRight.find((t) => t.categoryId != i.categoryId)
+        );
+        this.datasourceRightShow = this.datasourceRightShow.filter((i) =>
+          this.selectionRight.find((t) => t.categoryId != i.categoryId)
+        );
+
+        this.datasourceShow.push(...this.selectionRight);
+        this.datasource.push(...this.selectionRight);
+
+        this.selectionRight = [];
+      },
+      reload () {
+        this.datasourceShow = this.datasource.filter((item) => {
+          return (
+            (!this.where.categoryLevelGroupId ||
+              item.categoryLevelGroupId.includes(
+                this.where.categoryLevelGroupId
+              )) &&
+            (!this.where.code || item.code.includes(this.where.code)) &&
+            (!this.where.name || item.name.includes(this.where.name)) &&
+            (!this.where.modelType ||
+              item.modelType.includes(this.where.modelType))
+          );
+        });
+      },
+      reloadRight () {
+        this.datasourceRightShow = this.datasourceRight.filter((item) => {
+          return (
+            (!this.whereRight.categoryLevelGroupId ||
+              item.categoryLevelGroupId.includes(
+                this.whereRight.categoryLevelGroupId
+              )) &&
+            (!this.whereRight.code ||
+              item.code.includes(this.whereRight.code)) &&
+            (!this.whereRight.name ||
+              item.name.includes(this.whereRight.name)) &&
+            (!this.whereRight.modelType ||
+              item.modelType.includes(this.whereRight.modelType))
+          );
+        });
+      },
+      async getDatasource () {
+        const data = await unassociated({
+          categoryLevelGroupId: this.idMap[this.type]
+        });
+        this.datasource = data.slice(0);
+        this.datasourceShow = data.slice(0);
+      },
+      async getDatasourceRight () {
+        const data = await getRelatesInformationList({
+          mainCategoryId: this.row.categoryLevelId,
+          // categoryLevelGroupId: this.idMap[this.type],
+          categoryLevelRootId: this.type
+        });
+        this.datasourceRight = data.slice(0);
+        this.datasourceRightShow = data.slice(0);
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .ml20 {
+    margin-left: 20px;
+  }
+  .footer {
+    text-align: right;
+  }
+</style>

+ 131 - 0
src/views/equipmentManage/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <EquipmentSearch @search="reload" />
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            ref="assetTreeRef"
+            id="4"
+            @handleNodeClick="handleNodeClick"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            height="calc(100vh - 350px)"
+            :need-page="false"
+            :initLoad="false"
+            :current.sync="current"
+            highlight-current-row
+            class="dict-table"
+            tool-class="ele-toolbar-actions"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:toolbar>
+              <el-button type="primary" @click="handleLink('5')"
+                >关联模具</el-button
+              >
+              <el-button type="primary" @click="handleLink('6')"
+                >关联备品备件</el-button
+              >
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+    <linkMaterialDialog ref="linkMaterialDialogRef" @success="success" />
+  </div>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import EquipmentSearch from './components/equipment-search.vue';
+  import linkMaterialDialog from './components/link-material-dialog.vue';
+  import { getList } from '@/api/classifyManage/itemInformation';
+
+  export default {
+    name: 'SystemDictionary',
+    components: { AssetTree, EquipmentSearch, linkMaterialDialog },
+    data () {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            prop: 'code',
+            label: '设备编码'
+          },
+          {
+            prop: 'name',
+            label: '设备名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号'
+          },
+          {
+            prop: 'modelType',
+            label: '型号'
+          },
+          {
+            prop: 'measuringUnit',
+            label: '计量单位'
+          },
+          {
+            prop: 'packingUnit',
+            label: '包装单位'
+          }
+        ],
+        categoryLevelId: '9',
+        current: null
+      };
+    },
+
+    methods: {
+      /* 表格数据源 */
+      datasource ({ page, where, limit }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId
+        });
+      },
+      success () {
+        this.reload();
+      },
+      handleLink (type) {
+        if (!this.current) {
+          return this.$message.error('请选择设备!');
+        }
+
+        this.$refs.linkMaterialDialogRef.open(type, this.current);
+      },
+      /* 刷新表格 */
+      reload () {
+        this.$refs.table.reload();
+      },
+      handleNodeClick (data) {
+        this.categoryLevelId = data.id;
+        this.reload();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 33 - 39
src/views/ledgerAssets/boat/index.vue

@@ -1,43 +1,40 @@
 <template>
   <div class="ele-body">
-     <el-card shadow="never" v-loading="loading">
-       <ele-split-layout
-         width="266px"
-         allow-collapse
-         :right-style="{ overflow: 'hidden' }"
-       >
-         <div>
-           <div class="ele-border-lighter sys-organization-list">
-             <AssetTree
-               @handleNodeClick="handleNodeClick"
-               @setRootId="setRootId"
-               :type="'2'"
-               :paramsType="'type'"
-               ref="treeList"
-             />
-           </div>
-         </div>
-         <template v-slot:content>
-           <boat-list
-             v-if="current"
-             :category-id="current.id"
-             :root-id="rootId"
-           />
-         </template>
-       </ele-split-layout>
-     </el-card>
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="ele-border-lighter sys-organization-list">
+            <AssetTree
+              @handleNodeClick="handleNodeClick"
+              @setRootId="setRootId"
+              id="8"
+              ref="treeList"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <boat-list
+            v-if="current"
+            :category-id="current.id"
+            :root-id="rootId"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
   </div>
 </template>
 
 <script>
   import AssetTree from '@/components/AssetTree';
   import BoatList from './components/boat-list.vue';
-  import {
-    getBoatList
-  } from '@/api/ledgerAssets';
+  import { getBoatList } from '@/api/ledgerAssets';
   export default {
     components: {
-      AssetTree ,
+      AssetTree,
       BoatList
     },
     data () {
@@ -46,22 +43,19 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null,
-        rootId:null,
+        current: null,
+        rootId: null
       };
     },
-    computed: {
-
-    },
+    computed: {},
     methods: {
       handleNodeClick (info) {
-        this.current = info
+        this.current = info;
       },
       // 获取根节点id
-      setRootId(id){
-        this.rootId = id
+      setRootId (id) {
+        this.rootId = id;
       }
-
     }
   };
 </script>

+ 1 - 1
src/views/ledgerAssets/equipment/index.vue

@@ -11,7 +11,7 @@
             <AssetTree
               @handleNodeClick="handleNodeClick"
               @setRootId="setRootId"
-              :type="'1'"
+              id="4"
               :paramsType="'type'"
               ref="treeList"
             />

+ 33 - 38
src/views/ledgerAssets/material/index.vue

@@ -1,43 +1,40 @@
 <template>
   <div class="ele-body">
-     <el-card shadow="never" v-loading="loading">
-       <ele-split-layout
-         width="266px"
-         allow-collapse
-         :right-style="{ overflow: 'hidden' }"
-       >
-         <div>
-           <div class="ele-border-lighter sys-organization-list">
-             <AssetTree
-               @handleNodeClick="handleNodeClick"
-               @setRootId="setRootId"
-               :type="'3'"
-               :paramsType="'type'"
-               ref="treeList"
-             />
-           </div>
-         </div>
-         <template v-slot:content>
-           <material-list
-             v-if="current"
-             :category-id="current.id"
-             :root-id="rootId"
-           />
-         </template>
-       </ele-split-layout>
-     </el-card>
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="ele-border-lighter sys-organization-list">
+            <AssetTree
+              @handleNodeClick="handleNodeClick"
+              @setRootId="setRootId"
+              id="1"
+              ref="treeList"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <material-list
+            v-if="current"
+            :category-id="current.id"
+            :root-id="rootId"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
   </div>
 </template>
 
 <script>
   import AssetTree from '@/components/AssetTree';
   import MaterialList from './components/material-list.vue';
-  import {
-    getBoatList
-  } from '@/api/ledgerAssets';
+  import { getBoatList } from '@/api/ledgerAssets';
   export default {
     components: {
-      AssetTree ,
+      AssetTree,
       MaterialList
     },
     data () {
@@ -46,20 +43,18 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null,
-        rootId:null,
+        current: null,
+        rootId: null
       };
     },
-    computed: {
-
-    },
+    computed: {},
     methods: {
       handleNodeClick (info) {
-        this.current = info
+        this.current = info;
       },
       // 获取根节点id
-      setRootId(id){
-        this.rootId = id
+      setRootId (id) {
+        this.rootId = id;
       }
     }
   };

+ 32 - 35
src/views/ledgerAssets/mould/index.vue

@@ -1,31 +1,30 @@
 <template>
   <div class="ele-body">
-     <el-card shadow="never" v-loading="loading">
-       <ele-split-layout
-         width="266px"
-         allow-collapse
-         :right-style="{ overflow: 'hidden' }"
-       >
-         <div>
-           <div class="ele-border-lighter sys-organization-list">
-             <AssetTree
-               @handleNodeClick="handleNodeClick"
-               @setRootId="setRootId"
-               :type="'6'"
-               :paramsType="'type'"
-               ref="treeList"
-             />
-           </div>
-         </div>
-         <template v-slot:content>
-           <mould-list
-             v-if="current"
-             :category-id="current.id"
-             :root-id="rootId"
-           />
-         </template>
-       </ele-split-layout>
-     </el-card>
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="ele-border-lighter sys-organization-list">
+            <AssetTree
+              @handleNodeClick="handleNodeClick"
+              @setRootId="setRootId"
+              id="5"
+              ref="treeList"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <mould-list
+            v-if="current"
+            :category-id="current.id"
+            :root-id="rootId"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
   </div>
 </template>
 
@@ -35,7 +34,7 @@
 
   export default {
     components: {
-      AssetTree ,
+      AssetTree,
       MouldList
     },
     data () {
@@ -44,20 +43,18 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null,
-        rootId:null
+        current: null,
+        rootId: null
       };
     },
-    computed: {
-
-    },
+    computed: {},
     methods: {
       handleNodeClick (info) {
-        this.current = info
+        this.current = info;
       },
       // 获取根节点id
-      setRootId(id){
-        this.rootId = id
+      setRootId (id) {
+        this.rootId = id;
       }
     }
   };

+ 32 - 35
src/views/ledgerAssets/sparepart/index.vue

@@ -1,31 +1,30 @@
 <template>
   <div class="ele-body">
-     <el-card shadow="never" v-loading="loading">
-       <ele-split-layout
-         width="266px"
-         allow-collapse
-         :right-style="{ overflow: 'hidden' }"
-       >
-         <div>
-           <div class="ele-border-lighter sys-organization-list">
-             <AssetTree
-               @handleNodeClick="handleNodeClick"
-               @setRootId="setRootId"
-               :type="'7'"
-               :paramsType="'type'"
-               ref="treeList"
-             />
-           </div>
-         </div>
-         <template v-slot:content>
-           <sparepart-list
-             v-if="current"
-             :category-id="current.id"
-             :root-id="rootId"
-           />
-         </template>
-       </ele-split-layout>
-     </el-card>
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="ele-border-lighter sys-organization-list">
+            <AssetTree
+              @handleNodeClick="handleNodeClick"
+              @setRootId="setRootId"
+              id="6"
+              ref="treeList"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <sparepart-list
+            v-if="current"
+            :category-id="current.id"
+            :root-id="rootId"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
   </div>
 </template>
 
@@ -35,7 +34,7 @@
 
   export default {
     components: {
-      AssetTree ,
+      AssetTree,
       SparepartList
     },
     data () {
@@ -44,20 +43,18 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null,
-        rootId:null
+        current: null,
+        rootId: null
       };
     },
-    computed: {
-
-    },
+    computed: {},
     methods: {
       handleNodeClick (info) {
-        this.current = info
+        this.current = info;
       },
       // 获取根节点id
-      setRootId(id){
-        this.rootId = id
+      setRootId (id) {
+        this.rootId = id;
       }
     }
   };

+ 32 - 35
src/views/ledgerAssets/turnoverCar/index.vue

@@ -1,31 +1,30 @@
 <template>
   <div class="ele-body">
-     <el-card shadow="never" v-loading="loading">
-       <ele-split-layout
-         width="266px"
-         allow-collapse
-         :right-style="{ overflow: 'hidden' }"
-       >
-         <div>
-           <div class="ele-border-lighter sys-organization-list">
-             <AssetTree
-               @handleNodeClick="handleNodeClick"
-               @setRootId="setRootId"
-               :type="'5'"
-               :paramsType="'type'"
-               ref="treeList"
-             />
-           </div>
-         </div>
-         <template v-slot:content>
-           <turnovercar-list
-             v-if="current"
-             :category-id="current.id"
-             :root-id="rootId"
-           />
-         </template>
-       </ele-split-layout>
-     </el-card>
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="ele-border-lighter sys-organization-list">
+            <AssetTree
+              @handleNodeClick="handleNodeClick"
+              @setRootId="setRootId"
+              id="7"
+              ref="treeList"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <turnovercar-list
+            v-if="current"
+            :category-id="current.id"
+            :root-id="rootId"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
   </div>
 </template>
 
@@ -35,7 +34,7 @@
 
   export default {
     components: {
-      AssetTree ,
+      AssetTree,
       TurnovercarList
     },
     data () {
@@ -44,20 +43,18 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null,
-        rootId:null
+        current: null,
+        rootId: null
       };
     },
-    computed: {
-
-    },
+    computed: {},
     methods: {
       handleNodeClick (info) {
-        this.current = info
+        this.current = info;
       },
       // 获取根节点id
-      setRootId(id){
-        this.rootId = id
+      setRootId (id) {
+        this.rootId = id;
       }
     }
   };

+ 1 - 0
src/views/material/productLinkMaterial/components/link-material-dialog.vue

@@ -314,6 +314,7 @@
           }))
         };
         await productTieUpMaterial(params);
+        this.cancel();
 
         this.$message.success('操作成功!');
         this.$emit('success');