|
@@ -0,0 +1,190 @@
|
|
|
+<template>
|
|
|
+<basic-container>
|
|
|
+ <avue-crud
|
|
|
+ :option="option"
|
|
|
+ :data="dataList"
|
|
|
+ :page.sync="page"
|
|
|
+ :search.sync="search"
|
|
|
+ ref="crud"
|
|
|
+ @on-load="onLoad"
|
|
|
+ @resetColumn="resetColumn"
|
|
|
+ @saveColumn="saveColumn"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @refresh-change="refreshChange">
|
|
|
+ <template slot="corpNameSearch">
|
|
|
+ <crop-select
|
|
|
+ v-model="search.corpId"
|
|
|
+ :name.sync="search.corpName"
|
|
|
+ :refresh="false"
|
|
|
+ corp-type="KH"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="corpName" slot-scope="{row,index}">
|
|
|
+ <span class="el-button--text" style="cursor: pointer" @click.stop="jump(row)">{{row.corpName}}</span>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+</basic-container>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {getList} from "@/api/generalLedger";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "index",
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ search:{},
|
|
|
+ dataList:[],
|
|
|
+ page: {
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
+ option:{},
|
|
|
+ optionList:{
|
|
|
+ align: "center",
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+ searchIndex: 2,
|
|
|
+ searchIcon: true,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ searchSpan: 8,
|
|
|
+ height: "auto",
|
|
|
+ searchMenuPosition: "right",
|
|
|
+ showSummary: true,
|
|
|
+ summaryText: "合计",
|
|
|
+ sumColumnList: [{
|
|
|
+ name: 'lastAmount',
|
|
|
+ type: 'sum',
|
|
|
+ decimals: 2
|
|
|
+ }, {
|
|
|
+ name: 'lastSettlementAmount',
|
|
|
+ type: 'sum',
|
|
|
+ decimals: 2
|
|
|
+ }, {
|
|
|
+ name: 'lastOutstandingAmount',
|
|
|
+ type: 'sum',
|
|
|
+ decimals: 2
|
|
|
+ }, {
|
|
|
+ name: 'amount',
|
|
|
+ type: 'sum',
|
|
|
+ decimals: 2
|
|
|
+ }, {
|
|
|
+ name: 'settlementAmount',
|
|
|
+ type: 'sum',
|
|
|
+ decimals: 2
|
|
|
+ }, {
|
|
|
+ name: 'outstandingAmount',
|
|
|
+ type: 'sum',
|
|
|
+ decimals: 2
|
|
|
+ }],
|
|
|
+ column:[{
|
|
|
+ label: "客户名称",
|
|
|
+ prop: "corpName",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: "日期",
|
|
|
+ prop: "createTime",
|
|
|
+ type: "month",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: "上期账单金额",
|
|
|
+ prop: "lastAmount",
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: "上期结算金额",
|
|
|
+ prop: "lastSettlementAmount",
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: "上期未收金额",
|
|
|
+ prop: "lastOutstandingAmount",
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: "本期账单金额",
|
|
|
+ prop: "amount",
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: "本期结算金额",
|
|
|
+ prop: "settlementAmount",
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: "本期未收金额",
|
|
|
+ prop: "outstandingAmount",
|
|
|
+ overHidden: true,
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(202.1), this.optionList);
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ //跳转
|
|
|
+ jump(){
|
|
|
+ this.$router.push({
|
|
|
+ path: '/financialManagement/billDetails/billDetails'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //刷新
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+ //点击搜索按钮触发
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ let queryParams = {
|
|
|
+ size: page.pageSize,
|
|
|
+ current: page.currentPage,
|
|
|
+ // itemStatus: this.activeName,
|
|
|
+ statusIds: this.activeName,
|
|
|
+ ...Object.assign(params, this.search)
|
|
|
+ }
|
|
|
+ getList({
|
|
|
+ ...queryParams,
|
|
|
+ dc:"d"
|
|
|
+ }).then(res=>{
|
|
|
+ this.dataList = res.data.data.records || [];
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumn() {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(202.1), this.option);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumn() {
|
|
|
+ this.option = this.optionList;
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(202.1), this.optionList);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|