Kaynağa Gözat

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

# Conflicts:
#	src/services/apis.js
weichaochao 5 yıl önce
ebeveyn
işleme
e7f9011f0f

+ 1
- 1
src/components/HouseSelect/ApartmentSelect.jsx Dosyayı Görüntüle

38
 
38
 
39
   const checkValue = (data) => {
39
   const checkValue = (data) => {
40
     if (props.value) {
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
       const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
42
       const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43
       props.onChange(va)
43
       props.onChange(va)
44
 
44
 

+ 5
- 5
src/pages/house/edit/components/house.jsx Dosyayı Görüntüle

81
    *
81
    *
82
    * @param {*} record
82
    * @param {*} record
83
    */
83
    */
84
-  function deleteApartment(record) {
85
-    confirm({
84
+  function deleteHouseResource(record) {
85
+    Modal.confirm({
86
       title: '确认删除当前数据?',
86
       title: '确认删除当前数据?',
87
       content: '确定后成功删除,点击取消则放弃当前操作',
87
       content: '确定后成功删除,点击取消则放弃当前操作',
88
       okText: '确定',
88
       okText: '确定',
89
       cancelText: '取消',
89
       cancelText: '取消',
90
       onOk() {
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
           openNotificationWithIcon('success', '操作成功')
94
           openNotificationWithIcon('success', '操作成功')
95
         }).catch(err => {
95
         }).catch(err => {
96
           // openNotificationWithIcon('error', err.message)
96
           // openNotificationWithIcon('error', err.message)
165
       render: (_, record) => (
165
       render: (_, record) => (
166
         <>
166
         <>
167
           <Button type="link" style={{ color: 'red' }} onClick={() => showEdi({type: "add",houseId: record.houseId})}>编辑</Button>
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 Dosyayı Görüntüle

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

+ 4
- 0
src/services/apis.js Dosyayı Görüntüle

1163
     url: `${prefix}/taPreselectRecord`,
1163
     url: `${prefix}/taPreselectRecord`,
1164
     method: 'GET',
1164
     method: 'GET',
1165
     action: 'admin.taPreselectRecord.get',
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
 }