傅行帆 6 år sedan
förälder
incheckning
eec34873a8

+ 14
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpRentalHouseController.java Visa fil

@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiImplicitParams;
15 15
 import io.swagger.annotations.ApiOperation;
16 16
 import org.springframework.beans.factory.annotation.Autowired;
17 17
 import org.springframework.cloud.context.config.annotation.RefreshScope;
18
+import org.springframework.web.bind.annotation.PathVariable;
18 19
 import org.springframework.web.bind.annotation.RequestBody;
19 20
 import org.springframework.web.bind.annotation.RequestMapping;
20 21
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -86,6 +87,19 @@ public class TpRentalHouseController extends BaseController {
86 87
 		return responseBean;
87 88
 	}
88 89
 	
90
+	@ApiOperation(value = "获取公寓信息", notes = "获取公寓信息")
91
+	@ApiImplicitParams({
92
+			@ApiImplicitParam(paramType = "path", dataType = "Integer", name = "id", value = "公寓Id"),
93
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
94
+	})
95
+	@RequestMapping(value = "/rental/get/{id}",method = RequestMethod.GET)
96
+	public ResponseBean getRental(@PathVariable Integer id, HttpSession session){
97
+		ResponseBean responseBean = new ResponseBean();
98
+		UserElement userElement = getUserElement(session);
99
+		TpRentalHouse rentalHouse = tpRentalHouseService.getRentalById(id);
100
+		responseBean.addSuccess(rentalHouse);
101
+		return responseBean;
102
+	}
89 103
 	
90 104
 	@ApiOperation(value = "上架房间", notes = "上架房间")
