傅行帆 преди 6 години
родител
ревизия
c9bc3c38b2
променени са 17 файла, в които са добавени 2861 реда и са изтрити 2521 реда
  1. 10
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BuildingTreeController.java
  2. 2
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpLevelMapper.java
  3. 2
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpPhaseMapper.java
  4. 2
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpUnitMapper.java
  5. 4
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpBuilding.java
  6. 6
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpLevel.java
  7. 6
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpPhase.java
  8. 6
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpUnit.java
  9. 9
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/BuildingTreeServiceI.java
  10. 180
    4
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java
  11. 2
    59
      VUECODE/smart-property-manage/src/api/buildingTree.js
  12. 10
    1
      VUECODE/smart-property-manage/src/store/modules/batchImport.js
  13. 3
    51
      VUECODE/smart-property-manage/src/store/modules/buildingTree.js
  14. 1
    1
      VUECODE/smart-property-manage/src/views/building/buildingdata/BuildingBatchImport.vue
  15. 24
    210
      VUECODE/smart-property-manage/src/views/building/buildingdata/index.vue
  16. 1297
    1096
      文档/MYSQL/smartCommunity.pdb
  17. 1297
    1096
      文档/MYSQL/smartCommunity.pdm

+ 10
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BuildingTreeController.java Целия файл

@@ -8,6 +8,7 @@ import io.swagger.annotations.Api;
8 8
 import io.swagger.annotations.ApiOperation;
9 9
 import org.springframework.beans.factory.annotation.Autowired;
10 10
 import org.springframework.cloud.context.config.annotation.RefreshScope;
11
+import org.springframework.web.bind.annotation.GetMapping;
11 12
 import org.springframework.web.bind.annotation.PostMapping;
12 13
 import org.springframework.web.bind.annotation.RequestMapping;
13 14
 import org.springframework.web.bind.annotation.RequestParam;
@@ -45,4 +46,13 @@ public class BuildingTreeController extends BaseController {
45 46
 		responseBean = buildingTreeService.submitExcelData(file,userElement);
46 47
 		return responseBean;
47 48
 	}
49
+	
50
+	@ApiOperation(value = "获取树形数据", notes = "获取树形数据")
51
+	@GetMapping(value = "/trees")
52
+	public ResponseBean getTreeList(@RequestParam("id") Integer id,@RequestParam("treeType") String treeType,HttpSession session){
53
+		ResponseBean responseBean = new ResponseBean();
54
+		UserElement userElement = getUserElement(session);
55
+		responseBean = buildingTreeService.getTreeList(userElement.getCommunityId(),id,treeType);
56
+		return responseBean;
57
+	}
48 58
 }

+ 2
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpLevelMapper.java Целия файл

@@ -2,6 +2,7 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.TpLevel;
5
+import org.apache.ibatis.annotations.Mapper;
5 6
 
6 7
 /**
7 8
  * <p>
@@ -11,6 +12,7 @@ import com.community.huiju.model.TpLevel;
11 12
  * @author jobob
12 13
  * @since 2019-04-01
13 14
  */
15
+@Mapper
14 16
 public interface TpLevelMapper extends BaseMapper<TpLevel> {
15 17
 
16 18
 }

+ 2
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpPhaseMapper.java Целия файл

@@ -2,6 +2,7 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.TpPhase;
5
+import org.apache.ibatis.annotations.Mapper;
5 6
 
6 7
 /**
7 8
  * <p>
@@ -11,6 +12,7 @@ import com.community.huiju.model.TpPhase;
11 12
  * @author jobob
12 13
  * @since 2019-04-01
13 14
  */
15
+@Mapper
14 16
 public interface TpPhaseMapper extends BaseMapper<TpPhase> {
15 17
 
16 18
 }

+ 2
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpUnitMapper.java Целия файл

@@ -2,6 +2,7 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.TpUnit;
5
+import org.apache.ibatis.annotations.Mapper;
5 6
 
6 7
 /**
7 8
  * <p>
@@ -11,6 +12,7 @@ import com.community.huiju.model.TpUnit;
11 12
  * @author jobob
12 13
  * @since 2019-04-01
13 14
  */
15
+@Mapper
14 16
 public interface TpUnitMapper extends BaseMapper<TpUnit> {
15 17
 
16 18
 }

