张延森 hace 4 años
padre
commit
1ce6b7491f

+ 6
- 0
config/routes.js Ver fichero

619
                 component: './property/bill/info',
619
                 component: './property/bill/info',
620
                 hideInMenu: true,
620
                 hideInMenu: true,
621
               },
621
               },
622
+              {
623
+                path: 'bill/management/info/add',
624
+                name: '新增收费',
625
+                component: './property/bill/info/Add',
626
+                hideInMenu: true,
627
+              },
622
               {
628
               {
623
                 path: 'bill/order',
629
                 path: 'bill/order',
624
                 name: '订单管理',
630
                 name: '订单管理',

+ 18
- 4
src/pages/property/bill/info/Add.jsx Ver fichero

1
-import React, { useEffect, useState } from 'react'
2
-import { Button, Icon, Modal, Table, Popconfirm } from 'antd'
1
+import React, { useEffect, useState, useCallback } from 'react'
2
+import { Button, Icon, Modal, Table, Popconfirm, notification } from 'antd'
3
 import { fetch, fetchList, apis } from '@/utils/request'
3
 import { fetch, fetchList, apis } from '@/utils/request'
4
 import NavLink from 'umi/navlink'
4
 import NavLink from 'umi/navlink'
5
 import List from '../../components/List'
5
 import List from '../../components/List'
8
 const getTempBillInvoice = fetch(apis.bill.getTempBillInvoice)
8
 const getTempBillInvoice = fetch(apis.bill.getTempBillInvoice)
9
 const addTempBillInvoice = fetch(apis.bill.addTempBillInvoice)
9
 const addTempBillInvoice = fetch(apis.bill.addTempBillInvoice)
10
 const deleteTempBillInvoice = fetch(apis.bill.deleteTempBillInvoice)
10
 const deleteTempBillInvoice = fetch(apis.bill.deleteTempBillInvoice)
11
+const updateBillInvoiceStatus = fetch(apis.bill.updateBillInvoiceStatus)
11
 
12
 
12
 export default props => {
13
 export default props => {
13
   const [loading, setLoading] = useState(false)
14
   const [loading, setLoading] = useState(false)
46
     })
47
     })
47
   }
48
   }
48
 
49
 
50
+  const handleCommitAll = () => {
51
+    if (!listData.length) {
52
+      notification.warn({ message: '没有需要提交的数据' })
53
+      return
54
+    }
55
+
56
+    setLoading(true)
57
+    updateBillInvoiceStatus({data: listData.map(x => x.id)}).then(res => {
58
+      notification.success({ message: '全部提交成功' })
59
+      setLoading(false)
60
+    }).catch(e => setLoading(false))
61
+  }
62
+
49
   useEffect(() => {
63
   useEffect(() => {
50
     if (id) {
64
     if (id) {
51
       getListData()
65
       getListData()
56
 
70
 
57
   return (
71
   return (
58
     <div>
72
     <div>
59
-      <div>
73
+      <div style={{marginBottom: '24PX'}}>
60
         <Button type="primary" onClick={() => setShowAdd(true)}><Icon type="plus"/>新增记录</Button>
74
         <Button type="primary" onClick={() => setShowAdd(true)}><Icon type="plus"/>新增记录</Button>
61
-        <Button type="danger" style={{marginLeft: '48px'}} onClick={}><Icon type="save"/>提交全部</Button>
75
+        <Button type="danger" style={{marginLeft: '48px'}} onClick={handleCommitAll}><Icon type="save"/>提交全部</Button>
62
       </div>
76
       </div>
63
       <List dataSource={listData} loading={loading} rowKey="id">
77
       <List dataSource={listData} loading={loading} rowKey="id">
64
         <Table.Column title="房屋信息" dataIndex="roomNo" key="roomNo" render={(_, row) => row.phase + row.building + row.unit + row.roomNo} />
78
         <Table.Column title="房屋信息" dataIndex="roomNo" key="roomNo" render={(_, row) => row.phase + row.building + row.unit + row.roomNo} />

+ 14
- 8
src/pages/property/bill/info/components/AddOne.jsx Ver fichero

90
       })
90
       })
91
     }
91
     }
92
   }
92
   }
93
+  
94
+  const handlePhaseChange = e => setPhaseId(e)
95
+  const handleBuildingChange = e => setBuildingId(e)
96
+  const handleUnitChange = e => setUnitId(e)
97
+  const handleLevelChange = e => setLevelId(e)
98
+  const handleRoomChange = e => setRoomNoId(e)
93
 
