zhangxp
2023-06-07 432bbf252ffc66393ac10e14958a8c412b3e401c
Source/UBCS-WEB/src/views/integration/applicationForm.vue
@@ -0,0 +1,146 @@
<template>
    <basic-container>
        <avue-crud :table-loading="loading" :data="data" :option="option" :search.sync="searchParam" :page.sync="page"
            ref="crud" @refresh-change="getDataList" @search-change="handleSearch" @search-reset="handleReset"
            @size-change="handleSizePage" @current-change="handleCurrentPage" @on-load="getDataList">
            <template slot="menuLeft">
                <el-button icon="el-icon-document" size="small" type="primary" @click="handleStatus">集团申请状态
                </el-button>
            </template>
        </avue-crud>
    </basic-container>
</template>
<script>
import { getList } from '@/api/integration/application.js'
import { dateFormat } from '@/util/date.js'
export default {
    data() {
        return {
            loading: false,
            data: [],
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            searchParam: {},
            option: {
                height: "auto",
                index: true,
                border: true,
                addBtn: false,
                columnBtn: false,
                searchMenuSpan: 8,
                highlightCurrentRow: true,
                menu:false,
                column: [
                    {
                        label: '申请单号',
                        prop: 'id',
                        width: 300,
                        fixed: true,
                        search: true,
                    }, {
                        label: '集团码',
                        width: 200,
                        prop: 'groupCode',
                        search: true,
                    }, {
                        label: '操作类型',
                        width: 200,
                        prop: 'operationType',
                        type: 'select',
                        search: true,
                        dicData: [{
                            label: '申请',
                            value: 1
                        }, {
                            label: '更改',
                            value: 2
                        }]
                    }, {
                        label: '申请单数据信息',
                        width: 300,
                        prop: 'description'
                    },
                    {
                        label: '创建时间',
                        width: 200,
                        prop: 'createTime',
                        type: 'datetime',
                        search: true,
                    },
                    {
                        label: '更改时间',
                        width: 200,
                        prop: 'lastModifyTime',
                        type: 'datetime',
                        search: true,
                        formatter: () => {
                        }
                    }, {
                        label: '返回标识',
                        width: 100,
                        prop: 'code'
                    },
                    {
                        label: '返回信息',
                        width: 300,
                        prop: 'content'
                    },
                    {
                        label: '消息信息',
                        width: 300,
                        prop: 'msg'
                    }
                ]
            }
        }
    },
    methods: {
        handleStatus() {
        },
        async getDataList() {
            this.loading = true
            console.log(this.searchParam)
            const { pageSize, currentPage, total } = this.page
            let param = { size: pageSize, current: currentPage }
            const response = await getList({ ...param, ...this.searchParam })
            if (response.status === 200) {
                this.loading = false
                console.log(response)
                const data = response.data.data
                this.data = data.records
                this.page.total = data.total
            } else this.loading = false
        },
        handleSizePage(event) {
            this.page.pageSize = event
        },
        handleCurrentPage(event) {
            this.page.currentPage = event
        },
        handleReset() {
            this.searchParam = {}
        },
        handleSearch(form, done) {
            const { id, groupCode, operationType } = form
            let dataTime = { id, groupCode, operationType }
            if (form.hasOwnProperty('createTime')) {
                dataTime = { createTime: dateFormat(form.createTime), ...dataTime }
            }
            if (form.hasOwnProperty('lastModifyTime')) {
                dataTime = { lastModifyTime: dateFormat(form.lastModifyTime), ...dataTime }
            }
            console.log(dataTime)
            this.searchParam = dataTime
            this.page.currentPage = 1
            this.getDataList()
            done()
        }
    }
}
</script>