|
@@ -84,14 +84,13 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (visible && type === 'pass') {
|
|
|
- if(curAuditor.progress === '1') {
|
|
|
+ if (curAuditor.progress === '1') {
|
|
|
form.setFieldsValue({ opinion: '已按要求整改完成。' })
|
|
|
}
|
|
|
|
|
|
if (isLastAuditor && auditors.findIndex(item => item.progress === '1') !== -1) {
|
|
|
|
|
|
const auditor = auditors.find(item => item.progress === '1')
|
|
|
- console.log('auditor', auditor)
|
|
|
|
|
|
auditor && (setUser({ ...user, id: auditor.audit_id, company: auditor.company, name: auditor.name, position: auditor.position }))
|
|
|
}
|
|
@@ -140,7 +139,7 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
|
|
|
// 初始化审批退回下拉选择框
|
|
|
const initAuditBackGroup = () => {
|
|
|
const newGroup: iAccountGroupItem[] = []
|
|
|
- for (let index = 0; index < 3; index++) {
|
|
|
+ for (let index = 0; index < 4; index++) {
|
|
|
if (index === 0) {
|
|
|
const newAuditors = auditors
|
|
|
.filter(item => item.progress === '' && item.audit_order < curAuditor.auditOrder)
|
|
@@ -148,10 +147,10 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
|
|
|
|
|
|
return mapUser(item.name, item.id, item.position, item.company, item.mobile)
|
|
|
})
|
|
|
- newGroup.push({ value: '检查人', children: newAuditors })
|
|
|
- }
|
|
|
- if (index === 1) {
|
|
|
- const newAuditors = auditors
|
|
|
+ newGroup.push({ value: '检查人', children: newAuditors })
|
|
|
+ }
|
|
|
+ if (index === 1) {
|
|
|
+ const newAuditors = auditors
|
|
|
.filter(item => item.progress === '0' && item.audit_order < curAuditor.auditOrder)
|
|
|
.map(item => {
|
|
|
return mapUser(item.name, item.id, item.position, item.company, item.mobile)
|
|
@@ -166,6 +165,14 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
|
|
|
})
|
|
|
newGroup.push({ value: '整改', children: newAuditors })
|
|
|
}
|
|
|
+ if (index === 3) {
|
|
|
+ const newAuditors = auditors
|
|
|
+ .filter(item => item.progress === '2' && item.audit_order < curAuditor.auditOrder)
|
|
|
+ .map(item => {
|
|
|
+ return mapUser(item.name, item.id, item.position, item.company, item.mobile)
|
|
|
+ })
|
|
|
+ newGroup.push({ value: '复查', children: newAuditors })
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
function mapUser(name: string, id: string, position: string, company: string, mobile: string) {
|
|
@@ -289,7 +296,7 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
|
|
|
<>
|
|
|
<div className="pi-bordered pi-warning">
|
|
|
<span>已选择退回流程: </span>
|
|
|
- <span>{user.name}</span>
|
|
|
+ <span>{user.name}-{user.position}-{user.company}</span>
|
|
|
</div>
|
|
|
<Form.Item name="opinion" label="审批意见">
|
|
|
<Input.TextArea rows={5} />
|