91 105
 	@ApiImplicitParams({

+ 4
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpRentalHouseImgMapper.java Visa fil

@@ -3,6 +3,8 @@ package com.community.huiju.dao;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.TpRentalHouseImg;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * <p>
8 10
  * 出租房间图片 Mapper 接口
@@ -12,5 +14,6 @@ import com.community.huiju.model.TpRentalHouseImg;
12 14
  * @since 2019-05-13
13 15
  */
14 16
 public interface TpRentalHouseImgMapper extends BaseMapper<TpRentalHouseImg> {
15
-
17
+	
18
+	int batchInsert(List<TpRentalHouseImg> rentalHouseImgList);
16 19
 }

+ 13
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpRentalHouse.java Visa fil

@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11 11
 import java.time.LocalDateTime;
12
+import java.util.List;
12 13
 
13 14
 /**
14 15
  * <p>
@@ -222,5 +223,16 @@ public class TpRentalHouse implements Serializable {
222 223
      */
223 224
     @TableField(exist = false)
224 225
     private String userName;
225
-
226
+    
227
+    /**
228
+     * 列表图片
229
+     */
230
+    @TableField(exist = false)
231
+    private String appListImg;
232
+    
233
+    /**
234
+     * 轮播图
235
+     */
236
+    @TableField(exist = false)
237
+    private List<String> appCarouselImg;
226 238
 }

+ 15
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpRentalHouseService.java Visa fil

@@ -30,4 +30,19 @@ public interface ITpRentalHouseService extends IService<TpRentalHouse> {
30 30
 	 * @return
31 31
 	 */
32 32
 	ResponseBean getRentalList(Integer id, String houseName, String startPrice, String endPrice, String rentalType, String houseType, String houseStatus, UserElement userElement, Integer pageNum, Integer pageSize);
33
+	
34
+	/**
35
+	 * 保存长租公寓房间信息
36
+	 * @param rentalHouse
37
+	 * @param userElement
38
+	 * @return
39
+	 */
40
+	ResponseBean saveRental(TpRentalHouse rentalHouse, UserElement userElement);
41
+	
42
+	/**
43
+	 * 根据ID取值
44
+	 * @param id
45
+	 * @return
46
+	 */
47
+	TpRentalHouse getRentalById(Integer id);
33 48
 }

+ 83
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpRentalHouseServiceImpl.java Visa fil

@@ -1,15 +1,20 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 6
 import com.community.commom.mode.ResponseBean;
6 7
 import com.community.commom.session.UserElement;
8
+import com.community.huiju.dao.TpRentalHouseImgMapper;
7 9
 import com.community.huiju.dao.TpRentalHouseMapper;
8 10
 import com.community.huiju.model.TpRentalHouse;
11
+import com.community.huiju.model.TpRentalHouseImg;
9 12
 import com.community.huiju.service.ITpRentalHouseService;
10 13
 import org.springframework.beans.factory.annotation.Autowired;
11 14
 import org.springframework.stereotype.Service;
12 15
 
16
+import java.time.LocalDateTime;
17
+import java.util.ArrayList;
13 18
 import java.util.HashMap;
14 19
 import java.util.List;
15 20
 import java.util.Map;
@@ -27,6 +32,10 @@ public class TpRentalHouseServiceImpl extends ServiceImpl<TpRentalHouseMapper, T
27 32
 	
28 33
 	@Autowired
29 34
 	private TpRentalHouseMapper tpRentalHouseMapper;
35
+	
36
+	@Autowired
37
+	private TpRentalHouseImgMapper tpRentalHouseImgMapper;
38
+	
30 39
 	/**
31 40
 	 * 获取公寓房间列表
32 41
 	 *
@@ -62,4 +71,78 @@ public class TpRentalHouseServiceImpl extends ServiceImpl<TpRentalHouseMapper, T
62 71
 		responseBean.addSuccess(map);
63 72
 		return responseBean;
64 73
 	}
74
+	
75
+	/**
76
+	 * 保存长租公寓房间信息
77
+	 *
78
+	 * @param rentalHouse
79
+	 * @param userElement
80
+	 * @return
81
+	 */
82
+	@Override
83
+	public ResponseBean saveRental(TpRentalHouse rentalHouse, UserElement userElement) {
84
+		ResponseBean responseBean = new ResponseBean();
85
+		//插入房间信息
86
+		Integer communityId = userElement.getCommunityId();
87
+		Integer userId = userElement.getId();
88
+		LocalDateTime nowTime = LocalDateTime.now();
89
+		rentalHouse.setCommunityId(communityId);
90
+		rentalHouse.setCreateDate(nowTime);
91
+		rentalHouse.setCreateUser(userId);
92
+		tpRentalHouseMapper.insert(rentalHouse);
93
+		//插入公寓首页图信息
94
+		TpRentalHouseImg tpRentalHouseImg = new TpRentalHouseImg();
95
+		tpRentalHouseImg.setCommunityId(communityId);
96
+		tpRentalHouseImg.setCreateDate(nowTime);
97
+		tpRentalHouseImg.setRentalHouseId(rentalHouse.getId());
98
+		tpRentalHouseImg.setImgType("1");
99
+		tpRentalHouseImg.setImgUrl(rentalHouse.getAppListImg());
100
+		tpRentalHouseImgMapper.insert(tpRentalHouseImg);
101
+		//插入公寓轮播图信息
102
+		List<String> imgList = rentalHouse.getAppCarouselImg();
103
+		List<TpRentalHouseImg> rentalHouseImgList = new ArrayList<>();
104
+		imgList.stream().forEach(e -> {
105
+			TpRentalHouseImg rentalHouseImg = new TpRentalHouseImg();
106
+			rentalHouseImg.setCommunityId(communityId);
107
+			rentalHouseImg.setCreateDate(nowTime);
108
+			rentalHouseImg.setRentalHouseId(rentalHouse.getId());
109
+			rentalHouseImg.setImgType("2");
110
+			rentalHouseImg.setImgUrl(e);
111
+			rentalHouseImgList.add(rentalHouseImg);
112
+		});
113
+		tpRentalHouseImgMapper.batchInsert(rentalHouseImgList);
114
+		responseBean.addSuccess("插入成功");
115
+		return responseBean;
116
+	}
117
+	
118
+	/**
119
+	 * 根据ID取值
120
+	 *
121
+	 * @param id
122
+	 * @return
123
+	 */
124
+	@Override
125
+	public TpRentalHouse getRentalById(Integer id) {
126
+		//获取公寓数据
127
+		TpRentalHouse tpRentalHouse = tpRentalHouseMapper.selectById(id);
128
+		//获取公寓列表图片
129
+		QueryWrapper<TpRentalHouseImg> tpRentalHouseImgQueryWrapper = new QueryWrapper<>();
130
+		tpRentalHouseImgQueryWrapper.eq("community_id", tpRentalHouse.getCommunityId());
131
+		tpRentalHouseImgQueryWrapper.eq("rental_house_id",tpRentalHouse.getId());
132
+		tpRentalHouseImgQueryWrapper.eq("img_type","1");
133
+		TpRentalHouseImg tpRentalHouseImg = tpRentalHouseImgMapper.selectOne(tpRentalHouseImgQueryWrapper);
134
+		tpRentalHouse.setAppListImg(tpRentalHouseImg.getImgUrl());
135
+		//获取公寓轮播图图片
136
+		QueryWrapper<TpRentalHouseImg> carouseQueryWrapper = new QueryWrapper<>();
137
+		carouseQueryWrapper.eq("community_id", tpRentalHouse.getCommunityId());
138
+		carouseQueryWrapper.eq("rental_house_id",tpRentalHouse.getId());
139
+		carouseQueryWrapper.eq("img_type","2");
140
+		List<TpRentalHouseImg> tpRentalHouseImgList = tpRentalHouseImgMapper.selectList(carouseQueryWrapper);
141
+		List<String> imgList = new ArrayList<>();
142
+		tpRentalHouseImgList.stream().forEach(e -> {
143
+			imgList.add(e.getImgUrl());
144
+		});
145
+		tpRentalHouse.setAppCarouselImg(imgList);
146
+		return tpRentalHouse;
147
+	}
65 148
 }

