ysy пре 2 година
родитељ
комит
5385a17728

+ 1 - 3
src/views/ledgerAssets/dryArea/components/dryArea-list.vue

@@ -34,7 +34,7 @@
 
     </ele-pro-table>
 
-    <user-edit :visible.sync="showEdit" :data="current" @done="reload" ref="userEdit" />
+    <user-edit :visible.sync="showEdit" :rootId="rootId" :data="current" @done="reload" ref="userEdit" />
 
   </div>
 </template>
@@ -55,8 +55,6 @@ export default {
   },
   data() {
     return {
-
-
       // 当前编辑数据
       current: null,
       // 是否显示编辑弹窗

+ 8 - 5
src/views/ledgerAssets/dryArea/components/user-edit.vue

@@ -3,6 +3,7 @@
   <ele-modal width="60%" :visible="visible" :append-to-body="true" :close-on-click-modal="true"
     custom-class="ele-dialog-form" :title="isUpdate ? '修改干燥区' : '新增干燥区'" @update:visible="updateVisible">
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+
       <el-row>
         <el-col :span="12">
           <el-form-item label="干燥区编码:" prop="code">
@@ -73,14 +74,18 @@ export default {
     // 弹窗是否打开
     visible: Boolean,
     // 修改回显的数据
-    data: Object
+    data: Object,
+    rootId: [Number, String],
   },
   data() {
     const defaultForm = {
       code: '',
       name: '',
       categoryLevelName: '',
-      status: ''
+      categoryLevelId: '',
+      status: '',
+      region: '',
+      specification: ''
     };
     return {
       defaultForm,
@@ -154,7 +159,7 @@ export default {
     },
 
     openCategory() {
-      this.$refs.categoryRefs.open(11, '选择分类')
+      this.$refs.categoryRefs.open(this.rootId, '选择分类')
     },
 
 
@@ -177,8 +182,6 @@ export default {
         if (this.data) {
           this.$util.assignObject(this.form, {
             ...this.data,
-            roleId: this.data.roleList.map((d) => d.id),
-            loginPwd: ''
           });
           this.isUpdate = true;
         } else {

+ 44 - 52
src/views/ledgerAssets/dryArea/index.vue

@@ -1,27 +1,14 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <ele-split-layout
-        width="266px"
-        allow-collapse
-        :right-style="{ overflow: 'hidden' }"
-      >
+      <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="11"
-              ref="treeList"
-            />
+            <AssetTree @handleNodeClick="handleNodeClick" @setRootId="setRootId" :id="rootId" ref="treeList" />
           </div>
         </div>
         <template v-slot:content>
-          <dryArea-list
-            v-if="current"
-            :category-id="current.id"
-            :root-id="rootId"
-          />
+          <dryArea-list v-if="current" :category-id="current.id" :root-id="rootId" />
         </template>
       </ele-split-layout>
     </el-card>
@@ -29,49 +16,54 @@
 </template>
 
 <script>
-  import AssetTree from '@/components/AssetTree';
-  import dryAreaList from './components/dryArea-list.vue';
+import AssetTree from '@/components/AssetTree';
+import dryAreaList from './components/dryArea-list.vue';
 
-  export default {
-    components: {
-      AssetTree,
-      dryAreaList
+export default {
+  components: {
+    AssetTree,
+    dryAreaList
+  },
+  data() {
+    return {
+      // 加载状态
+      loading: false,
+      // 表格选中数据
+      selection: [],
+      current: null,
+      rootId: 11
+    };
+  },
+  computed: {},
+  methods: {
+    handleNodeClick(info) {
+      this.current = info;
     },
-    data () {
-      return {
-        // 加载状态
-        loading: false,
-        // 表格选中数据
-        selection: [],
-        current: null,
-        rootId: null
-      };
-    },
-    computed: {},
-    methods: {
-      handleNodeClick (info) {
-        this.current = info;
-      },
-      // 获取根节点id
-      setRootId (id) {
+    // 获取根节点id
+    setRootId(id) {
+      if (id) {
         this.rootId = id;
       }
+
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .sys-organization-list {
-    height: calc(100vh - 264px);
-    box-sizing: border-box;
-    border-width: 1px;
-    border-style: solid;
-    overflow: auto;
-  }
-  .sys-organization-list :deep(.el-tree-node__content) {
-    height: 40px;
-    & > .el-tree-node__expand-icon {
-      margin-left: 10px;
-    }
+.sys-organization-list {
+  height: calc(100vh - 264px);
+  box-sizing: border-box;
+  border-width: 1px;
+  border-style: solid;
+  overflow: auto;
+}
+
+.sys-organization-list :deep(.el-tree-node__content) {
+  height: 40px;
+
+  &>.el-tree-node__expand-icon {
+    margin-left: 10px;
   }
+}
 </style>