99
 
94
   useEffect(() => {
100
   useEffect(() => {
95
     props.form.setFieldsValue(formData)
101
     props.form.setFieldsValue(formData)
96
   }, [formData])
102
   }, [formData])
97
 
103
 
98
   useEffect(() => {
104
   useEffect(() => {
99
-    setPhaseErr(phaseId ? '请选择期数': undefined)
105
+    setPhaseErr(!phaseId ? '请选择期数': undefined)
100
   }, [phaseId])
106
   }, [phaseId])
101
 
107
 
102
   useEffect(() => {
108
   useEffect(() => {
103
-    setBuildingErr(buildingId ? '请选择楼栋': undefined)
109
+    setBuildingErr(!buildingId ? '请选择楼栋': undefined)
104
   }, [buildingId])
110
   }, [buildingId])
105
 
111
 
106
   useEffect(() => {
112
   useEffect(() => {
107
-    setUnitErr(setUnitId ? '请选择单元': undefined)
108
-  }, [setUnitId])
113
+    setUnitErr(!unitId ? '请选择单元': undefined)
114
+  }, [unitId])
109
 
115
 
110
   useEffect(() => {
116
   useEffect(() => {
111
-    setLevelErr(levelId ? '请选择层数': undefined)
117
+    setLevelErr(!levelId ? '请选择层数': undefined)
112
   }, [levelId])
118
   }, [levelId])
113
 
119
 
114
   useEffect(() => {
120
   useEffect(() => {
115
-    setRoomNoErr(roomNoId ? '请选择户号': undefined)
121
+    setRoomNoErr(!roomNoId ? '请选择户号': undefined)
116
   }, [roomNoId])
122
   }, [roomNoId])
117
 
123
 
