Parcourir la source

新增凭证配置(85%)

caojunjie il y a 3 ans
Parent
commit
06861a1290

+ 20 - 0
src/api/base/credentials.js

@@ -0,0 +1,20 @@
+import request from '@/router/axios';
+
+//凭证配置列表
+export function customerList(data,moduleName) {
+    return request({
+        url: 'api/trade-finance/jdmodule/list',
+        method: 'get',
+        params: {
+            ...data,
+            moduleName
+        }
+    })
+}
+//模块名称字典获取
+export const getDeptLazyTree = () => {
+    return request({
+        url: '/api/blade-system/dict-biz/dictionary?code=voucher_type',
+        method: 'get'
+    })
+}

+ 139 - 0
src/views/base/credentials.vue

@@ -0,0 +1,139 @@
+<template>
+  <div>
+    <basic-container style="width: 20%;float: left">
+      <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
+    </basic-container>
+    <basic-container style="width: 80%;float: right">
+      <avue-crud
+          :data="data"
+          :option="option"
+          :page.sync="page"
+          @on-load="onLoad"
+          @refresh-change="refreshChange"
+      ></avue-crud>
+    </basic-container>
+  </div>
+</template>
+<script>
+import {customerList,getDeptLazyTree} from '@/api/base/credentials'
+export default {
+  name: "credentials",
+  data() {
+    return {
+      page: {
+        size: 10,
+        current:1
+      },
+      treeData: [],
+      treeOption: {
+        nodeKey: 'id',
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          console.log(node)
+          const parentId = (node.level === 0) ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(res.data.data.map(item => {
+              return {
+                ...item,
+                leaf: !item.hasChildren
+              }
+            }))
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: 'small',
+        props: {
+          labelText: '标题',
+          label: 'dictValue',
+          value: 'dictValue',
+          children: 'children'
+        }
+      },
+      data: [],
+      treeDeptName:'',
+      option: {
+        addBtn: false,
+        align: 'center',
+        menuAlign: 'center',
+        column: [
+          {
+            label: '模块名称',
+            prop: 'module',
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=voucher_type",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
+            search:true
+          },
+          {
+            label: '币种代码',
+            prop: 'dc'
+          },
+          {
+            label: '币种名称',
+            prop: 'projectCode'
+          },
+          {
+            label: '凭证类型',
+            prop: 'projectName'
+          },
+          {
+            label: '类型名称',
+            prop: 'accountName'
+          },
+          {
+            label: '分录类型',
+            prop: 'accountName'
+          },
+          {
+            label: '科目代码',
+            prop: 'accountName'
+          },
+          {
+            label: '科目名称',
+            prop: 'accountName'
+          },
+          {
+            label: '金额方向',
+            prop: 'accountName'
+          },
+          {
+            label: '静态值',
+            prop: 'accountName'
+          },
+          {
+            label: '附加公司',
+            prop: 'accountName'
+          }
+        ]
+      }
+    }
+  },
+  methods: {
+    onLoad(page) {
+      customerList({size: page.size,current: page.current},this.treeDeptName).then(res=>{
+        console.log(res)
+        this.data = res.data.data.records
+        this.page.total = res.data.data.total
+      })
+    },
+    nodeClick(data) {
+      console.log(data)
+      this.treeDeptName = data.dictValue;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    refreshChange(){
+      this.onLoad(this.page)
+    }
+  }
+
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/views/basicData/commodityType/index.vue

@@ -229,6 +229,7 @@ export default {
         nodeKey: 'id',
         lazy: true,
         treeLoad: function (node, resolve) {
+          console.log(node)
           const parentId = (node.level === 0) ? 0 : node.data.id;
           getDeptLazyTree(parentId).then(res => {
             resolve(res.data.data.map(item => {
@@ -353,7 +354,6 @@ export default {
   watch: {
     'form.tenantId'() {
       if (this.form.tenantId !== '' && this.initFlag) {
-        console.log(this.form)
         this.initData(0);
       }
     },