update 流转日志展示

This commit is contained in:
2021-07-08 16:58:14 +08:00
parent ad50293249
commit a14ccf6399
16 changed files with 230 additions and 64 deletions

View File

@@ -25,5 +25,22 @@ namespace Ewide.Application
[Comment("状态")] [Comment("状态")]
public HouseLogStatus Status { get; set; } public HouseLogStatus Status { get; set; }
[Comment("备注信息")]
public string Remark { get; set; }
[Comment("完成时间")]
public DateTime? FinishedTime { get; set; }
[Comment("完成者Id")]
[MaxLength(36)]
public string FinishedUserId { get; set; }
[Comment("完成者名称")]
[MaxLength(20)]
public string FinishedUserName { get; set; }
[Comment("排序")]
public int Sort { get; set; }
} }
} }

View File

@@ -261,6 +261,6 @@ namespace Ewide.Application
/// 是否有效 /// 是否有效
/// </summary> /// </summary>
[Comment("是否有效")] [Comment("是否有效")]
public bool IsEnabled { get; set; } public bool IsEnabled { get; set; } = true;
} }
} }

View File

@@ -58,8 +58,8 @@ namespace Ewide.Application.Service.HouseCode
await houseCode.InsertAsync(); await houseCode.InsertAsync();
// 添加到流转日志 // 添加到流转日志
await _houseLogService.AddThenDone(id, _userManager.User, HouseLogType.CreateCode); var sort = await _houseLogService.AddThenDone(id, _userManager.User, HouseLogType.CreateCode);
await _houseLogService.Add(id, _userManager.User, HouseLogType.SelectMember); sort = await _houseLogService.Add(id, _userManager.User, HouseLogType.SelectMember, sort: sort);
} }
[HttpPost("/houseCode/edit")] [HttpPost("/houseCode/edit")]

View File

@@ -132,6 +132,7 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
} }
[NonAction] [NonAction]
[UnitOfWork]
public async Task InputDataProcess(HouseInfoInputSave input,DataStatus dataStatus = DataStatus.Init) public async Task InputDataProcess(HouseInfoInputSave input,DataStatus dataStatus = DataStatus.Init)
{ {
//房屋编码地址/坐标单独更新 //房屋编码地址/坐标单独更新
@@ -142,13 +143,14 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
var houseEntity = await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(h => h.HouseCodeId == input.houseCode.Id); var houseEntity = await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(h => h.HouseCodeId == input.houseCode.Id);
//建档审核通过的房屋数据修改时对应的建档任务Task不处理 //建档审核通过的房屋数据修改时对应的建档任务Task不处理
var houseTask = input.PatrolInfo.Adapt<BsHouseTask>(); var houseTask = await _houseTaskRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.PatrolInfo.Id);
if (houseEntity == null || houseEntity.State != 6) if (houseEntity == null || houseEntity.State != 6)
{ {
houseTask.HouseCodeId = input.houseCode.Id; var _houseTask = input.PatrolInfo.Adapt<BsHouseTask>();
_houseTask.HouseCodeId = input.houseCode.Id;
//任务没有暂存状态其他状态与HouseInfo的State一致 //任务没有暂存状态其他状态与HouseInfo的State一致
houseTask.Status = dataStatus == DataStatus.TempSaved ? (int)DataStatus.Saved : (int)dataStatus; _houseTask.Status = dataStatus == DataStatus.TempSaved ? (int)DataStatus.Saved : (int)dataStatus;
await houseTask.UpdateExcludeAsync(new string[] { nameof(BsHouseTask.TaskType) }, ignoreNullValues: true); await _houseTask.UpdateExcludeAsync(new string[] { nameof(BsHouseTask.TaskType) }, ignoreNullValues: true);
} }
//判断房屋建档状态 //判断房屋建档状态
//dataStatus == DataStatus.Saved 若是保存操作 则判断是新增/更新 //dataStatus == DataStatus.Saved 若是保存操作 则判断是新增/更新
@@ -168,7 +170,9 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
await houseInfo.UpdateExcludeAsync(new[] { nameof(BsHouseInfo.HouseGrade) }, true); await houseInfo.UpdateExcludeAsync(new[] { nameof(BsHouseInfo.HouseGrade) }, true);
} }
if(dataStatus == DataStatus.Submited) int? logSort = null;
if (dataStatus == DataStatus.Submited)
{ {
await _houseLogService.Done(input.houseCode.Id); await _houseLogService.Done(input.houseCode.Id);
@@ -184,7 +188,7 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
where e.OrgId == org.Id && r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase() where e.OrgId == org.Id && r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()
select u).ToListAsync(); select u).ToListAsync();
await _houseLogService.Add(input.houseCode.Id, zoneManagerList, HouseLogType.Check); logSort = await _houseLogService.Add(input.houseCode.Id, zoneManagerList, HouseLogType.Check);
} }
//审核操作则新增一条审核记录 //审核操作则新增一条审核记录
if (dataStatus == DataStatus.Back || dataStatus == DataStatus.Passed) if (dataStatus == DataStatus.Back || dataStatus == DataStatus.Passed)
@@ -192,11 +196,11 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
var checkRecord = input.TaskCheckRecord.Adapt<BsHouseTaskCheckRecord>(); var checkRecord = input.TaskCheckRecord.Adapt<BsHouseTaskCheckRecord>();
await checkRecord.InsertAsync(); await checkRecord.InsertAsync();
await _houseLogService.Done(input.houseCode.Id); await _houseLogService.Done(input.houseCode.Id);
await _houseLogService.AddThenDone(input.houseCode.Id, _userManager.User, dataStatus == DataStatus.Passed ? HouseLogType.Agree : HouseLogType.Disagree); logSort = await _houseLogService.AddThenDone(input.houseCode.Id, _userManager.User, dataStatus == DataStatus.Passed ? HouseLogType.Agree : HouseLogType.Disagree, remark: checkRecord.Content, sort: logSort);
if (dataStatus == DataStatus.Back) if (dataStatus == DataStatus.Back)
{ {
var user = await _sysUserRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(houseTask.UserID)); var user = await _sysUserRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(houseTask.UserID));
await _houseLogService.Add(input.houseCode.Id, user, HouseLogType.CreateInfo); logSort = await _houseLogService.Add(input.houseCode.Id, user, HouseLogType.CreateInfo, sort: logSort);
} }
} }
} }