+ 4
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpBuilding.java Целия файл

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import lombok.Data;
4 6
 import lombok.EqualsAndHashCode;
5 7
 import lombok.experimental.Accessors;
@@ -10,6 +12,8 @@ import java.util.Date;
10 12
 @EqualsAndHashCode(callSuper = false)
11 13
 @Accessors(chain = true)
12 14
 public class TpBuilding implements Serializable {
15
+	
16
+	@TableId(value = "id", type = IdType.AUTO)
13 17
     private Integer id;
14 18
     /**
15 19
      * 小区ID

+ 6
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpLevel.java Целия файл

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -22,7 +24,10 @@ import java.io.Serializable;
22 24
 public class TpLevel implements Serializable {
23 25
 
24 26
     private static final long serialVersionUID = 1L;
25
-
27
+    
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Integer id;
30
+    
26 31
     /**
27 32
      * 小区ID
28 33
      */

+ 6
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpPhase.java Целия файл

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -22,7 +24,10 @@ import java.io.Serializable;
22 24
 public class TpPhase implements Serializable {
23 25
 
24 26
     private static final long serialVersionUID = 1L;
25
-
27
+    
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Integer id;
30
+    
26 31
     /**
27 32
      * 小区ID
28 33
      */

+ 6
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpUnit.java Целия файл

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -22,7 +24,10 @@ import java.io.Serializable;
22 24
 public class TpUnit implements Serializable {
23 25
 
24 26
     private static final long serialVersionUID = 1L;
25
-
27
+    
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Integer id;
30
+    
26 31
     /**
27 32
      * 小区ID
28 33
      */

+ 9
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/BuildingTreeServiceI.java Целия файл

@@ -20,4 +20,13 @@ public interface BuildingTreeServiceI {
20 20
 	 * @return
21 21
 	 */
22 22
 	ResponseBean submitExcelData(MultipartFile file, UserElement userElement);
23
+	
24
+	/**
25
+	 * 获取树形数据
26
+	 * @param communityId
27
+	 * @param id
28
+	 * @param treeType
29
+	 * @return
30
+	 */
31
+	ResponseBean getTreeList(Integer communityId, Integer id, String treeType);
23 32
 }

+ 180
- 4
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java Целия файл

@@ -1,15 +1,24 @@
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.core.toolkit.StringUtils;
4 5
 import com.community.commom.constant.Constant;
5 6
 import com.community.commom.mode.ResponseBean;
6 7
 import com.community.commom.session.UserElement;
7 8
 import com.community.commom.utils.AccountValidatorUtil;
9
+import com.community.huiju.dao.TpBuildingMapper;
10
+import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
11
+import com.community.huiju.dao.TpLevelMapper;
8 12
 import com.community.huiju.dao.TpPhaseMapper;
13
+import com.community.huiju.dao.TpUnitMapper;
9 14
 import com.community.huiju.model.TaUser;
15
+import com.community.huiju.model.TpBuilding;
10 16
 import com.community.huiju.model.TpBuildingOwnerInfo;
17
+import com.community.huiju.model.TpLevel;
11 18
 import com.community.huiju.model.TpPhase;
19
+import com.community.huiju.model.TpUnit;
12 20
 import com.community.huiju.service.BuildingTreeServiceI;
21
+import org.apache.ibatis.annotations.Mapper;
13 22
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
14 23
 import org.apache.poi.ss.usermodel.Row;
15 24
 import org.apache.poi.ss.usermodel.Sheet;
@@ -38,6 +47,19 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
38 47
 	
39 48
 	@Autowired
40 49
 	private TpPhaseMapper tpPhaseMapper;
50
+	
51
+	@Autowired
52
+	private TpBuildingMapper tpBuildingMapper;
53
+	
54
+	@Autowired
55
+	private TpUnitMapper tpUnitMapper;
56
+	
57
+	@Autowired
58
+	private TpLevelMapper tpLevelMapper;
59
+	
60
+	@Autowired
61
+	private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
62
+	
41 63
 	/**
42 64
 	 * 获取整个小区的基础数据
43 65
 	 *
@@ -157,16 +179,170 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
157 179
 		Integer communityId = userElement.getCommunityId();
158 180
 		
159 181
 		//保存数据到表中--拆分数据
160
-		String state = saveBuildingTreeData(communityId,list);
182
+		saveBuildingTreeData(communityId,list);
161 183
 		responseBean.addSuccess("success");
162 184
 		return responseBean;
163 185
 	}
164 186
 	
165
-	private String saveBuildingTreeData(Integer communityId, List<TpBuildingOwnerInfo> list) {
187
+	/**
188
+	 * 获取树形数据
189
+	 *
190
+	 * @param communityId
191
+	 * @param id
192
+	 * @param treeType
193
+	 * @return
194
+	 */
195
+	@Override
196
+	public ResponseBean getTreeList(Integer communityId, Integer id, String treeType) {
197
+		ResponseBean responseBean = new ResponseBean();
198
+		List<Map<String,Object>> resultList = new ArrayList<>();
199
+		//获取区/期树形数据
200
+		if (treeType.equals("phase")){
201
+			QueryWrapper<TpPhase> queryWrapper = new QueryWrapper<>();
202
+			queryWrapper.eq("community_id",communityId);
203
+			List<TpPhase> list = tpPhaseMapper.selectList(queryWrapper);
204
+			list.stream().forEach(e -> {
205
+				Map<String,Object> map = new HashMap<>();
206
+				map.put("name",e.getName());
207
+				map.put("id",e.getId());
208
+				map.put("type","building");
209
+				resultList.add(map);
210
+			});
211
+		}else if (treeType.equals("building")){
212
+			QueryWrapper<TpBuilding> queryWrapper = new QueryWrapper<>();
213
+			queryWrapper.eq("community_id",communityId);
214
+			queryWrapper.eq("phase_id",id);
215
+			List<TpBuilding> list = tpBuildingMapper.selectList(queryWrapper);
216
+			list.stream().forEach(e -> {
217
+				Map<String,Object> map = new HashMap<>();
218
+				map.put("name",e.getName());
219
+				map.put("id",e.getId());
220
+				map.put("type","unit");
221
+				resultList.add(map);
222
+			});
223
+		}else if (treeType.equals("unit")){
224
+			QueryWrapper<TpUnit> queryWrapper = new QueryWrapper<>();
225
+			queryWrapper.eq("community_id",communityId);
226
+			queryWrapper.eq("building_id",id);
227
+			List<TpUnit> list = tpUnitMapper.selectList(queryWrapper);
228
+			list.stream().forEach(e -> {
229
+				Map<String,Object> map = new HashMap<>();
230
+				map.put("name",e.getName());
231
+				map.put("id",e.getId());
232
+				map.put("type","level");
233
+				resultList.add(map);
234
+			});
235
+		}else if (treeType.equals("level")){
236
+			QueryWrapper<TpLevel> queryWrapper = new QueryWrapper<>();
237
+			queryWrapper.eq("community_id",communityId);
238
+			queryWrapper.eq("unit_id",id);
239
+			List<TpLevel> list = tpLevelMapper.selectList(queryWrapper);
240
+			list.stream().forEach(e -> {
241
+				Map<String,Object> map = new HashMap<>();
242
+				map.put("name",e.getName());
243
+				map.put("id",e.getId());
244
+				map.put("type","roomNo");
245
+				resultList.add(map);
246
+			});
247
+		}else if (treeType.equals("roomNo")){
248
+			QueryWrapper<TpBuildingOwnerInfo> queryWrapper = new QueryWrapper<>();
249
+			queryWrapper.eq("community_id",communityId);
250
+			queryWrapper.eq("level_id",id);
251
+			List<TpBuildingOwnerInfo> list = tpBuildingOwnerInfoMapper.selectList(queryWrapper);
252
+			list.stream().forEach(e -> {
253
+				Map<String,Object> map = new HashMap<>();
254
+				map.put("name",e.getName());
255
+				map.put("id",e.getId());
256
+				map.put("type","end");
257
+				map.put("leaf",true);
258
+				resultList.add(map);
259
+			});
260
+		}
261
+		responseBean.addSuccess(resultList);
262
+		return responseBean;
263
+	}
264
+	
265
+	private void saveBuildingTreeData(Integer communityId, List<TpBuildingOwnerInfo> list) {
166 266
 		String lastPhaseName = "";
167
-		for (int i = 0; i < list.size(); i++){
267
+		String lastBuildingName = "";
268
+		String lastUnitName = "";
269
+		String lastLevelName = "";
270
+		String lastRoomNoName = "";
168 271
 		
272
+		Integer lastPhaseId = null;
273
+		Integer lastBuildingId = null;
274
+		Integer lastUnitId = null;
275
+		Integer lastLevelId = null;
276
+		
277
+		for (TpBuildingOwnerInfo tpBuildingOwnerInfo : list){
278
+			//插入期/区数据
279
+			if (!tpBuildingOwnerInfo.getPhaseName().equals(lastPhaseName)){
280
+				TpPhase tpPhase = new TpPhase();
281
+				tpPhase.setName(tpBuildingOwnerInfo.getPhaseName());
282
+				tpPhase.setCommunityId(communityId);
283
+				tpPhaseMapper.insert(tpPhase);
284
+				//重置Last
285
+				lastPhaseName = tpBuildingOwnerInfo.getPhaseName();
286
+				lastBuildingName = "";
287
+				lastUnitName = "";
288
+				lastLevelName = "";
289
+				lastRoomNoName = "";
290
+				lastPhaseId = tpPhase.getId();
291
+			}
292
+			//插入楼栋数据
293
+			if (!tpBuildingOwnerInfo.getBuildingName().equals(lastBuildingName)){
294
+				TpBuilding tpBuilding = new TpBuilding();
295
+				tpBuilding.setCommunityId(communityId);
296
+				tpBuilding.setPhaseId(lastPhaseId);
297
+				tpBuilding.setPhaseName(lastPhaseName);
298
+				tpBuilding.setName(tpBuildingOwnerInfo.getBuildingName());
299
+				tpBuildingMapper.insert(tpBuilding);
300
+				lastBuildingName = tpBuildingOwnerInfo.getBuildingName();
301
+				lastBuildingId = tpBuilding.getId();
302
+			}
303
+			//插入单元信息
304
+			if (!tpBuildingOwnerInfo.getUnitName().equals(lastUnitName)){
305
+				TpUnit tpUnit = new TpUnit();
306
+				tpUnit.setCommunityId(communityId);
307
+				tpUnit.setPhaseId(lastPhaseId);
308
+				tpUnit.setPhaseName(lastPhaseName);
309
+				tpUnit.setBuildingId(lastBuildingId);
310
+				tpUnit.setBuildingName(lastBuildingName);
311
+				tpUnit.setName(tpBuildingOwnerInfo.getUnitName());
312
+				tpUnitMapper.insert(tpUnit);
313
+				lastUnitName = tpBuildingOwnerInfo.getUnitName();
314
+				lastUnitId = tpUnit.getId();
315
+			}
316
+			//插入楼层信息
317
+			if (!tpBuildingOwnerInfo.getLevelName().equals(lastLevelName)){
318
+				TpLevel tpLevel = new TpLevel();
319
+				tpLevel.setCommunityId(communityId);
320
+				tpLevel.setPhaseId(lastPhaseId);
321
+				tpLevel.setPhaseName(lastPhaseName);
322
+				tpLevel.setBuildingId(lastBuildingId);
323
+				tpLevel.setBuildingName(lastBuildingName);
324
+				tpLevel.setUnitId(lastUnitId);
325
+				tpLevel.setUnitName(lastUnitName);
326
+				tpLevel.setName(tpBuildingOwnerInfo.getLevelName());
327
+				tpLevelMapper.insert(tpLevel);
328
+				lastLevelName = tpBuildingOwnerInfo.getLevelName();
329
+				lastLevelId = tpLevel.getId();
330
+			}
331
+			//插入房间号信息
332
+			if (!tpBuildingOwnerInfo.getName().equals(lastRoomNoName)){
333
+				TpBuildingOwnerInfo tpBuildingOwnerInfoNew = new TpBuildingOwnerInfo();
334
+				tpBuildingOwnerInfoNew.setCommunityId(communityId);
335
+				tpBuildingOwnerInfoNew.setPhaseId(lastPhaseId);
336
+				tpBuildingOwnerInfoNew.setPhaseName(lastPhaseName);
337
+				tpBuildingOwnerInfoNew.setBuildingId(lastBuildingId);
338
+				tpBuildingOwnerInfoNew.setBuildingName(lastBuildingName);
339
+				tpBuildingOwnerInfoNew.setUnitId(lastUnitId);
340
+				tpBuildingOwnerInfoNew.setUnitName(lastUnitName);
341
+				tpBuildingOwnerInfoNew.setLevelId(lastLevelId);
342
+				tpBuildingOwnerInfoNew.setLevelName(lastLevelName);
343
+				tpBuildingOwnerInfoNew.setName(tpBuildingOwnerInfo.getName());
344
+				tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfoNew);
345
+			}
169 346
 		}
170
-		return "";
171 347
 	}
172 348
 }

+ 2
- 59
VUECODE/smart-property-manage/src/api/buildingTree.js Целия файл

@@ -1,66 +1,9 @@
1 1
 import request from '@/utils/request'
2 2
 
3
-export function fetchBillList(query) {
3
+export function buildingTreeList(query) {
4 4
   return request({
5
-    url: '/bills',
5
+    url: '/trees',
6 6
     method: 'get',
7 7
     params: query
8 8
   })
9 9
 }
10
-
11
-// 保存草稿 或者 发布账单
12
-export function billUploadExcelAdd(data) {
13
-  return request({
14
-    url: '/bill/uploadExcel/add',
15
-    method: 'post',
16
-    header: {
17
-      'Content-Type': 'multipart/form-data'
18
-    },
19
-    data
20
-    // data: {
21
-    //   file: data.files,
22
-    //   billName: data.billName,
23
-    //   billExplain: data.billExplain,
24
-    //   endDate: data.endDate,
25
-    //   billStatus: data.billStatus
26
-    // }
27
-  })
28
-}
29
-
30
-// 根据 id 修改缴费项状态
31
-export function updateBillStatus(data) {
32
-  return request({
33
-    url: '/bill/updateBillStatus/' + data.id,
34
-    method: 'put',
35
-    params: {
36
-      billStatus: data.billStatus
37
-    }
38
-  })
39
-}
40
-
41
-//  根据 id集合 删除缴费项
42
-export function deleteBillBeach(data) {
43
-  return request({
44
-    url: '/bill/deleteBillBeach',
45
-    method: 'post',
46
-    data
47
-  })
48
-}
49
-
50
-// 下载excel模板
51
-export function billDownloadExcel() {
52
-  return request({
53
-    url: '/bill/downloadExcel',
54
-    method: 'get',
55
-    responseType: 'blob'
56
-  })
57
-}
58
-
59
-// 根据收费项ID查询,收费项详情
60
-export function getBillInfoBydId(id) {
61
-  return request({
62
-    url: '/bill/' + id,
63
-    method: 'get'
64
-  })
65
-}
66
-

+ 10
- 1
VUECODE/smart-property-manage/src/store/modules/batchImport.js Целия файл

@@ -1,4 +1,4 @@
1
-import { uploadBuildingExcel, submitBuildingExcel, uploadBuildingTreeExcel } from '@/api/batchImport'
1
+import { uploadBuildingExcel, submitBuildingExcel, uploadBuildingTreeExcel, submitBuildingTreeExcel } from '@/api/batchImport'
2 2
 
3 3
 const batchImport = {
4 4
   namespaced: true,
@@ -61,6 +61,15 @@ const batchImport = {
61 61
           reject(error)
62 62
         })
63 63
       })
64
+    },
65
+    SubmitBuildingTreeExcel({ commit }, file) {
66
+      return new Promise((resolve, reject) => {
67
+        submitBuildingTreeExcel({ file: file.raw }).then(response => {
68
+          resolve(response)
69
+        }).catch(error => {
70
+          reject(error)
71
+        })
72
+      })
64 73
     }
