|  | @@ -1,35 +1,51 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  |    <div>
 | 
	
		
			
				|  |  | -    <basic-container style="width: 20%;float: left">
 | 
	
		
			
				|  |  | +    <basic-container style="width: 25%;float: left">
 | 
	
		
			
				|  |  | +      <avue-tree :option="getList" :data="accountList" @node-click="nodeClickTwo"/>
 | 
	
		
			
				|  |  | +    </basic-container>
 | 
	
		
			
				|  |  | +    <basic-container style="width: 15%;float: left">
 | 
	
		
			
				|  |  |        <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
 | 
	
		
			
				|  |  |      </basic-container>
 | 
	
		
			
				|  |  | -    <basic-container style="width: 80%;float: right">
 | 
	
		
			
				|  |  | +    <basic-container style="width: 60%;float: right">
 | 
	
		
			
				|  |  |        <avue-crud
 | 
	
		
			
				|  |  |            :data="data"
 | 
	
		
			
				|  |  |            :option="option"
 | 
	
		
			
				|  |  |            :page.sync="page"
 | 
	
		
			
				|  |  |            @on-load="onLoad"
 | 
	
		
			
				|  |  | +          @row-del="rowDel"
 | 
	
		
			
				|  |  | +          @row-save="rowSave"
 | 
	
		
			
				|  |  | +          @row-update="rowUpdate"
 | 
	
		
			
				|  |  | +          @search-change="searchChange"
 | 
	
		
			
				|  |  | +          @search-reset="searchReset"
 | 
	
		
			
				|  |  |            @refresh-change="refreshChange"
 | 
	
		
			
				|  |  |        ></avue-crud>
 | 
	
		
			
				|  |  |      </basic-container>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | -import {customerList,getDeptLazyTree} from '@/api/base/credentials'
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +  customerList,
 | 
	
		
			
				|  |  | +  getAccountList,
 | 
	
		
			
				|  |  | +  getDeptLazyTree,
 | 
	
		
			
				|  |  | +  jdmoduleDelete,
 | 
	
		
			
				|  |  | +  jdmoduleSave,
 | 
	
		
			
				|  |  | +  jdmoduleUpdate
 | 
	
		
			
				|  |  | +} from '@/api/base/credentials'
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: "credentials",
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        page: {
 | 
	
		
			
				|  |  |          size: 10,
 | 
	
		
			
				|  |  | -        current:1
 | 
	
		
			
				|  |  | +        current: 1
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        treeData: [],
 | 
	
		
			
				|  |  | +      accountList: [],
 | 
	
		
			
				|  |  |        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 => {
 | 
	
	
		
			
				|  | @@ -50,10 +66,37 @@ export default {
 | 
	
		
			
				|  |  |            children: 'children'
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | +      getList: {
 | 
	
		
			
				|  |  | +        nodeKey: 'id',
 | 
	
		
			
				|  |  | +        lazy: true,
 | 
	
		
			
				|  |  | +        treeLoad: function (node, resolve) {
 | 
	
		
			
				|  |  | +          const parentId = (node.level === 0) ? 0 : node.data.id;
 | 
	
		
			
				|  |  | +          getAccountList(parentId).then(res => {
 | 
	
		
			
				|  |  | +            resolve(res.data.data.map(item => {
 | 
	
		
			
				|  |  | +              return {
 | 
	
		
			
				|  |  | +                ...item,
 | 
	
		
			
				|  |  | +                leaf: !item.hasChildren
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            }))
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        addBtn: false,
 | 
	
		
			
				|  |  | +        menu: false,
 | 
	
		
			
				|  |  | +        size: 'small',
 | 
	
		
			
				|  |  | +        props: {
 | 
	
		
			
				|  |  | +          labelText: '标题',
 | 
	
		
			
				|  |  | +          label: 'accountName',
 | 
	
		
			
				|  |  | +          value: 'accountId',
 | 
	
		
			
				|  |  | +          children: 'children'
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |        data: [],
 | 
	
		
			
				|  |  | -      treeDeptName:'',
 | 
	
		
			
				|  |  | +      treeDeptName: '',
 | 
	
		
			
				|  |  | +      accountId: '',
 | 
	
		
			
				|  |  |        option: {
 | 
	
		
			
				|  |  | -        addBtn: false,
 | 
	
		
			
				|  |  | +        searchMenuPosition: "right",
 | 
	
		
			
				|  |  | +        searchMenuSpan: 18,
 | 
	
		
			
				|  |  | +        index: true,
 | 
	
		
			
				|  |  |          align: 'center',
 | 
	
		
			
				|  |  |          menuAlign: 'center',
 | 
	
		
			
				|  |  |          column: [
 | 
	
	
		
			
				|  | @@ -65,72 +108,173 @@ export default {
 | 
	
		
			
				|  |  |              props: {
 | 
	
		
			
				|  |  |                label: "dictValue",
 | 
	
		
			
				|  |  |                value: "dictValue"
 | 
	
		
			
				|  |  | -            },
 | 
	
		
			
				|  |  | -            search:true
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '币种代码',
 | 
	
		
			
				|  |  | -            prop: 'dc'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '币种名称',
 | 
	
		
			
				|  |  | -            prop: 'projectCode'
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  | +            label: '业务币种',
 | 
	
		
			
				|  |  | +            display: false,
 | 
	
		
			
				|  |  | +            children: [{
 | 
	
		
			
				|  |  | +              label: '币种代码',
 | 
	
		
			
				|  |  | +              prop: 'currencyCode',
 | 
	
		
			
				|  |  | +              type: "select",
 | 
	
		
			
				|  |  | +              dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
 | 
	
		
			
				|  |  | +              props: {
 | 
	
		
			
				|  |  | +                label: "dictValue",
 | 
	
		
			
				|  |  | +                value: "dictValue"
 | 
	
		
			
				|  |  | +              },
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }],
 | 
	
		
			
				|  |  | +              search: true
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +              label: '币种名称',
 | 
	
		
			
				|  |  | +              prop: 'currency',
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }]
 | 
	
		
			
				|  |  | +            }]
 | 
	
		
			
				|  |  | +          }, {
 | 
	
		
			
				|  |  |              label: '凭证类型',
 | 
	
		
			
				|  |  | -            prop: 'projectName'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '类型名称',
 | 
	
		
			
				|  |  | -            prop: 'accountName'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '分录类型',
 | 
	
		
			
				|  |  | -            prop: 'accountName'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '科目代码',
 | 
	
		
			
				|  |  | -            prop: 'accountName'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '科目名称',
 | 
	
		
			
				|  |  | -            prop: 'accountName'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | +            display: false,
 | 
	
		
			
				|  |  | +            children: [{
 | 
	
		
			
				|  |  | +              label: '凭证类型',
 | 
	
		
			
				|  |  | +              prop: 'voucherType',
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }]
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +              label: '凭证名称',
 | 
	
		
			
				|  |  | +              prop: 'voucher',
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }]
 | 
	
		
			
				|  |  | +            }]
 | 
	
		
			
				|  |  | +          }, {
 | 
	
		
			
				|  |  | +            label: '分录',
 | 
	
		
			
				|  |  | +            display: false,
 | 
	
		
			
				|  |  | +            children: [{
 | 
	
		
			
				|  |  | +              label: '分录类型',
 | 
	
		
			
				|  |  | +              prop: 'projectType',
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }]
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +              label: '科目代码',
 | 
	
		
			
				|  |  | +              prop: 'projectCode',
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }]
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +              label: '科目名称',
 | 
	
		
			
				|  |  | +              prop: 'projectName',
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }]
 | 
	
		
			
				|  |  | +            }]
 | 
	
		
			
				|  |  | +          }, {
 | 
	
		
			
				|  |  |              label: '金额方向',
 | 
	
		
			
				|  |  | -            prop: 'accountName'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '静态值',
 | 
	
		
			
				|  |  | -            prop: 'accountName'
 | 
	
		
			
				|  |  | -          },
 | 
	
		
			
				|  |  | -          {
 | 
	
		
			
				|  |  | -            label: '附加公司',
 | 
	
		
			
				|  |  | -            prop: 'accountName'
 | 
	
		
			
				|  |  | +            prop: 'accountName',
 | 
	
		
			
				|  |  | +            rules: [{
 | 
	
		
			
				|  |  | +              required: true,
 | 
	
		
			
				|  |  | +              message: " ",
 | 
	
		
			
				|  |  | +              trigger: "blur"
 | 
	
		
			
				|  |  | +            }]
 | 
	
		
			
				|  |  | +          }, {
 | 
	
		
			
				|  |  | +            label: '摘要',
 | 
	
		
			
				|  |  | +            display: false,
 | 
	
		
			
				|  |  | +            children: [{
 | 
	
		
			
				|  |  | +              label: '静态值',
 | 
	
		
			
				|  |  | +              prop: 'abstractStatic',
 | 
	
		
			
				|  |  | +              rules: [{
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  | +                message: " ",
 | 
	
		
			
				|  |  | +                trigger: "blur"
 | 
	
		
			
				|  |  | +              }]
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +              label: '附加公式',
 | 
	
		
			
				|  |  | +              prop: 'abstractFormula'
 | 
	
		
			
				|  |  | +            }]
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          ]
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | -    onLoad(page) {
 | 
	
		
			
				|  |  | -      customerList({size: page.size,current: page.current},this.treeDeptName).then(res=>{
 | 
	
		
			
				|  |  | -        console.log(res)
 | 
	
		
			
				|  |  | +    //列表查询
 | 
	
		
			
				|  |  | +    onLoad(page, params) {
 | 
	
		
			
				|  |  | +      if (!this.accountId) return this.$message.warning('请选择套账')
 | 
	
		
			
				|  |  | +      customerList({...params, size: page.size, current: page.current}, this.treeDeptName, this.accountId).then(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)
 | 
	
		
			
				|  |  | +    // 套账选中后触发列表查询
 | 
	
		
			
				|  |  | +    nodeClickTwo(data) {
 | 
	
		
			
				|  |  | +      this.accountId = data.accountId
 | 
	
		
			
				|  |  | +      this.page.currentPage = 1;
 | 
	
		
			
				|  |  | +      this.onLoad(this.page);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //刷新按钮触发
 | 
	
		
			
				|  |  | +    refreshChange() {
 | 
	
		
			
				|  |  | +      this.onLoad(this.page);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //表单搜索按钮触发
 | 
	
		
			
				|  |  | +    searchChange(params, done) {
 | 
	
		
			
				|  |  | +      this.page.currentPage = 1;
 | 
	
		
			
				|  |  | +      this.onLoad(this.page, params);
 | 
	
		
			
				|  |  | +      done()
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //清空
 | 
	
		
			
				|  |  | +    searchReset() {
 | 
	
		
			
				|  |  | +      this.page.currentPage = 1;
 | 
	
		
			
				|  |  | +      this.treeDeptName = this.accountId = ''
 | 
	
		
			
				|  |  | +      this.onLoad(this.page);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //新增
 | 
	
		
			
				|  |  | +    rowSave(row, done, loading) {
 | 
	
		
			
				|  |  | +      jdmoduleSave(row).then(() => {
 | 
	
		
			
				|  |  | +        this.$message.success('新增成功');
 | 
	
		
			
				|  |  | +        loading()
 | 
	
		
			
				|  |  | +        done()
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //编辑
 | 
	
		
			
				|  |  | +    rowUpdate(row, index, done, loading) {
 | 
	
		
			
				|  |  | +      jdmoduleUpdate(row).then(() => {
 | 
	
		
			
				|  |  | +        this.$message.success('修改成功');
 | 
	
		
			
				|  |  | +        this.onLoad(this.page);
 | 
	
		
			
				|  |  | +        loading()
 | 
	
		
			
				|  |  | +        done()
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //删除
 | 
	
		
			
				|  |  | +    rowDel(row, index, done) {
 | 
	
		
			
				|  |  | +      jdmoduleDelete(row.id).then(() => {
 | 
	
		
			
				|  |  | +        this.$message.success('删除成功');
 | 
	
		
			
				|  |  | +        done()
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 |