dingxin пре 6 година
родитељ
комит
436686b418

+ 30
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillController.java Прегледај датотеку

@@ -1,10 +1,23 @@
1 1
 package com.community.huiju.controller;
2 2
 
3 3
 
4
+import com.community.commom.mode.ResponseBean;
4 5
 import com.community.huiju.common.base.BaseController;
6
+import com.community.huiju.service.IBillService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.cloud.context.config.annotation.RefreshScope;
13
+import org.springframework.web.bind.annotation.PathVariable;
14
+import org.springframework.web.bind.annotation.RequestBody;
5 15
 import org.springframework.web.bind.annotation.RequestMapping;
6 16
 import org.springframework.web.bind.annotation.RestController;
7 17
 
18
+import javax.servlet.http.HttpSession;
19
+import java.util.List;
20
+
8 21
 /**
9 22
  * <p>
10 23
  * 缴费项表 前端控制器
@@ -14,7 +27,23 @@ import org.springframework.web.bind.annotation.RestController;
14 27
  * @since 2019-02-13
15 28
  */
16 29
 @RestController
17
-@RequestMapping("/tp/bill")
30
+@RequestMapping("/")
31
+@RefreshScope
32
+@Api(value = "缴费项 API", description = "缴费项 API")
18 33
 public class BillController extends BaseController {
19 34
 
35
+    @Autowired
36
+    private IBillService iBillService;
37
+
38
+    @ApiOperation(value = "根据 id 查询缴费项详情", notes = "根据 id 查询缴费项详情")
39
+    @ApiImplicitParams({
40
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "path", name = "id", value = "id编号")
41
+    })
42
+    @RequestMapping(value = "/bill/{id}")
43
+    public ResponseBean getByBillId(HttpSession session, @PathVariable("id") Integer id) {
44
+        ResponseBean responseBean = new ResponseBean();
45
+        responseBean = iBillService.getByBillId(id);
46
+        return responseBean;
47
+    }
48
+
20 49
 }

+ 48
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillInvoiceController.java Прегледај датотеку

@@ -5,6 +5,7 @@ import com.community.commom.mode.ResponseBean;
5 5
 import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.common.base.BaseController;
7 7
 import com.community.huiju.service.IBillInvoiceService;
8
+import com.community.huiju.service.IBillService;
8 9
 import io.swagger.annotations.Api;
9 10
 import io.swagger.annotations.ApiImplicitParam;
10 11
 import io.swagger.annotations.ApiImplicitParams;
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
17 18
 import org.springframework.web.bind.annotation.RestController;
18 19
 
19 20
 import javax.servlet.http.HttpSession;
21
+import java.util.List;
20 22
 
21 23
 /**
22 24
  * <p>
@@ -35,6 +37,9 @@ public class BillInvoiceController extends BaseController {
35 37
     @Autowired
36 38
     private IBillInvoiceService iBillInvoiceService;
37 39
 
40
+    @Autowired
41
+    private IBillService iBillService;
42
+
38 43
     @ApiOperation(value = "查询缴费单", notes = "查询缴费单")
39 44
     @ApiImplicitParams({
40 45
             @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "billId: 缴费项目id," +
@@ -50,4 +55,47 @@ public class BillInvoiceController extends BaseController {
50 55
         return responseBean;
51 56
     }
52 57
 
58
+    @ApiOperation(value = "修改缴费项 收费项名称,缴费项说明,截止时间", notes = "修改缴费项 收费项名称,缴费项说明,截止时间")
59
+    @ApiImplicitParams({
60
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "billName收费项名称,billExplain缴费项说明,endDate截止时间"),
61
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
62
+    })
63
+    @RequestMapping(value = "/bill/invoice/updateBill", method = RequestMethod.PUT)
64
+    public ResponseBean updateBill(HttpSession session, @RequestBody String parameter) {
65
+        ResponseBean responseBean = new ResponseBean();
66
+
67
+        UserElement userElement = getUserElement(session);
68
+        responseBean = iBillService.updateBillNameAndBillExplainAndEndDate(userElement, parameter);
69
+        return responseBean;
70
+    }
71
+
72
+    @ApiOperation(value = "根据 id集合 删除缴费单", notes = "根据 id集合 删除缴费单")
73
+    @ApiImplicitParams({
74
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "ids", value = "id集合"),
75
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
76
+    })
77
+    @RequestMapping(value = "/bill/invoice/delete", method = RequestMethod.POST)
78
+    public ResponseBean delete(HttpSession session, @RequestBody List<Integer> ids) {
79
+        ResponseBean responseBean = new ResponseBean();
80
+        UserElement userElement = getUserElement(session);
81
+
82
+        responseBean = iBillInvoiceService.deleteBillInvoice(ids, userElement);
83
+        return responseBean;
84
+    }
85
+
86
+    @ApiOperation(value = "设置线下缴费", notes = "设置线下缴费")
87
+    @ApiImplicitParams({
88
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "ids", value = "id集合"),
89
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
90
+    })
91
+    @RequestMapping(value = "/bill/invoice/offlinePayment", method = RequestMethod.POST)
92
+    public ResponseBean offlinePayment(HttpSession session, @RequestBody List<Integer> ids) {
93
+        ResponseBean responseBean = new ResponseBean();
94
+        UserElement userElement = getUserElement(session);
95
+
96
+        responseBean = iBillInvoiceService.offlinePayment(ids, userElement);
97
+        return responseBean;
98
+    }
99
+
100
+
53 101
 }

+ 7
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/Bill.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;
@@ -7,6 +9,7 @@ import lombok.experimental.Accessors;
7 9
 
8 10
 import java.io.Serializable;
9 11
 import java.time.LocalDateTime;
12
+import java.util.Date;
10 13
 
11 14
 /**
12 15
  * <p>
@@ -24,6 +27,9 @@ public class Bill implements Serializable {
24 27
 
25 28
     private static final long serialVersionUID = 1L;
26 29
 
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer id;
32
+
27 33
     /**
28 34
      * 小区id
29 35
      */