View File

@@ -8,12 +8,13 @@ namespace Ewide.Application
{ {
public class HouseLogOutput public class HouseLogOutput
{ {
public string Id { get; set; }
public string TargetUserNames { get; set; } public string TargetUserNames { get; set; }
public int Type { get; set; } public int Type { get; set; }
public int Status { get; set; } public int Status { get; set; }
public DateTime CreatedTime { get; set; } public string Remark { get; set; }
public DateTime? UpdatedTimeg { get; set; } public DateTime? FinishedTime { get; set; }
public string CreatedUserName { get; set; } public string FinishedUserId { get; set; }
public string UpdatedUserName { get; set; } public string FinishedUserName { get; set; }
} }
} }

View File

@@ -22,33 +22,45 @@ namespace Ewide.Application.Service
{ {
private readonly IDapperRepository _dapperRep; private readonly IDapperRepository _dapperRep;
private readonly IUserManager _userManager;
private readonly IRepository<BsHouseLog> _bsHouseLogRep; private readonly IRepository<BsHouseLog> _bsHouseLogRep;
public HouseLogService(IDapperRepository dapperRep, IRepository<BsHouseLog> bsHouseLogRep) public HouseLogService(IDapperRepository dapperRep, IUserManager userManager, IRepository<BsHouseLog> bsHouseLogRep)
{ {
_dapperRep = dapperRep; _dapperRep = dapperRep;
_userManager = userManager;
_bsHouseLogRep = bsHouseLogRep; _bsHouseLogRep = bsHouseLogRep;
} }
[NonAction] [NonAction]
[UnitOfWork] [UnitOfWork]
public async Task Add(string houseCodeId, SysUser targetUser, HouseLogType type) public async Task<int> Add(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null)
{ {
await Add(houseCodeId, new List<SysUser> { targetUser }, type); return await Add(houseCodeId, new List<SysUser> { targetUser }, type, remark, sort);
} }
[NonAction] [NonAction]
[UnitOfWork] [UnitOfWork]
public async Task Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type) public async Task<int> Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null)
{ {
if (!sort.HasValue)
{
sort = await _bsHouseLogRep.DetachedEntities.Where(p => p.HouseCodeId.Equals(houseCodeId)).MaxAsync(p => p.Sort);
}
var _sort = sort.GetValueOrDefault(1) + 1;
await new BsHouseLog await new BsHouseLog
{ {
Id = Guid.NewGuid().ToString(), Id = Guid.NewGuid().ToString(),
HouseCodeId = houseCodeId, HouseCodeId = houseCodeId,
TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)), TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)),
Type = type, Type = type,
Status = HouseLogStatus.Handle Status = HouseLogStatus.Handle,
Remark = remark,
Sort = _sort
}.InsertAsync(); }.InsertAsync();
return _sort;
} }
[NonAction] [NonAction]
@@ -77,57 +89,88 @@ namespace Ewide.Application.Service
if (log != null) if (log != null)
{ {
log.Status = HouseLogStatus.Handled; log.Status = HouseLogStatus.Handled;
log.FinishedTime = DateTime.Now;
log.FinishedUserId = _userManager.UserId;
log.FinishedUserName = _userManager.User.Account;
await log.UpdateAsync(); await log.UpdateAsync();
} }
} }
[NonAction] [NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type) public async Task<int> AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null)
{ {
await AddThenRead(houseCodeId, new List<SysUser> { targetUser }, type); return await AddThenRead(houseCodeId, new List<SysUser> { targetUser }, type, remark, sort);
} }
[NonAction] [NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type) public async Task<int> AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null)
{ {
if (!sort.HasValue)
{
sort = await _bsHouseLogRep.DetachedEntities.Where(p => p.HouseCodeId.Equals(houseCodeId)).MaxAsync(p => p.Sort);
}
var _sort = sort.GetValueOrDefault(1) + 1;
await new BsHouseLog await new BsHouseLog
{ {
Id = Guid.NewGuid().ToString(), Id = Guid.NewGuid().ToString(),
HouseCodeId = houseCodeId, HouseCodeId = houseCodeId,
TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)), TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)),
Type = type, Type = type,
Status = HouseLogStatus.Handling Status = HouseLogStatus.Handling,
Remark = remark,
Sort = _sort
}.InsertAsync(); }.InsertAsync();
return _sort;
} }
[NonAction] [NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type) public async Task<int> AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null)
{ {
await AddThenDone(houseCodeId, new List<SysUser> { targetUser }, type); return await AddThenDone(houseCodeId, new List<SysUser> { targetUser }, type, remark, sort);
} }
[NonAction] [NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type) public async Task<int> AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null)
{ {
if (!sort.HasValue)
{
sort = await _bsHouseLogRep.DetachedEntities.Where(p => p.HouseCodeId.Equals(houseCodeId)).MaxAsync(p => p.Sort);
}
var _sort = sort.GetValueOrDefault(1) + 1;
await new BsHouseLog await new BsHouseLog
{ {
Id = Guid.NewGuid().ToString(), Id = Guid.NewGuid().ToString(),
HouseCodeId = houseCodeId, HouseCodeId = houseCodeId,
TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)), TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)),
Type = type, Type = type,
Status = HouseLogStatus.Handled Status = HouseLogStatus.Handled,
Remark = remark,
FinishedTime = DateTime.Now,
FinishedUserId = _userManager.UserId,
FinishedUserName = _userManager.User.Account,
Sort = _sort
}.InsertAsync(); }.InsertAsync();
return _sort;
} }
[HttpGet("/houseLog/list")] [HttpGet("/houseLog/list")]
public async Task<dynamic> List([FromQuery] HouseLogInput input) public async Task<dynamic> List([FromQuery] HouseLogInput input)
{ {
var sql = @"SELECT *, var sql = @"SELECT
(SELECT GROUP_CONCAT(`Name`) FROM sys_user HL.Id,
HL.Type,
HL.`Status`,
HL.Remark,
HL.FinishedTime,
HL.FinishedUserId,
IFNULL(NickName, `Name`) FinishedUserName,
(SELECT GROUP_CONCAT(IFNULL(NickName,`Name`)) FROM sys_user
WHERE Id IN ( WHERE Id IN (
SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(_HL.TargetUserIds,',',HT.help_topic_id + 1),',',-1) SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(_HL.TargetUserIds,',',HT.help_topic_id + 1),',',-1)
FROM bs_house_log _HL FROM bs_house_log _HL
@@ -136,8 +179,9 @@ namespace Ewide.Application.Service
) )
) TargetUserNames ) TargetUserNames
FROM bs_house_log HL FROM bs_house_log HL
LEFT JOIN sys_user SU ON HL.FinishedUserId = SU.Id
WHERE HouseCodeId = @HouseCodeId WHERE HouseCodeId = @HouseCodeId
ORDER BY HL.CreatedTime DESC, Type DESC"; ORDER BY Sort DESC";
return await _dapperRep.QueryAsync<HouseLogOutput>(sql, new { houseCodeId = input.Id }); return await _dapperRep.QueryAsync<HouseLogOutput>(sql, new { houseCodeId = input.Id });
} }