65 74
   }
66 75
 }

+ 3
- 51
VUECODE/smart-property-manage/src/store/modules/buildingTree.js Целия файл

@@ -1,4 +1,4 @@
1
-import { fetchBillList, billUploadExcelAdd, updateBillStatus, deleteBillBeach, billDownloadExcel, getBillInfoBydId } from '@/api/buildingTree'
1
+import { buildingTreeList } from '@/api/buildingTree'
2 2
 
3 3
 const transaction = {
4 4
   namespaced: true,
@@ -18,57 +18,9 @@ const transaction = {
18 18
 
19 19
   actions: {
20 20
     // 获取收费组列表
21
-    FetchBillList({ commit }, listQuery) {
21
+    BuildingTreeList({ commit }, listQuery) {
22 22
       return new Promise((resolve, reject) => {
23
-        fetchBillList(listQuery).then(response => {
24
-          const data = response.data
25
-          commit('SET_LIST', data.list)
26
-          commit('SET_TOTAL', data.total)
27
-          resolve()
28
-        }).catch(error => {
29
-          reject(error)
30
-        })
31
-      })
32
-    },
33
-    BillUploadExcelAdd({ commit }, data) { // 上传缴费项接口, 保存
34
-      return new Promise((resolve, reject) => {
35
-        billUploadExcelAdd(data).then(response => {
36
-          resolve(response)
37
-        }).catch(error => {
38
-          reject(error)
39
-        })
40
-      })
41
-    },
42
-    UpdateBillStatus({ commit }, data) { // 根据 id 修改缴费项状态
43
-      return new Promise((resolve, reject) => {
44
-        updateBillStatus(data).then(response => {
45
-          resolve(response)
46
-        }).catch(error => {
47
-          reject(error)
48
-        })
49
-      })
50
-    },
51
-    DeleteBillBeach({ commit }, data) { // 根据 id集合 删除缴费项
52
-      return new Promise((resolve, reject) => {
53
-        deleteBillBeach(data).then(response => {
54
-          resolve(response)
55
-        }).catch(error => {
56
-          reject(error)
57
-        })
58
-      })
59
-    },
60
-    BillDownloadExcel({ commit }) { // 下载Excel模板
61
-      return new Promise((resolve, reject) => {
62
-        billDownloadExcel().then(response => {
63
-          resolve(response)
64
-        }).catch(error => {
65
-          reject(error)
66
-        })
67
-      })
68
-    },
69
-    GetBillInfoBydId({ commit }, id) { //  根据收费项ID查询,收费项详情
70
-      return new Promise((resolve, reject) => {
71
-        getBillInfoBydId(id).then(response => {
23
+        buildingTreeList(listQuery).then(response => {
72 24
           resolve(response)
73 25
         }).catch(error => {
74 26
           reject(error)

+ 1
- 1
VUECODE/smart-property-manage/src/views/building/buildingdata/BuildingBatchImport.vue Целия файл

@@ -135,7 +135,7 @@ export default {
135 135
       console.log(this.list);
136 136
     },
137 137
     dialogBuildingIndex() {
138
-      this.$router.push({ name: "building-index" });
138
+      this.$router.push({ name: "building-data" });
139 139
     }
140 140
   }
141 141
 };

+ 24
- 210
VUECODE/smart-property-manage/src/views/building/buildingdata/index.vue Целия файл

@@ -14,8 +14,7 @@
14 14
     <el-tree
15 15
       :props="defaultProps"
16 16
       :load="loadTree"
17
-      lazy
18
-      show-checkbox>
17
+      lazy>
19 18
     </el-tree>
20 19
   </div>
21 20
 </template>
@@ -26,29 +25,14 @@ import { mapActions, mapState, mapGetters } from 'vuex'
26 25
 export default {
27 26
   data() {
28 27
     return {
29
-      listQuery: {
30
-        phase: '',
31
-        building: '',
32
-        unit: '',
33
-        level: '',
34
-        roomNo: '',
35
-        ownerName: '',
36
-        pageNum: 1,
37
-        pageSize: 10
28
+      treeQuery: {
29
+        id: '',
30
+        treeType: ''
38 31
       },
39 32
       defaultProps: {
40 33
         label: 'name', 
41 34
         isLeaf: 'leaf'
42
-      },
43
-      total: 0, // 数据总数
44
-      phaseList: [], // 期 集合
45
-      buildingInfoLists: [], // 表格数据集合
46
-      buildingList: [], // seletc 楼栋集合
47
-      unitList: [], // seletc 单元集合
48
-      levelList: [], // seletc 层 集合
49
-      roomNoList: [], //  seletc 户号集合
50
-      listLoading: true, // 加载圈
51
-      deleteIds: [] // 需要删除的id集合
35
+      }
52 36
     }
53 37
   },
54 38
   computed: {
@@ -62,7 +46,8 @@ export default {
62 46
     defaulData() {
63 47
       return [{
64 48
         name: this.userData.communityName,
65
-        id: this.userData.id
49
+        id: this.userData.id,
50
+        type: 'phase'
66 51
       }]
67 52
     }
68 53
   },
@@ -75,207 +60,36 @@ export default {
75 60
     }
76 61
   },
77 62
   mounted() {
78
-    const query = this.$route.params.listQuery
79
-    if (query !== undefined) {
80
-      console.log('参数:', query)
81
-      this.listQuery = query
82
-    }
83
-
84
-    // 获取数据
85
-    this.dataQuery()
86 63
   },
87 64
   methods: {
88 65
     ...mapActions('buildingTree', [
89
-      'BuildingInfoList'
66
+      'BuildingTreeList'
90 67
     ]),
91 68
     loadTree(node, resolve) {
92
-      console.log(node)
93 69
       if (node.level === 0) {
94 70
           return resolve(this.defaulData);
95 71
         }
96
-        if (node.level > 1) return resolve([]);
97
-
98
-        setTimeout(() => {
99
-          const data = [{
100
-            name: 'leaf',
101
-            leaf: true
102
-          }, {
103
-            name: 'zone'
104
-          }];
72
+        
73
+        // var data = [];  
74
+          this.treeQuery.treeType = node.data.type
75
+          this.treeQuery.id = node.data.id
76
+          this.BuildingTreeList(this.treeQuery).then(response => {
77
+            console.log(response.data)
78
+              if (response.code === "0") {
79
+                // data = response.data
80
+                resolve(response.data);
81
+              }
82
+          }).catch(() => {
83
+            console.log("get tree error");
84
+          });
105 85
 
106
-          resolve(data);
107
-        }, 500);
108
-    },
109
-    handleSizeChange(val) {
110
-      console.log(`每页 ${val} 条`)
111
-      this.listQuery.pageSize = val
112
-      this.listQuery.pageNum = 1
113
-      // 获取数据
114
-      this.dataQuery()
115
-    },
116
-    handleCurrentChange(val) {
117
-      console.log(`当前页: ${val}`)
118
-      this.listQuery.pageNum = val
119
-      // 获取数据
120
-      this.dataQuery()
86
+        // setTimeout(() => {
87
+        //   resolve(data);
88
+        // }, 500);
121 89
     },
122 90
     dialogBatchImport() {
123 91
       this.$router.push({ name: 'building-batch-import' })
124 92
     },
125
-    handleSelectionChange(data) { // 表格多选框
126
-      console.log('多选框的值:', data)
127
-      // 设置为 空
128
-      this.deleteIds = []
129
-      for (let i = 0; i < data.length; i++) {
130
-        this.deleteIds.push(data[i].id)
131
-      }
132
-    },
133
-    getPhase() { // 获取期
134
-      this.listQuery.phase = ''
135
-      this.$store.dispatch('BuildingAddress', this.listQuery).then((res) => {
136
-        this.phaseList = res.data
137
-      }).catch(() => {
138
-        console.log('error phase BuildingAddress')
139
-      })
140
-    },
141
-    getBuild() { // 获取楼栋
142
-      this.listQuery.building = ''
143
-      this.$store.dispatch('BuildingAddress', this.listQuery).then((res) => {
144
-        this.buildingList = res.data
145
-      }).catch(() => {
146
-        console.log('error building BuildingAddress')
147
-      })
148
-    },
149
-    getUnit() { // 获取单元
150
-      this.listQuery.unit = ''
151
-      this.$store.dispatch('BuildingAddress', this.listQuery).then((res) => {
152
-        this.unitList = res.data
153
-      }).catch(() => {
154
-        console.log('error unit BuildingAddress')
155
-      })
156
-    },
157
-    getLevel() { // 获取楼层
158
-      this.listQuery.level = ''
159
-      this.$store.dispatch('BuildingAddress', this.listQuery).then((res) => {
160
-        this.levelList = res.data
161
-      }).catch(() => {
162
-        console.log('error level BuildingAddress')
163
-      })
164
-    },
165
-    getRoomNo() { // 获取户号
166
-      this.listQuery.roomNo = ''
167
-      this.$store.dispatch('BuildingAddress', this.listQuery).then((res) => {
168
-        this.roomNoList = res.data
169
-      }).catch(() => {
170
-        console.log('error roomNo BuildingAddress')
171
-      })
172
-    },
173
-    buildSelectChange(value) { // select 的 change
174
-      switch (value) {
175
-        case 0: // 查询栋
176
-          this.buildingList = []
177
-          this.unitList = []
178
-          this.levelList = []
179
-          this.roomNoList = []
180
-          this.listQuery.building = ''
181
-          this.listQuery.unit = ''
182
-          this.listQuery.level = ''
183
-          this.listQuery.roomNo = ''
184
-          this.getBuild()
185
-          break
186
-        case 1: // 查询 单元
187
-          this.unitList = []
188
-          this.levelList = []
189
-          this.roomNoList = []
190
-          this.listQuery.unit = ''
191
-          this.listQuery.level = ''
192
-          this.listQuery.roomNo = ''
193
-          this.getUnit()
194
-          break
195
-        case 2: // 查询 楼层
196
-          this.levelList = []
197
-          this.roomNoList = []
198
-          this.listQuery.level = ''
199
-          this.listQuery.roomNo = ''
200
-          this.getLevel()
201
-          break
202
-        case 3: // 查询 户号
203
-          this.roomNoList = []
204
-          this.listQuery.roomNo = ''
205
-          this.getRoomNo()
206
-          break
207
-      }
208
-    },
209
-    conditionsQuery() { // 条件查询
210
-      this.listQuery.pageNum = 1
211
-      this.dataQuery()
212
-    },
213
-    dataQuery() { // 查询数据
214
-      this.listLoading = true
215
-      // this.$store.dispatch('BuildingTreeList', this.listQuery).then((res) => {
216
-      //   this.listLoading = false
217
-      // }).catch(() => {
218
-      //   this.listLoading = false
219
-      //   console.log('error BuildingInfoList')
220
-      // })
221
-    },
222
-    emptyListQuery() { // 清空按钮
223
-      this.listQuery.phase = ''
224
-      this.listQuery.building = ''
225
-      this.listQuery.unit = ''
226
-      this.listQuery.level = ''
227
-      this.listQuery.roomNo = ''
228
-      this.listQuery.ownerName = ''
229
-      this.listQuery.pageNum = 1
230
-      // 获取数据
231
-      this.dataQuery()
232
-    },
233
-    deleteData() { // 删除
234
-      this.$confirm('您确定要删除吗?')
235
-        .then(_ => {
236
-          this.$store.dispatch('DeleteBuilding', this.deleteIds).then((res) => {
237
-            if (res.code === '0') {
238
-              this.$message({
239
-                message: res.message,
240
-                type: 'success'
241
-              })
242
-              // 获取数据
243
-              this.dataQuery()
244
-              return
245
-            }
246
-            this.$message.error(res.message)
247
-          }).catch(() => {
248
-            console.log('error deleteBuilding')
249
-          })
250
-        }).catch(_ => {})
251
-    },
252
-    addBuilding() { // 添加楼栋业主信息资料
253
-      this.$router.push({ name: 'building-add' })
254
-    },
255
-    ediBuilding(buildId) { // 修改楼栋业主信息资料
256
-      const ids = this.deleteIds
257
-      if (ids.length > 1) {
258
-        this.$message.error('只能选择一行数据进行修改!')
259
-        return
260
-      }
261
-      if (ids < 1) {
262
-        this.$message.error('请选择一行数据进行修改!')
263
-        return
264
-      }
265
-      this.$store.dispatch('GetByIdBuildingId', ids[0]).then((res) => {
266
-        const resCode = res.code
267
-        if (resCode === '0') {
268
-          const resData = res.data
269
-          if (resData.verifyStatus === '1') {
270
-            this.$message.error('不能修改已认证的楼栋业主信息!')
271
-            return
272
-          }
273
-        }
274
-        this.$router.push({ name: 'building-edi', params: { id: ids[0], listQuery: this.listQuery }})
275
-      }).catch(() => {
276
-        console.log('error GetByIdBuildingId')
277
-      })
278
-    },
279 93
     formatDate(val) {
280 94
       var value = new Date(val)
281 95
       var year = value.getFullYear()

+ 1297
- 1096
文档/MYSQL/smartCommunity.pdb
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1297
- 1096
文档/MYSQL/smartCommunity.pdm
Файловите разлики са ограничени, защото са твърде много
Целия файл