@@ -64,7 +70,7 @@ public class Bill implements Serializable {
64 70
     /**
65 71
      * 截止时间
66 72
      */
67
-    private LocalDateTime endDate;
73
+    private Date endDate;
68 74
 
69 75
     /**
70 76
      * 创建人

+ 17
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillInvoiceService.java Прегледај датотеку

@@ -5,6 +5,8 @@ import com.community.commom.mode.ResponseBean;
5 5
 import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.model.BillInvoice;
7 7
 
8
+import java.util.List;
9
+
8 10
 /**
9 11
  * <p>
10 12
  * 缴费单 服务类
@@ -23,5 +25,20 @@ public interface IBillInvoiceService extends IService<BillInvoice> {
23 25
      */
24 26
     ResponseBean getBillList(String parameter, UserElement userElement);
25 27
 
28
+    /**
29
+     * 批量删除 缴费单
30
+     * @param ids
31
+     * @param userElement
32
+     * @return
33
+     */
34
+    ResponseBean deleteBillInvoice(List<Integer> ids, UserElement userElement);
35
+
36
+    /**
37
+     * 设置线下缴费
38
+     * @param ids
39
+     * @param userElement
40
+     * @return
41
+     */
42
+    ResponseBean offlinePayment(List<Integer> ids, UserElement userElement);
26 43
 
27 44
 }

+ 16
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillService.java Прегледај датотеку

@@ -2,6 +2,7 @@ package com.community.huiju.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
5 6
 import com.community.huiju.model.Bill;
6 7
 
7 8
 /**
@@ -14,5 +15,20 @@ import com.community.huiju.model.Bill;
14 15
  */
15 16
 public interface IBillService extends IService<Bill> {
16 17
 
18
+    /**
19
+     * 修改 缴费项的 收费项名称,缴费项说明,截止时间
20
+     *
21
+     * @param parameter
22
+     * @param userElement
23
+     * @return
24
+     */
25
+    ResponseBean updateBillNameAndBillExplainAndEndDate(UserElement userElement, String parameter);
26
+
27
+    /**
28
+     * 根据ID查询 缴费项
29
+     * @param id
30
+     * @return
31
+     */
32
+    ResponseBean getByBillId(Integer id);
17 33
 
18 34
 }

+ 54
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java Прегледај датотеку

@@ -8,13 +8,17 @@ import com.community.commom.mode.ResponseBean;
8 8
 import com.community.commom.session.UserElement;
9 9
 import com.community.huiju.dao.BillMapper;
10 10
 import com.community.huiju.dao.BillStatementMapper;
11
+import com.community.huiju.exception.WisdomException;
12
+import com.community.huiju.model.Bill;
11 13
 import com.community.huiju.model.BillInvoice;
12 14
 import com.community.huiju.dao.BillInvoiceMapper;
13 15
 import com.community.huiju.service.IBillInvoiceService;
14 16
 import com.google.common.collect.Maps;
15 17
 import org.springframework.beans.factory.annotation.Autowired;
16 18
 import org.springframework.stereotype.Service;
19
+import org.springframework.transaction.annotation.Transactional;
17 20
 
21
+import java.util.List;
18 22
 import java.util.Map;
19 23
 
