|  | @@ -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>
 |