Merge branch 'master' of http://118.178.224.202:3000/ewide/ewide_core
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Ewide.Application.Service
|
|||||||
[HttpPost("/houseTask/page")]
|
[HttpPost("/houseTask/page")]
|
||||||
public async Task<dynamic> QueryPage([FromBody] QueryHouseTaskInput input)
|
public async Task<dynamic> QueryPage([FromBody] QueryHouseTaskInput input)
|
||||||
{
|
{
|
||||||
var sql = @"SELECT T.Id,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,Proj.Name,CONCAT(Proj.Name,'(',Proj.Note,')') FullProjName,HC.HouseCode,HC.Address,T.EndTime,HC.Type,HC.Industry,HC.No,T.Status,HI.State FROM `bs_house_task` T
|
var sql = @"SELECT T.Id,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,Proj.Name,CONCAT(Proj.Name,'(',Proj.Note,')') FullProjName,HC.HouseCode,HC.Address,T.EndTime,HC.Type,HC.Industry,HC.No,T.Status,IFNULL(HI.State,0) State FROM `bs_house_task` T
|
||||||
LEFT JOIN bs_house_code HC ON T.HouseCodeId = HC.Id
|
LEFT JOIN bs_house_code HC ON T.HouseCodeId = HC.Id
|
||||||
LEFT JOIN bs_house_info HI ON HI.HouseCodeId = T.HouseCodeId
|
LEFT JOIN bs_house_info HI ON HI.HouseCodeId = T.HouseCodeId
|
||||||
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
|
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
|
||||||
@@ -56,7 +56,7 @@ WHERE {0}";
|
|||||||
var param = new DynamicParameters();
|
var param = new DynamicParameters();
|
||||||
if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.HouseSecurityManager).ToUnderScoreCase()).Count() > 0)
|
if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.HouseSecurityManager).ToUnderScoreCase()).Count() > 0)
|
||||||
{
|
{
|
||||||
sql = String.Format(sql, " (T.Status !=3) AND T.UserID=@UserID ");
|
sql = String.Format(sql, " T.UserID=@UserID ");
|
||||||
param.Add("UserID", user.Id);
|
param.Add("UserID", user.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ WHERE {0}";
|
|||||||
param.Add("ZoneId", userOrg.Id);
|
param.Add("ZoneId", userOrg.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await _dapperRepository.QueryPageDataDynamic(sql, input, param, filterFields: new string[] { "Type", "Address", "HouseCode" });
|
return await _dapperRepository.QueryPageDataDynamic(sql, input, param, filterFields: new string[] { "Type", "Address", "HouseCode", "Status","State" });
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("/houseTask/submit")]
|
[HttpPost("/houseTask/submit")]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { Form, Button, Input, Descriptions, message as Message, Spin, Tabs } from 'antd'
|
import { Form, Button, Input, Descriptions, message as Message, Modal, Spin, Tabs } from 'antd'
|
||||||
import { merge, isEqual } from 'lodash'
|
import { merge, isEqual } from 'lodash'
|
||||||
import { AntIcon, ComponentDynamic, Container } from 'components'
|
import { AntIcon, ComponentDynamic, Container } from 'components'
|
||||||
import { api } from 'common/api'
|
import { api } from 'common/api'
|
||||||
@@ -46,6 +46,23 @@ const tabs = [
|
|||||||
show: true,
|
show: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
const actions = {
|
||||||
|
save: {
|
||||||
|
action: 'houseInfoSave',
|
||||||
|
remark: '保存',
|
||||||
|
after: 'reload',
|
||||||
|
},
|
||||||
|
submit: {
|
||||||
|
action: 'houseInfoSubmitToCheck',
|
||||||
|
remark: '提交',
|
||||||
|
after: 'close',
|
||||||
|
},
|
||||||
|
check: {
|
||||||
|
action: 'houseInfoSave',
|
||||||
|
remark: '审核',
|
||||||
|
after: 'close',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
export default class index extends Component {
|
export default class index extends Component {
|
||||||
state = {
|
state = {
|
||||||
@@ -89,22 +106,43 @@ export default class index extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async onSave() {
|
||||||
|
await this.onPostData(actions.save)
|
||||||
|
}
|
||||||
|
|
||||||
|
async onSubmit() {
|
||||||
|
Modal.confirm({
|
||||||
|
content: '确认提交审核吗?',
|
||||||
|
onOk: () => {
|
||||||
|
this.onPostData(actions.submit)
|
||||||
|
},
|
||||||
|
onCancel: () => {},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async onCheck(pass_or_back) {
|
async onCheck(pass_or_back) {
|
||||||
const form = this.checkForm.current
|
const form = this.checkForm.current
|
||||||
const valid = await form.validateFields()
|
const valid = await form.validateFields()
|
||||||
if (valid) {
|
|
||||||
var checkRecord = {
|
Modal.confirm({
|
||||||
taskCheckRecord: {
|
content: '审核结果即将提交,请确认',
|
||||||
taskId: this.props.param.taskId,
|
onOk: () => {
|
||||||
passOrBack: +pass_or_back,
|
if (valid) {
|
||||||
content: form.getFieldValue(['taskCheckRecord', 'content']),
|
var checkRecord = {
|
||||||
},
|
taskCheckRecord: {
|
||||||
}
|
taskId: this.props.param.taskId,
|
||||||
await this.onSubmit('houseInfoSave', checkRecord)
|
passOrBack: +pass_or_back,
|
||||||
}
|
content: form.getFieldValue(['taskCheckRecord', 'content']),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
this.onPostData(actions.check, checkRecord)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel: () => {},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async onSubmit(action, append) {
|
async onPostData(action, append) {
|
||||||
for (const child of this.children) {
|
for (const child of this.children) {
|
||||||
try {
|
try {
|
||||||
const data = await child.getData()
|
const data = await child.getData()
|
||||||
@@ -133,12 +171,28 @@ export default class index extends Component {
|
|||||||
console.log(this.formData)
|
console.log(this.formData)
|
||||||
this.setState({ saving: true })
|
this.setState({ saving: true })
|
||||||
|
|
||||||
api[action](this.formData)
|
if (action) {
|
||||||
.then(({ data }) => {})
|
try {
|
||||||
.catch(() => {})
|
const { success } = await api[action.action](this.formData)
|
||||||
.finally(() => {
|
if (success) {
|
||||||
|
Message.success(action.remark + '成功')
|
||||||
|
this.setState({ saving: false })
|
||||||
|
if (this.props.param.table) {
|
||||||
|
this.props.param.table.current.onReloadData()
|
||||||
|
}
|
||||||
|
switch (action.after) {
|
||||||
|
case 'close':
|
||||||
|
window.closeContentWindow()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
this.componentDidMount()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
this.setState({ saving: false })
|
this.setState({ saving: false })
|
||||||
})
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// Message.success('提交成功')
|
// Message.success('提交成功')
|
||||||
@@ -200,16 +254,13 @@ export default class index extends Component {
|
|||||||
disabled={saveDisabled}
|
disabled={saveDisabled}
|
||||||
loading={saving}
|
loading={saving}
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={() => this.onSubmit('houseInfoSave')}
|
onClick={() => this.onSave()}
|
||||||
>
|
>
|
||||||
保存
|
保存
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{this.state.taskStatus == 2 && (
|
{this.state.taskStatus == 2 && (
|
||||||
<Button
|
<Button type="primary" onClick={() => this.onSubmit()}>
|
||||||
type="primary"
|
|
||||||
onClick={() => this.onSubmit('houseInfoSubmitToCheck')}
|
|
||||||
>
|
|
||||||
提交审核
|
提交审核
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import auth from 'components/authorized/handler'
|
|||||||
import { isEqual } from 'lodash'
|
import { isEqual } from 'lodash'
|
||||||
import getDictData from 'util/dic'
|
import getDictData from 'util/dic'
|
||||||
import { toCamelCase } from 'util/format'
|
import { toCamelCase } from 'util/format'
|
||||||
|
import { getSearchInfo } from 'util/query'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注释段[\/**\/]为必须要改
|
* 注释段[\/**\/]为必须要改
|
||||||
@@ -27,6 +28,10 @@ const authName = 'houseTask'
|
|||||||
export default class index extends Component {
|
export default class index extends Component {
|
||||||
state = {
|
state = {
|
||||||
codes: {
|
codes: {
|
||||||
|
status: [
|
||||||
|
{ code: 3, value: '审核中' },
|
||||||
|
{ code: 6, value: '审核通过' },
|
||||||
|
],
|
||||||
houseType: [],
|
houseType: [],
|
||||||
houseIndustry: [],
|
houseIndustry: [],
|
||||||
},
|
},
|
||||||
@@ -78,6 +83,13 @@ export default class index extends Component {
|
|||||||
sorter: true,
|
sorter: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '审核状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
sorter: true,
|
||||||
|
width: 100,
|
||||||
|
render: text => this.bindCodeValue(text, 'status'),
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,7 +109,9 @@ export default class index extends Component {
|
|||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<QueryTableActions>
|
<QueryTableActions>
|
||||||
<Auth auth={{ houseInfo: 'getByTaskId' }}>
|
<Auth auth={{ houseInfo: 'getByTaskId' }}>
|
||||||
<a onClick={() => this.onOpen(record.id)}>审核</a>
|
<a onClick={() => this.onOpen(record.id)}>
|
||||||
|
{record.state === 3 ? `审核` : `查看`}
|
||||||
|
</a>
|
||||||
</Auth>
|
</Auth>
|
||||||
</QueryTableActions>
|
</QueryTableActions>
|
||||||
),
|
),
|
||||||
@@ -125,7 +139,7 @@ export default class index extends Component {
|
|||||||
const { onLoading, onLoadData } = this.table.current
|
const { onLoading, onLoadData } = this.table.current
|
||||||
onLoading()
|
onLoading()
|
||||||
getDictData('house_type', 'house_industry').then(codes => {
|
getDictData('house_type', 'house_industry').then(codes => {
|
||||||
this.setState({ codes }, () => {
|
this.setState({ codes: { ...this.state.codes, ...codes } }, () => {
|
||||||
onLoadData()
|
onLoadData()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -139,9 +153,20 @@ export default class index extends Component {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
loadData = async (params, query) => {
|
loadData = async (params, query) => {
|
||||||
|
const searchInfo = getSearchInfo({
|
||||||
|
query,
|
||||||
|
queryType: {
|
||||||
|
type: '=',
|
||||||
|
industry: '=',
|
||||||
|
address: 'like',
|
||||||
|
houseCode: 'like',
|
||||||
|
status: '=',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const { data } = await apiAction.page({
|
const { data } = await apiAction.page({
|
||||||
...params,
|
...params,
|
||||||
...query,
|
searchInfo,
|
||||||
})
|
})
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
@@ -175,6 +200,7 @@ export default class index extends Component {
|
|||||||
path: 'business/house/info/form',
|
path: 'business/house/info/form',
|
||||||
param: {
|
param: {
|
||||||
taskId,
|
taskId,
|
||||||
|
table: this.table,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -218,6 +244,7 @@ export default class index extends Component {
|
|||||||
columns={this.columns}
|
columns={this.columns}
|
||||||
queryInitialValues={{
|
queryInitialValues={{
|
||||||
type: '',
|
type: '',
|
||||||
|
status: '',
|
||||||
}}
|
}}
|
||||||
onQueryChange={values => {
|
onQueryChange={values => {
|
||||||
if (values.hasOwnProperty('type')) {
|
if (values.hasOwnProperty('type')) {
|
||||||
@@ -257,6 +284,16 @@ export default class index extends Component {
|
|||||||
<Form.Item label="房屋唯一编码" name="houseCode">
|
<Form.Item label="房屋唯一编码" name="houseCode">
|
||||||
<Input autoComplete="off" placeholder="请输入房屋唯一编码" />
|
<Input autoComplete="off" placeholder="请输入房屋唯一编码" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label="审核状态" name="status">
|
||||||
|
<Radio.Group buttonStyle="solid">
|
||||||
|
<Radio.Button value="">全部</Radio.Button>
|
||||||
|
{codes.status.map(item => (
|
||||||
|
<Radio.Button key={item.code} value={item.code}>
|
||||||
|
{item.value}
|
||||||
|
</Radio.Button>
|
||||||
|
))}
|
||||||
|
</Radio.Group>
|
||||||
|
</Form.Item>
|
||||||
</Auth>
|
</Auth>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ export default class index extends Component {
|
|||||||
status: [
|
status: [
|
||||||
{ code: -1, value: '审核退回' },
|
{ code: -1, value: '审核退回' },
|
||||||
{ code: 0, value: '待处理' },
|
{ code: 0, value: '待处理' },
|
||||||
{ code: null, value: '待处理' },
|
|
||||||
{ code: 1, value: '暂存' },
|
{ code: 1, value: '暂存' },
|
||||||
{ code: 2, value: '待提交' },
|
{ code: 2, value: '待提交' },
|
||||||
{ code: 3, value: '审核中' },
|
{ code: 3, value: '审核中' },
|
||||||
@@ -169,6 +168,7 @@ export default class index extends Component {
|
|||||||
industry: '=',
|
industry: '=',
|
||||||
address: 'like',
|
address: 'like',
|
||||||
houseCode: 'like',
|
houseCode: 'like',
|
||||||
|
state: '=',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -208,6 +208,7 @@ export default class index extends Component {
|
|||||||
path: 'business/house/info/form',
|
path: 'business/house/info/form',
|
||||||
param: {
|
param: {
|
||||||
taskId,
|
taskId,
|
||||||
|
table: this.table,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -251,6 +252,7 @@ export default class index extends Component {
|
|||||||
columns={this.columns}
|
columns={this.columns}
|
||||||
queryInitialValues={{
|
queryInitialValues={{
|
||||||
type: '',
|
type: '',
|
||||||
|
state: 0,
|
||||||
}}
|
}}
|
||||||
onQueryChange={values => {
|
onQueryChange={values => {
|
||||||
if (values.hasOwnProperty('type')) {
|
if (values.hasOwnProperty('type')) {
|
||||||
@@ -290,6 +292,16 @@ export default class index extends Component {
|
|||||||
<Form.Item label="房屋唯一编码" name="houseCode">
|
<Form.Item label="房屋唯一编码" name="houseCode">
|
||||||
<Input autoComplete="off" placeholder="请输入房屋唯一编码" />
|
<Input autoComplete="off" placeholder="请输入房屋唯一编码" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label="建档状态" name="state">
|
||||||
|
<Select allowClear className="w-150" placeholder="建档状态">
|
||||||
|
<Select.Option value="">全部</Select.Option>
|
||||||
|
{codes.status.map(item => (
|
||||||
|
<Select.Option key={item.code} value={item.code}>
|
||||||
|
{item.value}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
</Auth>
|
</Auth>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user