+ 7
- 1
CODE/smart-community/property-api/src/main/resources/mapper/TpRentalHouseImgMapper.xml Visa fil

@@ -1,5 +1,11 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.community.huiju.dao.TpRentalHouseImgMapper">
4
-
4
+    <insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.ArrayList">
5
+        insert into tp_rental_house_img(community_id,rental_house_id,img_url,img_type,create_date)
6
+        VALUES
7
+        <foreach collection="list" item="item" index="index" separator=",">
8
+            (#{item.communityId},#{item.rentalHouseId},#{item.imgUrl},#{item.imgType},#{item.createDate})
9
+        </foreach>
10
+    </insert>
5 11
 </mapper>

+ 8
- 1
VUECODE/smart-property-manage/src/api/rental.js Visa fil

@@ -28,10 +28,17 @@ export function shelfRental(ids) {
28 28
   })
29 29
 }
30 30
 
31
-export function addShop(listQuery) {
31
+export function addRental(listQuery) {
32 32
   return request({
33 33
     url: '/rental/add',
34 34
     method: 'post',
35 35
     data: listQuery
36 36
   })
37 37
 }
38
+
39
+export function getRental(id) {
40
+  return request({
41
+    url: '/rental/get/' + id,
42
+    method: 'get'
43
+  })
44
+}

+ 10
- 1
VUECODE/smart-property-manage/src/store/modules/rental.js Visa fil

@@ -1,4 +1,4 @@
1
-import { fetchRentalList, shelfRental, obtainedRental, addRental } from '@/api/rental'
1
+import { fetchRentalList, shelfRental, obtainedRental, addRental, getRental } from '@/api/rental'
2 2
 
3 3
 const transaction = {
4 4
   namespaced: true,
@@ -28,6 +28,15 @@ const transaction = {
28 28
         })
29 29
       })
30 30
     },
