소스 검색

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

# Conflicts:
#	src/services/apis.js
weichaochao 5 년 전
부모
커밋
e7f9011f0f

+ 1
- 1
src/components/HouseSelect/ApartmentSelect.jsx 파일 보기

@@ -38,7 +38,7 @@ const ApartmentSelect = props => {
38 38
 
39 39
   const checkValue = (data) => {
40 40
     if (props.value) {
41
-      const tempData = data.filter(f => f.buildingId == props.value)
41
+      const tempData = data.filter(f => f.apartmentId == props.value)
42 42
       const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43 43
       props.onChange(va)
44 44
 

+ 5
- 5
src/pages/house/edit/components/house.jsx 파일 보기

@@ -81,16 +81,16 @@ function House(props) {
81 81
    *
82 82
    * @param {*} record
83 83
    */
84
-  function deleteApartment(record) {
85
-    confirm({
84
+  function deleteHouseResource(record) {
85
+    Modal.confirm({
86 86
       title: '确认删除当前数据?',
87 87
       content: '确定后成功删除,点击取消则放弃当前操作',
88 88
       okText: '确定',
89 89
       cancelText: '取消',
90 90
       onOk() {
91 91
         // 网路请求
92
-        request({ ...apis.building.buildingApartmentDelete, urlData: { id: record.apartmentId } }).then(res => {
93
-          getList()
92
+        request({ ...apis.house.houseDelete, urlData: { id: record.houseId } }).then(res => {
93
+          getList({ pageNumber: 1, pageSize: 10 })
94 94
           openNotificationWithIcon('success', '操作成功')
95 95
         }).catch(err => {
96 96
           // openNotificationWithIcon('error', err.message)
@@ -165,7 +165,7 @@ function House(props) {
165 165
       render: (_, record) => (
166 166
         <>
167 167
           <Button type="link" style={{ color: 'red' }} onClick={() => showEdi({type: "add",houseId: record.houseId})}>编辑</Button>
168
-          <Button type="link" style={{ color: 'red' }} onClick={() => deleteApartment(record)}>删除</Button>
168
+          <Button type="link" style={{ color: 'red' }} onClick={() => deleteHouseResource(record)}>删除</Button>
169 169
         </>
170 170
       ),
171 171
     },

+ 8
- 8
src/pages/house/edit/components/houseAdd.jsx 파일 보기

@@ -49,7 +49,7 @@ function HouseAdd(props) {
49 49
       if (!err) {
50 50
           if(houseId){
51 51
             request({ ...apis.house.houseEdit,urlData: {id: houseId}, data: { ...values,buildingId: props.buildingId, salesBatchId: props.salesBatchId } }).then((data) => {
52
-              message.info('保存成功')
52
+              message.info('修改成功')
53 53
               props.onSuccess({type: "house"})
54 54
             }).catch((err) => {
55 55
               // message.info(err.msg || err.message)
@@ -74,7 +74,7 @@ function HouseAdd(props) {
74 74
   return (
75 75
     <>
76 76
       <Form {...formItemLayout} onSubmit={handleSubmit}>
77
-      <Form.Item label="期">
77
+      <Form.Item label="期" >
78 78
         {getFieldDecorator('termName', {
79 79
           rules: [
80 80
             {
@@ -82,7 +82,7 @@ function HouseAdd(props) {
82 82
               message: '请输入楼栋',
83 83
             },
84 84
           ],
85
-        })(<Input/>)}
85
+        })(<Input disabled={houseId && houseId !== '' ? true : false}/>)}
86 86
         </Form.Item>
87 87
         <Form.Item label="楼栋">
88 88
         {getFieldDecorator('blockName', {
@@ -92,7 +92,7 @@ function HouseAdd(props) {
92 92
               message: '请输入楼栋',
93 93
             },
94 94
           ],
95
-        })(<Input/>)}
95
+        })(<Input disabled={houseId && houseId !== '' ? true : false}/>)}
96 96
         </Form.Item>
97 97
         <Form.Item label="单元">
98 98
         {getFieldDecorator('unitName', {
@@ -102,7 +102,7 @@ function HouseAdd(props) {
102 102
               message: '请输入单元',
103 103
             },
104 104
           ],
105
-        })(<Input/>)}
105
+        })(<Input disabled={houseId && houseId !== '' ? true : false}/>)}
106 106
         </Form.Item>
107 107
         <Form.Item label="层">
108 108
         {getFieldDecorator('floorName', {
@@ -112,7 +112,7 @@ function HouseAdd(props) {
112 112
               message: '请输入楼层',
113 113
             },
114 114
           ],
115
-        })(<Input/>)}
115
+        })(<Input disabled={houseId && houseId !== '' ? true : false}/>)}
116 116
         </Form.Item>
117 117
         <Form.Item label="房号">
118 118
         {getFieldDecorator('roomName', {
@@ -160,8 +160,8 @@ function HouseAdd(props) {
160 160
           ],
161 161
         })(
162 162
           <Select placeholder="发布状态">
163
-            <Option value="0">否</Option>
164
-            <Option value="1">是</Option>
163
+            <Option value={0}>否</Option>
164
+            <Option value={1}>是</Option>
165 165
           </Select>,
166 166
         )}
167 167
         </Form.Item>

+ 4
- 0
src/services/apis.js 파일 보기

@@ -1163,6 +1163,10 @@ export default {
1163 1163
     url: `${prefix}/taPreselectRecord`,
1164 1164
     method: 'GET',
1165 1165
     action: 'admin.taPreselectRecord.get',
1166
+  houseDelete: {
1167
+    url: `${prefix}/houseDelete/:id`,
1168
+    method: 'DELETE',
1169
+    action: 'admin.houseDelete.id.put',
1166 1170
   }
1167 1171
  },
1168 1172
 }