ysy hace 2 años
padre
commit
eb142399f7

+ 1 - 5
README.md

@@ -1,6 +1,2 @@
-node版本----v16.17.1
+node版本----v16.20.0
 
-
-依赖问题:
-下载7-Zip https://sparanoid.com/lab/7z/
-解压node_modules.7z即可

+ 34 - 0
src/api/ledgerAssets/dryArea.js

@@ -0,0 +1,34 @@
+import request from '@/utils/request';
+
+/*  干燥区台账  */
+
+
+// 列表 
+export async function getList (data) {
+    let par = new URLSearchParams(data);
+    const res = await request.get(`/main/aridregion/page?` + par, {});
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+  
+
+  // 新增
+  export async function save (data) {
+    const res = await request.post(`/main/aridregion/save`, data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+
+  // 编辑
+  export async function update (data) {
+    const res = await request.put(`/main/aridregion/update`, data);
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+  

+ 144 - 0
src/views/ledgerAssets/dryArea/components/dryArea-list.vue

@@ -0,0 +1,144 @@
+<template>
+  <div>
+    <dryArea-search 
+      @search="reload"
+      ref="searchRef"
+    >
+    </dryArea-search>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          class="ele-btn-icon"
+          @click="btnExport"
+        >
+          导出
+        </el-button>
+      </template>
+      <!-- 编码列 -->
+      <template v-slot:code="{ row }">
+        <el-link @click="details(row)" type="primary" :underline="false">
+          {{ row.code }}
+        </el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import dryAreaSearch from './dryArea-search.vue';
+  import { getBoatList  } from '@/api/ledgerAssets';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    components: { dryAreaSearch },
+    props: {
+      // 类别id
+      categoryId: [Number, String],
+      rootId: [Number, String],
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '干燥区编码',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code',
+          },
+          {
+            prop: 'name',
+            label: '干燥区名称',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+   
+          {
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+ 
+ 
+          {
+            prop: 'region',
+            label: '位置',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+       
+     
+        
+        ]
+      };
+    },
+    created () {
+       this.requestDict('角度');
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getBoatList({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      // 跳转到详情页
+      details ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/boat/detail',
+          query: {
+            id
+          }
+        })
+      },
+
+
+    },
+    watch: {
+      // 监听类别id变化
+      categoryId() {
+        this.reload();
+      }
+    }
+  };
+</script>

+ 81 - 0
src/views/ledgerAssets/dryArea/components/dryArea-search.vue

@@ -0,0 +1,81 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="50px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="名称:">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="规格:">
+          <el-input clearable v-model="where.specification" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label-width="50px">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+          >重置</el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        specification:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 77 - 0
src/views/ledgerAssets/dryArea/index.vue

@@ -0,0 +1,77 @@
+<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"
+              id="11"
+              ref="treeList"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <dryArea-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 dryAreaList from './components/dryArea-list.vue';
+
+  export default {
+    components: {
+      AssetTree,
+      dryAreaList
+    },
+    data () {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current: null,
+        rootId: null
+      };
+    },
+    computed: {},
+    methods: {
+      handleNodeClick (info) {
+        this.current = info;
+      },
+      // 获取根节点id
+      setRootId (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;
+    }
+  }
+</style>