31
+    GetRental({ commit }, id) {
32
+      return new Promise((resolve, reject) => {
33
+        getRental(id).then(response => {
34
+          resolve(response)
35
+        }).catch(error => {
36
+          reject(error)
37
+        })
38
+      })
39
+    },
31 40
     ShelfRental({ commit }, ids) {
32 41
       return new Promise((resolve, reject) => {
33 42
         shelfRental(ids).then(response => {

+ 18
- 18
VUECODE/smart-property-manage/src/views/rental/rentalAdd.vue Visa fil

@@ -52,7 +52,7 @@
52 52
         </el-dialog>
53 53
       </el-form-item>
54 54
       <el-form-item label="上架状态" prop="houseStatus">
55
-        <el-select v-model="listData.shopStatus" placeholder="请选择">
55
+        <el-select v-model="listData.houseStatus" placeholder="请选择">
56 56
           <el-option label="已上架" value="1"/>
57 57
           <el-option label="已下架" value="2"/>
58 58
         </el-select>
@@ -73,22 +73,22 @@
73 73
         <el-input v-model="listData.communityAddress"/>
74 74
       </el-form-item>
75 75
       <el-form-item label="房屋配套">
76
-        <el-checkbox v-model="listData.bed">床</el-checkbox>
77
-        <el-checkbox v-model="listData.mattress">床垫</el-checkbox>
78
-        <el-checkbox v-model="listData.wardrobe">衣柜</el-checkbox>
79
-        <el-checkbox v-model="listData.sofa">沙发</el-checkbox>
80
-        <el-checkbox v-model="listData.washingMachine">洗衣机</el-checkbox>
81
-        <el-checkbox v-model="listData.airConditioning">空调</el-checkbox>
82
-        <el-checkbox v-model="listData.fridge">冰箱</el-checkbox>
83
-        <el-checkbox v-model="listData.TV">电视</el-checkbox>
84
-        <el-checkbox v-model="listData.smartLock">智能锁</el-checkbox>
85
-        <el-checkbox v-model="listData.waterHeater">热水器</el-checkbox>
86
-        <el-checkbox v-model="listData.desk">桌子</el-checkbox>
87
-        <el-checkbox v-model="listData.chair">椅子</el-checkbox>
88
-        <el-checkbox v-model="listData.WiFi">网络</el-checkbox>
89
-        <el-checkbox v-model="listData.kitchen">厨房</el-checkbox>
90
-        <el-checkbox v-model="listData.bathroom">独卫</el-checkbox>
91
-        <el-checkbox v-model="listData.balcony">阳台</el-checkbox>
76
+        <el-checkbox v-model="listData.bed" true-label="1" false-label="0">床</el-checkbox>
77
+        <el-checkbox v-model="listData.mattress" true-label="1" false-label="0">床垫</el-checkbox>
78
+        <el-checkbox v-model="listData.wardrobe" true-label="1" false-label="0">衣柜</el-checkbox>
79
+        <el-checkbox v-model="listData.sofa" true-label="1" false-label="0">沙发</el-checkbox>
80
+        <el-checkbox v-model="listData.washingMachine" true-label="1" false-label="0">洗衣机</el-checkbox>
81
+        <el-checkbox v-model="listData.airConditioning" true-label="1" false-label="0">空调</el-checkbox>
82
+        <el-checkbox v-model="listData.fridge" true-label="1" false-label="0">冰箱</el-checkbox>
83
+        <el-checkbox v-model="listData.TV" true-label="1" false-label="0">电视</el-checkbox>
84
+        <el-checkbox v-model="listData.smartLock" true-label="1" false-label="0">智能锁</el-checkbox>
85
+        <el-checkbox v-model="listData.waterHeater" true-label="1" false-label="0">热水器</el-checkbox>
86
+        <el-checkbox v-model="listData.desk" true-label="1" false-label="0">桌子</el-checkbox>
87
+        <el-checkbox v-model="listData.chair" true-label="1" false-label="0">椅子</el-checkbox>
88
+        <el-checkbox v-model="listData.WiFi" true-label="1" false-label="0">网络</el-checkbox>
89
+        <el-checkbox v-model="listData.kitchen" true-label="1" false-label="0">厨房</el-checkbox>
90
+        <el-checkbox v-model="listData.bathroom" true-label="1" false-label="0">独卫</el-checkbox>
91
+        <el-checkbox v-model="listData.balcony" true-label="1" false-label="0">阳台</el-checkbox>
92 92
       </el-form-item>
93 93
       <el-form-item label="高德坐标">
94 94
         <el-input placeholder="经度" v-model="listData.communityLongitude" style="width: 150px;" />
@@ -285,7 +285,7 @@ export default {
285 285
         loading.close()
286 286
       }).catch(() => {
287 287
         loading.close()
288
-        console.log('error AddBuilding')
288
+        console.log('error addRental')
289 289
       })
290 290
     }
291 291
   }

+ 107
- 85
VUECODE/smart-property-manage/src/views/rental/rentalEdit.vue Visa fil

@@ -1,23 +1,14 @@
1 1
 <template>
2 2
   <div class="root">
3 3
     <el-form ref="ruleForm" :model="listData" :rules="rules" label-width="150px" class="add-ruleForm">
4
-      <el-form-item label="商铺名称" prop="shopName">
5
-        <el-input v-model="listData.shopName"/>
4
+      <el-form-item label="房间名称" prop="houseName">
5
+        <el-input v-model="listData.houseName"/>
6 6
       </el-form-item>
7
-      <el-form-item label="商铺说明" prop="remark">
8
-        <el-input v-model="listData.remark"/>
7
+      <el-form-item label="房间租金" prop="rentalPrice">
8
+        <el-input v-model="listData.rentalPrice"/>
9 9
       </el-form-item>
10
-      <el-form-item label="app首页展示图" prop="appIndexImg">
11
-        <el-upload
12
-          class="avatar-uploader"
13
-          name="uploadFiles"
14
-          :action="uploadImgUrl"
15
-          :show-file-list="false"
16
-          :on-success="handleAppIndexSuccess"
17
-          :before-upload="beforeAvatarUpload">
18
-          <img v-if="listData.appIndexImg" :src="listData.appIndexImg" class="avatar">
19
-          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
20
-        </el-upload>
10
+      <el-form-item label="面积" prop="area">
11
+        <el-input v-model="listData.area"/>
21 12
       </el-form-item>
22 13
       <el-form-item label="app列表展示图" prop="appListImg">
23 14
         <el-upload
@@ -31,13 +22,27 @@
31 22
           <i v-else class="el-icon-plus avatar-uploader-icon"></i>
32 23
         </el-upload>
33 24
       </el-form-item>
34
-      <el-form-item label="app商铺轮播图" prop="appCarouselImg">
25
+      <el-form-item label="户型" prop="houseType">
26
+        <el-select v-model="listData.houseType" placeholder="请选择">
27
+            <el-option label="一室居" value="1"/>
28
+            <el-option label="二室居" value="2"/>
29
+            <el-option label="三室居" value="3"/>
30
+            <el-option label="四室居及以上" value="4"/>
31
+          </el-select>
32
+      </el-form-item>
33
+      <el-form-item label="租赁方式" prop="rentalType">
34
+        <el-select v-model="listData.rentalType" placeholder="请选择">
35
+            <el-option label="整租" value="1"/>
36
+            <el-option label="合租" value="2"/>
37
+          </el-select>
38
+      </el-form-item>
39
+      <el-form-item label="轮播图" prop="appCarouselImg">
35 40
         <el-upload
36 41
           name="uploadFiles"
37 42
           :limit="6"
43
+          :file-list="displayAppCarouselImg"
38 44
           :action="uploadImgUrl"
39 45
           list-type="picture-card"
40
-          :file-list="displayAppCarouselImg"
41 46
           :on-preview="handlePictureCardPreview"
42 47
           :on-remove="handleRemove"
43 48
           :on-success="handleSuccessCarouselImg">
@@ -47,32 +52,48 @@
47 52
           <img width="100%" :src="dialogImageUrl" alt="">
48 53
         </el-dialog>
49 54
       </el-form-item>
50
-      <el-form-item label="权重" prop="sort">
51
-        <el-input v-model="listData.sort"/>
52
-      </el-form-item>
53
-      <el-form-item label="商铺类型" prop="shopTypeId">
54
-        <el-select v-model="listData.shopTypeId" placeholder="商铺类型" clearable class="filter-item">
55
-          <el-option v-for="item in shopTypeList" :key="item.id" :value="item.id" :label="item.typeName"/>
56
-        </el-select>
57
-      </el-form-item>
58
-      <el-form-item label="上架状态" prop="shopStatus">
59
-        <el-select v-model="listData.shopStatus" placeholder="请选择">
55
+      <el-form-item label="上架状态" prop="houseStatus">
56
+        <el-select v-model="listData.houseStatus" placeholder="请选择">
60 57
           <el-option label="已上架" value="1"/>
61 58
           <el-option label="已下架" value="2"/>
62 59
         </el-select>
63 60
       </el-form-item>
64
-      <el-form-item label="联系电话" prop="shopTel">
65
-        <el-input v-model="listData.shopTel"/>
61
+      <el-form-item label="楼层" prop="houseLevel">
62
+         <el-input v-model="listData.houseLevel"/>
63
+      </el-form-item>
64
+      <el-form-item label="特色标签" prop="houseLabel">
65
+        <el-input v-model="listData.houseLabel"/>
66
+      </el-form-item>
67
+      <el-form-item label="权重" prop="sort">
68
+        <el-input v-model="listData.sort"/>
66 69
       </el-form-item>
67
-      <el-form-item label="商铺地址" prop="shopAddress">
68
-        <el-input v-model="listData.shopAddress"/>
70
+      <el-form-item label="联系电话" prop="houseTel">
71
+        <el-input v-model="listData.houseTel"/>
69 72
       </el-form-item>
70
-      <el-form-item label="人均消费" prop="averagePrice">
71
-        <el-input v-model="listData.averagePrice"/>
73
+      <el-form-item label="小区地址" prop="communityAddress">
74
+        <el-input v-model="listData.communityAddress"/>
75
+      </el-form-item>
76
+      <el-form-item label="房屋配套">
77
+        <el-checkbox v-model="listData.bed" true-label="1" false-label="0">床</el-checkbox>
78
+        <el-checkbox v-model="listData.mattress" true-label="1" false-label="0">床垫</el-checkbox>
79
+        <el-checkbox v-model="listData.wardrobe" true-label="1" false-label="0">衣柜</el-checkbox>
80
+        <el-checkbox v-model="listData.sofa" true-label="1" false-label="0">沙发</el-checkbox>
81
+        <el-checkbox v-model="listData.washingMachine" true-label="1" false-label="0">洗衣机</el-checkbox>
82
+        <el-checkbox v-model="listData.airConditioning" true-label="1" false-label="0">空调</el-checkbox>
83
+        <el-checkbox v-model="listData.fridge" true-label="1" false-label="0">冰箱</el-checkbox>
84
+        <el-checkbox v-model="listData.TV" true-label="1" false-label="0">电视</el-checkbox>
85
+        <el-checkbox v-model="listData.smartLock" true-label="1" false-label="0">智能锁</el-checkbox>
86
+        <el-checkbox v-model="listData.waterHeater" true-label="1" false-label="0">热水器</el-checkbox>
87
+        <el-checkbox v-model="listData.desk" true-label="1" false-label="0">桌子</el-checkbox>
88
+        <el-checkbox v-model="listData.chair" true-label="1" false-label="0">椅子</el-checkbox>
89
+        <el-checkbox v-model="listData.WiFi" true-label="1" false-label="0">网络</el-checkbox>
90
+        <el-checkbox v-model="listData.kitchen" true-label="1" false-label="0">厨房</el-checkbox>
91
+        <el-checkbox v-model="listData.bathroom" true-label="1" false-label="0">独卫</el-checkbox>
92
+        <el-checkbox v-model="listData.balcony" true-label="1" false-label="0">阳台</el-checkbox>
72 93
       </el-form-item>
73 94
       <el-form-item label="高德坐标">
74
-        <el-input placeholder="经度" v-model="listData.shopLongitude" style="width: 150px;" />
75
-        <el-input placeholder="纬度" v-model="listData.shopLatitude" style="width: 150px;" />
95
+        <el-input placeholder="经度" v-model="listData.communityLongitude" style="width: 150px;" />
96
+        <el-input placeholder="纬度" v-model="listData.communityLatitude" style="width: 150px;" />
76 97
       </el-form-item>
77 98
       <el-form-item label="">
78 99
          <!-- 地图 -->
@@ -83,10 +104,10 @@
83 104
           </el-amap>
84 105
         </div>
85 106
       </el-form-item>
86
-      <el-form-item label="商铺介绍">
107
+      <el-form-item label="房间介绍">
87 108
           <!-- <el-input v-model="addForm.bannerContent" placeholder="内容详情"/> -->
88 109
           <div id="father">
89
-            <wangeditor :content="listData.shopIntroduction" @wangeditorEvent="wangeditorValue"/>
110
+            <wangeditor :content="listData.houseIntroduction" @wangeditorEvent="wangeditorValue"/>
90 111
           </div>
91 112
         </el-form-item>
92 113
       <el-form-item>
@@ -107,32 +128,49 @@ export default {
107 128
       events: {
108 129
         click: e => {
109 130
           // _self.postData.Coordinate = e.lnglat.lat + ',' + e.lnglat.lng
110
-          this.listData.shopLongitude = e.lnglat.lng
111
-          this.listData.shopLatitude = e.lnglat.lat
131
+          this.listData.communityLongitude = e.lnglat.lng
132
+          this.listData.communityLatitude = e.lnglat.lat
112 133
         }
113 134
       },
114 135
       listData: {
115
-        id: '',
116
-        shopName: '',
117
-        remark: '',
118
-        appIndexImg: '',
136
+        houseName: '',
137
+        rentalPrice: '',
138
+        area: '',
119 139
         appListImg: '',
120 140
         appCarouselImg: [],
141
+        houseType: '',
142
+        rentalType: '',
143
+        houseStatus: '',
144
+        houseLevel: '',
145
+        houseLabel: '',
121 146
         sort: '',
122
-        shopTypeId: '',
123
-        shopStatus: '',
124
-        shopTel: '',
125
-        shopAddress: '',
126
-        averagePrice: '',
127
-        shopLongitude: '',
128
-        shopLatitude: '',
129
-        shopIntroduction: ''
147
+        houseTel: '',
148
+        communityAddress: '',
149
+        communityLongitude: '',
150
+        communityLatitude: '',
151
+        houseIntroduction: '',
152
+        bed: '',
153
+        mattress: '',
154
+        wardrobe: '',
155
+        sofa: '',
156
+        washingMachine: '',
157
+        airConditioning: '',
158
+        fridge: '',
159
+        TV: '',
160
+        smartLock: '',
161
+        waterHeater: '',
162
+        desk: '',
163
+        chair: '',
164
+        WiFi: '',
165
+        kitchen: '',
166
+        bathroom: '',
167
+        balcony: ''
130 168
       },
131
-      displayAppCarouselImg: [],
132 169
       dialogImageUrl: '',
133 170
       dialogVisible: false,
134 171
       uploadImgUrl: process.env.BASE_API + '/uploadimage',
135 172
       markers: [],
173
+      displayAppCarouselImg: [],
136 174
       shopTypeList: [],
137 175
       searchOption: {
138 176
         city: '南京',
@@ -141,26 +179,17 @@ export default {
141 179
       mapCenter: [118.789509, 32.019989],
142 180
       tableKey: 0,
143 181
       rules: {
144
-        typeName: [
145
-          { required: true, message: '请输入商铺名称', trigger: 'blur' }
146
-        ],
147
-        remark: [
148
-          { required: true, message: '请输入商铺说明', trigger: 'blur' }
182
+        houseName: [
183
+          { required: true, message: '请输入房间名称', trigger: 'blur' }
149 184
         ],
150
-        shopTel: [
185
+        houseTel: [
151 186
           { required: true, message: '请输入联系电话', trigger: 'blur' }
152 187
         ],
153
-        shopAddress: [
154
-          { required: true, message: '请输入商铺地址', trigger: 'blur' }
155
-        ],
156
-        appIndexImg: [
157
-          { required: true, message: 'app首页展示图', trigger: 'blur' }
158
-        ],
159 188
         appListImg: [
160 189
           { required: true, message: 'app列表展示图', trigger: 'blur' }
161 190
         ],
162 191
         appCarouselImg: [
163
-          { required: true, message: 'app商铺轮播图', trigger: 'blur' }
192
+          { required: true, message: '轮播图', trigger: 'blur' }
164 193
         ],
165 194
       }
166 195
     }
@@ -168,7 +197,6 @@ export default {
168 197
   created() {
169 198
     this.listData.id = this.$route.query.id
170 199
     this.getById()
171
-    this.getShopTypeList()
172 200
   },
173 201
   methods: {
174 202
      addMarker() {
@@ -177,13 +205,14 @@ export default {
177 205
       this.markers.push([lng, lat])
178 206
     },
179 207
     getById() {
180
-      this.$store.dispatch('shopType/GetShop', this.listData.id).then((res) => {
181
-        const shopData = res.data
182
-        this.listData = shopData
183
-        alert(this.listData.shopIntroduction)
208
+      this.$store.dispatch('rental/GetRental', this.listData.id).then((res) => {
209
+        const rentalData = res.data
210
+        console.log(rentalData)
211
+        this.listData = { ...rentalData }
212
+        
184 213
         // 多张图片进行遍历
185
-        for (let i = 0; i < shopData.appCarouselImg.length; i++) {
186
-          this.displayAppCarouselImg.push({ url: shopData.appCarouselImg[i] })
214
+        for (let i = 0; i < rentalData.appCarouselImg.length; i++) {
215
+          this.displayAppCarouselImg.push({ url: rentalData.appCarouselImg[i] })
187 216
         }
188 217
       })
189 218
     },
@@ -209,13 +238,6 @@ export default {
209 238
       this.dialogImageUrl = file.url;
210 239
       this.dialogVisible = true;
211 240
     },
212
-    getShopTypeList() {
213
-      this.$store.dispatch('shopType/FetchShopTypeSelect', this.listData).then((res) => {
214
-        this.shopTypeList = res.data
215
-      }).catch(() => {
216
-        console.log('error ListAnnouncement')
217
-      })
218
-    },
219 241
     onSearchResult(pois) {
220 242
       // 搜索地图
221 243
       let latSum = 0
@@ -235,12 +257,12 @@ export default {
235 257
       }
236 258
     },
237 259
     wangeditorValue(value) {
238
-      this.listData.shopIntroduction = value // 在这里接受子组件传过来的参数,赋值给data里的参数
260
+      this.listData.houseIntroduction = value // 在这里接受子组件传过来的参数,赋值给data里的参数
239 261
     },
240 262
     submitForm(formName) { // 提交
241 263
       this.$refs[formName].validate((valid) => {
242 264
         if (valid) {
243
-          this.updateShop()
265
+          this.addRental()
244 266
         } else {
245 267
           console.log('error submit!!')
246 268
           return false
@@ -256,7 +278,7 @@ export default {
256 278
       console.log(this.isRegistered)
257 279
       this.$refs[formName].resetFields()
258 280
     },
259
-    updateShop() {
281
+    addRental() {
260 282
       // 加载框
261 283
       const loading = this.$loading({
262 284
         lock: true,
@@ -264,13 +286,13 @@ export default {
264 286
         spinner: 'el-icon-loading',
265 287
         background: 'rgba(0, 0, 0, 0.7)'
266 288
       })
267
-      this.$store.dispatch('shopType/UpdateShop', this.listData).then((res) => {
289
+      this.$store.dispatch('rental/AddRental', this.listData).then((res) => {
268 290
         if (res.code === '0') {
269 291
           this.$message({
270 292
             message: res.message,
271 293
             type: 'success'
272 294
           })
273
-          this.$router.push({ name: 'shop-index' })
295
+          this.$router.push({ name: 'rental-index' })
274 296
           loading.close()
275 297
           return
276 298
         }
@@ -278,7 +300,7 @@ export default {
278 300
         loading.close()
279 301
       }).catch(() => {
280 302
         loading.close()
281
-        console.log('error UpdateShop')
303
+        console.log('error addRental')
282 304
       })
283 305
     }
284 306
   }

+ 1
- 1
VUECODE/smart-property-manage/src/views/rental/rentalIndex.vue Visa fil

@@ -283,7 +283,7 @@ export default {
283 283
 
284 284
 
285 285
     clickTitle(id) {
286
-      this.$router.push({ name: 'shop-edit', query: { id: id }})
286
+      this.$router.push({ name: 'rental-edit', query: { id: id }})
287 287
     },
288 288
     formatDate(val) {
289 289
       if (val === null) {