|
|
@@ -14,9 +14,12 @@ import './index.scss'
|
|
|
|
|
|
interface iGroupItem extends iAccountGroupItem {
|
|
|
onSelect: (item: iUserInfo) => void
|
|
|
+ filterGroups?: string[]
|
|
|
}
|
|
|
export const GroupItem: React.FC<iGroupItem> = props => {
|
|
|
- const { onSelect } = props
|
|
|
+ const { onSelect, filterGroups } = props
|
|
|
+
|
|
|
+ // console.log(filterGroups)
|
|
|
|
|
|
const [ visible, setVisible ] = useState<boolean>(true)
|
|
|
|
|
|
@@ -34,7 +37,7 @@ export const GroupItem: React.FC<iGroupItem> = props => {
|
|
|
<QueueAnim>
|
|
|
{visible
|
|
|
? props.children.map((account: iUserInfo) => {
|
|
|
- return (
|
|
|
+ return filterGroups && filterGroups.includes(account.id) ? null : (
|
|
|
<div key={account.id} className={[ 'group-item-content', 'pi-justify-between', 'item-border-bottom' ].join(' ')} onClick={() => onSelect(account)}>
|
|
|
<div className="pi-flex-column">
|
|
|
<span className="pi-blue">{account.name}</span>
|
|
|
@@ -53,6 +56,7 @@ export const GroupItem: React.FC<iGroupItem> = props => {
|
|
|
interface iAuditContentProps {
|
|
|
onSelect: (type: string, item: iUserInfo) => void
|
|
|
onDelete: (id: string, progress: string) => void
|
|
|
+ filterGroup: (progress: string) => string[]
|
|
|
data : {
|
|
|
uid: string
|
|
|
auditors: iAuditor[]
|
|
|
@@ -63,15 +67,12 @@ interface iAuditContentProps {
|
|
|
}
|
|
|
|
|
|
const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
- const { onSelect, onDelete, data: { auditors, status, auditHistory, uid } } = props
|
|
|
+ const { onSelect, onDelete, filterGroup, data: { auditors, status, auditHistory, uid } } = props
|
|
|
const [ visible, setVisible ] = useState({
|
|
|
check: false,
|
|
|
reCheck: false
|
|
|
})
|
|
|
|
|
|
- const showPopover = (type: string) => {
|
|
|
- setVisible({ ...visible, [type]: true })
|
|
|
- }
|
|
|
const [ searchValue, setSearchValue ] = useState<string>('')
|
|
|
const [ groups, setGroups ] = useState<Array<iAccountGroupItem>>([])
|
|
|
useEffect(() => {
|
|
|
@@ -86,6 +87,11 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
const data = await getUserGroup({ name: serach, bidsectionId: tenderStore.bid })
|
|
|
setGroups(data)
|
|
|
}
|
|
|
+
|
|
|
+ const showPopover = (type: string) => {
|
|
|
+ setVisible({ ...visible, [type]: true })
|
|
|
+ }
|
|
|
+
|
|
|
const handleVisibleChange = (type: string, isShow: boolean) => {
|
|
|
setVisible({ ...visible, [type]: isShow })
|
|
|
}
|
|
|
@@ -118,7 +124,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
.filter(item => item.progress === '0')
|
|
|
.map((item, idx) => {
|
|
|
return (
|
|
|
- <li key={item.audit_id}>
|
|
|
+ <li key={item.id + idx}>
|
|
|
<div className="pi-flex-column">
|
|
|
<p>
|
|
|
<span>{idx + 1}</span> {item.name}
|
|
|
@@ -136,7 +142,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
.filter(item => item.progress === '2')
|
|
|
.map((item, idx) => {
|
|
|
return (
|
|
|
- <li key={item.audit_id}>
|
|
|
+ <li key={item.id + idx}>
|
|
|
<div className="pi-flex-column">
|
|
|
<p>
|
|
|
<span>{idx + 1}</span> {item.name}
|
|
|
@@ -282,7 +288,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
.filter(item => item.progress === '0')
|
|
|
.map((item, idx) => {
|
|
|
return idx === 0 ? (
|
|
|
- <tr key={item.id}>
|
|
|
+ <tr key={item.id + idx}>
|
|
|
<td rowSpan={auditors.filter(item => item.progress === '0').length} className="pi-text-center">
|
|
|
审批
|
|
|
</td>
|
|
|
@@ -298,7 +304,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
) : null}
|
|
|
</tr>
|
|
|
) : (
|
|
|
- <tr key={item.id}>
|
|
|
+ <tr key={item.id + idx}>
|
|
|
<td>
|
|
|
<SvgIcon type={item.status === 0 ? 'xxh-stop-circle' : 'xxh-chevron-circle-down'} />
|
|
|
<span className="pi-mg-left-3">{item.name}</span>
|
|
|
@@ -347,7 +353,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
.filter(item => item.progress === '2')
|
|
|
.map((item, idx) => {
|
|
|
return idx === 0 ? (
|
|
|
- <tr key={item.id}>
|
|
|
+ <tr key={item.id + idx}>
|
|
|
<td rowSpan={auditors.filter(item => item.progress === '2').length} className="pi-text-center">
|
|
|
复查
|
|
|
</td>
|
|
|
@@ -363,7 +369,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
) : null}
|
|
|
</tr>
|
|
|
) : (
|
|
|
- <tr key={item.id}>
|
|
|
+ <tr key={item.id + idx}>
|
|
|
<td>
|
|
|
<SvgIcon type={item.status === 0 ? 'xxh-stop-circle' : 'xxh-chevron-circle-down'} />
|
|
|
<span className="pi-mg-left-3">{item.name}</span>
|
|
|
@@ -444,7 +450,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
<Popover
|
|
|
title={<Input.Search size="small" placeholder="姓名/手机 检索" onSearch={search} onChange={e => change(e)} />}
|
|
|
content={groups.map(item => (
|
|
|
- <GroupItem {...item} key={item.value} onSelect={(item: iUserInfo) => itemSelectHandler('check', item)} />
|
|
|
+ <GroupItem {...item} key={item.value} onSelect={(item: iUserInfo) => itemSelectHandler('check', item)} filterGroups={filterGroup('0')}/>
|
|
|
))}
|
|
|
overlayClassName="popover-card"
|
|
|
trigger="click"
|
|
|
@@ -472,7 +478,7 @@ const AuditContent: React.FC<iAuditContentProps> = props => {
|
|
|
<Popover
|
|
|
title={<Input.Search size="small" placeholder="姓名/手机 检索" onSearch={search} onChange={e => change(e)} />}
|
|
|
content={groups.map(item => (
|
|
|
- <GroupItem {...item} key={item.value} onSelect={(item: iUserInfo) => itemSelectHandler('reCheck', item)} />
|
|
|
+ <GroupItem {...item} key={item.value} onSelect={(item: iUserInfo) => itemSelectHandler('reCheck', item)} filterGroups={filterGroup('2')}/>
|
|
|
))}
|
|
|
overlayClassName="popover-card"
|
|
|
trigger="click"
|