update 项目管理、片区管理编辑读数据方式更改
This commit is contained in:
@@ -730,7 +730,7 @@
|
|||||||
<summary>
|
<summary>
|
||||||
通过ID获取项目
|
通过ID获取项目
|
||||||
</summary>
|
</summary>
|
||||||
<param name="id"></param>
|
<param name="projectId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Ewide.Application.Service.HouseProjectInfo.HouseProjectInfoService.QueryProjectPageList(Ewide.Application.Service.HouseProjectInfo.Dto.PageProjectInput)">
|
<member name="M:Ewide.Application.Service.HouseProjectInfo.HouseProjectInfoService.QueryProjectPageList(Ewide.Application.Service.HouseProjectInfo.Dto.PageProjectInput)">
|
||||||
|
|||||||
@@ -69,12 +69,12 @@ namespace Ewide.Application.Service.HouseProjectInfo
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通过ID获取项目
|
/// 通过ID获取项目
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="projectId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("/houseProjectInfo/detailById")]
|
[HttpGet("/houseProjectInfo/getById")]
|
||||||
public async Task<BsHouseProjectInfo> GetProjectById([Required] string id)
|
public async Task<BsHouseProjectInfo> GetById([Required] string projectId)
|
||||||
{
|
{
|
||||||
return await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == id);
|
return await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == projectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ namespace Ewide.Application.Service
|
|||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("/houseZone/getById")]
|
||||||
|
public async Task<dynamic> GetById([Required] string zoneId)
|
||||||
|
{
|
||||||
|
return await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == zoneId);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分页查询片区
|
/// 分页查询片区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ const urls = {
|
|||||||
houseProejctDelete: ['/houseProjectInfo/delete', 'post'],
|
houseProejctDelete: ['/houseProjectInfo/delete', 'post'],
|
||||||
houseProejctDetail: ['/houseProjectInfo/detail', 'get'],
|
houseProejctDetail: ['/houseProjectInfo/detail', 'get'],
|
||||||
houseProjectNextSort: ['/houseProjectInfo/nextSort', 'get'],
|
houseProjectNextSort: ['/houseProjectInfo/nextSort', 'get'],
|
||||||
houseProjectList: ['houseProjectInfo/list', 'get']
|
houseProjectList: ['houseProjectInfo/list', 'get'],
|
||||||
|
houseProjectGetById: ['houseProjectInfo/getById', 'get']
|
||||||
}
|
}
|
||||||
|
|
||||||
export default urls
|
export default urls
|
||||||
@@ -8,7 +8,8 @@ const urls = {
|
|||||||
houseZoneList: '/houseZone/list',
|
houseZoneList: '/houseZone/list',
|
||||||
houseZoneAutoIncrement: '/houseZone/autoIncrement',
|
houseZoneAutoIncrement: '/houseZone/autoIncrement',
|
||||||
houseZoneAdd: ['/houseZone/add', 'post'],
|
houseZoneAdd: ['/houseZone/add', 'post'],
|
||||||
houseZoneEdit: ['/houseZone/edit', 'post']
|
houseZoneEdit: ['/houseZone/edit', 'post'],
|
||||||
|
houseZoneGetById: ['/houseZone/getById', 'get']
|
||||||
}
|
}
|
||||||
|
|
||||||
export default urls
|
export default urls
|
||||||
@@ -41,19 +41,29 @@ export default class form extends Component {
|
|||||||
* @param {*} params
|
* @param {*} params
|
||||||
*/
|
*/
|
||||||
async fillData(params) {
|
async fillData(params) {
|
||||||
const areaCodeDefault = params.record
|
let areaCodeDefault = params.pid ? params.pid : ''
|
||||||
? params.record.areaCode
|
|
||||||
: params.pid
|
|
||||||
? params.pid
|
|
||||||
: ''
|
|
||||||
this.houseType = params.record ? params.record.type : 1
|
this.houseType = params.record ? params.record.type : 1
|
||||||
this.record = cloneDeep(params.record)
|
if (params.id) {
|
||||||
|
this.setState({
|
||||||
|
loading: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
api.houseProjectGetById({ projectId: params.id }).then(({ data }) => {
|
||||||
|
areaCodeDefault = data.areaCode
|
||||||
|
this.record = data
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
loading: false,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// this.record = cloneDeep(params.record)
|
||||||
this.initRecord = cloneDeep(params.record)
|
this.initRecord = cloneDeep(params.record)
|
||||||
//#region 从后端转换成前段所需格式
|
//#region 从后端转换成前段所需格式
|
||||||
const areaData = await this.loadAreaData()
|
const areaData = await this.loadAreaData()
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
exist: !!params.record,
|
exist: !!params.id,
|
||||||
options: { areaData },
|
options: { areaData },
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -81,7 +91,9 @@ export default class form extends Component {
|
|||||||
if (areaCodeDefault) {
|
if (areaCodeDefault) {
|
||||||
findCode(areaData)
|
findCode(areaData)
|
||||||
this.areaCode = areaCodeDefault
|
this.areaCode = areaCodeDefault
|
||||||
this.nextSort(this.areaCode, this.houseType)
|
if (!this.state.exist) {
|
||||||
|
this.nextSort(this.areaCode, this.houseType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.record = {
|
this.record = {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default class index extends Component {
|
|||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<QueryTableActions>
|
<QueryTableActions>
|
||||||
<Auth auth="houseProjectInfo:edit">
|
<Auth auth="houseProjectInfo:edit">
|
||||||
<a onClick={() => this.onOpen(this.editForm, record)}>编辑</a>
|
<a onClick={() => this.onOpen(this.editForm, record.id)}>编辑</a>
|
||||||
</Auth>
|
</Auth>
|
||||||
<Auth auth="houseProjectInfo:delete">
|
<Auth auth="houseProjectInfo:delete">
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
@@ -200,10 +200,11 @@ export default class index extends Component {
|
|||||||
* @param {*} modal
|
* @param {*} modal
|
||||||
* @param {*} record
|
* @param {*} record
|
||||||
*/
|
*/
|
||||||
onOpen(modal, record) {
|
onOpen(modal, id) {
|
||||||
modal.current.open({
|
modal.current.open({
|
||||||
pid: this.selectCode,
|
pid: this.selectCode,
|
||||||
record,
|
// record,
|
||||||
|
id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { Form, Input, InputNumber, Spin, TreeSelect } from 'antd'
|
import { Form, Input, InputNumber, Spin, TreeSelect } from 'antd'
|
||||||
import { AntIcon } from 'components'
|
import { AntIcon } from 'components'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep, pickBy } from 'lodash'
|
||||||
import { api } from 'common/api'
|
import { api } from 'common/api'
|
||||||
import { numberToChinese } from 'util/format'
|
import { numberToChinese } from 'util/format'
|
||||||
import store from 'store'
|
import store from 'store'
|
||||||
@@ -54,12 +54,25 @@ export default class form extends Component {
|
|||||||
*/
|
*/
|
||||||
async fillData(params) {
|
async fillData(params) {
|
||||||
const { user } = this.state
|
const { user } = this.state
|
||||||
this.record = cloneDeep(params.record)
|
if (params.id) {
|
||||||
|
this.setState({
|
||||||
|
loading: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
api.houseZoneGetById({ zoneId: params.id }).then(({ data }) => {
|
||||||
|
this.record = data
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
loading: false,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// this.record = cloneDeep(params.record)
|
||||||
//#region 从后端转换成前段所需格式
|
//#region 从后端转换成前段所需格式
|
||||||
const orgData = await this.loadOrgData()
|
const orgData = await this.loadOrgData()
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
exist: !!params.record,
|
exist: !!params.id,
|
||||||
options: { orgData },
|
options: { orgData },
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -78,7 +91,7 @@ export default class form extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
if (!params.record && !!params.orgId) {
|
if (!params.id && !!params.orgId) {
|
||||||
this.onOrgIdChanged(params.orgId)
|
this.onOrgIdChanged(params.orgId)
|
||||||
}
|
}
|
||||||
this.form.current.setFieldsValue(this.record)
|
this.form.current.setFieldsValue(this.record)
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export default class index extends Component {
|
|||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<QueryTableActions>
|
<QueryTableActions>
|
||||||
<Auth auth="houseZone:edit">
|
<Auth auth="houseZone:edit">
|
||||||
<a onClick={() => this.onOpen(this.editForm, record)}>编辑</a>
|
<a onClick={() => this.onOpen(this.editForm, record.id)}>编辑</a>
|
||||||
</Auth>
|
</Auth>
|
||||||
<Auth auth="houseZone:delete">
|
<Auth auth="houseZone:delete">
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
@@ -180,10 +180,11 @@ export default class index extends Component {
|
|||||||
* @param {*} modal
|
* @param {*} modal
|
||||||
* @param {*} record
|
* @param {*} record
|
||||||
*/
|
*/
|
||||||
onOpen(modal, record) {
|
onOpen(modal, id) {
|
||||||
modal.current.open({
|
modal.current.open({
|
||||||
orgId: this.selectId,
|
orgId: this.selectId,
|
||||||
record,
|
// record,
|
||||||
|
id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user