|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+<script lang="ts" setup>
|
|
|
2
|
+import { onMounted, ref, watch } from 'vue'
|
|
|
3
|
+import { AdministrativeDivisionApi } from '@/api/system/administrativeDivision'
|
|
|
4
|
+import { DetermineDeliveryWarehouseApi } from '@/api/DeliveryWarehouse/DetermineDeliveryWarehouse'
|
|
|
5
|
+import DeliveryWarehouseSelectFrom from '@/views/DeliveryWarehouse/compontents/Form.vue'
|
|
|
6
|
+import AddFinancialInformationForm from '@/views/DeliveryWarehouse/compontents/AddFinancialInformationForm.vue'
|
|
|
7
|
+import { DeliveryWarehouseListApi } from '@/api/DeliveryWarehouse/DeliveryWarehouseList'
|
|
|
8
|
+import download from '@/utils/download'
|
|
|
9
|
+
|
|
|
10
|
+// 接口定义
|
|
|
11
|
+interface QueryParams {
|
|
|
12
|
+ pageNo: number
|
|
|
13
|
+ pageSize: number
|
|
|
14
|
+ dwmc?: string // 企业名称
|
|
|
15
|
+ kqmc?: string // 库区名称
|
|
|
16
|
+ yhmc?: string // 银行名称
|
|
|
17
|
+ shengCode?: string | undefined // 省份编码
|
|
|
18
|
+ shiCode?: string | undefined // 市区编码
|
|
|
19
|
+ xianCode?: string | undefined // 县区编码
|
|
|
20
|
+}
|
|
|
21
|
+
|
|
|
22
|
+interface TableItem {
|
|
|
23
|
+ sheng: string // 省份
|
|
|
24
|
+ shi: string // 市区
|
|
|
25
|
+ xian: string // 县区
|
|
|
26
|
+ dwmc: string // 企业名称
|
|
|
27
|
+ kqmc: string // 库区名称
|
|
|
28
|
+ kqfzr: string // 库区联系人
|
|
|
29
|
+ cfsl: string // 仓房数量
|
|
|
30
|
+ cfzcr: string // 仓房总仓容
|
|
|
31
|
+ zzc: string // 总资产(万元)
|
|
|
32
|
+ sndjlr: string // 上一年度净利润(万元)
|
|
|
33
|
+ cfzt: string // 仓房状态
|
|
|
34
|
+}
|
|
|
35
|
+
|
|
|
36
|
+interface AreaOption {
|
|
|
37
|
+ id: number | string
|
|
|
38
|
+ areaCode: number | string
|
|
|
39
|
+ areaName: string
|
|
|
40
|
+}
|
|
|
41
|
+
|
|
|
42
|
+interface CfOption {
|
|
|
43
|
+ value: number | string
|
|
|
44
|
+ label: string
|
|
|
45
|
+}
|
|
|
46
|
+
|
|
|
47
|
+// 查询参数
|
|
|
48
|
+const queryParams = ref<QueryParams>({
|
|
|
49
|
+ pageNo: 1,
|
|
|
50
|
+ pageSize: 10
|
|
|
51
|
+})
|
|
|
52
|
+// 自定义仓房状态
|
|
|
53
|
+const cfztOption = ref<CfOption[]>([
|
|
|
54
|
+ {
|
|
|
55
|
+ value: '0',
|
|
|
56
|
+ label: '全部'
|
|
|
57
|
+ },
|
|
|
58
|
+ {
|
|
|
59
|
+ value: '1',
|
|
|
60
|
+ label: '国家备选'
|
|
|
61
|
+ },
|
|
|
62
|
+ {
|
|
|
63
|
+ value: '2',
|
|
|
64
|
+ label: '省级备选'
|
|
|
65
|
+ },
|
|
|
66
|
+ {
|
|
|
67
|
+ value: '3',
|
|
|
68
|
+ label: '银行认定'
|
|
|
69
|
+ },
|
|
|
70
|
+ {
|
|
|
71
|
+ value: '4',
|
|
|
72
|
+ label: '贷款人选定'
|
|
|
73
|
+ },
|
|
|
74
|
+ {
|
|
|
75
|
+ value: '5',
|
|
|
76
|
+ label: '粮食入库'
|
|
|
77
|
+ },
|
|
|
78
|
+ {
|
|
|
79
|
+ value: '6',
|
|
|
80
|
+ label: '粮食出清'
|
|
|
81
|
+ }
|
|
|
82
|
+])
|
|
|
83
|
+
|
|
|
84
|
+// 组件状态
|
|
|
85
|
+const loading = ref(false)
|
|
|
86
|
+const queryFormRef = ref()
|
|
|
87
|
+const refForm = ref()
|
|
|
88
|
+
|
|
|
89
|
+// 表格数据
|
|
|
90
|
+const listCopy = ref<TableItem[]>([
|
|
|
91
|
+ {
|
|
|
92
|
+ sheng: '天津市',
|
|
|
93
|
+ shi: '天津',
|
|
|
94
|
+ xian: '宝坻区',
|
|
|
95
|
+ dwmc: '天津利达粮油储运有限公司',
|
|
|
96
|
+ kqmc: '天津利达粮油库',
|
|
|
97
|
+ kqfzr: '张继孝',
|
|
|
98
|
+ cfsl: '1',
|
|
|
99
|
+ cfzcr: '23',
|
|
|
100
|
+ zzc: '400',
|
|
|
101
|
+ sndjlr: '300',
|
|
|
102
|
+ cfzt: '国家备选'
|
|
|
103
|
+ },
|
|
|
104
|
+ {
|
|
|
105
|
+ sheng: '河南省',
|
|
|
106
|
+ shi: '洛阳市',
|
|
|
107
|
+ xian: '牡丹区',
|
|
|
108
|
+ dwmc: '洛阳粮仓直属公司',
|
|
|
109
|
+ kqmc: '洛阳粮仓直属库',
|
|
|
110
|
+ kqfzr: '董加思',
|
|
|
111
|
+ cfsl: '1',
|
|
|
112
|
+ cfzcr: '23',
|
|
|
113
|
+ zzc: '400',
|
|
|
114
|
+ sndjlr: '300',
|
|
|
115
|
+ cfzt: '省级备选'
|
|
|
116
|
+ },
|
|
|
117
|
+ {
|
|
|
118
|
+ sheng: '黑龙江省',
|
|
|
119
|
+ shi: '哈尔滨',
|
|
|
120
|
+ xian: '南岗区',
|
|
|
121
|
+ dwmc: '黑龙江直属公司',
|
|
|
122
|
+ kqmc: '黑龙江直属库',
|
|
|
123
|
+ kqfzr: '李福海',
|
|
|
124
|
+ cfsl: '1',
|
|
|
125
|
+ cfzcr: '23',
|
|
|
126
|
+ zzc: '400',
|
|
|
127
|
+ sndjlr: '300',
|
|
|
128
|
+ cfzt: '银行认定'
|
|
|
129
|
+ },
|
|
|
130
|
+ {
|
|
|
131
|
+ sheng: '辽宁省',
|
|
|
132
|
+ shi: '沈阳市',
|
|
|
133
|
+ xian: '铁西区',
|
|
|
134
|
+ dwmc: '辽宁直属公司',
|
|
|
135
|
+ kqmc: '辽宁直属库',
|
|
|
136
|
+ kqfzr: '张民',
|
|
|
137
|
+ cfsl: '1',
|
|
|
138
|
+ cfzcr: '23',
|
|
|
139
|
+ zzc: '400',
|
|
|
140
|
+ sndjlr: '300',
|
|
|
141
|
+ cfzt: '贷款人选定'
|
|
|
142
|
+ },
|
|
|
143
|
+ {
|
|
|
144
|
+ sheng: '四川省',
|
|
|
145
|
+ shi: '广安市',
|
|
|
146
|
+ xian: '华蓥市',
|
|
|
147
|
+ dwmc: '四川华蓥铜堡省粮食储备库',
|
|
|
148
|
+ kqmc: '四川华蓥铜堡省粮食储备库高兴主库',
|
|
|
149
|
+ kqfzr: '成云松',
|
|
|
150
|
+ cfsl: '1',
|
|
|
151
|
+ cfzcr: '23',
|
|
|
152
|
+ zzc: '400',
|
|
|
153
|
+ sndjlr: '300',
|
|
|
154
|
+ cfzt: '粮食入库'
|
|
|
155
|
+ },
|
|
|
156
|
+ {
|
|
|
157
|
+ sheng: '陕西省',
|
|
|
158
|
+ shi: '咸阳市',
|
|
|
159
|
+ xian: '秦都区',
|
|
|
160
|
+ dwmc: '咸阳秦储粮粮油仓储有限公司',
|
|
|
161
|
+ kqmc: '咸阳秦储粮粮油仓储有限公司',
|
|
|
162
|
+ kqfzr: '余涛',
|
|
|
163
|
+ cfsl: '1',
|
|
|
164
|
+ cfzcr: '23',
|
|
|
165
|
+ zzc: '400',
|
|
|
166
|
+ sndjlr: '300',
|
|
|
167
|
+ cfzt: '粮食出清'
|
|
|
168
|
+ }
|
|
|
169
|
+])
|
|
|
170
|
+const list = ref<TableItem[]>([])
|
|
|
171
|
+const total = ref(0)
|
|
|
172
|
+
|
|
|
173
|
+// 行政区划数据
|
|
|
174
|
+const shengList = ref<AreaOption[]>([])
|
|
|
175
|
+const shiList = ref<AreaOption[]>([])
|
|
|
176
|
+const xianList = ref<AreaOption[]>([])
|
|
|
177
|
+
|
|
|
178
|
+/**
|
|
|
179
|
+ * 查询列表数据
|
|
|
180
|
+ */
|
|
|
181
|
+const handleQuery = async () => {
|
|
|
182
|
+ list.value = listCopy.value
|
|
|
183
|
+}
|
|
|
184
|
+
|
|
|
185
|
+/**
|
|
|
186
|
+ * 重置查询条件
|
|
|
187
|
+ */
|
|
|
188
|
+const resetQuery = () => {
|
|
|
189
|
+ queryParams.value.pageNo = 1
|
|
|
190
|
+ queryFormRef.value?.resetFields()
|
|
|
191
|
+ handleQuery()
|
|
|
192
|
+}
|
|
|
193
|
+
|
|
|
194
|
+/**
|
|
|
195
|
+ * 退回库区
|
|
|
196
|
+ * @description 退回库区并更新表格数据
|
|
|
197
|
+ */
|
|
|
198
|
+const selectRows = ref<any[]>([])
|
|
|
199
|
+const handleSelectionChange = (selection: any) => {
|
|
|
200
|
+ selectRows.value = selection
|
|
|
201
|
+}
|
|
|
202
|
+const handleBack = async () => {
|
|
|
203
|
+ return
|
|
|
204
|
+ if (selectRows.value.length < 1) {
|
|
|
205
|
+ Message.warning('请选择要退回的库区')
|
|
|
206
|
+ return
|
|
|
207
|
+ }
|
|
|
208
|
+ try {
|
|
|
209
|
+ await ElMessageBox.confirm('确认要退回的所选的库区?', '提示', {
|
|
|
210
|
+ confirmButtonText: '确 认',
|
|
|
211
|
+ cancelButtonText: '取 消'
|
|
|
212
|
+ })
|
|
|
213
|
+ await DeliveryWarehouseListApi.revertKqxx({ ids: selectRows.value.map((item) => item.kqId) })
|
|
|
214
|
+ await handleQuery()
|
|
|
215
|
+ } catch (err) {
|
|
|
216
|
+ console.error(err)
|
|
|
217
|
+ } finally {
|
|
|
218
|
+ }
|
|
|
219
|
+}
|
|
|
220
|
+/**
|
|
|
221
|
+ * 导出Excel
|
|
|
222
|
+ */
|
|
|
223
|
+const handleExport = async () => {
|
|
|
224
|
+ return
|
|
|
225
|
+ // TODO: 实现数据导出
|
|
|
226
|
+ try {
|
|
|
227
|
+ const excel = await DetermineDeliveryWarehouseApi.exportExcel(queryParams.value)
|
|
|
228
|
+ download.excel(excel, '认定交收库列表.xls')
|
|
|
229
|
+ } catch (err) {
|
|
|
230
|
+ console.error(err)
|
|
|
231
|
+ } finally {
|
|
|
232
|
+ }
|
|
|
233
|
+}
|
|
|
234
|
+/**
|
|
|
235
|
+ * 获取行政区划数据
|
|
|
236
|
+ */
|
|
|
237
|
+const getDivision = async (areaCode?: string) => {
|
|
|
238
|
+ try {
|
|
|
239
|
+ return await AdministrativeDivisionApi.getList({ areaCode })
|
|
|
240
|
+ } catch (err) {
|
|
|
241
|
+ throw err
|
|
|
242
|
+ }
|
|
|
243
|
+}
|
|
|
244
|
+
|
|
|
245
|
+/**
|
|
|
246
|
+ * 打开表单
|
|
|
247
|
+ */
|
|
|
248
|
+const openForm = (type: string, row: any) => {
|
|
|
249
|
+ refForm.value?.open(type, row)
|
|
|
250
|
+}
|
|
|
251
|
+const refAddFinancialInformationForm = ref()
|
|
|
252
|
+// 获取库区财务信息详情
|
|
|
253
|
+const openCwxxForm = (row: any) => {
|
|
|
254
|
+ refAddFinancialInformationForm.value.open('create', row)
|
|
|
255
|
+}
|
|
|
256
|
+// 监听省份变化
|
|
|
257
|
+watch(
|
|
|
258
|
+ () => queryParams.value.shengCode,
|
|
|
259
|
+ async (newValue) => {
|
|
|
260
|
+ queryParams.value.shiCode = ''
|
|
|
261
|
+ queryParams.value.xianCode = ''
|
|
|
262
|
+ if (newValue) {
|
|
|
263
|
+ shiList.value = await getDivision(newValue)
|
|
|
264
|
+ } else {
|
|
|
265
|
+ shiList.value = []
|
|
|
266
|
+ }
|
|
|
267
|
+ }
|
|
|
268
|
+)
|
|
|
269
|
+
|
|
|
270
|
+// 监听市区变化
|
|
|
271
|
+watch(
|
|
|
272
|
+ () => queryParams.value.shiCode,
|
|
|
273
|
+ async (newValue) => {
|
|
|
274
|
+ queryParams.value.xianCode = ''
|
|
|
275
|
+ if (newValue) {
|
|
|
276
|
+ xianList.value = await getDivision(newValue)
|
|
|
277
|
+ } else {
|
|
|
278
|
+ xianList.value = []
|
|
|
279
|
+ }
|
|
|
280
|
+ }
|
|
|
281
|
+)
|
|
|
282
|
+
|
|
|
283
|
+// 初始化加载
|
|
|
284
|
+onMounted(async () => {
|
|
|
285
|
+ shengList.value = await getDivision()
|
|
|
286
|
+ await handleQuery()
|
|
|
287
|
+})
|
|
|
288
|
+</script>
|
|
|
289
|
+
|
|
|
290
|
+<template>
|
|
|
291
|
+ <div class="form-card">
|
|
|
292
|
+ <el-form
|
|
|
293
|
+ ref="queryFormRef"
|
|
|
294
|
+ :inline="true"
|
|
|
295
|
+ :model="queryParams"
|
|
|
296
|
+ class="-mb-15px"
|
|
|
297
|
+ label-width="68px"
|
|
|
298
|
+ >
|
|
|
299
|
+ <el-form-item label="所属省份" prop="shengCode">
|
|
|
300
|
+ <el-select
|
|
|
301
|
+ v-model="queryParams.shengCode"
|
|
|
302
|
+ class="!w-240px"
|
|
|
303
|
+ clearable
|
|
|
304
|
+ placeholder="所属省份"
|
|
|
305
|
+ >
|
|
|
306
|
+ <el-option
|
|
|
307
|
+ v-for="item in shengList"
|
|
|
308
|
+ :key="item.id"
|
|
|
309
|
+ :label="item.areaName"
|
|
|
310
|
+ :value="item.areaCode"
|
|
|
311
|
+ />
|
|
|
312
|
+ </el-select>
|
|
|
313
|
+ </el-form-item>
|
|
|
314
|
+ <el-form-item label="企业名称" prop="dwmc">
|
|
|
315
|
+ <el-input v-model="queryParams.dwmc" class="!w-240px" placeholder="请输入企业名称" />
|
|
|
316
|
+ </el-form-item>
|
|
|
317
|
+ <el-form-item label="库区名称" prop="kqmc">
|
|
|
318
|
+ <el-input
|
|
|
319
|
+ v-model="queryParams.kqmc"
|
|
|
320
|
+ class="!w-240px"
|
|
|
321
|
+ clearable
|
|
|
322
|
+ placeholder="请输入库区名称"
|
|
|
323
|
+ />
|
|
|
324
|
+ </el-form-item>
|
|
|
325
|
+ <el-form-item label="仓房状态" prop="cfzt">
|
|
|
326
|
+ <el-select v-model="queryParams.cfzt" class="!w-240px" clearable placeholder="仓房状态">
|
|
|
327
|
+ <el-option
|
|
|
328
|
+ v-for="item in cfztOption"
|
|
|
329
|
+ :key="item.value"
|
|
|
330
|
+ :label="item.label"
|
|
|
331
|
+ :value="item.value"
|
|
|
332
|
+ />
|
|
|
333
|
+ </el-select>
|
|
|
334
|
+ </el-form-item>
|
|
|
335
|
+ <el-form-item>
|
|
|
336
|
+ <el-button type="primary" @click="handleQuery">
|
|
|
337
|
+ <Icon class="mr-5px" icon="ep:search" />
|
|
|
338
|
+ 查询
|
|
|
339
|
+ </el-button>
|
|
|
340
|
+ <el-button type="primary" plain @click="resetQuery">
|
|
|
341
|
+ <Icon class="mr-5px" icon="ep:refresh" />
|
|
|
342
|
+ 重置
|
|
|
343
|
+ </el-button>
|
|
|
344
|
+ <el-button plain type="success" @click="handleExport">
|
|
|
345
|
+ <Icon class="mr-5px" icon="ep:download" />
|
|
|
346
|
+ 导出
|
|
|
347
|
+ </el-button>
|
|
|
348
|
+ </el-form-item>
|
|
|
349
|
+ </el-form>
|
|
|
350
|
+ </div>
|
|
|
351
|
+
|
|
|
352
|
+ <ContentWrap>
|
|
|
353
|
+ <el-table
|
|
|
354
|
+ v-loading="loading"
|
|
|
355
|
+ :border="true"
|
|
|
356
|
+ :data="list"
|
|
|
357
|
+ tooltip-effect="dark"
|
|
|
358
|
+ show-overflow-tooltip
|
|
|
359
|
+ :header-cell-style="{
|
|
|
360
|
+ background: 'var(--table-header-bg-color) ',
|
|
|
361
|
+ color: 'var(--table-header-text-color)',
|
|
|
362
|
+ height: 'var(--table-header-height)'
|
|
|
363
|
+ }"
|
|
|
364
|
+ @selection-change="handleSelectionChange"
|
|
|
365
|
+ >
|
|
|
366
|
+ <!-- <el-table-column align="center" fixed="left" min-width="40" type="selection" /> -->
|
|
|
367
|
+ <el-table-column align="center" fixed="left" label="序号" min-width="60" type="index" />
|
|
|
368
|
+ <el-table-column align="center" label="所属省份" min-width="100" prop="sheng" />
|
|
|
369
|
+ <el-table-column align="center" label="所属市区" min-width="100" prop="shi" />
|
|
|
370
|
+ <el-table-column align="center" label="所属县区" min-width="100" prop="xian" />
|
|
|
371
|
+ <el-table-column align="center" label="企业名称" min-width="180" prop="dwmc" />
|
|
|
372
|
+ <el-table-column align="center" label="库区名称" min-width="180" prop="kqmc" />
|
|
|
373
|
+ <el-table-column align="center" label="库区联系人" min-width="120" prop="kqfzr" />
|
|
|
374
|
+ <el-table-column align="center" label="仓房数量" min-width="120" prop="cfsl" />
|
|
|
375
|
+ <el-table-column align="center" label="仓房总仓容" min-width="120" prop="cfzcr" />
|
|
|
376
|
+ <el-table-column
|
|
|
377
|
+ v-hasPermi="['column:DetermineDeliveryWarehouse:zzc']"
|
|
|
378
|
+ align="center"
|
|
|
379
|
+ label="总资产(万元)"
|
|
|
380
|
+ min-width="150"
|
|
|
381
|
+ prop="zzc"
|
|
|
382
|
+ >
|
|
|
383
|
+ <template #default="scope">
|
|
|
384
|
+ <div
|
|
|
385
|
+ class="w-full color-[var(--el-color-primary)] cursor-pointer"
|
|
|
386
|
+ @click="openCwxxForm(scope.row)"
|
|
|
387
|
+ >{{ scope.row.zzc }}</div
|
|
|
388
|
+ >
|
|
|
389
|
+ </template>
|
|
|
390
|
+ </el-table-column>
|
|
|
391
|
+ <el-table-column
|
|
|
392
|
+ v-hasPermi="['column:DetermineDeliveryWarehouse:sndjlr']"
|
|
|
393
|
+ align="center"
|
|
|
394
|
+ label="上一年度净利润(万元)"
|
|
|
395
|
+ min-width="180"
|
|
|
396
|
+ prop="sndjlr"
|
|
|
397
|
+ >
|
|
|
398
|
+ <template #default="scope">
|
|
|
399
|
+ <div
|
|
|
400
|
+ class="w-full color-[var(--el-color-primary)] cursor-pointer"
|
|
|
401
|
+ @click="openCwxxForm(scope.row)"
|
|
|
402
|
+ >{{ scope.row.sndjlr }}</div
|
|
|
403
|
+ >
|
|
|
404
|
+ </template>
|
|
|
405
|
+ </el-table-column>
|
|
|
406
|
+ <el-table-column align="center" label="仓房状态" min-width="120" prop="cfzt" />
|
|
|
407
|
+ </el-table>
|
|
|
408
|
+
|
|
|
409
|
+ <Pagination
|
|
|
410
|
+ v-model:limit="queryParams.pageSize"
|
|
|
411
|
+ v-model:page="queryParams.pageNo"
|
|
|
412
|
+ :total="total"
|
|
|
413
|
+ @pagination="handleQuery"
|
|
|
414
|
+ />
|
|
|
415
|
+ <DeliveryWarehouseSelectFrom ref="refForm" @success="handleQuery" />
|
|
|
416
|
+ <AddFinancialInformationForm ref="refAddFinancialInformationForm" @success="handleQuery" />
|
|
|
417
|
+ </ContentWrap>
|
|
|
418
|
+</template>
|
|
|
419
|
+
|
|
|
420
|
+<style lang="scss" scoped>
|
|
|
421
|
+</style>
|