View File

@@ -9,14 +9,14 @@ namespace Ewide.Application.Service
{ {
public interface IHouseLogService public interface IHouseLogService
{ {
Task Add(string houseCodeId, SysUser targetUser, HouseLogType type); Task<int> Add(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null);
Task Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type); Task<int> Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null);
Task Read(string houseCodeId); Task Read(string houseCodeId);
Task Done(string houseCodeId); Task Done(string houseCodeId);
Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type); Task<int> AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null);
Task AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type); Task<int> AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null);
Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type); Task<int> AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null);
Task AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type); Task<int> AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null);
Task<dynamic> List(HouseLogInput input); Task<dynamic> List(HouseLogInput input);
Task<dynamic> ListByInfoId(HouseLogInput input); Task<dynamic> ListByInfoId(HouseLogInput input);
Task<dynamic> ListByTaskId(HouseLogInput input); Task<dynamic> ListByTaskId(HouseLogInput input);

View File

@@ -155,7 +155,7 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
// 选定房屋 // 选定房屋
house.ForEach(async p => house.ForEach(async p =>
{ {
var originalTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t =>t.HouseCodeId == p && t.TaskType == 0); var originalTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t => t.HouseCodeId == p && t.TaskType == 0 && t.IsEnabled);
if (originalTask == null) if (originalTask == null)
{ {
new BsHouseTask new BsHouseTask
@@ -173,7 +173,7 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
} }
else else
{ {
await _houseLogService.AddThenDone(p, _userManager.User, HouseLogType.SelectMember); var sort = await _houseLogService.AddThenDone(p, _userManager.User, HouseLogType.SelectMember);
if (originalTask.Status != 6)//建档未完成生成新建档任务分配给新的人员原建档任务数据保留有效性设置为false取消巡查关系 if (originalTask.Status != 6)//建档未完成生成新建档任务分配给新的人员原建档任务数据保留有效性设置为false取消巡查关系
{ {
var newTask = originalTask.Adapt<BsHouseTask>(); var newTask = originalTask.Adapt<BsHouseTask>();
@@ -185,7 +185,7 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
originalTask.IsEnabled = false; originalTask.IsEnabled = false;
originalTask.Update(); originalTask.Update();
await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo); sort = await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo, sort: sort);
}//已建档完成,不再分配建档任务,仅更换巡查关系 }//已建档完成,不再分配建档任务,仅更换巡查关系
else else
{ {

View File

@@ -100,7 +100,10 @@
"sysUser:updateAvatar", "sysUser:updateAvatar",
"sysNotice:received", "sysNotice:received",
"sysNotice:unread", "sysNotice:unread",
"sysNotice:detail" "sysNotice:detail",
"houseLog:list",
"houseLog:listByInfoId",
"houseLog:listByTaskId"
] ]
}, },

View File

@@ -0,0 +1,7 @@
const urls = {
houseLogList: '/houseLog/list',
houseLogListByInfoId: '/houseLog/listByInfoId',
houseLogListByTaskId: '/houseLog/listByTaskId',
}
export default urls

View File

@@ -7,6 +7,7 @@ import houseTask from './houseTask'
import houseInfo from './houseInfo' import houseInfo from './houseInfo'
import houseQuery from './houseQuery' import houseQuery from './houseQuery'
import houseCompany from './houseCompany' import houseCompany from './houseCompany'
import houseLog from './houseLog'
const urls = { const urls = {
...houseProjectInfo, ...houseProjectInfo,
@@ -17,7 +18,8 @@ const urls = {
...houseTask, ...houseTask,
...houseInfo, ...houseInfo,
...houseQuery, ...houseQuery,
...houseCompany ...houseCompany,
...houseLog
} }
export default urls export default urls

View File

@@ -1,10 +1,12 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { Spin, Steps, Timeline } from 'antd' import { Descriptions, Spin, Steps, Timeline } from 'antd'
import { AntIcon } from 'components' import { AntIcon } from 'components'
import { api } from 'common/api' import { api } from 'common/api'
import getDictData from 'util/dic' import getDictData from 'util/dic'
import { toCamelCase } from 'util/format' import { toCamelCase } from 'util/format'
const ellipsisType = [3, 4, 6]
export default class houseLog extends Component { export default class houseLog extends Component {
state = { state = {
loading: true, loading: true,
@@ -21,7 +23,11 @@ export default class houseLog extends Component {
state.codes = await getDictData('house_log_type') state.codes = await getDictData('house_log_type')
if (id) { if (id) {
const { data } = await api.houseLogList({ id })
state.data = data
} else if (infoId) { } else if (infoId) {
const { data } = await api.houseLogListByInfoId({ id: infoId })
state.data = data
} else if (taskId) { } else if (taskId) {
const { data } = await api.houseLogListByTaskId({ id: taskId }) const { data } = await api.houseLogListByTaskId({ id: taskId })
state.data = data state.data = data
@@ -51,18 +57,37 @@ export default class houseLog extends Component {
<Timeline.Item <Timeline.Item
key={i} key={i}
dot={ dot={
[ item.type === 6 ? (
, <AntIcon type="close-circle" className="text-error" />
<AntIcon type="clock-circle" />, ) : (
<AntIcon type="check-circle" />, [
][item.status] ,
<AntIcon type="clock-circle" />,
<AntIcon type="check-circle" className="text-success" />,
][item.status]
)
} }
> >
<h5 className="h5"> <h6 className="h6">
{this.bindCodeValue(item.type, 'house_log_type')} <b>
</h5> {['等待', '正在', ''][item.status] +
<p className="text-gray">{item.updatedTime}</p> this.bindCodeValue(item.type, 'house_log_type')}
<p>{item.targetUserNames}</p> </b>
</h6>
<p className="text-gray">{item.finishedTime}</p>
<Descriptions column={1} colon={false} labelStyle={{ opacity: 0.5 }}>
{item.remark && (
<Descriptions.Item>{item.remark}</Descriptions.Item>
)}
<Descriptions.Item label="操作人">
{item.targetUserNames.split(',').join(' / ')}
</Descriptions.Item>
{item.finishedUserName && (
<Descriptions.Item label="实际操作人">
{item.finishedUserName}
</Descriptions.Item>
)}
</Descriptions>
</Timeline.Item> </Timeline.Item>
))} ))}
</Timeline> </Timeline>

View File

@@ -10,9 +10,10 @@ import {
message as Message, message as Message,
Radio, Radio,
Select, Select,
Drawer,
} from 'antd' } from 'antd'
import { isEqual } from 'lodash' import { isEqual } from 'lodash'
import { AntIcon, Auth, Container, QueryTable, QueryTableActions } from 'components' import { AntIcon, Auth, Container, HouseLog, QueryTable, QueryTableActions } from 'components'
import { api } from 'common/api' import { api } from 'common/api'
import getDictData from 'util/dic' import getDictData from 'util/dic'
import auth from 'components/authorized/handler' import auth from 'components/authorized/handler'
@@ -39,6 +40,8 @@ export default class index extends Component {
}, },
type: '', type: '',
visibleLog: false,
} }
// 表格实例 // 表格实例
@@ -95,7 +98,7 @@ export default class index extends Component {
if (flag) { if (flag) {
this.columns.push({ this.columns.push({
title: '操作', title: '操作',
width: 150, width: 180,
dataIndex: 'actions', dataIndex: 'actions',
render: (text, record) => ( render: (text, record) => (
<QueryTableActions> <QueryTableActions>
@@ -111,6 +114,7 @@ export default class index extends Component {
<a>删除</a> <a>删除</a>
</Popconfirm> </Popconfirm>
</Auth> </Auth>
<a onClick={() => this.onShowLog(record.id)}>日志</a>
</QueryTableActions> </QueryTableActions>
), ),
}) })
@@ -255,10 +259,13 @@ export default class index extends Component {
} }
//#region 自定义方法 //#region 自定义方法
onShowLog(id) {
this.setState({ visibleLog: id })
}
//#endregion //#endregion
render() { render() {
const { options, codes, type } = this.state const { options, codes, type, visibleLog } = this.state
return ( return (
<Container mode="fluid"> <Container mode="fluid">
@@ -348,7 +355,14 @@ export default class index extends Component {
} }
/> />
</Card> </Card>
{this.props.supportInfo} <Drawer
width={600}
visible={visibleLog}
onClose={() => this.setState({ visibleLog: false })}
destroyOnClose
>
<HouseLog id={visibleLog} />
</Drawer>
</Container> </Container>
) )
} }

View File

@@ -250,7 +250,7 @@ export default class index extends Component {
通过 通过
</Button> </Button>
<Button <Button
type="primary" type="danger"
onClick={() => this.onCheck(-1)} onClick={() => this.onCheck(-1)}
> >
退回 退回

View File

@@ -1,6 +1,25 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { Button, Card, Form, Input, message as Message, Popconfirm, Radio, Select, Tag } from 'antd' import {
import { AntIcon, Auth, Container, ModalForm, QueryTable, QueryTableActions } from 'components' Button,
Card,
Drawer,
Form,
Input,
message as Message,
Popconfirm,
Radio,
Select,
Tag,
} from 'antd'
import {
AntIcon,
Auth,
Container,
HouseLog,
ModalForm,
QueryTable,
QueryTableActions,
} from 'components'
import { api } from 'common/api' import { api } from 'common/api'
import auth from 'components/authorized/handler' import auth from 'components/authorized/handler'
import { isEqual } from 'lodash' import { isEqual } from 'lodash'
@@ -37,6 +56,8 @@ export default class index extends Component {
}, },
type: '', type: '',
visibleLog: false,
} }
// 表格实例 // 表格实例
@@ -113,6 +134,7 @@ export default class index extends Component {
{record.state === 3 ? `审核` : `查看`} {record.state === 3 ? `审核` : `查看`}
</a> </a>
</Auth> </Auth>
<a onClick={() => this.onShowLog(record.id)}>日志</a>
</QueryTableActions> </QueryTableActions>
), ),
}) })
@@ -228,10 +250,13 @@ export default class index extends Component {
} }
//#region 自定义方法 //#region 自定义方法
onShowLog(id) {
this.setState({ visibleLog: id })
}
//#endregion //#endregion
render() { render() {
const { codes, type } = this.state const { codes, type, visibleLog } = this.state
return ( return (
<Container mode="fluid"> <Container mode="fluid">
@@ -298,6 +323,15 @@ export default class index extends Component {
} }
/> />
</Card> </Card>
<Drawer
width={600}
visible={visibleLog}
onClose={() => this.setState({ visibleLog: false })}
destroyOnClose
>
<HouseLog taskId={visibleLog} />
</Drawer>
</Container> </Container>
) )
} }

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { Card, Checkbox, Form, Input, message as Message, Radio, Select, Tag } from 'antd' import { Card, Checkbox, Drawer, Form, Input, message as Message, Radio, Select, Tag } from 'antd'
import { Auth, Container, QueryTable, QueryTableActions } from 'components' import { Auth, Container, HouseLog, QueryTable, QueryTableActions } from 'components'
import { api } from 'common/api' import { api } from 'common/api'
import auth from 'components/authorized/handler' import auth from 'components/authorized/handler'
import { isEqual } from 'lodash' import { isEqual } from 'lodash'
@@ -35,6 +35,8 @@ export default class index extends Component {
}, },
type: '', type: '',
visibleLog: false,
} }
// 表格实例 // 表格实例
@@ -115,6 +117,7 @@ export default class index extends Component {
: `登记`} : `登记`}
</a> </a>
</Auth> </Auth>
<a onClick={() => this.onShowLog(record.id)}>日志</a>
</QueryTableActions> </QueryTableActions>
), ),
}) })
@@ -230,10 +233,13 @@ export default class index extends Component {
} }
//#region 自定义方法 //#region 自定义方法
onShowLog(id) {
this.setState({ visibleLog: id })
}
//#endregion //#endregion
render() { render() {
const { codes, type } = this.state const { codes, type, visibleLog } = this.state
return ( return (
<Container mode="fluid"> <Container mode="fluid">
@@ -310,6 +316,15 @@ export default class index extends Component {
} }
/> />
</Card> </Card>
<Drawer
width={600}
visible={visibleLog}
onClose={() => this.setState({ visibleLog: false })}
destroyOnClose
>
<HouseLog taskId={visibleLog} />
</Drawer>
</Container> </Container>
) )
} }