update
housequery 建档审核功能
This commit is contained in:
@@ -157,35 +157,37 @@ export default class building extends Component {
|
||||
onValuesChange(changedValues, allValues) {
|
||||
const form = this.form.current
|
||||
const { houseInfo } = changedValues
|
||||
if (
|
||||
houseInfo.hasOwnProperty('landFloorCount') ||
|
||||
houseInfo.hasOwnProperty('underFloorCount')
|
||||
) {
|
||||
const {
|
||||
houseInfo: { landFloorCount, underFloorCount },
|
||||
} = allValues
|
||||
form.setFieldsValue({
|
||||
houseInfo: {
|
||||
totalFloor: +landFloorCount + +underFloorCount,
|
||||
},
|
||||
})
|
||||
}
|
||||
if (houseInfo) {
|
||||
if (
|
||||
houseInfo.hasOwnProperty('landFloorCount') ||
|
||||
houseInfo.hasOwnProperty('underFloorCount')
|
||||
) {
|
||||
const {
|
||||
houseInfo: { landFloorCount, underFloorCount },
|
||||
} = allValues
|
||||
form.setFieldsValue({
|
||||
houseInfo: {
|
||||
totalFloor: +landFloorCount + +underFloorCount,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if (houseInfo.hasOwnProperty('insulationMaterial')) {
|
||||
const value = this.checkedNone(houseInfo.insulationMaterial, 'insulationMaterial')
|
||||
this.setState({
|
||||
showKeepWarmMaterialText: value.includes('100'),
|
||||
})
|
||||
}
|
||||
if (houseInfo.hasOwnProperty('insulationMaterial')) {
|
||||
const value = this.checkedNone(houseInfo.insulationMaterial, 'insulationMaterial')
|
||||
this.setState({
|
||||
showKeepWarmMaterialText: value.includes('100'),
|
||||
})
|
||||
}
|
||||
|
||||
if (houseInfo.hasOwnProperty('completedDate')) {
|
||||
dispatch({
|
||||
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
|
||||
date: {
|
||||
id: this.props.id,
|
||||
value: +houseInfo.completedDate.format('YYYY'),
|
||||
},
|
||||
})
|
||||
if (houseInfo.hasOwnProperty('completedDate')) {
|
||||
dispatch({
|
||||
type: 'PATROL_INIT_GRADE_BY_COMPLETED_DATE',
|
||||
date: {
|
||||
id: this.props.id,
|
||||
value: +houseInfo.completedDate.format('YYYY'),
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ export default class index extends Component {
|
||||
children = []
|
||||
|
||||
formData = {}
|
||||
checkform = React.createRef()
|
||||
checkForm = React.createRef()
|
||||
|
||||
shouldComponentUpdate(props, state) {
|
||||
return !isEqual(this.state, state)
|
||||
@@ -89,6 +89,21 @@ export default class index extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
async onCheck(pass_or_back) {
|
||||
const form = this.checkForm.current
|
||||
const valid = await form.validateFields()
|
||||
if (valid) {
|
||||
var checkRecord = {
|
||||
taskCheckRecord: {
|
||||
taskId: this.props.param.taskId,
|
||||
passOrBack: +pass_or_back,
|
||||
content: form.getFieldValue(['taskCheckRecord', 'content']),
|
||||
},
|
||||
}
|
||||
await this.onSubmit('houseInfoSave', checkRecord)
|
||||
}
|
||||
}
|
||||
|
||||
async onSubmit(action, append) {
|
||||
for (const child of this.children) {
|
||||
try {
|
||||
@@ -163,8 +178,18 @@ export default class index extends Component {
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary">通过</Button>
|
||||
<Button type="primary">退回</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.onCheck(6)}
|
||||
>
|
||||
通过
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.onCheck(-1)}
|
||||
>
|
||||
退回
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
)}
|
||||
|
||||
@@ -124,7 +124,6 @@ export default class handling extends Component {
|
||||
|
||||
render() {
|
||||
const { loading, codes, initGradeValue } = this.state
|
||||
console.log(initGradeValue)
|
||||
return (
|
||||
<Spin spinning={loading} indicator={<AntIcon type="loading" />}>
|
||||
<Form {...layout} ref={this.form}>
|
||||
|
||||
@@ -249,7 +249,7 @@ export default class index extends Component {
|
||||
size="small"
|
||||
type="primary"
|
||||
className="block w-100-p mt-xxs"
|
||||
onClick={() => this.onOpen(this.selectorModal, record)}
|
||||
onClick={() => this.onOpen(this.selectorModal, id)}
|
||||
>
|
||||
选房
|
||||
</Button>
|
||||
|
||||
@@ -63,7 +63,9 @@ export default class index extends Component {
|
||||
dataIndex: 'type',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
render: text => this.bindCodeValue(text, 'house_type'),
|
||||
render: (text, record) =>
|
||||
this.bindCodeValue(text, 'house_type') +
|
||||
(text === 2 ? `(${this.bindCodeValue(record.industry, 'house_industry')})` : ''),
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
|
||||
@@ -6,6 +6,7 @@ import auth from 'components/authorized/handler'
|
||||
import { isEqual } from 'lodash'
|
||||
import getDictData from 'util/dic'
|
||||
import { toCamelCase } from 'util/format'
|
||||
import { getSearchInfo } from 'util/query'
|
||||
|
||||
/**
|
||||
* 注释段[\/**\/]为必须要改
|
||||
@@ -27,6 +28,15 @@ const authName = 'houseTask'
|
||||
export default class index extends Component {
|
||||
state = {
|
||||
codes: {
|
||||
status: [
|
||||
{ code: -1, value: '审核退回' },
|
||||
{ code: 0, value: '待处理' },
|
||||
{ code: null, value: '待处理' },
|
||||
{ code: 1, value: '暂存' },
|
||||
{ code: 2, value: '待提交' },
|
||||
{ code: 3, value: '审核中' },
|
||||
{ code: 6, value: '审核通过' },
|
||||
],
|
||||
houseType: [],
|
||||
houseIndustry: [],
|
||||
},
|
||||
@@ -63,7 +73,9 @@ export default class index extends Component {
|
||||
dataIndex: 'type',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
render: text => this.bindCodeValue(text, 'house_type'),
|
||||
render: (text, record) =>
|
||||
this.bindCodeValue(text, 'house_type') +
|
||||
(text === 2 ? `(${this.bindCodeValue(record.industry, 'house_industry')})` : ''),
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
@@ -76,6 +88,13 @@ export default class index extends Component {
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '建档状态',
|
||||
dataIndex: 'state',
|
||||
sorter: true,
|
||||
width: 100,
|
||||
render: text => this.bindCodeValue(text, 'status'),
|
||||
},
|
||||
]
|
||||
|
||||
/**
|
||||
@@ -95,7 +114,13 @@ export default class index extends Component {
|
||||
render: (text, record) => (
|
||||
<QueryTableActions>
|
||||
<Auth auth={{ houseInfo: 'getByTaskId' }}>
|
||||
<a onClick={() => this.onOpen(record.id)}>登记</a>
|
||||
<a onClick={() => this.onOpen(record.id)}>
|
||||
{record.state === -1 || record.state === 1 || record.state === 2
|
||||
? `修改`
|
||||
: record.state === 3 || record.state === 6
|
||||
? `查看`
|
||||
: `登记`}
|
||||
</a>
|
||||
</Auth>
|
||||
</QueryTableActions>
|
||||
),
|
||||
@@ -123,7 +148,7 @@ export default class index extends Component {
|
||||
const { onLoading, onLoadData } = this.table.current
|
||||
onLoading()
|
||||
getDictData('house_type', 'house_industry').then(codes => {
|
||||
this.setState({ codes }, () => {
|
||||
this.setState({ codes: { ...this.state.codes, ...codes } }, () => {
|
||||
onLoadData()
|
||||
})
|
||||
})
|
||||
@@ -137,9 +162,19 @@ export default class index extends Component {
|
||||
* @returns
|
||||
*/
|
||||
loadData = async (params, query) => {
|
||||
const searchInfo = getSearchInfo({
|
||||
query,
|
||||
queryType: {
|
||||
type: '=',
|
||||
industry: '=',
|
||||
address: 'like',
|
||||
houseCode: 'like',
|
||||
},
|
||||
})
|
||||
|
||||
const { data } = await apiAction.page({
|
||||
...params,
|
||||
...query,
|
||||
searchInfo,
|
||||
})
|
||||
return data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user