|
@@ -0,0 +1,165 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud
|
|
|
+ :option="option"
|
|
|
+ :search.sync="search"
|
|
|
+ v-model="form"
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="dataList"
|
|
|
+ ref="crud"
|
|
|
+ :key="key"
|
|
|
+ @on-load="onLoad"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @resetColumn="resetColumnTwo('crud','option','optionList',239)"
|
|
|
+ @saveColumn="saveColumnTwo('crud','option','optionList',239)"
|
|
|
+ :page.sync="page">
|
|
|
+ <template slot="corpNameSearch">
|
|
|
+ <crop-select v-model="search.corpId" corpType="GYS"/>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import {getList} from "@/api/accountBalance/index.js";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "index",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ search: {},
|
|
|
+ form: {},
|
|
|
+ detailData: {},
|
|
|
+ dataList: [],
|
|
|
+ page: {
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
+ key: 0,
|
|
|
+ option: {},
|
|
|
+ optionList: {
|
|
|
+ viewBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ addBtn: false,
|
|
|
+ index: true,
|
|
|
+ span: 8,
|
|
|
+ border: true,
|
|
|
+ height:"auto",
|
|
|
+ searchMenuPosition: "right",
|
|
|
+ align: "center",
|
|
|
+ menuWidth: 140,
|
|
|
+ searchSpan: 8,
|
|
|
+ searchIcon: true,
|
|
|
+ searchIndex: 2,
|
|
|
+ highlightCurrentRow: true,
|
|
|
+ dialogWidth: "70%",
|
|
|
+ menu:false,
|
|
|
+ column: [{
|
|
|
+ label: '工厂',
|
|
|
+ prop: 'corpName',
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: '本期应付',
|
|
|
+ prop: 'amount',
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: '本期已付',
|
|
|
+ prop: 'settlementAmount',
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: '余额(总)',
|
|
|
+ prop: 'balance',
|
|
|
+ overHidden: true,
|
|
|
+ },{
|
|
|
+ label: '日期',
|
|
|
+ prop: 'createDateList',
|
|
|
+ search: true,
|
|
|
+ showColumn:false,
|
|
|
+ hide:true,
|
|
|
+ type: "date",
|
|
|
+ searchRange: true,
|
|
|
+ searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss"
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(240), this.optionList);
|
|
|
+ this.key++
|
|
|
+ let i = 0;
|
|
|
+ this.option.column.forEach(item => {
|
|
|
+ if (item.search) i++
|
|
|
+ })
|
|
|
+ if (i % 3 !== 0) {
|
|
|
+ const num = 3 - Number(i % 3)
|
|
|
+ this.option.searchMenuSpan = num * 8;
|
|
|
+ this.option.searchMenuPosition = "right";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //刷新
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ done();
|
|
|
+ this.onLoad(this.page, params)
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ current: page.currentPage,
|
|
|
+ size: page.pageSize,
|
|
|
+ billType:"申请"
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ getList(params).then(res => {
|
|
|
+ this.dataList = res.data.data.records
|
|
|
+ this.page.total = res.data.data.total
|
|
|
+ this.loading = false
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+//自定义列保存
|
|
|
+ async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+//自定义列重置
|
|
|
+ async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|