|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+<script lang="ts" setup>
|
|
|
2
|
+import {onMounted, ref, watch} from 'vue'
|
|
|
3
|
+import {AdministrativeDivisionApi} from '@/api/system/administrativeDivision'
|
|
|
4
|
+import {SelectDeliveryWarehouseApi} from "@/api/DeliveryWarehouse/SelectDeliveryWarehouse";
|
|
|
5
|
+import DeliveryWarehouseSelectFrom from '@/views/DeliveryWarehouse/DeliveryWarehouseSelect/compontents/Form.vue'
|
|
|
6
|
+// 接口定义
|
|
|
7
|
+interface QueryParams {
|
|
|
8
|
+ pageNo: number
|
|
|
9
|
+ pageSize: number
|
|
|
10
|
+ dwmc?: string // 企业名称
|
|
|
11
|
+ kqmc?: string // 库区名称
|
|
|
12
|
+ yhmc?: string // 银行名称
|
|
|
13
|
+ shengCode?: string | undefined // 省份编码
|
|
|
14
|
+ shiCode?: string | undefined // 市区编码
|
|
|
15
|
+ xianCode?: string | undefined // 县区编码
|
|
|
16
|
+}
|
|
|
17
|
+
|
|
|
18
|
+interface TableItem {
|
|
|
19
|
+ province: string // 省份
|
|
|
20
|
+ urbanArea: string // 市区
|
|
|
21
|
+ countyDistrict: string // 县区
|
|
|
22
|
+ enterpriseName: string // 企业名称
|
|
|
23
|
+ warehouseAreaName: string // 库区名称
|
|
|
24
|
+ totalWarehouseCapacity: string // 总仓容
|
|
|
25
|
+ numberOfWarehouseCapacity: string // 仓容数量
|
|
|
26
|
+ selectedWarehouse: string // 已选仓库
|
|
|
27
|
+}
|
|
|
28
|
+
|
|
|
29
|
+interface AreaOption {
|
|
|
30
|
+ id: number | string
|
|
|
31
|
+ areaCode: number | string
|
|
|
32
|
+ areaName: string
|
|
|
33
|
+}
|
|
|
34
|
+
|
|
|
35
|
+// 查询参数
|
|
|
36
|
+const queryParams = ref<QueryParams>({
|
|
|
37
|
+ pageNo: 1,
|
|
|
38
|
+ pageSize: 10
|
|
|
39
|
+})
|
|
|
40
|
+
|
|
|
41
|
+// 组件状态
|
|
|
42
|
+const loading = ref(false)
|
|
|
43
|
+const queryFormRef = ref()
|
|
|
44
|
+const refForm = ref()
|
|
|
45
|
+
|
|
|
46
|
+// 表格数据
|
|
|
47
|
+const list = ref<TableItem[]>([])
|
|
|
48
|
+const total = ref(0)
|
|
|
49
|
+
|
|
|
50
|
+// 行政区划数据
|
|
|
51
|
+const shengList = ref<AreaOption[]>([])
|
|
|
52
|
+const shiList = ref<AreaOption[]>([])
|
|
|
53
|
+const xianList = ref<AreaOption[]>([])
|
|
|
54
|
+
|
|
|
55
|
+/**
|
|
|
56
|
+ * 查询列表数据
|
|
|
57
|
+ */
|
|
|
58
|
+const handleQuery = async () => {
|
|
|
59
|
+ loading.value = true
|
|
|
60
|
+ try {
|
|
|
61
|
+ // TODO: 实现查询逻辑
|
|
|
62
|
+ const data = await SelectDeliveryWarehouseApi.getSelectDeliveryWarehousePage(queryParams.value);
|
|
|
63
|
+ list.value = data.list
|
|
|
64
|
+ total.value = data.total
|
|
|
65
|
+ } catch (err) {
|
|
|
66
|
+ throw err
|
|
|
67
|
+ } finally {
|
|
|
68
|
+ loading.value = false
|
|
|
69
|
+ }
|
|
|
70
|
+}
|
|
|
71
|
+
|
|
|
72
|
+/**
|
|
|
73
|
+ * 重置查询条件
|
|
|
74
|
+ */
|
|
|
75
|
+const resetQuery = () => {
|
|
|
76
|
+ queryParams.value.pageNo = 1
|
|
|
77
|
+ queryFormRef.value?.resetFields()
|
|
|
78
|
+ handleQuery()
|
|
|
79
|
+}
|
|
|
80
|
+
|
|
|
81
|
+/**
|
|
|
82
|
+ * 获取行政区划数据
|
|
|
83
|
+ */
|
|
|
84
|
+const getDivision = async (areaCode?: string) => {
|
|
|
85
|
+ try {
|
|
|
86
|
+ return await AdministrativeDivisionApi.getList({areaCode})
|
|
|
87
|
+ } catch (err) {
|
|
|
88
|
+ throw err
|
|
|
89
|
+ }
|
|
|
90
|
+}
|
|
|
91
|
+
|
|
|
92
|
+/**
|
|
|
93
|
+ * 打开表单
|
|
|
94
|
+ */
|
|
|
95
|
+const openForm = (type: string,row:any) => {
|
|
|
96
|
+ console.log(1111)
|
|
|
97
|
+ refForm.value?.open(type, row)
|
|
|
98
|
+}
|
|
|
99
|
+
|
|
|
100
|
+// 监听省份变化
|
|
|
101
|
+watch(() => queryParams.value.shengCode, async (newValue) => {
|
|
|
102
|
+ queryParams.value.shiCode = ''
|
|
|
103
|
+ queryParams.value.xianCode = ''
|
|
|
104
|
+ if (newValue) {
|
|
|
105
|
+ shiList.value = await getDivision(newValue)
|
|
|
106
|
+ } else {
|
|
|
107
|
+ shiList.value = []
|
|
|
108
|
+ }
|
|
|
109
|
+})
|
|
|
110
|
+
|
|
|
111
|
+// 监听市区变化
|
|
|
112
|
+watch(() => queryParams.value.shiCode, async (newValue) => {
|
|
|
113
|
+ queryParams.value.xianCode = ''
|
|
|
114
|
+ if (newValue) {
|
|
|
115
|
+ xianList.value = await getDivision(newValue)
|
|
|
116
|
+ } else {
|
|
|
117
|
+ xianList.value = []
|
|
|
118
|
+ }
|
|
|
119
|
+})
|
|
|
120
|
+
|
|
|
121
|
+// 初始化加载
|
|
|
122
|
+onMounted(async () => {
|
|
|
123
|
+ shengList.value = await getDivision()
|
|
|
124
|
+ await handleQuery()
|
|
|
125
|
+})
|
|
|
126
|
+</script>
|
|
|
127
|
+
|
|
|
128
|
+<template>
|
|
|
129
|
+ <ContentWrap>
|
|
|
130
|
+ <el-form
|
|
|
131
|
+ ref="queryFormRef"
|
|
|
132
|
+ :inline="true"
|
|
|
133
|
+ :model="queryParams"
|
|
|
134
|
+ class="-mb-15px"
|
|
|
135
|
+ label-width="68px"
|
|
|
136
|
+ >
|
|
|
137
|
+ <el-form-item label="所属省份" prop="shengCode">
|
|
|
138
|
+ <el-select
|
|
|
139
|
+ v-model="queryParams.shengCode"
|
|
|
140
|
+ class="!w-240px"
|
|
|
141
|
+ clearable
|
|
|
142
|
+ placeholder="所属省份">
|
|
|
143
|
+ <el-option
|
|
|
144
|
+ v-for="item in shengList" :key="item.id" :label="item.areaName"
|
|
|
145
|
+ :value="item.areaCode"/>
|
|
|
146
|
+
|
|
|
147
|
+ </el-select>
|
|
|
148
|
+
|
|
|
149
|
+ </el-form-item>
|
|
|
150
|
+ <el-form-item label="所属市区" prop="shiCode">
|
|
|
151
|
+ <el-select
|
|
|
152
|
+ v-model="queryParams.shiCode"
|
|
|
153
|
+ class="!w-240px"
|
|
|
154
|
+ clearable
|
|
|
155
|
+ placeholder="所属省份">
|
|
|
156
|
+ <el-option
|
|
|
157
|
+ v-for="item in shiList" :key="item.id" :label="item.areaName"
|
|
|
158
|
+ :value="item.areaCode"/>
|
|
|
159
|
+
|
|
|
160
|
+ </el-select>
|
|
|
161
|
+ </el-form-item>
|
|
|
162
|
+ <el-form-item label="所属县区" prop="xianCode">
|
|
|
163
|
+ <el-select
|
|
|
164
|
+ v-model="queryParams.xianCode"
|
|
|
165
|
+ class="!w-240px"
|
|
|
166
|
+ clearable
|
|
|
167
|
+ placeholder="所属省份">
|
|
|
168
|
+ <el-option
|
|
|
169
|
+ v-for="item in xianList" :key="item.id" :label="item.areaName"
|
|
|
170
|
+ :value="item.areaCode"/>
|
|
|
171
|
+
|
|
|
172
|
+ </el-select>
|
|
|
173
|
+ </el-form-item>
|
|
|
174
|
+ <el-form-item label="企业名称" prop="dwmc">
|
|
|
175
|
+ <el-input
|
|
|
176
|
+ v-model="queryParams.dwmc"
|
|
|
177
|
+ class="!w-240px"
|
|
|
178
|
+ />
|
|
|
179
|
+ </el-form-item>
|
|
|
180
|
+ <el-form-item label="库区名称" prop="kqmc">
|
|
|
181
|
+ <el-input
|
|
|
182
|
+ v-model="queryParams.kqmc"
|
|
|
183
|
+ class="!w-240px"
|
|
|
184
|
+ clearable
|
|
|
185
|
+ placeholder="所属市区"
|
|
|
186
|
+ />
|
|
|
187
|
+ </el-form-item>
|
|
|
188
|
+ <el-form-item label="银行名称" prop="yhmc">
|
|
|
189
|
+ <el-input
|
|
|
190
|
+ v-model="queryParams.yhmc"
|
|
|
191
|
+ class="!w-240px"
|
|
|
192
|
+ clearable
|
|
|
193
|
+ placeholder="所属市区"
|
|
|
194
|
+ />
|
|
|
195
|
+ </el-form-item>
|
|
|
196
|
+ <el-form-item>
|
|
|
197
|
+ <el-button @click="handleQuery">
|
|
|
198
|
+ <Icon class="mr-5px" icon="ep:search"/>
|
|
|
199
|
+ 查询
|
|
|
200
|
+ </el-button>
|
|
|
201
|
+ <el-button @click="resetQuery">
|
|
|
202
|
+ <Icon class="mr-5px" icon="ep:refresh"/>
|
|
|
203
|
+ 重置
|
|
|
204
|
+ </el-button>
|
|
|
205
|
+ <el-button
|
|
|
206
|
+ plain
|
|
|
207
|
+ type="success"
|
|
|
208
|
+ @click="openForm('create')"
|
|
|
209
|
+ >
|
|
|
210
|
+ <Icon class="mr-5px" icon="ep:download"/>
|
|
|
211
|
+ 导出
|
|
|
212
|
+ </el-button>
|
|
|
213
|
+ </el-form-item>
|
|
|
214
|
+ </el-form>
|
|
|
215
|
+ <el-divider/>
|
|
|
216
|
+ <el-table
|
|
|
217
|
+ v-loading="loading" :border="true" :data="list" :header-cell-style="{
|
|
|
218
|
+ background: 'rgba(248,248,249,1)', color: 'rgb(79,79,79)', height: '45px'
|
|
|
219
|
+ }"
|
|
|
220
|
+ >
|
|
|
221
|
+ <el-table-column align="center" fixed="left" min-width="60" type="selection"/>
|
|
|
222
|
+ <el-table-column align="center" fixed="left" label="序号" min-width="60" type="index"/>
|
|
|
223
|
+ <el-table-column align="center" label="所属省份" min-width="180" prop="sheng"/>
|
|
|
224
|
+ <el-table-column align="center" label="所属市区" min-width="180" prop="shi"/>
|
|
|
225
|
+ <el-table-column align="center" label="所属县区" min-width="180" prop="xian"/>
|
|
|
226
|
+ <el-table-column align="center" label="企业名称" min-width="280" prop="dwmc"/>
|
|
|
227
|
+ <el-table-column align="center" label="库区名称" min-width="280" prop="kqmc"/>
|
|
|
228
|
+ <el-table-column align="center" label="库区联系人" min-width="280" prop="kqfzr"/>
|
|
|
229
|
+ <el-table-column align="center" label="联系电话" min-width="280" prop="lxdh"/>
|
|
|
230
|
+ <el-table-column align="center" label="银行认定仓房数量(个)" min-width="280" prop="yhrdnum">
|
|
|
231
|
+ <template #default="scope">
|
|
|
232
|
+ <div @click="openForm('look', {...scope.row,yxcf:3})">{{scope.row.yhrdnum }}</div>
|
|
|
233
|
+ </template>
|
|
|
234
|
+ </el-table-column>
|
|
|
235
|
+ <el-table-column align="center" label="选定仓房数量(个)" min-width="280" prop="yxcfnum">
|
|
|
236
|
+ <template #default="scope">
|
|
|
237
|
+ <div @click="openForm('look', {...scope.row,yxcf:4})">{{scope.row.yxcfnum }}</div>
|
|
|
238
|
+ </template>
|
|
|
239
|
+ </el-table-column>
|
|
|
240
|
+ <el-table-column align="center" label="认定银行" min-width="280" prop="rdyhName"/>
|
|
|
241
|
+ </el-table>
|
|
|
242
|
+ <Pagination
|
|
|
243
|
+ v-model:limit="queryParams.pageSize"
|
|
|
244
|
+ v-model:page="queryParams.pageNo"
|
|
|
245
|
+ :total="total"
|
|
|
246
|
+ @pagination="handleQuery"
|
|
|
247
|
+ />
|
|
|
248
|
+ <DeliveryWarehouseSelectFrom ref="refForm" @success="handleQuery"/>
|
|
|
249
|
+ </ContentWrap>
|
|
|
250
|
+
|
|
|
251
|
+</template>
|
|
|
252
|
+
|
|
|
253
|
+<style lang="scss" scoped>
|
|
|
254
|
+
|
|
|
255
|
+</style>
|