20 24
 /**
@@ -81,14 +85,64 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
81 85
         page.setSize(pageSize);
82 86
         IPage<BillInvoice> invoiceIPage = billInvoiceMapper.selectBillInvoice(page, map);
83 87
 
88
+        // 缴费项目
89
+        Bill bill = billMapper.selectById(billId);
90
+
84 91
         Map<String, Object> respMap = Maps.newHashMap();
85 92
         respMap.put("pageNum", invoiceIPage.getCurrent());
86 93
         respMap.put("pageSize", invoiceIPage.getSize());
87 94
         respMap.put("total", invoiceIPage.getTotal());
88 95
         respMap.put("list", invoiceIPage.getRecords());
96
+        respMap.put("billName", bill.getBillName());
97
+        respMap.put("billExplain", bill.getBillExplain());
98
+        respMap.put("endDate", bill.getEndDate());
89 99
 
90 100
         responseBean.addSuccess(respMap);
91 101
 
92 102
         return responseBean;
93 103
     }
104
+
105
+    @Override
106
+    @Transactional(rollbackFor = Exception.class)
107
+    public ResponseBean deleteBillInvoice(List<Integer> ids, UserElement userElement) {
108
+        ResponseBean responseBean = new ResponseBean();
109
+        if (null == userElement) {
110
+            responseBean.addError("请登录后操作");
111
+            return responseBean;
112
+        }
113
+
114
+        ids.stream().forEach(e -> {
115
+            BillInvoice billInvoice = billInvoiceMapper.selectById(e);
116
+            if (!"0".equals(billInvoice.getBillStatus())) {
117
+                throw new WisdomException("费用已缴,无法删除");
118
+            }
119
+            billInvoiceMapper.deleteById(e);
120
+        });
121
+
122
+        responseBean.addSuccess("操作成功");
123
+        return responseBean;
124
+    }
125
+
126
+    @Override
127
+    @Transactional(rollbackFor = Exception.class)
128
+    public ResponseBean offlinePayment(List<Integer> ids, UserElement userElement) {
129
+        ResponseBean responseBean = new ResponseBean();
130
+        if (null == userElement) {
131
+            responseBean.addError("请登录后操作");
132
+            return responseBean;
133
+        }
134
+
135
+        ids.stream().forEach(e -> {
136
+            BillInvoice billInvoice = billInvoiceMapper.selectById(e);
137
+            if ("1".equals(billInvoice.getBillStatus())) {
138
+                throw new WisdomException("费用已缴,无法更改");
139
+            }
140
+
141
+            billInvoice.setBillStatus("2");
142
+            billInvoiceMapper.updateById(billInvoice);
143
+        });
144
+
145
+        responseBean.addSuccess("操作成功");
146
+        return responseBean;
147
+    }
94 148
 }

+ 39
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java Прегледај датотеку

@@ -1,14 +1,18 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
3 4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 5
 import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
5 7
 import com.community.huiju.dao.BillInvoiceMapper;
6 8
 import com.community.huiju.dao.BillStatementMapper;
7 9
 import com.community.huiju.model.Bill;
8 10
 import com.community.huiju.dao.BillMapper;
9 11
 import com.community.huiju.service.IBillService;
12
+import org.apache.commons.lang3.StringUtils;
10 13
 import org.springframework.beans.factory.annotation.Autowired;
11 14
 import org.springframework.stereotype.Service;
15
+import org.springframework.transaction.annotation.Transactional;
12 16
 
13 17
 /**
14 18
  * <p>
@@ -33,5 +37,40 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
33 37
     @Autowired
34 38
     private BillStatementMapper billStatementMapper;
35 39
 
40
+    @Override
41
+    @Transactional(rollbackFor = Exception.class)
42
+    public ResponseBean updateBillNameAndBillExplainAndEndDate(UserElement userElement, String parameter) {
43
+        ResponseBean responseBean = new ResponseBean();
44
+        Bill bill = JSONObject.parseObject(parameter, Bill.class);
45
+        if (StringUtils.isEmpty(bill.getBillName())) {
46
+            responseBean.addError("收费项名称不能为空");
47
+            return responseBean;
48
+        }
49
+        if (StringUtils.isEmpty(bill.getBillExplain())) {
50
+            responseBean.addError("缴费项说明");
51
+            return responseBean;
52
+        }
53
+        if (bill.getEndDate() == null) {
54
+            responseBean.addError("截止时间不能为空");
55
+            return responseBean;
56
+        }
36 57
 
58
+        Bill selectBill = billMapper.selectById(bill.getId());
59
+        if (selectBill == null) {
60
+            responseBean.addError("缴费项不存在");
61
+            return responseBean;
62
+        }
63
+
64
+        billMapper.updateById(bill);
65
+        responseBean.addSuccess("操作成功");
66
+        return responseBean;
67
+    }
68
+
69
+    @Override
70
+    public ResponseBean getByBillId(Integer id) {
71
+        ResponseBean responseBean = new ResponseBean();
72
+        Bill bill = billMapper.selectById(id);
73
+        responseBean.addSuccess(bill);
74
+        return responseBean;
75
+    }
37 76
 }

+ 2
- 2
CODE/smart-community/property-api/src/main/resources/mapper/BillInvoiceMapper.xml Прегледај датотеку

@@ -33,13 +33,13 @@
33 33
                     AND tboi.room_no = #{map.roomNo}
34 34
                 </if>
35 35
                 <if test="map.ownerName != null and map.ownerName != ''">
36
-                    AND tboi.owner_name = #{map.ownerName}
36
+                    AND tboi.owner_name like CONCAT('%',#{map.ownerName},'%')
37 37
                 </if>
38 38
                 <if test="map.billStatus != null and map.billStatus != ''">
39 39
                     AND tpi.bill_status = #{map.billStatus}
40 40
                 </if>
41 41
                 <if test="map.payName != null and map.payName != ''">
42
-                    AND tpi.pay_name = #{map.payName}
42
+                    AND tpi.pay_name like CONCAT('%',#{map.payName}, '%')
43 43
                 </if>
44 44
                 <if test="map.billId != null">
45 45
                     AND tpi.bill_id = #{map.billId}

+ 36
- 6
VUECODE/smart-property-manage/src/api/billInvoice.js Прегледај датотеку

@@ -20,12 +20,42 @@ export function getBillInvoiceList(data) {
20 20
   })
21 21
 }
22 22
 
23
+// 修改缴费项 收费项名称,缴费项说明,截止时间
24
+export function updateBillNameAndBillExplainAndEndDate(data) {
25
+  return request({
26
+    url: '/bill/invoice/updateBill',
27
+    method: 'put',
28
+    data: {
29
+      id: data.id, // 收费项ID
30
+      billName: data.billName, // 收费项名称
31
+      billExplain: data.billExplain, // 缴费项说明
32
+      endDate: data.endDate // 截止时间
33
+    }
34
+  })
35
+}
23 36
 
37
+// 根据ID 查询缴费项信息
38
+export function getBillByIdInfo(id) {
39
+  return request({
40
+    url: '/bill/' + id,
41
+    method: 'get'
42
+  })
43
+}
24 44
 
45
+//  根据 id 批量删除 缴费单
46
+export function deleteBillInvoiceById(data) {
47
+  return request({
48
+    url: '/bill/invoice/delete',
49
+    method: 'post',
50
+    data
51
+  })
52
+}
25 53
 
26
-
27
-
28
-
29
-
30
-
31
-
54
+// 设置线下缴费
55
+export function billInvoiceOfflinePayment(data) {
56
+  return request({
57
+    url: '/bill/invoice/offlinePayment',
58
+    method: 'post',
59
+    data
60
+  })
61
+}

+ 7
- 0
VUECODE/smart-property-manage/src/router/index.js Прегледај датотеку

@@ -226,6 +226,13 @@ export const constantRouterMap = [
226 226
         name: 'bill-info',
227 227
         hidden: true,
228 228
         meta: { title: '收费组详情', icon: 'table' }
229
+      },
230
+      {
231
+        path: '/bill/management/info/bill-edi',
232
+        component: () => import('@/views/bill/info/bill-edi/index'),
233
+        name: 'bill-info-edi',
234
+        hidden: true,
235
+        meta: { title: '收费组详情', icon: 'table' }
229 236
       }
230 237
     ]
231 238
   },

+ 38
- 2
VUECODE/smart-property-manage/src/store/modules/billInvoice.js Прегледај датотеку

@@ -1,4 +1,4 @@
1
-import { getBillInvoiceList } from '@/api/billInvoice'
1
+import { getBillInvoiceList, updateBillNameAndBillExplainAndEndDate, getBillByIdInfo, deleteBillInvoiceById, billInvoiceOfflinePayment } from '@/api/billInvoice'
2 2
 
3 3
 const billInvoice = {
4 4
   state: {
@@ -8,7 +8,7 @@ const billInvoice = {
8 8
 
9 9
   },
10 10
   actions: {
11
-    GetBillInvoiceList({ commit }, data) {
11
+    GetBillInvoiceList({ commit }, data) { // // 查询缴费单
12 12
       return new Promise((resolve, reject) => {
13 13
         getBillInvoiceList(data).then(response => {
14 14
           resolve(response)
@@ -16,6 +16,42 @@ const billInvoice = {
16 16
           reject(error)
17 17
         })
18 18
       })
19
+    },
20
+    UpdateBillNameAndBillExplainAndEndDate({ commit }, data) { // 修改缴费项 收费项名称,缴费项说明,截止时间
21
+      return new Promise((resolve, reject) => {
22
+        updateBillNameAndBillExplainAndEndDate(data).then(response => {
23
+          resolve(response)
24
+        }).catch(error => {
25
+          reject(error)
26
+        })
27
+      })
28
+    },
29
+    GetBillByIdInfo({ commit }, id) { // 根据 id 查询 缴费项信息
30
+      return new Promise((resolve, reject) => {
31
+        getBillByIdInfo(id).then(response => {
32
+          resolve(response)
33
+        }).catch(error => {
34
+          reject(error)
35
+        })
36
+      })
37
+    },
38
+    DeleteBillInvoiceById({ commit }, data) { // 根据 id 集合批量删除
39
+      return new Promise((resolve, reject) => {
40
+        deleteBillInvoiceById(data).then(response => {
41
+          resolve(response)
42
+        }).catch(error => {
43
+          reject(error)
44
+        })
45
+      })
46
+    },
47
+    BillInvoiceOfflinePayment({ commit }, data) { // 设置线下缴费
48
+      return new Promise((resolve, reject) => {
49
+        billInvoiceOfflinePayment(data).then(response => {
50
+          resolve(response)
51
+        }).catch(error => {
52
+          reject(error)
53
+        })
54
+      })
19 55
     }
20 56
   }
21 57
 }

+ 1
- 1
VUECODE/smart-property-manage/src/views/bill/index.vue Прегледај датотеку

@@ -10,7 +10,7 @@ export default {
10 10
   name: 'Index',
11 11
   methods: {
12 12
     getInfo() {
13
-      this.$router.push({ name: 'bill-info', params: { id: 187 }})
13
+      this.$router.push({ name: 'bill-info', params: { id: 908 }})
14 14
     }
15 15
   }
16 16
 }

+ 96
- 0
VUECODE/smart-property-manage/src/views/bill/info/bill-edi/index.vue Прегледај датотеку

@@ -0,0 +1,96 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="form-ruleForm">
4
+      <el-form-item label="收费组名称" prop="billName">
5
+        <el-input v-model="ruleForm.billName"/>
6
+      </el-form-item>
7
+      <el-form-item label="收费组说明" prop="billExplain">
8
+        <el-input v-model="ruleForm.billExplain"/>
9
+      </el-form-item>
10
+      <el-form-item label="截止时间" prop="endDate">
11
+        <el-date-picker
12
+          v-model="ruleForm.endDate"
13
+          type="date"
14
+          placeholder="选择日期"/>
15
+      </el-form-item>
16
+      <el-form-item>
17
+        <el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
18
+      </el-form-item>
19
+    </el-form>
20
+  </div>
21
+</template>
22
+
23
+<script>
24
+export default {
25
+  name: 'Index',
26
+  data() {
27
+    return {
28
+      ruleForm: {
29
+        id: '', // 收费项ID
30
+        billName: '', // 收费项名称
31
+        billExplain: '', // 缴费项说明
32
+        endDate: '' // 截止时间
33
+      },
34
+      rules: {
35
+        billName: [
36
+          { required: true, message: '请输入收费项名称', trigger: 'blur' }
37
+        ],
38
+        billExplain: [
39
+          { required: true, message: '请选择缴费项说明', trigger: 'blur' }
40
+        ],
41
+        endDate: [
42
+          { type: 'date', required: true, message: '请选择截止时间', trigger: 'change' }
43
+        ]
44
+      }
45
+    }
46
+  },
47
+  mounted() {
48
+    this.ruleForm.id = this.$route.params.id
49
+    this.getBillByIdInfo()
50
+  },
51
+  methods: {
52
+    submitForm(formName) {
53
+      this.$refs[formName].validate((valid) => {
54
+        if (valid) {
55
+          this.$store.dispatch('UpdateBillNameAndBillExplainAndEndDate', this.ruleForm).then(res => {
56
+            const code = res.code
57
+            if (code === '0') {
58
+              this.$message.success(res.message)
59
+              this.$router.push({ name: 'bill-info', params: { id: this.ruleForm.id }})
60
+              return
61
+            }
62
+            this.$message.error(res.message)
63
+          }).catch(() => {
64
+            console.log('UpdateBillNameAndBillExplainAndEndDate error')
65
+          })
66
+        } else {
67
+          console.log('error submit!!')
68
+          return false
69
+        }
70
+      })
71
+    },
72
+    resetForm(formName) { // 重置
73
+      this.$refs[formName].resetFields()
74
+    },
75
+    getBillByIdInfo() { // 根据 id 查询 缴费项信息
76
+      this.$store.dispatch('GetBillByIdInfo', this.ruleForm.id).then(res => {
77
+        const resData = res.data
78
+        this.ruleForm.billName = resData.billName
79
+        this.ruleForm.billExplain = resData.billExplain
80
+        this.ruleForm.endDate = resData.endDate
81
+      }).catch(() => {
82
+        console.log('GetBillByIdInfo error')
83
+      })
84
+    }
85
+  }
86
+}
87
+</script>
88
+
89
+<style scoped>
90
+#root {
91
+  margin-top: 20px;
92
+  margin-left: auto;
93
+  margin-right: auto;
94
+  width: 500px;
95
+}
96
+</style>

+ 267
- 45
VUECODE/smart-property-manage/src/views/bill/info/index.vue Прегледај датотеку

@@ -3,40 +3,40 @@
3 3
     <div class="bill-info-title">
4 4
       <div class="title-info">收费组名称: {{ billName }}</div>
5 5
       <div class="title-info">收费组说明: {{ billExplain }}</div>
6
-      <div class="title-info">截止时间: {{ endDate }}</div>
7
-      <el-button type="info">修改</el-button>
6
+      <div class="title-info">截止时间: {{ formatDate(endDate) }}</div>
7
+      <el-button type="info" @click="updateBill">修改</el-button>
8 8
     </div>
9 9
     <div class="bill-info-search">
10 10
       <span style="font-weight: bold;">收费情况</span>
11 11
       <el-form :model="formInline" inline="true" class="form-inline">
12 12
         <el-form-item label="选择房子">
13
-          <el-select v-model="formInline.phase" placeholder="请选择期">
13
+          <el-select v-model="formInline.phase" placeholder="请选择期" @change="buildSelectChange(0)">
14 14
             <el-option
15
-              v-for="item in options"
16
-              :key="item.value"
17
-              :label="item.label"
18
-              :value="item.value"/>
15
+              v-for="item in phaseList"
16
+              :key="item.id"
17
+              :label="item.phase"
18
+              :value="item.phase"/>
19 19
           </el-select>
20
-          <el-select v-model="formInline.building" placeholder="请选择栋">
20
+          <el-select v-model="formInline.building" placeholder="请选择栋" @change="buildSelectChange(1)">
21 21
             <el-option
22
-              v-for="item in options"
23
-              :key="item.value"
24
-              :label="item.label"
25
-              :value="item.value"/>
22
+              v-for="item in buildingList"
23
+              :key="item.id"
24
+              :label="item.building"
25
+              :value="item.building"/>
26 26
           </el-select>
27
-          <el-select v-model="formInline.unit" placeholder="请选择单元">
27
+          <el-select v-model="formInline.unit" placeholder="请选择单元" @change="buildSelectChange(3)">
28 28
             <el-option
29
-              v-for="item in options"
30
-              :key="item.value"
31
-              :label="item.label"
32
-              :value="item.value"/>
29
+              v-for="item in unitList"
30
+              :key="item.id"
31
+              :label="item.unit"
32
+              :value="item.unit"/>
33 33
           </el-select>
34 34
           <el-select v-model="formInline.roomNo" placeholder="请选择户">
35 35
             <el-option
36
-              v-for="item in options"
37
-              :key="item.value"
38
-              :label="item.label"
39
-              :value="item.value"/>
36
+              v-for="item in roomNoList"
37
+              :key="item.id"
38
+              :label="item.roomNo"
39
+              :value="item.roomNo"/>
40 40
           </el-select>
41 41
         </el-form-item>
42 42
         <br>
@@ -45,85 +45,114 @@
45 45
         </el-form-item>
46 46
         <el-form-item label="缴费状态">
47 47
           <el-select v-model="formInline.billStatus" placeholder="活动区域">
48
-            <el-option label="请选择" value="shanghai"/>
48
+            <el-option label="未缴费" value="0"/>
49
+            <el-option label="已线上缴费" value="1"/>
50
+            <el-option label="已线下缴费" value="2"/>
49 51
           </el-select>
50 52
         </el-form-item>
51 53
         <el-form-item label="缴费人姓名">
52 54
           <el-input v-model="formInline.payName"/>
53 55
         </el-form-item>
54 56
         <el-form-item>
55
-          <el-button type="info">清空</el-button>
56
-          <el-button type="primary" @click="onSubmit">查询</el-button>
57
+          <el-button type="info" @click="cleanQuery">清空</el-button>
58
+          <el-button type="primary" @click="getBillInvoice">查询</el-button>
57 59
         </el-form-item>
58 60
       </el-form>
59 61
     </div>
60 62
     <div class="bill-info-operation">
61 63
       <el-button type="primary">添加更多收费单</el-button>
62
-      <el-button type="danger">删除</el-button>
63
-      <el-button type="primary">设置为已线下缴费</el-button>
64
+      <el-button type="danger" @click="deleteBeachIds">删除</el-button>
65
+      <el-button type="primary" @click="offlinePayment">设置为已线下缴费</el-button>
64 66
       <el-button type="success">导出数据</el-button>
65 67
       <div style="height: 40px; line-height: 40px; margin-left: 10px; color: #99a9bf;">未缴户主费用可以直接点击 收费金额数字 修改,已缴费业主无法修改,需要线下多退少补</div>
66 68
     </div>
67 69
     <el-table
70
+      v-loading="tableLoading"
68 71
       ref="multipleTable"
69 72
       :data="list"
70 73
       style="width: 100%; margin-top: 20px;"
71
-      border="true"
74
+      border
72 75
       @selection-change="handleSelectionChange">
73 76
       <el-table-column
74 77
         type="selection"
75
-        width="55"/>
78
+        width="55"
79
+        align="center"/>
76 80
       <el-table-column
77 81
         prop="id"
78 82
         label="收费单号"
79
-        width="55">
83
+        width="55"
84
+        align="center">
80 85
         <!--<template slot-scope="scope">{{ scope.row.date }}</template>-->
81 86
       </el-table-column>
82 87
       <el-table-column
83 88
         prop="name"
84
-        label="房屋信息">
89
+        label="房屋信息"
90
+        align="center">
85 91
         <template slot-scope="scope">{{ scope.row.phase + '期' + scope.row.building + '栋' + scope.row.unit + '单元' + scope.row.roomNo + '户号' }}</template>
86 92
       </el-table-column>
87 93
       <el-table-column
88 94
         prop="ownerName"
89 95
         label="业主姓名"
96
+        align="center"
90 97
         show-overflow-tooltip/>
91 98
       <el-table-column
92 99
         prop="billInvoiceExplain"
93 100
         label="收费单说明"
94
-        width="300"/>
101
+        width="300"
102
+        align="center"/>
95 103
       <el-table-column
96 104
         prop="payPrice"
97
-        label="金额(元)"/>
105
+        label="金额(元)"
106
+        align="center">
107
+        <template slot-scope="scope">
108
+          <span style="color: #409EFF;cursor: pointer" @click="ediPayPrice(scope.row)">{{ scope.row.payPrice }}</span>
109
+        </template>
110
+      </el-table-column>
98 111
       <el-table-column
99 112
         prop="billStatement"
100
-        label="流水"/>
113
+        label="流水"
114
+        align="center"/>
101 115
       <el-table-column
102 116
         prop="billStatus"
103
-        label="缴费状态"/>
117
+        label="缴费状态"
118
+        align="center">
119
+        <template slot-scope="scope">{{ showBillStatus(scope.row.billStatus) }}</template>
120
+      </el-table-column>
104 121
       <el-table-column
105 122
         prop="payName"
106
-        label="缴费人"/>
123
+        label="缴费人"
124
+        align="center"/>
107 125
       <el-table-column
108 126
         prop="payDate"
109
-        label="缴费时间"/>
127
+        label="缴费时间"
128
+        align="center">
129
+        <template slot-scope="scope"> {{ formatDate(scope.row.payDate) }} </template>
130
+      </el-table-column>
110 131
       <el-table-column
111 132
         prop="createDate"
112
-        label="新建时间"/>
133
+        label="新建时间"
134
+        align="center">
135
+        <template slot-scope="scope"> {{ formatDate(scope.row.createDate) }} </template>
136
+      </el-table-column>
113 137
       <el-table-column
114 138
         prop="createUserName"
115
-        label="新建人"/>
139
+        label="新建人"
140
+        align="center"/>
116 141
       <el-table-column
117 142
         prop="updateUserName"
118
-        label="修改时间"/>
143
+        label="修改人"
144
+        align="center"/>
119 145
       <el-table-column
120 146
         prop="updateDate"
121
-        label="修改时间"/>
147
+        label="修改时间"
148
+        align="center">
149
+        <template slot-scope="scope"> {{ formatDate(scope.row.updateDate) }} </template>
150
+      </el-table-column>
122 151
     </el-table>
123 152
     <div class="pagination-info">
124 153
       <el-pagination
125 154
         :current-page="formInline.pageNum"
126
-        :page-sizes="[100, 200, 300, 400]"
155
+        :page-sizes="[10, 20, 40, 80, 100]"
127 156
         :page-size="formInline.pageSize"
128 157
         :total="total"
129 158
         layout="total, sizes, prev, pager, next, jumper"
@@ -150,20 +179,43 @@ export default {
150 179
         pageSize: 10,
151 180
         pageNum: 1
152 181
       },
153
-      billName: 'xxx收费项目',
154
-      billExplain: 'xxx收费说明',
155
-      endDate: 'xxx收费项截止时间',
182
+      billName: '', // 缴费组说明
183
+      billExplain: '', // 缴费组说明
184
+      endDate: '', // 缴费组截止时间
156 185
       list: [], // 数据列表
157
-      total: 0
186
+      total: 0,
187
+      buildingList: [], // seletc 楼栋集合
188
+      unitList: [], // seletc 单元集合
189
+      levelList: [], // seletc 层 集合
190
+      roomNoList: [], //  seletc 户号集合
191
+      phaseList: [], // 期 集合
192
+      deleteIds: [], // 需要删除的id集合
193
+      tableLoading: true // 表格加载圈
158 194
     }
159 195
   },
160 196
   mounted() {
197
+    // 获取期
198
+    this.getPhase()
161 199
     this.formInline.billId = this.$route.params.id
162 200
     this.getBillInvoice()
163 201
   },
164 202
   methods: {
165 203
     handleSelectionChange(val) {
166 204
       console.log(val)
205
+      this.deleteIds = []
206
+      for (const i in val) {
207
+        this.deleteIds.push(val[i].id)
208
+      }
209
+    },
210
+    cleanQuery() { // 清空
211
+      this.formInline.phase = ''
212
+      this.formInline.building = ''
213
+      this.formInline.unit = ''
214
+      this.formInline.roomNo = ''
215
+      this.formInline.ownerName = ''
216
+      this.formInline.billStatus = ''
217
+      this.formInline.payName = ''
218
+      this.getBillInvoice()
167 219
     },
168 220
     getBillInvoice() {
169 221
       this.$store.dispatch('GetBillInvoiceList', this.formInline).then(res => {
@@ -172,8 +224,178 @@ export default {
172 224
         this.formInline.pageNum = resData.pageNum
173 225
         this.formInline.pageSize = resData.pageSize
174 226
         this.total = resData.total
227
+        this.billName = resData.billName
228
+        this.billExplain = resData.billExplain
229
+        this.endDate = resData.endDate
230
+        this.tableLoading = false
175 231
       }).catch(() => {
176 232
         console.log('GetBillInvoiceList error')
233
+        this.tableLoading = false
234
+      })
235
+    },
236
+    getPhase() { // 获取期
237
+      this.formInline.phase = ''
238
+      this.$store.dispatch('BuildingAddress', this.formInline).then((res) => {
239
+        this.phaseList = res.data
240
+      }).catch(() => {
241
+        console.log('error phase BuildingAddress')
242
+      })
243
+    },
244
+    getBuild() { // 获取楼栋
245
+      this.formInline.building = ''
246
+      this.$store.dispatch('BuildingAddress', this.formInline).then((res) => {
247
+        this.buildingList = res.data
248
+      }).catch(() => {
249
+        console.log('error building BuildingAddress')
250
+      })
251
+    },
252
+    getUnit() { // 获取单元
253
+      this.formInline.unit = ''
254
+      this.$store.dispatch('BuildingAddress', this.formInline).then((res) => {
255
+        this.unitList = res.data
256
+      }).catch(() => {
257
+        console.log('error unit BuildingAddress')
258
+      })
259
+    },
260
+    getLevel() { // 获取楼层
261
+      this.formInline.level = ''
262
+      this.$store.dispatch('BuildingAddress', this.formInline).then((res) => {
263
+        this.levelList = res.data
264
+      }).catch(() => {
265
+        console.log('error level BuildingAddress')
266
+      })
267
+    },
268
+    getRoomNo() { // 获取户号
269
+      this.formInline.roomNo = ''
270
+      this.$store.dispatch('BuildingAddress', this.formInline).then((res) => {
271
+        this.roomNoList = res.data
272
+      }).catch(() => {
273
+        console.log('error roomNo BuildingAddress')
274
+      })
275
+    },
276
+    buildSelectChange(value) { // select 的 change
277
+      switch (value) {
278
+        case 0: // 查询栋
279
+          this.buildingList = []
280
+          this.unitList = []
281
+          this.levelList = []
282
+          this.roomNoList = []
283
+          this.formInline.building = ''
284
+          this.formInline.unit = ''
285
+          this.formInline.level = ''
286
+          this.formInline.roomNo = ''
287
+          this.getBuild()
288
+          break
289
+        case 1: // 查询 单元
290
+          this.unitList = []
291
+          this.levelList = []
292
+          this.roomNoList = []
293
+          this.formInline.unit = ''
294
+          this.formInline.level = ''
295
+          this.formInline.roomNo = ''
296
+          this.getUnit()
297
+          break
298
+        case 2: // 查询 楼层
299
+          this.levelList = []
300
+          this.roomNoList = []
301
+          this.formInline.level = ''
302
+          this.formInline.roomNo = ''
303
+          this.getLevel()
304
+          break
305
+        case 3: // 查询 户号
306
+          this.roomNoList = []
307
+          this.formInline.roomNo = ''
308
+          this.getRoomNo()
309
+          break
310
+      }
311
+    },
312
+    formatDate(val) {
313
+      var value = new Date(val)
314
+      var year = value.getFullYear()
315
+      var month = value.getMonth() + 1
316
+      var day = value.getDate()
317
+      // var hour = value.getHours()
318
+      // var minutes = value.getMinutes()
319
+      // var seconds = value.getSeconds()
320
+      // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
321
+      return year + '-' + month + '-' + day
322
+    },
323
+    handleSizeChange(val) {
324
+      console.log(`每页 ${val} 条`)
325
+      this.formInline.pageSize = val
326
+      this.getBillInvoice()
327
+    },
328
+    handleCurrentChange(val) {
329
+      console.log(`当前页: ${val}`)
330
+      this.formInline.pageNum = val
331
+      this.getBillInvoice()
332
+    },
333
+    updateBill() { // 跳转修改bill标题页面 bill-info-edi
334
+      this.$router.push({ name: 'bill-info-edi', params: { id: this.formInline.billId }})
335
+    },
336
+    deleteBeachIds() { // 批量删除
337
+      if (this.deleteIds.length <= 0) {
338
+        this.$message.error('请至少选择一行数据')
339
+        return
340
+      }
341
+      this.$store.dispatch('DeleteBillInvoiceById', this.deleteIds).then(res => {
342
+        const code = res.code
343
+        if (code === '0') {
344
+          this.$message.success(res.message)
345
+          this.getBillInvoice()
346
+          return
347
+        }
348
+        this.$message.error(res.message)
349
+      }).catch(() => {
350
+        console.log('DeleteBillInvoiceById error')
351
+      })
352
+    },
353
+    showBillStatus(val) {
354
+      let str = ''
355
+      switch (val) {
356
+        case '0':
357
+          str = '未缴费'
358
+          break
359
+        case '1':
360
+          str = '已线上缴费'
361
+          break
362
+        case '2':
363
+          str = '已线下缴费'
364
+          break
365
+      }
366
+      return str
367
+    },
368
+    offlinePayment() { // 设置线下缴费
369
+      this.$store.dispatch('BillInvoiceOfflinePayment', this.deleteIds).then(res => {
370
+        const resCode = res.code
371
+        if (resCode === '0') {
372
+          this.$message.success(res.message)
373
+          this.getBillInvoice()
374
+          return
375
+        }
376
+        this.$message.error(res.message)
377
+      }).catch(() => {
378
+        console.log('BillInvoiceOfflinePayment error')
379
+      })
380
+    },
381
+    ediPayPrice(obj) { // 修改金额
382
+      const payPrice = obj.payPrice
383
+      this.$prompt('请输入金额', '提示', {
384
+        confirmButtonText: '确定',
385
+        cancelButtonText: '取消',
386
+        inputPlaceholder: payPrice,
387
+        inputPattern: /^\d+\.?\d{0,2}$/,
388
+        inputErrorMessage: '请输入有效的金额'
389
+      }).then(({ value }) => {
390
+        this.$message({
391
+          type: 'success',
392
+          message: '你的金额是: ' + value
393
+        })
394
+      }).catch(() => {
395
+        this.$message({
396
+          type: 'info',
397
+          message: '取消输入'
398
+        })
177 399
       })
178 400
     }
179 401
   }

+ 1
- 1
VUECODE/smart-property-manage/src/views/building/index.vue Прегледај датотеку

@@ -183,7 +183,7 @@ export default {
183 183
         this.deleteIds.push(data[i].id)
184 184
       }
185 185
     },
186
-    getPhase() { // 获取楼栋
186
+    getPhase() { // 获取
187 187
       this.listQuery.phase = ''
188 188
       this.$store.dispatch('BuildingAddress', this.listQuery).then((res) => {
189 189
         this.phaseList = res.data