Merge branch 'master' of http://118.178.224.202:3000/ewide/ewide_core
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -81,7 +88,10 @@ export default class building extends Component {
|
|||||||
houseInfo.completedDate = moment(houseInfo.completedDate)
|
houseInfo.completedDate = moment(houseInfo.completedDate)
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
|
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
|
||||||
value: +houseInfo.completedDate.format('YYYY'),
|
date: {
|
||||||
|
id: this.props.id,
|
||||||
|
value: +houseInfo.completedDate.format('YYYY'),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,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()
|
||||||
@@ -171,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',
|
||||||
value: +houseInfo.completedDate.format('YYYY'),
|
date: {
|
||||||
|
id: this.props.id,
|
||||||
|
value: +houseInfo.completedDate.format('YYYY'),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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,18 +102,22 @@ export default class handling extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getInitGrade(year) {
|
getInitGrade(completedDate) {
|
||||||
if (year > 1999) {
|
const date = completedDate.find(p => p.id === this.props.id)
|
||||||
return 1
|
if (date) {
|
||||||
}
|
const { value: year } = date
|
||||||
if (year > 1994 && year < 2000) {
|
if (year > 1999) {
|
||||||
return 2
|
return 1
|
||||||
}
|
}
|
||||||
if (year > 1979 && year < 1995) {
|
if (year > 1994 && year < 2000) {
|
||||||
return 3
|
return 2
|
||||||
}
|
}
|
||||||
if (year < 1980) {
|
if (year > 1979 && year < 1995) {
|
||||||
return 4
|
return 3
|
||||||
|
}
|
||||||
|
if (year < 1980) {
|
||||||
|
return 4
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,15 +132,17 @@ export default class handling extends Component {
|
|||||||
name={['patrolInfo', 'initGrade']}
|
name={['patrolInfo', 'initGrade']}
|
||||||
rules={[{ required: true, message: '请选择初始等级' }]}
|
rules={[{ required: true, message: '请选择初始等级' }]}
|
||||||
>
|
>
|
||||||
<Radio.Group disabled buttonStyle="solid">
|
<Tooltip title="初始等级无法手动更改,由房屋详情的竣工日期决定:2000年之后竣工的为一级,1995年~1999年竣工的为二级,1980年~1994年竣工的为三级,早于1980年竣工的为四级。选择房屋竣工日期后,初始等级会自动填充。">
|
||||||
{codes.dicHousePatrolInitGrade.map(item => {
|
<Radio.Group disabled buttonStyle="solid">
|
||||||
return (
|
{codes.dicHousePatrolInitGrade.map(item => {
|
||||||
<Radio.Button key={item.code} value={+item.code}>
|
return (
|
||||||
{item.value}
|
<Radio.Button key={item.code} value={+item.code}>
|
||||||
</Radio.Button>
|
{item.value}
|
||||||
)
|
</Radio.Button>
|
||||||
})}
|
)
|
||||||
</Radio.Group>
|
})}
|
||||||
|
</Radio.Group>
|
||||||
|
</Tooltip>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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 }
|
{
|
||||||
return _state
|
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
|
||||||
|
}
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user