118
   return (
124
   return (
154
       </Form.Item>
160
       </Form.Item>
155
       <Form.Item label="收费单说明">
161
       <Form.Item label="收费单说明">
156
       {
162
       {
157
-        getFieldDecorator('billInvoiceExplain', {
163
+        props.form.getFieldDecorator('billInvoiceExplain', {
158
           rules: [
164
           rules: [
159
             {required: true, message: '请填写收费单说明'}
165
             {required: true, message: '请填写收费单说明'}
160
           ]
166
           ]
163
       </Form.Item>
169
       </Form.Item>
164
       <Form.Item label="收费金额(元)">
170
       <Form.Item label="收费金额(元)">
165
       {
171
       {
166
-        getFieldDecorator('payPrice', {
172
+        props.form.getFieldDecorator('payPrice', {
167
           rules: [
173
           rules: [
168
             {required: true, message: '请填写收费金额'}
174
             {required: true, message: '请填写收费金额'}
169
           ]
175
           ]

+ 1
- 1
src/pages/property/bill/info/index.jsx Ver fichero

295
       </div>
295
       </div>
296
 
296
 
297
       <div style={{margin: '24px 0'}}>
297
       <div style={{margin: '24px 0'}}>
298
-        <NavLink to=""><Button type="primary"><Icon type="plus" />添加更多收费单</Button></NavLink>
298
+        <NavLink to="/property/bill/management/info/add"><Button type="primary"><Icon type="plus" />添加更多收费单</Button></NavLink>
299
         <Button type="link" onClick={exportExcel}><Icon type="export" />导出数据</Button>
299
         <Button type="link" onClick={exportExcel}><Icon type="export" />导出数据</Button>
300
         <div style={{height: '40px', lineHeight: '40px', marginLeft: '10px', fontSize: '14px', color: '#888' }}>未缴户主费用可以直接点击 收费金额数字 修改,已缴费户主无法修改,需要线下多退少补</div>
300
         <div style={{height: '40px', lineHeight: '40px', marginLeft: '10px', fontSize: '14px', color: '#888' }}>未缴户主费用可以直接点击 收费金额数字 修改,已缴费户主无法修改,需要线下多退少补</div>
301
       </div>
301
       </div>

+ 2
- 2
src/pages/property/bill/order/index.jsx Ver fichero

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
-import { Select, Spin, Table, Button, Form, Input, Divider } from 'antd'
2
+import { Select, Spin, Table, Button, Form, Input, Divider, Icon } from 'antd'
3
 import NavLink from 'umi/navlink'
3
 import NavLink from 'umi/navlink'
4
 import { fetchList, apis, fetch } from '@/utils/request'
4
 import { fetchList, apis, fetch } from '@/utils/request'
5
 import Search from '../../components/Search'
5
 import Search from '../../components/Search'
108
     <div>
108
     <div>
109
       <Condition onSearch={handleSearch} onReset={handleSearch} />
109
       <Condition onSearch={handleSearch} onReset={handleSearch} />
110
       <div style={{ margin: '24px 0' }}>
110
       <div style={{ margin: '24px 0' }}>
111
-        <Button type="primary" onClick={exportExcel}>导出数据</Button>
111
+        <Button type="link" onClick={exportExcel}><Icon type="download"/>导出数据</Button>
112
       </div>
112
       </div>
113
       <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="id">
113
       <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="id">
114
         <Table.Column
114
         <Table.Column

+ 3
- 3
src/pages/property/building/BatchImport.jsx Ver fichero

72
   return (
72
   return (
73
     <div>
73
     <div>
74
       <div style={{ marginBottom: '24px' }}>
74
       <div style={{ marginBottom: '24px' }}>
75
-        <Button onClick={downloadExcel}><Icon type="download" />下载模板</Button>
76
-        <Button onClick={importExcel} style={spaceStyle}><Icon type="upload" />选取文件并预览</Button>
77
-        <Button type="primary" onClick={submitExcel} style={spaceStyle}>提交</Button>
75
+        <Button type="primary" onClick={importExcel}><Icon type="upload" />选取文件并预览</Button>
76
+        <Button type="danger" onClick={submitExcel} style={spaceStyle}>提交</Button>
78
         <Button style={spaceStyle} onClick={() => router.go(-1)}>取消</Button>
77
         <Button style={spaceStyle} onClick={() => router.go(-1)}>取消</Button>
78
+        <Button type="link" onClick={downloadExcel} style={spaceStyle}><Icon type="download" />下载模板</Button>
79
       </div>
79
       </div>
80
 
80
 
81
       <Table dataSource={dataList} pagination={pagenavi} loading={loading}>
81
       <Table dataSource={dataList} pagination={pagenavi} loading={loading}>

+ 1
- 1
src/pages/property/building/index.jsx Ver fichero

142
     <>
142
     <>
143
       <div style={{ marginBottom: '24px' }}>
143
       <div style={{ marginBottom: '24px' }}>
144
         <Button onClick={() => showPrompt({ type: 'phase' })}><Icon type="plus" />增加顶级节点</Button>
144
         <Button onClick={() => showPrompt({ type: 'phase' })}><Icon type="plus" />增加顶级节点</Button>
145
-        <Button type="link" onClick={handleBatchImport} style={{ marginLeft: '24px' }}>批量导入小区楼栋信息</Button>
145
+        <Button type="link" onClick={handleBatchImport} style={{ marginLeft: '24px' }}><Icon type="upload"/>批量导入小区楼栋信息</Button>
146
       </div>
146
       </div>
147
       {
147
       {
148
         treeData && treeData.length ? (
148
         treeData && treeData.length ? (

+ 18
- 53
src/pages/property/proprietor/Add.jsx Ver fichero

2
 import { Form, Input, Select, Button, Radio, Modal, Descriptions } from 'antd'
2
 import { Form, Input, Select, Button, Radio, Modal, Descriptions } from 'antd'
3
 import router from 'umi/router'
3
 import router from 'umi/router'
4
 import { fetch, apis } from '@/utils/request'
4
 import { fetch, apis } from '@/utils/request'
5
+import useRoomSelect from '../utils/hooks/useRoomSelect'
5
 
6
 
6
-const fetchPhaseList = fetch(apis.buildingOwnerInfo.getPhaseList)
7
-const fetchBuildingList = fetch(apis.buildingOwnerInfo.getBuildingList)
8
-const fetchUnitList = fetch(apis.buildingOwnerInfo.getUnitList)
9
-const fetchLevelList = fetch(apis.buildingOwnerInfo.getLevelList)
10
-const fetchRoomNoList = fetch(apis.buildingOwnerInfo.getRoomNoList)
11
 const addPerson = fetch(apis.buildingOwnerInfo.addBuilding)
7
 const addPerson = fetch(apis.buildingOwnerInfo.addBuilding)
12
 const taUserHasOwner = fetch(apis.propUser.taUserHasOwner)
8
 const taUserHasOwner = fetch(apis.propUser.taUserHasOwner)
13
 const taUserHas = fetch(apis.propUser.taUserHas)
9
 const taUserHas = fetch(apis.propUser.taUserHas)
37
 }
33
 }
38
 
34
 
39
 export default Form.create()(props => {
35
 export default Form.create()(props => {
40
-  const [phaseList, setPhaseList] = useState([])
41
-  const [buildingList, setBuildingList] = useState([])
42
-  const [unitList, setUnitList] = useState([])
43
-  const [levelList, setLevelList] = useState([])
44
-  const [roomNoList, setRoomNoList] = useState([])
45
-
46
-  const [phaseId, setPhaseId] = useState()
47
-  const [buildingId, setBuildingId] = useState()
48
-  const [unitId, setUnitId] = useState()
49
-  const [levelId, setLevelId] = useState()
50
-  const [roomNoId, setRoomNoId] = useState()
36
+  const {
37
+    phaseId,
38
+    setPhaseId,
39
+    buildingId,
40
+    setBuildingId,
41
+    unitId,
42
+    setUnitId,
43
+    levelId,
44
+    setLevelId,
45
+    roomNoId,
46
+    setRoomNoId,
47
+    phaseList,
48
+    buildingList,
49
+    unitList,
50
+    levelList,
51
+    roomNoList
52
+  } = useRoomSelect()
51
 
53
 
52
   const [owerExist, setOwnerExist] = useState(false)
54
   const [owerExist, setOwnerExist] = useState(false)
53
   const [telAccUser, setTelAccUser] = useState()
55
   const [telAccUser, setTelAccUser] = useState()
66
     }
68
     }
67
   }
69
   }
68
 
70
 
69
-  // 获取期
70
-  useEffect(() => {
71
-    fetchPhaseList().then(res => setPhaseList(res))
72
-  }, [])
73
-
74
-  // 楼栋
75
-  useEffect(() => {
76
-    if (phaseId) {
77
-      fetchBuildingList({params: {phaseId}}).then(res => setBuildingList(res))
78
-    }
79
-    setBuildingId()
80
-  }, [phaseId])
81
-
82
-  // 单元
83
-  useEffect(() => {
84
-    if (phaseId && buildingId) {
85
-      fetchUnitList({params: {phaseId, buildingId}}).then(res => setUnitList(res))
86
-    }
87
-    setUnitId()
88
-  }, [phaseId, buildingId])
89
-
90
-  // 楼层
91
-  useEffect(() => {
92
-    if (phaseId && buildingId && unitId) {
93
-      fetchLevelList({params: {phaseId, buildingId, unitId}}).then(res => setLevelList(res))
94
-    }
95
-    setLevelId()
96
-  }, [phaseId, buildingId, unitId])
97
-
98
-  // 房号
99
-  useEffect(() => {
100
-    if (phaseId && buildingId && unitId && levelId) {
101
-      fetchRoomNoList({params: {phaseId, buildingId, unitId, levelId}}).then(res => setRoomNoList(res))
102
-    }
103
-    setRoomNoId()
104
-  }, [phaseId, buildingId, unitId, levelId])
105
-
106
   useEffect(() => {
71
   useEffect(() => {
107
     if (roomNoId) {
72
     if (roomNoId) {
108
       taUserHasOwner({ params: {phaseId, buildingId, unitId, levelId, roomNoId} }).then(res => {
73
       taUserHasOwner({ params: {phaseId, buildingId, unitId, levelId, roomNoId} }).then(res => {

+ 3
- 3
src/pages/property/proprietor/BatchImport.jsx Ver fichero

76
   return (
76
   return (
77
     <div>
77
     <div>
78
       <div style={{ marginBottom: '24px' }}>
78
       <div style={{ marginBottom: '24px' }}>
79
-        <Button onClick={downloadExcel}><Icon type="download" />下载模板</Button>
80
-        <Button onClick={importExcel} style={spaceStyle}><Icon type="upload" />选取文件并预览</Button>
81
-        <Button type="primary" onClick={submitExcel} style={spaceStyle}>提交</Button>
79
+        <Button type="primary" onClick={importExcel} style={spaceStyle}><Icon type="upload" />选取文件并预览</Button>
80
+        <Button type="danger" onClick={submitExcel} style={spaceStyle}>提交</Button>
82
         <Button style={spaceStyle} onClick={() => router.go(-1)}>取消</Button>
81
         <Button style={spaceStyle} onClick={() => router.go(-1)}>取消</Button>
82
+        <Button type="link" style={spaceStyle} onClick={downloadExcel}><Icon type="download" />下载模板</Button>
83
       </div>
83
       </div>
84
 
84
 
85
       <Table dataSource={dataList} pagination={pagenavi} loading={loading}>
85
       <Table dataSource={dataList} pagination={pagenavi} loading={loading}>