傅行帆 6 years ago
parent
commit
3b5c386a61

+ 2
- 11
CODE/smart-community/property-api/src/test/java/com/community/huiju/DemoApplicationTests.java View File

@@ -1,22 +1,13 @@
1 1
 package com.community.huiju;
2 2
 
3
-import com.alibaba.fastjson.JSONObject;
4
-import com.community.huiju.dao.ToCommunitiesMapper;
5
-import com.community.huiju.dao.TaUserMapper;
6
-import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
7
-import com.community.huiju.dao.TpSysRoleMapper;
8
-import com.community.huiju.model.TpBuildingOwnerInfo;
9
-import com.community.huiju.model.TpSysRole;
10
-import com.google.common.collect.Maps;
3
+
11 4
 import org.junit.Test;
12 5
 import org.junit.runner.RunWith;
13
-import org.springframework.beans.factory.annotation.Autowired;
14 6
 import org.springframework.boot.test.context.SpringBootTest;
15 7
 import org.springframework.test.context.junit4.SpringRunner;
16 8
 
17 9
 import java.time.Instant;
18
-import java.util.List;
19
-import java.util.Map;
10
+
20 11
 
21 12
 @RunWith(SpringRunner.class)
22 13
 @SpringBootTest

+ 318
- 4
VUECODE/smart-property-manage/src/views/building/audit/index.vue View File

@@ -1,15 +1,329 @@
1
+
1 2
 <template>
2
-  <div id="root">
3
-    审核资料
3
+  <div class="root">
4
+    <el-form :inline="true" :model="listQuery" class="form-listQuery">
5
+      <el-form-item label="收费组编号">
6
+        <el-input v-model="listQuery.billId" placeholder="收费组编号" />
7
+      </el-form-item>
8
+      <el-form-item label="收费组名">
9
+        <el-input v-model="listQuery.billName" placeholder="收费组名" />
10
+      </el-form-item>
11
+      <el-form-item label="收费组说明">
12
+        <el-input v-model="listQuery.billExplain" placeholder="收费组说明" />
13
+      </el-form-item>
14
+      <el-form-item>
15
+        <el-button type="info" @click="clearListQuery">清空</el-button>
16
+        <el-button type="primary" @click="handleFilter">查询</el-button>
17
+      </el-form-item>
18
+    </el-form>
19
+    <div class="operation">
20
+      <div>
21
+        <el-button type="primary" @click="addBill">新增收费组</el-button>
22
+        <el-button type="danger" @click="deleteBillBeach">删除</el-button>
23
+      </div>
24
+    </div>
25
+    <el-table
26
+      v-loading="listLoading"
27
+      ref="multipleTable"
28
+      :data="billList"
29
+      border
30
+      tooltip-effect="dark"
31
+      style="width: 100%; margin-top: 20px;"
32
+      @selection-change="handleSelectionChange">
33
+      <el-table-column type="selection" width="55" align="center"/>
34
+      <el-table-column label="收费组编号" align="center">
35
+        <template slot-scope="scope">
36
+          <span>{{ scope.row.id }}</span>
37
+        </template>
38
+      </el-table-column>
39
+      <el-table-column label="收费组名称" align="center">
40
+        <template slot-scope="scope">
41
+          <span style="color: #409EFF;cursor: pointer" @click="getInfo(scope.row.id, scope.row.billStatus)">{{ scope.row.billName }}</span>
42
+        </template>
43
+      </el-table-column>
44
+      <el-table-column label="收费组说明" align="center">
45
+        <template slot-scope="scope">
46
+          <span>{{ scope.row.billExplain }}</span>
47
+        </template>
48
+      </el-table-column>
49
+      <el-table-column label="应缴户数" align="center">
50
+        <template slot-scope="scope">
51
+          <span>{{ scope.row.payTotalNum }}</span>
52
+        </template>
53
+      </el-table-column>
54
+      <el-table-column label="已缴户数" align="center">
55
+        <template slot-scope="scope">
56
+          <span>{{ scope.row.payedNum }}</span>
57
+        </template>
58
+      </el-table-column>
59
+      <el-table-column label="未缴户数" align="center">
60
+        <template slot-scope="scope">
61
+          <span>{{ scope.row.unpayedNum }}</span>
62
+        </template>
63
+      </el-table-column>
64
+      <el-table-column label="收费组状态" align="center">
65
+        <template slot-scope="scope">
66
+          <span v-if="scope.row.billStatus === '0'">正在收费</span>
67
+          <span v-if="scope.row.billStatus === '1'">收费完成</span>
68
+          <span v-if="scope.row.billStatus === '2'">草稿</span>
69
+        </template>
70
+      </el-table-column>
71
+      <el-table-column label="收费组发布时间" align="center">
72
+        <template slot-scope="scope">
73
+          <span>{{ formatDate(scope.row.createDate) }}</span>
74
+        </template>
75
+      </el-table-column>
76
+      <el-table-column label="缴费截止时间" align="center">
77
+        <template slot-scope="scope">{{ formatDate(scope.row.endDate) }}</template>
78
+      </el-table-column>
79
+    </el-table>
80
+    <div class="block">
81
+      <el-pagination
82
+        :current-page.sync="listQuery.pageNum"
83
+        :page-sizes="[10, 20, 50, 100]"
84
+        :page-size.sync="listQuery.pageSize"
85
+        :total="total"
86
+        layout="total, sizes, prev, pager, next, jumper"
87
+        @size-change="handleSizeChange"
88
+        @current-change="handleCurrentChange"/>
89
+    </div>
4 90
   </div>
