zhangxp
2023-06-07 432bbf252ffc66393ac10e14958a8c412b3e401c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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>