傅行帆 6 年前
父节点
当前提交
eec34873a8

+ 14
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpRentalHouseController.java 查看文件

15
 import io.swagger.annotations.ApiOperation;
15
 import io.swagger.annotations.ApiOperation;
16
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.cloud.context.config.annotation.RefreshScope;
17
 import org.springframework.cloud.context.config.annotation.RefreshScope;
18
+import org.springframework.web.bind.annotation.PathVariable;
18
 import org.springframework.web.bind.annotation.RequestBody;
19
 import org.springframework.web.bind.annotation.RequestBody;
19
 import org.springframework.web.bind.annotation.RequestMapping;
20
 import org.springframework.web.bind.annotation.RequestMapping;
20
 import org.springframework.web.bind.annotation.RequestMethod;
21
 import org.springframework.web.bind.annotation.RequestMethod;
86
 		return responseBean;
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
 	@ApiOperation(value = "上架房间", notes = "上架房间")
104
 	@ApiOperation(value = "上架房间", notes = "上架房间")
91
 	@ApiImplicitParams({
105
 	@ApiImplicitParams({

+ 4
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpRentalHouseImgMapper.java 查看文件

3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.community.huiju.model.TpRentalHouseImg;
4
 import com.community.huiju.model.TpRentalHouseImg;
5
 
5
 
6
+import java.util.List;
7
+
6
 /**
8
 /**
7
  * <p>
9
  * <p>
8
  * 出租房间图片 Mapper 接口
10
  * 出租房间图片 Mapper 接口
12
  * @since 2019-05-13
14
  * @since 2019-05-13
13
  */
15
  */
14
 public interface TpRentalHouseImgMapper extends BaseMapper<TpRentalHouseImg> {
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 查看文件

9
 
9
 
10
 import java.io.Serializable;
10
 import java.io.Serializable;
11
 import java.time.LocalDateTime;
11
 import java.time.LocalDateTime;
12
+import java.util.List;
12
 
13
 
13
 /**
14
 /**
14
  * <p>
15
  * <p>
222
      */
223
      */
223
     @TableField(exist = false)
224
     @TableField(exist = false)
224
     private String userName;
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 查看文件

30
 	 * @return
30
 	 * @return
31
 	 */
31
 	 */
32
 	ResponseBean getRentalList(Integer id, String houseName, String startPrice, String endPrice, String rentalType, String houseType, String houseStatus, UserElement userElement, Integer pageNum, Integer pageSize);
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 查看文件

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.community.commom.mode.ResponseBean;
6
 import com.community.commom.mode.ResponseBean;
6
 import com.community.commom.session.UserElement;
7
 import com.community.commom.session.UserElement;
8
+import com.community.huiju.dao.TpRentalHouseImgMapper;
7
 import com.community.huiju.dao.TpRentalHouseMapper;
9
 import com.community.huiju.dao.TpRentalHouseMapper;
8
 import com.community.huiju.model.TpRentalHouse;
10
 import com.community.huiju.model.TpRentalHouse;
11
+import com.community.huiju.model.TpRentalHouseImg;
9
 import com.community.huiju.service.ITpRentalHouseService;
12
 import com.community.huiju.service.ITpRentalHouseService;
10
 import org.springframework.beans.factory.annotation.Autowired;
13
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.stereotype.Service;
14
 import org.springframework.stereotype.Service;
12
 
15
 
16
+import java.time.LocalDateTime;
17
+import java.util.ArrayList;
13
 import java.util.HashMap;
18
 import java.util.HashMap;
14
 import java.util.List;
19
 import java.util.List;
15
 import java.util.Map;
20
 import java.util.Map;
27
 	
32
 	
28
 	@Autowired
33
 	@Autowired
29
 	private TpRentalHouseMapper tpRentalHouseMapper;
34
 	private TpRentalHouseMapper tpRentalHouseMapper;
35
+	
36
+	@Autowired
37
+	private TpRentalHouseImgMapper tpRentalHouseImgMapper;
38
+	
30
 	/**
39
 	/**
31
 	 * 获取公寓房间列表
40
 	 * 获取公寓房间列表
32
 	 *
41
 	 *
62
 		responseBean.addSuccess(map);
71
 		responseBean.addSuccess(map);
63
 		return responseBean;
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 查看文件

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.community.huiju.dao.TpRentalHouseImgMapper">
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
 </mapper>
11
 </mapper>

+ 8
- 1
VUECODE/smart-property-manage/src/api/rental.js 查看文件

28
   })
28
   })
29
 }
29
 }
30
 
30
 
31
-export function addShop(listQuery) {
31
+export function addRental(listQuery) {
32
   return request({
32
   return request({
33
     url: '/rental/add',
33
     url: '/rental/add',
34
     method: 'post',
34
     method: 'post',
35
     data: listQuery
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 查看文件

1
-import { fetchRentalList, shelfRental, obtainedRental, addRental } from '@/api/rental'
1
+import { fetchRentalList, shelfRental, obtainedRental, addRental, getRental } from '@/api/rental'
2
 
2
 
3
 const transaction = {
3
 const transaction = {
4
   namespaced: true,
4
   namespaced: true,
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
     ShelfRental({ commit }, ids) {
40
     ShelfRental({ commit }, ids) {
32
       return new Promise((resolve, reject) => {
41
       return new Promise((resolve, reject) => {
33
         shelfRental(ids).then(response => {
42
         shelfRental(ids).then(response => {

+ 18
- 18
VUECODE/smart-property-manage/src/views/rental/rentalAdd.vue 查看文件

52
         </el-dialog>
52
         </el-dialog>
53
       </el-form-item>
53
       </el-form-item>
54
       <el-form-item label="上架状态" prop="houseStatus">
54
       <el-form-item label="上架状态" prop="houseStatus">
55
-        <el-select v-model="listData.shopStatus" placeholder="请选择">
55
+        <el-select v-model="listData.houseStatus" placeholder="请选择">
56
           <el-option label="已上架" value="1"/>
56
           <el-option label="已上架" value="1"/>
57
           <el-option label="已下架" value="2"/>
57
           <el-option label="已下架" value="2"/>
58
         </el-select>
58
         </el-select>
73
         <el-input v-model="listData.communityAddress"/>
73
         <el-input v-model="listData.communityAddress"/>
74
       </el-form-item>
74
       </el-form-item>
75
       <el-form-item label="房屋配套">
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
       </el-form-item>
92
       </el-form-item>
93
       <el-form-item label="高德坐标">
93
       <el-form-item label="高德坐标">
94
         <el-input placeholder="经度" v-model="listData.communityLongitude" style="width: 150px;" />
94
         <el-input placeholder="经度" v-model="listData.communityLongitude" style="width: 150px;" />
285
         loading.close()
285
         loading.close()
286
       }).catch(() => {
286
       }).catch(() => {
287
         loading.close()
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 查看文件

1
 <template>
1
 <template>
2
   <div class="root">
2
   <div class="root">
3
     <el-form ref="ruleForm" :model="listData" :rules="rules" label-width="150px" class="add-ruleForm">
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
       </el-form-item>
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
       </el-form-item>
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
       </el-form-item>
12
       </el-form-item>
22
       <el-form-item label="app列表展示图" prop="appListImg">
13
       <el-form-item label="app列表展示图" prop="appListImg">
23
         <el-upload
14
         <el-upload
31
           <i v-else class="el-icon-plus avatar-uploader-icon"></i>
22
           <i v-else class="el-icon-plus avatar-uploader-icon"></i>
32
         </el-upload>
23
         </el-upload>
33
       </el-form-item>
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
         <el-upload
40
         <el-upload
36
           name="uploadFiles"
41
           name="uploadFiles"
37
           :limit="6"
42
           :limit="6"
43
+          :file-list="displayAppCarouselImg"
38
           :action="uploadImgUrl"
44
           :action="uploadImgUrl"
39
           list-type="picture-card"
45
           list-type="picture-card"
40
-          :file-list="displayAppCarouselImg"
41
           :on-preview="handlePictureCardPreview"
46
           :on-preview="handlePictureCardPreview"
42
           :on-remove="handleRemove"
47
           :on-remove="handleRemove"
43
           :on-success="handleSuccessCarouselImg">
48
           :on-success="handleSuccessCarouselImg">
47
           <img width="100%" :src="dialogImageUrl" alt="">
52
           <img width="100%" :src="dialogImageUrl" alt="">
48
         </el-dialog>
53
         </el-dialog>
49
       </el-form-item>
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
           <el-option label="已上架" value="1"/>
57
           <el-option label="已上架" value="1"/>
61
           <el-option label="已下架" value="2"/>
58
           <el-option label="已下架" value="2"/>
62
         </el-select>
59
         </el-select>
63
       </el-form-item>
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
       </el-form-item>
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
       </el-form-item>
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
       </el-form-item>
93
       </el-form-item>
73
       <el-form-item label="高德坐标">
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
       </el-form-item>
97
       </el-form-item>
77
       <el-form-item label="">
98
       <el-form-item label="">
78
          <!-- 地图 -->
99
          <!-- 地图 -->
83
           </el-amap>
104
           </el-amap>
84
         </div>
105
         </div>
85
       </el-form-item>
106
       </el-form-item>
86
-      <el-form-item label="商铺介绍">
107
+      <el-form-item label="房间介绍">
87
           <!-- <el-input v-model="addForm.bannerContent" placeholder="内容详情"/> -->
108
           <!-- <el-input v-model="addForm.bannerContent" placeholder="内容详情"/> -->
88
           <div id="father">
109
           <div id="father">
89
-            <wangeditor :content="listData.shopIntroduction" @wangeditorEvent="wangeditorValue"/>
110
+            <wangeditor :content="listData.houseIntroduction" @wangeditorEvent="wangeditorValue"/>
90
           </div>
111
           </div>
91
         </el-form-item>
112
         </el-form-item>
92
       <el-form-item>
113
       <el-form-item>
107
       events: {
128
       events: {
108
         click: e => {
129
         click: e => {
109
           // _self.postData.Coordinate = e.lnglat.lat + ',' + e.lnglat.lng
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
       listData: {
135
       listData: {
115
-        id: '',
116
-        shopName: '',
117
-        remark: '',
118
-        appIndexImg: '',
136
+        houseName: '',
137
+        rentalPrice: '',
138
+        area: '',
119
         appListImg: '',
139
         appListImg: '',
120
         appCarouselImg: [],
140
         appCarouselImg: [],
141
+        houseType: '',
142
+        rentalType: '',
143
+        houseStatus: '',
144
+        houseLevel: '',
145
+        houseLabel: '',
121
         sort: '',
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
       dialogImageUrl: '',
169
       dialogImageUrl: '',
133
       dialogVisible: false,
170
       dialogVisible: false,
134
       uploadImgUrl: process.env.BASE_API + '/uploadimage',
171
       uploadImgUrl: process.env.BASE_API + '/uploadimage',
135
       markers: [],
172
       markers: [],
173
+      displayAppCarouselImg: [],
136
       shopTypeList: [],
174
       shopTypeList: [],
137
       searchOption: {
175
       searchOption: {
138
         city: '南京',
176
         city: '南京',
141
       mapCenter: [118.789509, 32.019989],
179
       mapCenter: [118.789509, 32.019989],
142
       tableKey: 0,
180
       tableKey: 0,
143
       rules: {
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
           { required: true, message: '请输入联系电话', trigger: 'blur' }
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
         appListImg: [
188
         appListImg: [
160
           { required: true, message: 'app列表展示图', trigger: 'blur' }
189
           { required: true, message: 'app列表展示图', trigger: 'blur' }
161
         ],
190
         ],
162
         appCarouselImg: [
191
         appCarouselImg: [
163
-          { required: true, message: 'app商铺轮播图', trigger: 'blur' }
192
+          { required: true, message: '轮播图', trigger: 'blur' }
164
         ],
193
         ],
165
       }
194
       }
166
     }
195
     }
168
   created() {
197
   created() {
169
     this.listData.id = this.$route.query.id
198
     this.listData.id = this.$route.query.id
170
     this.getById()
199
     this.getById()
171
-    this.getShopTypeList()
172
   },
200
   },
173
   methods: {
201
   methods: {
174
      addMarker() {
202
      addMarker() {
177
       this.markers.push([lng, lat])
205
       this.markers.push([lng, lat])
178
     },
206
     },
179
     getById() {
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
       this.dialogImageUrl = file.url;
238
       this.dialogImageUrl = file.url;
210
       this.dialogVisible = true;
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
     onSearchResult(pois) {
241
     onSearchResult(pois) {
220
       // 搜索地图
242
       // 搜索地图
221
       let latSum = 0
243
       let latSum = 0
235
       }
257
       }
236
     },
258
     },
237
     wangeditorValue(value) {
259
     wangeditorValue(value) {
238
-      this.listData.shopIntroduction = value // 在这里接受子组件传过来的参数,赋值给data里的参数
260
+      this.listData.houseIntroduction = value // 在这里接受子组件传过来的参数,赋值给data里的参数
239
     },
261
     },
240
     submitForm(formName) { // 提交
262
     submitForm(formName) { // 提交
241
       this.$refs[formName].validate((valid) => {
263
       this.$refs[formName].validate((valid) => {
242
         if (valid) {
264
         if (valid) {
243
-          this.updateShop()
265
+          this.addRental()
244
         } else {
266
         } else {
245
           console.log('error submit!!')
267
           console.log('error submit!!')
246
           return false
268
           return false
256
       console.log(this.isRegistered)
278
       console.log(this.isRegistered)
257
       this.$refs[formName].resetFields()
279
       this.$refs[formName].resetFields()
258
     },
280
     },
259
-    updateShop() {
281
+    addRental() {
260
       // 加载框
282
       // 加载框
261
       const loading = this.$loading({
283
       const loading = this.$loading({
262
         lock: true,
284
         lock: true,
264
         spinner: 'el-icon-loading',
286
         spinner: 'el-icon-loading',
265
         background: 'rgba(0, 0, 0, 0.7)'
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
         if (res.code === '0') {
290
         if (res.code === '0') {
269
           this.$message({
291
           this.$message({
270
             message: res.message,
292
             message: res.message,
271
             type: 'success'
293
             type: 'success'
272
           })
294
           })
273
-          this.$router.push({ name: 'shop-index' })
295
+          this.$router.push({ name: 'rental-index' })
274
           loading.close()
296
           loading.close()
275
           return
297
           return
276
         }
298
         }
278
         loading.close()
300
         loading.close()
279
       }).catch(() => {
301
       }).catch(() => {
280
         loading.close()
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 查看文件

283
 
283
 
284
 
284
 
285
     clickTitle(id) {
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
     formatDate(val) {
288
     formatDate(val) {
289
       if (val === null) {
289
       if (val === null) {