Admin
2022-11-08 ccaa5f7b43b39e2e875b4f999832675cb87f116a
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
301
302
303
304
305
306
307
308
309
<template>
    <div class="table">
        <div class="filter-container">
            <div class="table-tit">
                <h2>2023年上半年烟花爆竹生产经营安全检查(批发)</h2>
                <span>(检查一家反馈一家,没有检查出隐患问题的也要登记反馈)</span>
            </div>
            <div class="control-bar">
                <div>
                    批发企业共计<span>17</span>家,其中:已自查<span>15</span>家,未自查<span class="undone">2</span>家;本级已经抽查<span>5</span>家,未检查<span class="undone">12</span>家,完成率<span>100%</span>。
                </div>
                <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="showFilter = !showFilter">{{showFilter?'关闭查询':'自定义查询'}}</el-button>
            </div>
            <transition name="el-zoom-in-top">
                <el-row v-show="showFilter" :gutter="20">
                    <el-col :span="6">
                        <span>单位名称:</span>
                        <el-input v-model="search.name" class="carrier_search_input"></el-input>
                    </el-col>
                    <el-col :span="8">
                        <span>行政区划:</span>
                        <el-cascader
                            :options="options"
                            v-model="selectedOptions"
                            :props="{ checkStrictly: true,expandTrigger: 'hover'}"
                            separator="-"
                            @change="locationChange">
                        </el-cascader>
                    </el-col>
                    <el-col :span="6">
                        <span>自查是否有隐患:</span>
                        <el-radio-group v-model="search.isRisky">
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="2">否</el-radio>
                        </el-radio-group>
                    </el-col>
                    <el-col :span="4">
                        <el-button  style="margin-right: 10px;" type="primary">查询</el-button>
                        <el-button class="resetBtn"  type="primary" plain>重置</el-button>
                    </el-col>
                </el-row>
            </transition>
        </div>
        <div class="table_content">
            <el-table
                v-loading="listLoading"
                :key="tableKey"
                :data="checkData"
                border
                fit
                highlight-current-row
                style="width: 100%;"
            >
 
                <el-table-column type="index" label="序号" align="center" width="80"/>
                <el-table-column label="单位名称" prop="owner" align="center" width="180">
                    <template slot-scope="scope">
                        <span>{{ scope.row.owner }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="联系电话" prop="phone" align="center">
                    <template slot-scope="scope">
                        <span>{{scope.row.phone}}</span>
                    </template>
                </el-table-column>
 
                <el-table-column label="库存数量/万箱" prop="stock" align="center">
                    <template slot-scope="scope">
                        <span>{{ scope.row.stock }}</span>
                    </template>
                </el-table-column>
 
                <el-table-column label="是否查出隐患" prop="isRisk" align="center">
                    <template slot-scope="scope">
                        <span>{{ scope.row.isRisk == 0 ? '否' : '是' }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="自查填报时间" prop="selfCheckTime" width="130" align="center" sortable>
                    <template slot-scope="scope">
                        <span>{{ scope.row.selfCheckTime }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="填报状态" prop="fillStatus" align="center">
                    <template slot-scope="scope">
                        <span>{{ scope.row.fillStatus == 0 ? '未填报' : '已填报' }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="详情" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button type="text" @click="viewDetails(scope.row)">查看</el-button>
                    </template>
                </el-table-column>
                <el-table-column label="反馈状态" prop="feedback" align="center">
                    <template slot-scope="scope">
                        <span>{{ scope.row.feedback == 0 ? '未反馈' : '已反馈' }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="执法抽查" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button type="text" @click="toFeedback(scope.row)">情况反馈</el-button>
                    </template>
                </el-table-column>
            </el-table>
 
 
            <el-pagination
                v-show="recordTotal>0"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="pageSize"
                :total="recordTotal"
                layout="total, sizes, prev, pager, next, jumper"
                background
                style="float:right;margin:3px"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
            />
        </div>
        <report-details ref="report"></report-details>
        <feedback-details ref="feedback"></feedback-details>
    </div>
</template>
 
<script>
import {mapGetters} from "vuex";
import Cookies from "_js-cookie@2.2.0@js-cookie";
import {paramList} from "../../../api/contract";
import {computePageCount} from "../../../utils";
import {parseError} from "../../../utils/messageDialog";
import ReportDetails from "./reportDetails";
import feedbackDetails from "./feedbackDetails";
import { regionData } from 'element-china-area-data'
 
export default {
name: "wholesaleForm",
    components: {ReportDetails,feedbackDetails},
    data(){
        return{
            recordTotal: 0,
            pageSize: 10,
            pageTotal: 0,
            currentPage: 1,
            listLoading: false,
            showFilter: false,
            search:{
                name: '',
                location: '',
                isRisky: ''
            },
            tableKey: 0,
            options: regionData,
            selectedOptions: [],
            checkData: [
                {
                    owner: '单位一',
                    phone: '88888888',
                    stock: 266,
                    isRisk: 0,
                    selfCheckTime: '2022-10-27 15:16:00',
                    fillStatus: 1,
                    feedback: 0,
                },
                {
                    owner: '单位二',
                    phone: '66666666',
                    stock: 288,
                    isRisk: 1,
                    selfCheckTime: '2022-10-27 15:16:00',
                    fillStatus: 0,
                    feedback: 1,
                }
            ]
        }
    },
    created() {
        // this.getDataList();
    },
    computed: {
        ...mapGetters([
            'userType',
            'name'
        ])
    },
    methods:{
        // getDataList() {
            // const t = this;
            // const params = {};
            // params['pageIndex'] = t.currentPage;
            // params['pageSize'] = t.pageSize;
            // params['sort'] = t.sort;
            // params['order'] = t.order;
            // const userName = Cookies.get('userName');
            // const name = Cookies.get('name');
            // params['operator'] = name + '(' + userName + ')';
            // for (const i in t.queryForm) {
            //     if (t.queryForm[i] != undefined && t.queryForm[i].toString() != '') {
            //         params[i] = t.queryForm[i]
            //     }
            // }
            // t.listLoading = true
            // paramList(params).then(response => {
            //     const res = response.data;
            //     if (res.code === "200") {
            //         const result = res.result;
            //         t.recordTotal = result.totalCount;
            //         t.pageSize = result.pageSize;
            //         t.pageTotal = computePageCount(result.totalCount, result.pageSize);
            //         t.currentPage = result.pageIndex;
            //         t.checkData = result.result
            //     } else {
            //         parseError({error: res.message, vm: t})
            //     }
            //     t.listLoading = false
            // }).catch(error => {
            //     t.listLoading = false
            //     parseError({error: error, vm: t})
            // })
        // },
 
        handleSizeChange: function (val) {
            this.pageSize = val
            this.currentPage = 1
            // this.getDataList()
        },
        handleCurrentChange: function (val) {
            this.currentPage = val
            // this.getDataList()
        },
        locationChange(value) {
            console.log(value)
        },
 
        viewDetails(row){
            console.log(row)
            const t = this
            t.$refs.report.dialogVisible = true
        },
 
        toFeedback(row){
            console.log(row)
            const t = this
            t.$refs.feedback.dialogVisible = true
        }
    }
}
</script>
 
<style lang="scss" scoped>
    .table{
        width: 100%;
        height: 100%;
        .filter-container{
            .table-tit{
                text-align: center;
                margin-bottom: 10px;
                h2{
                    margin: 0;
                }
                span{
                    display: block;
                    margin-top: 6px;
                    color: #ff0000;
                }
            }
 
            .control-bar{
                display: flex;
                justify-content: space-between;
                align-items: center;
 
                div{
                    span{
                        font-size: 22px;
                        margin: 0 6px;
                        color: #034EA2;
                        font-weight: bolder;
                    }
 
                    .undone{
                        color: #ff0000;
                    }
                }
                .filter-item{
                    margin-bottom: 0;
                }
            }
            .el-row{
                margin: 20px 0 15px;
                display: flex;
                align-items: center;
                .el-col{
                    display: flex;
                    align-items: center;
                    span{
                        white-space: nowrap;
                    }
                    .el-cascader{
                        width: 100%;
                    }
                    .resetBtn{
                        color: #034EA2;
                        background-color: #ecf5ff;
                    }
                }
            }
        }
 
    }
</style>