kongdeqiang
2023-01-05 0c14153f387755551121da645710007c9931dd6c
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<template>
    <div class="daibanForm-wrap">
        <el-dialog
                title="我的待办"
                :visible.sync="dialogVisible"
                width="80%"
                :before-close="handleClose">
            <div class="daibanForm-main">
                <el-table
                        :data="pageData.rows"
                        style="width: 100%"
                        max-height="550">
                    <el-table-column
                            align="center"
                            fixed
                            type="index"
                            label="序号"
                            width="80">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            prop="carNo"
                            label="车牌号"
                            min-width="120">
                    </el-table-column>
                    <el-table-column
                            :show-overflow-tooltip="true"
                            align="left"
                            prop="address"
                            label="位置"
                            min-width="200">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            prop="userName"
                            label="执行人"
                            min-width="120">
                    </el-table-column>
                    <el-table-column
                            align="right"
                            prop="money"
                            label="金额(元)"
                            min-width="80">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            prop="status"
                            label="状态"
                            :filter-multiple="false"
                            :filters="statesOptions"
                            column-key="tag"
                            :filter-method="filterTag"
                            :formatter="statesFormat"
                            min-width="120">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            prop="violationTypeName"
                            label="违章类型"
                            min-width="120">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            prop="payStatus"
                            :formatter="payStatusFormat"
                            label="缴费状态"
                            min-width="120">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            prop="createTime"
                            label="时间"
                            min-width="180">
                    </el-table-column>
                    <el-table-column
                            align="right"
                            fixed="right"
                            label="操作"
                            min-width="120">
                        <template slot-scope="scope">
                            <el-button
                                    v-if="scope.row.status != 3 && scope.row.status != 1"
                                    @click.native.prevent="deleteRow(scope.row)"
                                    type="primary"
                                    size="mini">
                                撤销
                            </el-button>
                            <!--<el-button
                                    @click.native.prevent="deleteRow(scope.$index, tableData)"
                                    type="danger"
                                    size="mini">
                                删除
                            </el-button>-->
                        </template>
                    </el-table-column>
                </el-table>
                <div class="footer-box">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="pageData.currentPage"
                            :page-sizes="[10, 20, 30, 40, 50, 100, 200]"
                            :page-size="pageData.pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="pageData.total">
                    </el-pagination>
                </div>
 
            </div>
        </el-dialog>
    </div>
</template>
 
<script>
    export default {
        name: "daibanForm",
        data() {
            return {
                pageConfig: {
                    pageDataUrl: this.$systemconfig.basePath + '/ticket/findPage',
                    deleteDataUrl: this.$systemconfig.basePath + '/ticket/delete',
                },
                pageData: this.$byutil.defaultPageData(),
                dialogVisible:false,
                tableData: [],
                statesOptions: [
                    { value: 0, text: "未处理" },
                    { value: 1, text: "已处理" },
                    { value: 2, text: "未完成" },
                    { value: 3, text: "撤销" },
                ],
            }
        },
        mounted() {
            this.$byutil.initTableMaxHeight(this);
        },
        methods: {
            handleClose() {  //关闭弹框
                this.dialogVisible = false
            },
            payStatusFormat(row) {  //缴费状态
                if(row.type == 0) {
                    return '待缴费'
                }else if(row.type == 1) {
                    return '已缴费'
                }else if(row.type == 2) {
                    return '支付失败'
                }
            },
            statesFormat(row) {  //状态
                if(row.status == 0) {
                    return '未处理'
                }else if(row.status == 1) {
                    return '已处理'
                }else if(row.status == 2) {
                    return '未完成'
                }else if(row.status == 3) {
                    return '撤销'
                }
            },
            filterTag(value,row) {
                console.log('value-------',value)
                console.log('row.status',row.status)
                return row.status === value
            },
            /*statusFormat(row, column) {  //状态
              if(row.status == 0) {
                  return '未处理'
              }else if(row.status == 1) {
                  return '已处理'
              }else if(row.status == 2) {
                  return '未完成'
              }else if(row.status == 3) {
                  return '撤销'
              }
            },*/
            deleteRow(row) {  //撤销
                this.$confirm('是否继续此操作?','提示',{
                    confirmButtonText:'确定',
                    cancelButtonText:'取消',
                    type:'warning'
                }).then(() => {
                    console.log('row-------',row.id)
                    this.$byutil.postData(this,this.pageConfig.deleteDataUrl,{id:row.id},res => {
                        this.$message.success(res.msg)
                        this.loadData();
                    })
                }).catch(() => {
                    this.$message({
                        type:'info',
                        message:"已取消"
                    })
                })
 
            },
            //加载数据
            loadData() {
                this.$byutil.loadPageData(this, this.pageConfig.pageDataUrl,this.pageData);
            },
            initData() {
                this.dialogVisible = true
                this.loadData();
            },
            handleSizeChange(val) {
                this.pageData.pageSize = val;
                this.loadData();
            },
            handleCurrentChange(val) {
                this.pageData.page = val;
                this.loadData();
            }
        }
    }
</script>
 
<style lang="scss">
    .daibanForm-wrap{
        .el-dialog__title{
            color: #fff;
        }
        .el-dialog__wrapper{
            background:rgba(0,0,0,0.6);
        }
        .el-dialog, .el-pager li{
            background:rgba(0,0,0,0.5);
        }
        .el-form-item__label{
            color: #00fff6;
        }
        .el-table th{
            background:rgba(4,40,70,0.7);
        }
        .el-table tr{
            background:transparent;
        }
        .el-table__footer-wrapper, .el-table__header-wrapper:nth-child(even){
            background:rgba(4,40,70,0.7);
        }
        .el-table__row:nth-child(even){
            background:rgba(4,40,70,0.7);
        }
        .el-table, .el-table__expanded-cell{
            background:transparent;
        }
        .el-table td, .el-table th.is-leaf{
            border:none;
        }
        .el-table__body,.el-table__header{
            width: 100% !important;
        }
        .el-table::before,.el-table__fixed-right::before, .el-table__fixed::before{
            background-color: transparent;
        }
        .el-table__body tr.hover-row.current-row>td, .el-table__body tr.hover-row.el-table__row--striped.current-row>td, .el-table__body tr.hover-row.el-table__row--striped>td, .el-table__body tr.hover-row>td{
            background-color: #374f65;
        }
        .el-table thead{
            color: #fff;
        }
        .el-table{
            color:#00fff6;
        }
        .el-dialog__header{
            display: flex;
            justify-content: center;
        }
    }
    .footer-box{
        .el-pagination__total{
            color:#fff;
        }
        .el-pager li{
            color:#fff;
        }
        .el-pagination__jump{
            color:#fff;
        }
        .el-input__inner,.btn-prev,.btn-next,.el-pagination button:disabled{
            background-color: transparent;
        }
        .el-pager li.active{
            color: #409EFF;
        }
        .el-input__inner{
            color:#fff;
            border:1px solid #409EFF;
        }
        .el-pagination .btn-next, .el-pagination .btn-prev{
            color:#fff;
        }
    }
</style>
 
<style lang="scss" scoped>
.footer-box{
    margin-top: 20px;
    display: flex;
    flex-direction: row-reverse;
}
</style>