update 细节调整

This commit is contained in:
2021-06-23 11:31:57 +08:00
parent bf18f21a24
commit fb834eaa11
14 changed files with 88 additions and 44 deletions

View File

@@ -145,7 +145,7 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
HouseCodeId = p HouseCodeId = p
}.Insert(); }.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) if (initTask == null)
{ {
new BsHouseTask new BsHouseTask

View File

@@ -98,7 +98,7 @@ export default class aspect extends Component {
houseInfo.facadePhoto = fileValue houseInfo.facadePhoto = fileValue
} }
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -124,7 +124,7 @@ export default class attachments extends Component {
} }
} }
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -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() { call() {
if (this.props.onRef) { if (this.props.onRef) {
this.props.onRef(this) this.props.onRef(this)
@@ -79,10 +86,12 @@ export default class building extends Component {
const { houseInfo } = this.record const { houseInfo } = this.record
if (houseInfo.completedDate) { if (houseInfo.completedDate) {
houseInfo.completedDate = moment(houseInfo.completedDate) houseInfo.completedDate = moment(houseInfo.completedDate)
debugger
dispatch({ dispatch({
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE', type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
date: {
id: this.props.id,
value: +houseInfo.completedDate.format('YYYY'), value: +houseInfo.completedDate.format('YYYY'),
},
}) })
} }
@@ -110,7 +119,7 @@ export default class building extends Component {
) )
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState(_state) this.setState(_state)
this.call() this.call()
@@ -172,7 +181,10 @@ export default class building extends Component {
if (houseInfo.hasOwnProperty('completedDate')) { if (houseInfo.hasOwnProperty('completedDate')) {
dispatch({ dispatch({
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE', type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
date: {
id: this.props.id,
value: +houseInfo.completedDate.format('YYYY'), value: +houseInfo.completedDate.format('YYYY'),
},
}) })
} }
} }

View File

@@ -72,13 +72,16 @@ export default class drawing extends Component {
if (houseInfo.drawingMaterial) { if (houseInfo.drawingMaterial) {
houseInfo.drawingMaterial = houseInfo.drawingMaterial.split(',') 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') const codes = await getDictData('dic_house_storage_of_drawings')
console.log(codes) console.log(codes)
this.setState({ codes }) this.setState({ codes })
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -75,7 +75,7 @@ export default class identification extends Component {
) )
this.setState({ codes }) this.setState({ codes })
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -67,7 +67,7 @@ export default class ownership extends Component {
const codes = await getDictData('dic_house_property_rights') const codes = await getDictData('dic_house_property_rights')
this.setState({ codes }) this.setState({ codes })
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -62,7 +62,7 @@ export default class unit extends Component {
this.record = cloneDeep(params.record) this.record = cloneDeep(params.record)
//#region 从后端转换成前段所需格式 //#region 从后端转换成前段所需格式
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -47,7 +47,7 @@ export default class base extends Component {
this.record.patrolInfo.patrolDate = patrolDate ? moment(patrolDate) : patrolDate this.record.patrolInfo.patrolDate = patrolDate ? moment(patrolDate) : patrolDate
} }
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -1,5 +1,5 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { Form, Input, Radio, Spin } from 'antd' import { Form, Tooltip, Radio, Spin } from 'antd'
import { AntIcon } from 'components' import { AntIcon } from 'components'
import { cloneDeep, first, isEqual, last, sortBy } from 'lodash' import { cloneDeep, first, isEqual, last, sortBy } from 'lodash'
import getDictData from 'util/dic' import getDictData from 'util/dic'
@@ -64,6 +64,7 @@ export default class handling extends Component {
*/ */
async fillData(params) { async fillData(params) {
this.record = cloneDeep(params.record) this.record = cloneDeep(params.record)
const _state = { loading: false } const _state = { loading: false }
//#region 从后端转换成前段所需格式 //#region 从后端转换成前段所需格式
if (this.record) { if (this.record) {
@@ -76,7 +77,7 @@ export default class handling extends Component {
'dic_house_grade' 'dic_house_grade'
) )
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState(_state) this.setState(_state)
this.call() this.call()
@@ -101,7 +102,10 @@ export default class handling extends Component {
} }
} }
getInitGrade(year) { getInitGrade(completedDate) {
const date = completedDate.find(p => p.id === this.props.id)
if (date) {
const { value: year } = date
if (year > 1999) { if (year > 1999) {
return 1 return 1
} }
@@ -115,6 +119,7 @@ export default class handling extends Component {
return 4 return 4
} }
} }
}
render() { render() {
const { loading, codes, initGradeValue } = this.state const { loading, codes, initGradeValue } = this.state
@@ -127,6 +132,7 @@ export default class handling extends Component {
name={['patrolInfo', 'initGrade']} name={['patrolInfo', 'initGrade']}
rules={[{ required: true, message: '请选择初始等级' }]} rules={[{ required: true, message: '请选择初始等级' }]}
> >
<Tooltip title="初始等级无法手动更改由房屋详情的竣工日期决定2000年之后竣工的为一级1995年~1999年竣工的为二级1980年~1994年竣工的为三级早于1980年竣工的为四级。选择房屋竣工日期后初始等级会自动填充。">
<Radio.Group disabled buttonStyle="solid"> <Radio.Group disabled buttonStyle="solid">
{codes.dicHousePatrolInitGrade.map(item => { {codes.dicHousePatrolInitGrade.map(item => {
return ( return (
@@ -136,6 +142,7 @@ export default class handling extends Component {
) )
})} })}
</Radio.Group> </Radio.Group>
</Tooltip>
</Form.Item> </Form.Item>
<Form.Item <Form.Item

View File

@@ -50,7 +50,7 @@ export default class handling extends Component {
'dic_house_patrol_rectify_Reform' 'dic_house_patrol_rectify_Reform'
) )
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState(_state) this.setState(_state)
this.call() this.call()

View File

@@ -100,7 +100,7 @@ export default class inspection extends Component {
} }
} }
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()
@@ -204,7 +204,7 @@ export default class inspection extends Component {
<Col span={12}> <Col span={12}>
<Form.Item label="沉降倾斜情况" name={['patrolInfo', 'settlementTilt']}> <Form.Item label="沉降倾斜情况" name={['patrolInfo', 'settlementTilt']}>
<Input.TextArea <Input.TextArea
autoSize={{ minRows: 4 }} autoSize={{ minRows: 4.6 }}
placeholder="请输入沉降倾斜情况" placeholder="请输入沉降倾斜情况"
/> />
</Form.Item> </Form.Item>
@@ -242,7 +242,7 @@ export default class inspection extends Component {
<Col span={12}> <Col span={12}>
<Form.Item label="其他情况" name={['patrolInfo', 'otherInfo']}> <Form.Item label="其他情况" name={['patrolInfo', 'otherInfo']}>
<Input.TextArea <Input.TextArea
autoSize={{ minRows: 4 }} autoSize={{ minRows: 4.6 }}
placeholder="请输入其他情况" placeholder="请输入其他情况"
/> />
</Form.Item> </Form.Item>
@@ -278,7 +278,7 @@ export default class inspection extends Component {
</Row> </Row>
<Form.Item label="主要安全隐患综述" name={['patrolInfo', 'mainSafety']}> <Form.Item label="主要安全隐患综述" name={['patrolInfo', 'mainSafety']}>
<Input.TextArea <Input.TextArea
autoSize={{ minRows: 4 }} autoSize={{ minRows: 4.6 }}
placeholder="请输入主要安全隐患综述" placeholder="请输入主要安全隐患综述"
/> />
</Form.Item> </Form.Item>

View File

@@ -47,7 +47,7 @@ export default class result extends Component {
//#region 从后端转换成前段所需格式 //#region 从后端转换成前段所需格式
//#endregion //#endregion
this.form.current.setFieldsValue(this.record) this.form.current && this.form.current.setFieldsValue(this.record)
this.setState({ loading: false }) this.setState({ loading: false })
this.call() this.call()

View File

@@ -1,8 +1,30 @@
const business = (state = {}, action) => { const business = (state = {}, action) => {
switch (action.type) { switch (action.type) {
case 'PATROL_INIT_GRADE_BY_COMPLETED_DATE': case 'PATROL_INIT_GRADE_BY_COMPLETED_DATE':
const _state = { ...state, completedDate: action.value } {
const completedDate = state.completedDate || []
const { date } = action
const record = completedDate.find(p => p.id === date.id)
if (record) {
record.value = date.value
} else {
completedDate.push(date)
}
const _state = { ...state, completedDate }
return _state return _state
}
case 'PATROL_REMOVE_INIT_GRADE_BY_COMPLETED_DATE':
{
const completedDate = state.completedDate || []
const record = completedDate.find(p => p.id === action.id)
if (!record) {
return state
} else {
completedDate.splice(completedDate.indexOf(record), 1)
const _state = { ...state, completedDate }
return _state
}
}
default: default:
return state return state
} }