5 91
 </template>
6 92
 
7 93
 <script>
94
+import { mapState, mapActions, mapMutations } from 'vuex'
95
+import waves from '@/directive/waves' // Waves directive
96
+import { parseTime } from '@/utils'
97
+
8 98
 export default {
9
-  name: 'Audit'
99
+  computed: {
100
+    ...mapState('bill', {
101
+      billList: s => s.billList,
102
+      total: s => s.total
103
+    })
104
+  },
105
+  directives: { waves },
106
+  data() {
107
+    var _self = this
108
+    return {
109
+      events: {
110
+        click: (e) => {
111
+          // _self.postData.Coordinate = e.lnglat.lat + ',' + e.lnglat.lng
112
+          _self.detail.longitude = e.lnglat.lng
113
+          _self.detail.latitude = e.lnglat.lat
114
+        }
115
+      },
116
+      markers: [],
117
+      searchOption: {
118
+        city: '南京',
119
+        citylimit: false
120
+      },
121
+      listLoading: true,
122
+      listQuery: {
123
+        pageNum: 1,
124
+        pageSize: 20,
125
+        billId: undefined,
126
+        billExplain: undefined,
127
+        billName: undefined
128
+      },
129
+      ids: [], // id集合
130
+      tableKey: 0,
131
+      downloadLoading: false
132
+    }
133
+  },
134
+  created() {
135
+    this.getList()
136
+  },
137
+  methods: {
138
+    ...mapMutations('bill', {
139
+    }),
140
+    ...mapActions('bill', [
141
+      'FetchBillList'
142
+    ]),
143
+    setCurrent(item) {
144
+      this.setDetail({ ...item })
145
+    },
146
+    getList() {
147
+      this.listLoading = true
148
+      this.FetchBillList(this.listQuery).then(() => {
149
+        this.listLoading = false
150
+      }).catch(() => {
151
+        this.loading = false
152
+        console.log('get list error')
153
+      })
154
+    },
155
+    clearListQuery() {
156
+      this.listQuery.pageNum = 1
157
+      this.listQuery.pageSize = 20
158
+      this.listQuery.billId = undefined
159
+      this.listQuery.billName = undefined
160
+      this.listQuery.billExplain = undefined
161
+      this.getList()
162
+    },
163
+    getInfo(billId, billStatus) {
164
+      if (billStatus === '2') {
165
+        this.$router.push({ name: 'bill-edi', query: { id: billId }})
166
+      } else {
167
+        this.$router.push({ name: 'bill-info', query: { id: billId }})
168
+      }
169
+    },
170
+    addBill() {
171
+      this.$router.push({ name: 'bill-add' })
172
+    },
173
+    handleFilter() {
174
+      this.listQuery.pageNum = 1
175
+      this.getList()
176
+    },
177
+    handleModifyStatus(row, status) {
178
+      this.$message({
179
+        message: '操作成功',
180
+        type: 'success'
181
+      })
182
+      row.status = status
183
+    },
184
+    sortChange(data) {
185
+      const { prop, order } = data
186
+      if (prop === 'id') {
187
+        this.sortByID(order)
188
+      }
189
+    },
190
+    handleSizeChange(val) {
191
+      // console.log(`每页 ${val} 条`);
192
+      this.listQuery.pageSize = val
193
+      this.getList()
194
+    },
195
+    handleCurrentChange(val) {
196
+      // console.log(`当前页: ${val}`);
197
+      this.listQuery.pageNum = val
198
+      this.getList()
199
+    },
200
+    sortByID(order) {
201
+      if (order === 'ascending') {
202
+        this.listQuery.sort = '+id'
203
+      } else {
204
+        this.listQuery.sort = '-id'
205
+      }
206
+      this.handleFilter()
207
+    },
208
+    handleUpdate(row) {
209
+      this.setCurrent(row)
210
+      this.dialogStatus = 'update'
211
+      this.dialogFormVisible = true
212
+      this.$nextTick(() => {
213
+        this.$refs['dataForm'].clearValidate()
214
+      })
215
+      this.getEditCityList()
216
+      this.getEditDistrictList()
217
+    },
218
+    handleLook(id) {
219
+      this.$router.push({ name: 'transaction-info', params: { id: id }})
220
+    },
221
+    handleCreate() {
222
+      this.resetDetail()
223
+      this.dialogStatus = 'create'
224
+      this.dialogFormVisible = true
225
+      this.$nextTick(() => {
226
+        this.$refs['dataForm'].clearValidate()
227
+      })
228
+    },
229
+    handleDelete(row) {
230
+      this.$notify({
231
+        title: '成功',
232
+        message: '删除成功',
233
+        type: 'success',
234
+        duration: 2000
235
+      })
236
+      const index = this.list.indexOf(row)
237
+      this.list.splice(index, 1)
238
+    },
239
+    handleDownload() {
240
+      this.downloadLoading = true
241
+      import('@/vendor/Export2Excel').then(excel => {
242
+        const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
243
+        const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
244
+        const data = this.formatJson(filterVal, this.list)
245
+        excel.export_json_to_excel({
246
+          header: tHeader,
247
+          data,
248
+          filename: 'table-list'
249
+        })
250
+        this.downloadLoading = false
251
+      })
252
+    },
253
+    padDate(value) {
254
+      value = value < 10 ? '0' + value : value
255
+      return value
256
+    },
257
+    formatDate(val) {
258
+      if (val === null) {
259
+        return ''
260
+      }
261
+      var value = new Date(val)
262
+      var year = value.getFullYear()
263
+      var month = this.padDate(value.getMonth() + 1)
264
+      var day = this.padDate(value.getDate())
265
+      var hour = this.padDate(value.getHours())
266
+      var minutes = this.padDate(value.getMinutes())
267
+      var seconds = this.padDate(value.getSeconds())
268
+      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
269
+    },
270
+    formatJson(filterVal, jsonData) {
271
+      return jsonData.map(v => filterVal.map(j => {
272
+        if (j === 'timestamp') {
273
+          return parseTime(v[j])
274
+        } else {
275
+          return v[j]
276
+        }
277
+      }))
278
+    },
279
+    deleteBillBeach() { // 删除
280
+      if (this.ids.length <= 0) {
281
+        this.$message.error('请至少选择一项')
282
+        return
283
+      }
284
+      this.$store.dispatch('bill/DeleteBillBeach', this.ids).then(res => {
285
+        const resCode = res.code
286
+        if (resCode === '0') {
287
+          this.$message.success(res.message)
288
+          this.getList()
289
+          return
290
+        }
291
+        this.$message.error(res.message)
292
+      }).catch(() => {
293
+        console.log('DeleteBillBeach error')
294
+      })
295
+    },
296
+    handleSelectionChange(val) { // 选择
297
+      console.log(val)
298
+      this.ids = []
299
+
300
+      val.map((item, index) => {
301
+        console.log(item, index)
302
+        this.ids.push(item.id)
303
+      })
304
+    }
305
+  }
10 306
 }
11 307
 </script>
12 308
 
13 309
 <style scoped>
14
-
310
+.root{
311
+  display: flex;
312
+  flex-flow: column;
313
+}
314
+.form-listQuery{
315
+  margin-top: 20px;
316
+  margin-left: 30px;
317
+}
318
+.operation{
319
+  display: flex;
320
+  justify-content: space-between;
321
+  margin-left: 20px;
322
+  margin-right: 20px;
323
+}
324
+.block{
325
+  display: flex;
326
+  justify-content: flex-end;
327
+  margin-top: 10px;
328
+}
15 329
 </style>