diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs
index f040d2e..46d1295 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs
@@ -145,7 +145,7 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
HouseCodeId = p
}.Insert();
- var initTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t => t.TaskType == 0);
+ var initTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t =>t.HouseCodeId == p && t.TaskType == 0);
if (initTask == null)
{
new BsHouseTask
diff --git a/web-react/src/pages/business/house/info/form/base/aspect.jsx b/web-react/src/pages/business/house/info/form/base/aspect.jsx
index 8dbd577..021ac46 100644
--- a/web-react/src/pages/business/house/info/form/base/aspect.jsx
+++ b/web-react/src/pages/business/house/info/form/base/aspect.jsx
@@ -98,7 +98,7 @@ export default class aspect extends Component {
houseInfo.facadePhoto = fileValue
}
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false })
this.call()
diff --git a/web-react/src/pages/business/house/info/form/base/attachments.jsx b/web-react/src/pages/business/house/info/form/base/attachments.jsx
index 2db909c..b9ac6ce 100644
--- a/web-react/src/pages/business/house/info/form/base/attachments.jsx
+++ b/web-react/src/pages/business/house/info/form/base/attachments.jsx
@@ -124,7 +124,7 @@ export default class attachments extends Component {
}
}
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false })
this.call()
diff --git a/web-react/src/pages/business/house/info/form/base/building.jsx b/web-react/src/pages/business/house/info/form/base/building.jsx
index c3a66f1..a4031a6 100644
--- a/web-react/src/pages/business/house/info/form/base/building.jsx
+++ b/web-react/src/pages/business/house/info/form/base/building.jsx
@@ -59,6 +59,13 @@ export default class building extends Component {
})
}
+ componentWillUnmount() {
+ dispatch({
+ type: 'PATROL_REMOVE_INIT_GRADE_BY_COMPLETED_DATE',
+ id: this.props.id,
+ })
+ }
+
call() {
if (this.props.onRef) {
this.props.onRef(this)
@@ -79,10 +86,12 @@ export default class building extends Component {
const { houseInfo } = this.record
if (houseInfo.completedDate) {
houseInfo.completedDate = moment(houseInfo.completedDate)
- debugger
dispatch({
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
- value: +houseInfo.completedDate.format('YYYY'),
+ date: {
+ id: this.props.id,
+ value: +houseInfo.completedDate.format('YYYY'),
+ },
})
}
@@ -110,7 +119,7 @@ export default class building extends Component {
)
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState(_state)
this.call()
@@ -172,7 +181,10 @@ export default class building extends Component {
if (houseInfo.hasOwnProperty('completedDate')) {
dispatch({
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
- value: +houseInfo.completedDate.format('YYYY'),
+ date: {
+ id: this.props.id,
+ value: +houseInfo.completedDate.format('YYYY'),
+ },
})
}
}
diff --git a/web-react/src/pages/business/house/info/form/base/drawing.jsx b/web-react/src/pages/business/house/info/form/base/drawing.jsx
index 9d0bbba..022e24c 100644
--- a/web-react/src/pages/business/house/info/form/base/drawing.jsx
+++ b/web-react/src/pages/business/house/info/form/base/drawing.jsx
@@ -72,13 +72,16 @@ export default class drawing extends Component {
if (houseInfo.drawingMaterial) {
houseInfo.drawingMaterial = houseInfo.drawingMaterial.split(',')
}
- this.setState({ showDrawingMaterialText: houseInfo.drawingMaterial.includes('100') })
+ this.setState({
+ showDrawingMaterialText:
+ !!houseInfo.drawingMaterial && houseInfo.drawingMaterial.includes('100'),
+ })
}
const codes = await getDictData('dic_house_storage_of_drawings')
console.log(codes)
this.setState({ codes })
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false })
this.call()
diff --git a/web-react/src/pages/business/house/info/form/base/identification.jsx b/web-react/src/pages/business/house/info/form/base/identification.jsx
index 9950546..5b77bcd 100644
--- a/web-react/src/pages/business/house/info/form/base/identification.jsx
+++ b/web-react/src/pages/business/house/info/form/base/identification.jsx
@@ -75,7 +75,7 @@ export default class identification extends Component {
)
this.setState({ codes })
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false })
this.call()
diff --git a/web-react/src/pages/business/house/info/form/base/ownership.jsx b/web-react/src/pages/business/house/info/form/base/ownership.jsx
index cbc48c0..f12ad79 100644
--- a/web-react/src/pages/business/house/info/form/base/ownership.jsx
+++ b/web-react/src/pages/business/house/info/form/base/ownership.jsx
@@ -67,7 +67,7 @@ export default class ownership extends Component {
const codes = await getDictData('dic_house_property_rights')
this.setState({ codes })
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false })
this.call()
diff --git a/web-react/src/pages/business/house/info/form/base/unit.jsx b/web-react/src/pages/business/house/info/form/base/unit.jsx
index b04f5ed..59d5bb3 100644
--- a/web-react/src/pages/business/house/info/form/base/unit.jsx
+++ b/web-react/src/pages/business/house/info/form/base/unit.jsx
@@ -62,7 +62,7 @@ export default class unit extends Component {
this.record = cloneDeep(params.record)
//#region 从后端转换成前段所需格式
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false })
this.call()
diff --git a/web-react/src/pages/business/house/info/form/patrol/base.jsx b/web-react/src/pages/business/house/info/form/patrol/base.jsx
index 996ca1f..e231a6d 100644
--- a/web-react/src/pages/business/house/info/form/patrol/base.jsx
+++ b/web-react/src/pages/business/house/info/form/patrol/base.jsx
@@ -47,7 +47,7 @@ export default class base extends Component {
this.record.patrolInfo.patrolDate = patrolDate ? moment(patrolDate) : patrolDate
}
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false })
this.call()
diff --git a/web-react/src/pages/business/house/info/form/patrol/grade.jsx b/web-react/src/pages/business/house/info/form/patrol/grade.jsx
index 806ecae..fa45753 100644
--- a/web-react/src/pages/business/house/info/form/patrol/grade.jsx
+++ b/web-react/src/pages/business/house/info/form/patrol/grade.jsx
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
-import { Form, Input, Radio, Spin } from 'antd'
+import { Form, Tooltip, Radio, Spin } from 'antd'
import { AntIcon } from 'components'
import { cloneDeep, first, isEqual, last, sortBy } from 'lodash'
import getDictData from 'util/dic'
@@ -64,6 +64,7 @@ export default class handling extends Component {
*/
async fillData(params) {
this.record = cloneDeep(params.record)
+
const _state = { loading: false }
//#region 从后端转换成前段所需格式
if (this.record) {
@@ -76,7 +77,7 @@ export default class handling extends Component {
'dic_house_grade'
)
//#endregion
- this.form.current.setFieldsValue(this.record)
+ this.form.current && this.form.current.setFieldsValue(this.record)
this.setState(_state)
this.call()
@@ -101,18 +102,22 @@ export default class handling extends Component {
}
}
- getInitGrade(year) {
- if (year > 1999) {
- return 1
- }
- if (year > 1994 && year < 2000) {
- return 2
- }
- if (year > 1979 && year < 1995) {
- return 3
- }
- if (year < 1980) {
- return 4
+ getInitGrade(completedDate) {
+ const date = completedDate.find(p => p.id === this.props.id)
+ if (date) {
+ const { value: year } = date
+ if (year > 1999) {
+ return 1
+ }
+ if (year > 1994 && year < 2000) {
+ return 2
+ }
+ if (year > 1979 && year < 1995) {
+ return 3
+ }
+ if (year < 1980) {
+ return 4
+ }
}
}
@@ -127,15 +132,17 @@ export default class handling extends Component {
name={['patrolInfo', 'initGrade']}
rules={[{ required: true, message: '请选择初始等级' }]}
>
-