4373acf5
wesley88
1
|
1
2
3
|
<template>
<div>
<el-form :model="ruleForm" :rules="rulesHetong" ref="heForm" label-width="130px" class="demo-ruleForm">
|
118fc86d
wesley88
1
|
4
5
6
7
8
9
10
11
12
|
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="商铺名称" prop="shopName">
<el-input v-model="ruleForm.shopName" placeholder="请输入" maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商铺类型" prop="shopType">
<el-select v-model="ruleForm.shopType" placeholder="请选择" style="width: 100%;">
|
04473319
wesley88
1
|
13
14
15
|
<!-- <el-option label="移动铺位" value="1"></el-option>
<el-option label="固定铺位" value="2"></el-option> -->
<el-option v-for="(item,index) in typeShopList" :key="index" :label="item.label" :value="item.value"></el-option>
|
118fc86d
wesley88
1
|
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
|
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="测绘面积" prop="surveyingArea">
<el-input v-model.number="ruleForm.surveyingArea" placeholder="请输入" maxlength="10" @input="validateNumber('surveyingArea', $event)">
<template slot="append">M<sup>2</sup></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产权面积" prop="propertyArea">
<el-input v-model.number="ruleForm.propertyArea" placeholder="请输入" maxlength="10" @input="validateNumber('propertyArea', $event)">
<template slot="append">M<sup>2</sup></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="实际使用面积" prop="actualUsableArea">
<el-input v-model.number="ruleForm.actualUsableArea" placeholder="请输入" maxlength="10" @input="validateNumber('actualUsableArea', $event)">
<template slot="append">M<sup>2</sup></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属区域" prop="belongingRegion">
<el-select v-model="ruleForm.belongingRegion" placeholder="请选择" style="width: 100%;">
<el-option v-for="(item,index) in regionOptions"
:key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
|
c3f8e431
wesley88
1
|
54
55
56
57
58
59
60
61
62
63
|
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属绿道段" prop="belongingGreenwaySection">
<el-select v-model="ruleForm.belongingGreenwaySection" placeholder="请选择"
style="margin-top:5px;width: 100%;" @change="lvdaoSel">
<el-option :label="item.name" :value="item.code" v-for="(item,index) in lvdaoList"
:key="index"></el-option>
</el-select>
</el-form-item>
</el-col>
|
87726dd1
杨鑫
'最新'
|
64
|
|
c3f8e431
wesley88
1
|
65
|
<el-col :span="12">
|
2d926347
wesley88
1
|
66
67
68
69
70
71
72
73
74
75
|
<el-form-item label="所属公园/步道" prop="belongingParkTrail">
<el-select v-model="ruleForm.belongingParkTrail" placeholder="请选择" style="width: 100%;">
<el-option :label="item.name" :value="item.code" v-for="(item,index) in gongyuanList"
:key="index"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
|
c3f8e431
wesley88
1
|
76
77
78
79
80
|
<el-form-item label="门牌号" prop="houseNumber">
<el-input v-model="ruleForm.houseNumber" placeholder="请输入"
maxlength="20"></el-input>
</el-form-item>
</el-col>
|
118fc86d
wesley88
1
|
81
82
83
84
85
86
|
<el-col :span="12">
<el-form-item label="归属部门" prop="belongingDepartment">
<el-input v-model="ruleForm.belongingDepartment" placeholder="请输入" maxlength="20">
</el-input>
</el-form-item>
</el-col>
|
2d926347
wesley88
1
|
87
88
|
</el-row>
<el-row :gutter="20">
|
118fc86d
wesley88
1
|
89
90
91
92
93
94
|
<el-col :span="12">
<el-form-item label="负责人" prop="head">
<el-input v-model="ruleForm.head" placeholder="请输入" maxlength="10">
</el-input>
</el-form-item>
</el-col>
|
118fc86d
wesley88
1
|
95
96
|
<el-col :span="12">
<el-form-item label="联系人" prop="contacts">
|
cf438595
wesley88
1
|
97
|
<el-input v-model="ruleForm.contacts" placeholder="请输入" maxlength="50">
|
118fc86d
wesley88
1
|
98
99
100
|
</el-input>
</el-form-item>
</el-col>
|
2d926347
wesley88
1
|
101
102
|
</el-row>
<el-row :gutter="20">
|
118fc86d
wesley88
1
|
103
104
105
106
107
108
109
|
<el-col :span="12">
<el-form-item label="联系方式" prop="telephone">
<el-input v-model="ruleForm.telephone" placeholder="请输入" maxlength="20">
</el-input>
</el-form-item>
</el-col>
</el-row>
|
d64cd58f
wesley88
上传验收小程序
|
110
|
<el-form-item label="详细位置" prop="detailedLocation">
|
c3f8e431
wesley88
1
|
111
|
<el-input :disabled="true" v-model="ruleForm.detailedLocation" placeholder="请地图标点选择位置" maxlength="100">
|
d64cd58f
wesley88
上传验收小程序
|
112
113
114
115
|
</el-input>
</el-form-item>
<el-form-item label="地图标点" prop="mapPunctuation">
<div style="width: 100%;height: 300px;">
|
118fc86d
wesley88
1
|
116
|
<newmap :isonloed="info.id?true:false" :lat="lat" :lng="lng" @updatecenter="updatecenter"></newmap>
|
d64cd58f
wesley88
上传验收小程序
|
117
118
119
120
121
122
|
</div>
</el-form-item>
<el-form-item label="商铺描述" prop="shopDescription">
<el-input maxlength="200" show-word-limit rows="4" v-model="ruleForm.shopDescription" placeholder="请输入"
type="textarea" />
</el-form-item>
|
118fc86d
wesley88
1
|
123
124
|
<el-form-item label="建筑图纸" prop="architecturalDrawings">
<upimg :cmpOption="{disabled:false,isSetCover:false}" filePath="sp" inputtype="architecturalDrawings" :value="ruleForm.architecturalDrawings"
|
d64cd58f
wesley88
上传验收小程序
|
125
126
|
@changimg="e=>changimg(e,'architecturalDrawings')"></upimg>
</el-form-item>
|
118fc86d
wesley88
1
|
127
|
<el-form-item label="宣传图" prop="displayMainImage">
|
d64cd58f
wesley88
上传验收小程序
|
128
|
<upimg filePath="sp" inputtype="displayMainImage" :value="ruleForm.displayMainImage"
|
98bc35a2
wesley88
1
|
129
|
@changimg="e=>changimg(e,'displayMainImage')" @changfmindex="changfmindex"></upimg>
|
0c5d2ce8
wesley88
1
|
130
|
</el-form-item>
|
118fc86d
wesley88
1
|
131
|
<el-form-item label="其他视频" prop="otherImageVideos">
|
a182f238
wesley88
1
|
132
|
<upfile filePath="sp" inputtype="otherImageVideos" :value="ruleForm.otherImageVideos" @changimg="e=>changimg(e,'otherImageVideos')"></upfile>
|
118fc86d
wesley88
1
|
133
|
</el-form-item>
|
4373acf5
wesley88
1
|
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
<el-row :gutter="20">
<el-col :span="12">
<el-form-item>
<div style="margin-top: 20px">
<el-button @click="add()" style="background-color: #3F9B6A;color: #fff;">确定</el-button>
<el-button @click="close()" class="buttonHover"
style="color: #606266;border: 1px solid #DBDBDB;background-color: #fff;">取消</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
import MapMark from "@/components/MapContainer/MapMark";
import upimg from "@/components/ImageUpload/index"
|
d64cd58f
wesley88
上传验收小程序
|
152
|
import upfile from "@/components/fujianUpload/fujianList"
|
4373acf5
wesley88
1
|
153
154
155
156
157
158
159
160
161
162
|
import {
uploadUrl
} from '@/utils/request'
import {
miniioupload
} from '../../api/commodityLease.js'
import {
gongyuan,
lvdaoduan,
addList,
|
40a0b33d
杨鑫
'最新'
|
163
164
|
editList,
parkTrails
|
2d926347
wesley88
1
|
165
|
} from '@/api/information.js';
|
d64cd58f
wesley88
上传验收小程序
|
166
|
import newmap from "@/components/newmap/index";
|
4373acf5
wesley88
1
|
167
168
|
export default {
components: {
|
d64cd58f
wesley88
上传验收小程序
|
169
|
upfile,
|
4373acf5
wesley88
1
|
170
|
upimg,
|
d64cd58f
wesley88
上传验收小程序
|
171
172
|
MapMark,
newmap
|
4373acf5
wesley88
1
|
173
|
},
|
118fc86d
wesley88
1
|
174
175
|
computed: {
regionOptions() {
|
04473319
wesley88
1
|
176
177
178
179
180
|
return this.$store.state.cent.regionList;
},
typeShopList() {
return this.$store.state.cent.typeShopList;
},
|
118fc86d
wesley88
1
|
181
|
},
|
4373acf5
wesley88
1
|
182
183
|
data() {
return {
|
118fc86d
wesley88
1
|
184
185
|
lat: 30.67,
lng: 104.06,
|
4373acf5
wesley88
1
|
186
187
|
uploadFileUrl: uploadUrl, // 请求地址
ruleForm: {
|
d64cd58f
wesley88
上传验收小程序
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
shopName: '', // 商铺名称
venueNumber: '', // 场地编号
houseNumber: '', // 门牌号
architecturalForm: '', // 建筑形式
actualUsableArea: '', // 实际使用面积
belongingRegion: '', // 所属区域
belongingDepartment: '', // 归属部门
head: '', // 负责人
detailedLocation: '', // 详细位置
mapPunctuation: '', // 地图标点
architecturalDrawings: '', // 建筑图纸
shopDescription: '', // 商铺描述
displayMainImage: '', // 展示主图
otherImageVideos: '', // 其他图片视频
|
118fc86d
wesley88
1
|
202
|
rentalStatus: '', // 租赁状态
|
d64cd58f
wesley88
上传验收小程序
|
203
204
205
206
|
publishStatus: '', // 发布状态
leaseExpirationDate: '', // 租赁到期时间
createDate: '', // 创建时间
createUser: '', // 创建人
|
a182f238
wesley88
1
|
207
208
|
// updateDate: '', // 修改时间
// updateUser: '', // 修改人
|
d64cd58f
wesley88
上传验收小程序
|
209
|
businessNature: '', // 经营性质
|
118fc86d
wesley88
1
|
210
|
telephone: '', // 联系电话
|
d64cd58f
wesley88
上传验收小程序
|
211
212
213
214
|
identityCard: '', // 身份证号码
belongingGreenwaySection: '', // 所属绿道段
belongingParkTrail: '', // 所属公园/步道
floorSpace: '', // 建筑面积
|
118fc86d
wesley88
1
|
215
216
217
218
219
220
|
contractNumber: '', // 合同编号
shopType: '1', // 商铺类型
surveyingArea: '', // 测绘面积
propertyArea: '', // 产权面积
contacts: '', // 联系人
planningDrawings: '' // 规划图纸
|
4373acf5
wesley88
1
|
221
222
223
224
225
226
227
|
},
rulesHetong: {
shopName: [{
required: true,
message: '请输入商铺名称',
trigger: 'blur'
}, ],
|
118fc86d
wesley88
1
|
228
|
shopType: [{
|
4373acf5
wesley88
1
|
229
|
required: true,
|
118fc86d
wesley88
1
|
230
|
message: '请选择商铺类型',
|
4373acf5
wesley88
1
|
231
232
|
trigger: 'blur'
}, ],
|
3c4666ce
杨鑫
'最新'
|
233
234
235
236
237
|
actualUsableArea: [{
required: true,
message: '请输入实际使用面积',
trigger: 'blur'
}],
|
c3f8e431
wesley88
1
|
238
239
240
241
242
|
belongingGreenwaySection: [{
required: true,
message: '请填写所属绿道段',
trigger: 'blur'
}, ],
|
4373acf5
wesley88
1
|
243
244
245
246
247
|
belongingRegion: [{
required: true,
message: '请选择所属区域',
trigger: 'change'
}],
|
4373acf5
wesley88
1
|
248
249
|
detailedLocation: [{
required: true,
|
c3f8e431
wesley88
1
|
250
|
message: '请地图标点选择位置',
|
4373acf5
wesley88
1
|
251
252
|
trigger: 'blur'
}, ],
|
6b583a85
wesley88
1
|
253
254
255
256
257
|
propertyArea: [{
required: true,
message: '请填写产权面积',
trigger: 'blur'
}, ],
|
118fc86d
wesley88
1
|
258
259
260
261
262
263
264
265
266
267
|
mapPunctuation: [{
required: true,
message: '请选择地图标点',
trigger: 'change'
}],
displayMainImage: [{
required: true,
message: '请上传宣传图',
trigger: 'change'
}]
|
4373acf5
wesley88
1
|
268
269
270
271
272
|
},
uploadFiles: [],
filesLength: 1,
lvdaoList: [],
gongyuanList: [],
|
d64cd58f
wesley88
上传验收小程序
|
273
274
|
parentMessage: {},
edit: true
|
4373acf5
wesley88
1
|
275
276
277
278
279
280
281
282
283
284
285
286
|
};
},
props: {
info: {
type: Object,
default: {}
}
},
async created() {
console.error(this.info)
if (this.info.id) {
this.ruleForm = this.info
|
118fc86d
wesley88
1
|
287
|
if (this.ruleForm.mapPunctuation) {
|
a182f238
wesley88
1
|
288
289
|
this.lat = Number(this.ruleForm.mapPunctuation.split(',')[0])
this.lng = Number(this.ruleForm.mapPunctuation.split(',')[1])
|
118fc86d
wesley88
1
|
290
|
}
|
4373acf5
wesley88
1
|
291
|
}
|
40a0b33d
杨鑫
'最新'
|
292
293
294
|
const lvdao = await lvdaoduan()
const gongyua = await parkTrails()
this.lvdaoList = lvdao.data.concat(gongyua.data)
|
4373acf5
wesley88
1
|
295
296
|
},
methods: {
|
118fc86d
wesley88
1
|
297
298
299
300
301
302
303
|
validateNumber(field, value) {
// 使用正则表达式确保输入的是数字,并且可以包含最多两位小数
const regex = /^\d+(\.\d{1,2})?$/;
if (!regex.test(value)) {
this.ruleForm[field] = value.replace(/[^\d.]/g, '').replace(/(\.\d{2}).*$/, '$1');
}
},
|
d64cd58f
wesley88
上传验收小程序
|
304
|
updatecenter(e) {
|
118fc86d
wesley88
1
|
305
|
console.error('-----------', e)
|
d64cd58f
wesley88
上传验收小程序
|
306
|
this.ruleForm.detailedLocation = e.address
|
a182f238
wesley88
1
|
307
308
|
this.lat = e.lat
this.lng = e.lng
|
d64cd58f
wesley88
上传验收小程序
|
309
|
},
|
98bc35a2
wesley88
1
|
310
311
312
|
changfmindex(e) {
console.error(e)
},
|
d64cd58f
wesley88
上传验收小程序
|
313
314
|
changimg(e, type) {
this.ruleForm[type] = e
|
a182f238
wesley88
1
|
315
|
console.error(this.ruleForm[type])
|
d64cd58f
wesley88
上传验收小程序
|
316
|
},
|
4373acf5
wesley88
1
|
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
//获取当前时间
updateCurrentTime() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
//获取地图点击的经纬度
getChildDate(mapData) {
this.mapData = mapData
},
lvdaoSel(vaule) {
this.ruleForm.belongingParkTrail = ''
this.gongyuan(vaule)
},
async gongyuan(value) {
|
40a0b33d
杨鑫
'最新'
|
339
340
341
342
|
const budao = await gongyuan()
const gongyua = await parkTrails()
const allgong= budao.data.concat(gongyua.data)
this.gongyuanList = allgong.filter(item => item.superior == value);
|
4373acf5
wesley88
1
|
343
344
|
},
add() {
|
d64cd58f
wesley88
上传验收小程序
|
345
346
347
|
console.log({
...this.ruleForm
})
|
118fc86d
wesley88
1
|
348
349
350
351
|
if(this.lat) {
this.ruleForm.mapPunctuation = this.lat + ',' + this.lng
}
|
d64cd58f
wesley88
上传验收小程序
|
352
|
// return
|
4373acf5
wesley88
1
|
353
354
355
356
|
if (this.ruleForm.id) {
this.$refs.heForm.validate((valid) => {
console.log(valid)
if (valid) {
|
4373acf5
wesley88
1
|
357
|
this.ruleForm.updateDate = this.updateCurrentTime()
|
118fc86d
wesley88
1
|
358
|
this.ruleForm.updateUser = localStorage.getItem('roleName')
|
4373acf5
wesley88
1
|
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
|
editList(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.$emit('removeonaction', '1')
} else {
this.$message({
message: res.msg,
type: 'error'
})
}
})
} else {
this.$message({
message: '请填写完整信息',
type: 'error'
})
return false;
}
})
} else {
this.$refs.heForm.validate((valid) => {
console.log(valid)
if (valid) {
|
4373acf5
wesley88
1
|
387
|
this.ruleForm.createDate = this.updateCurrentTime()
|
4373acf5
wesley88
1
|
388
389
|
this.ruleForm.rentalStatus = 0
this.ruleForm.publishStatus = 0
|
118fc86d
wesley88
1
|
390
|
this.ruleForm.createUser = localStorage.getItem('roleName')
|
4373acf5
wesley88
1
|
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
addList(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.$emit('removeonaction', '1')
} else {
this.$message({
message: res.msg,
type: 'error'
})
}
})
} else {
this.$message({
message: '请填写完整信息',
type: 'error'
})
return false;
}
})
}
},
close() {
this.$emit('removeonaction', '1')
},
|
0c5d2ce8
wesley88
1
|
419
420
|
hefuRemove(e) {
// this.ruleForm[e] = ''
|
4373acf5
wesley88
1
|
421
|
},
|
0c5d2ce8
wesley88
1
|
422
|
hefuSuccess(response, e) {
|
4373acf5
wesley88
1
|
423
|
console.error(response)
|
0c5d2ce8
wesley88
1
|
424
425
|
console.error(e)
this.ruleForm[e] = ''
|
4373acf5
wesley88
1
|
426
427
|
let fd = new FormData()
fd.append('file', response.raw)
|
0c5d2ce8
wesley88
1
|
428
|
fd.append('filePath', 'sp')
|
4373acf5
wesley88
1
|
429
430
|
miniioupload(fd).then(res => {
console.error(res)
|
0c5d2ce8
wesley88
1
|
431
|
this.ruleForm[e] = res.data
|
4373acf5
wesley88
1
|
432
|
})
|
0c5d2ce8
wesley88
1
|
433
|
}
|
4373acf5
wesley88
1
|
434
435
436
437
438
439
|
},
};
</script>
<style lang="scss">
|
4373acf5
wesley88
1
|
440
441
442
443
444
445
446
447
448
449
|
.el-dialog__header {
background-color: #F2F3F5;
text-align: left;
}
.el-dialog__title {
line-height: 30px;
font-size: 15px;
color: #303133;
}
|
0c5d2ce8
wesley88
1
|
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
|
.avatar-uploader .el-upload {
border: 1px dashed #3F9B6A;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #3F9B6A;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
|
4373acf5
wesley88
1
|
477
|
</style>
|