Commit e800cca1 by zhaochengxiang

设计不通过 规范不允许改

parent 6121e09d
import React, { useState, useEffect, useRef, useMemo } from 'react';
import { Form, Button, Space, Tooltip, Modal, Select, Input, } from 'antd';
import { Form, Button, Space, Tooltip, Modal, Select, Input } from 'antd';
import LocalStorage from 'local-storage';
import { useMount, useUnmount } from 'ahooks';
import { LeftCircleFilled, RightCircleFilled } from '@ant-design/icons';
......@@ -636,45 +636,53 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk,
<Button type='primary' onClick={onHistoryClick}>历史版本</Button>
</Space>
<Space>
<Select
value={(type==='design')?item?.designReviewPass:item?.standardReviewPass}
placeholder='选择评审结论'
allowClear
style={{
width: 150,
}}
onChange={(val) => {
setItem(prev => {
return Object.assign({}, prev,
(type==='design') ? {
designReviewPass: val
}: {
standardReviewPass: val
}
)
})
}}
>
<Select.Option value={true}>通过</Select.Option>
<Select.Option value={false}>不通过</Select.Option>
</Select>
<Input
value={(type==='design')?item?.designReviewComment:item?.standardReviewComment}
placeholder='请输入评审意见'
style={{ width: 500 }}
allowClear
onChange={(e) => {
setItem(prev => {
return Object.assign({}, prev,
(type==='design') ? {
designReviewComment: e.target.value
}: {
standardReviewComment: e.target.value
}
)
})
}}
/>
<Tooltip title={((type==='rule')&&!item?.designReviewPass) ? '设计评审不通过' : ''}>
<Select
value={(type==='design')?item?.designReviewPass:item?.standardReviewPass}
placeholder='选择评审结论'
allowClear
disabled={(type==='rule')&&!item?.designReviewPass}
style={{
width: 150,
}}
onChange={(val) => {
setItem(prev => {
return Object.assign({}, prev,
(type==='design') ? {
designReviewPass: val
}: {
standardReviewPass: val
}
)
})
}}
>
<Select.Option value={true}>通过</Select.Option>
<Select.Option value={false}>不通过</Select.Option>
</Select>
</Tooltip>
<Tooltip title={((type==='rule')&&!item?.designReviewPass) ? '设计评审不通过' : ''}>
<Form.Item style={{ marginBottom: 0 }}>
<Input
value={(type==='design')?item?.designReviewComment:item?.standardReviewComment}
disabled={(type==='rule')&&!item?.designReviewPass}
placeholder='请输入评审意见'
style={{ width: 500 }}
allowClear
onChange={(e) => {
setItem(prev => {
return Object.assign({}, prev,
(type==='design') ? {
designReviewComment: e.target.value
}: {
standardReviewComment: e.target.value
}
)
})
}}
/>
</Form.Item>
</Tooltip>
<Button loading={waiting} type='primary' onClick={onOkClick}>确定</Button>
<Button type='text' icon={<LeftCircleFilled className='pointer' style={{ fontSize: 26, color: canPrev?'#196AD2':'#B5B5B5' }}/>} onClick={onPrevClick} disabled={!canPrev}></Button>
<Button type='text' icon={<RightCircleFilled className='pointer' style={{ fontSize: 26, color: canNext?'#196AD2':'#B5B5B5' }}/>} onClick={onNextClick} disabled={!canNext}></Button>
......
......@@ -259,59 +259,67 @@ const List = React.forwardRef(function ({type, data}, ref) {
dataIndex: (type === 'design') ? 'designReviewPass' : 'standardReviewPass',
width: 120,
className: 'highlight',
render: (text, __, index) => {
render: (text, record, index) => {
form?.setFieldsValue({ [`pass${index}`]: text })
return (
<Form.Item name={`pass${index}`}
rules={[{ required: true, message: '请选择评审结论!' }]}
style={{ marginBottom: 0 }}
>
<Select
placeholder='请选择'
<Tooltip title={((type==='rule')&&!record.designReviewPass) ? '设计评审不通过' : ''}>
<Form.Item name={`pass${index}`}
rules={[{ required: true, message: '请选择评审结论!' }]}
style={{ marginBottom: 0 }}
>
<Select
placeholder='请选择'
allowClear
style={{
width: '100%'
}}
disabled={(type==='rule')&&!record.designReviewPass}
onChange={(val) => {
setTableData(prev => {
return produce(prev, (draft) => {
if (type === 'design') {
draft[index].designReviewPass = val
} else {
draft[index].standardReviewPass = val
}
})
})
}}
>
<Select.Option value={true}>通过</Select.Option>
<Select.Option value={false}>不通过</Select.Option>
</Select>
</Form.Item>
</Tooltip>
)
}
},
{
title: '评审意见',
dataIndex: (type === 'design') ? 'designReviewComment' : 'standardReviewComment',
className: 'highlight',
render: (text, record, index) => (
<Tooltip title={((type==='rule')&&!record.designReviewPass) ? '设计评审不通过' : ''}>
<Form.Item style={{ marginBottom: 0 }}>
<Input.TextArea rows={1}
value={text}
autoSize={{ minRows: 1, maxRows: 3 }}
allowClear
style={{
width: '100%'
}}
onChange={(val) => {
disabled={(type==='rule')&&!record.designReviewPass}
onChange={(e) => {
setTableData(prev => {
return produce(prev, (draft) => {
if (type === 'design') {
draft[index].designReviewPass = val
draft[index].designReviewComment = e.target.value
} else {
draft[index].standardReviewPass = val
draft[index].standardReviewComment = e.target.value
}
})
})
}}
>
<Select.Option value={true}>通过</Select.Option>
<Select.Option value={false}>不通过</Select.Option>
</Select>
}}
/>
</Form.Item>
)
}
},
{
title: '评审意见',
dataIndex: (type === 'design') ? 'designReviewComment' : 'standardReviewComment',
className: 'highlight',
render: (text, __, index) => (
<Input.TextArea rows={1}
value={text}
autoSize={{ minRows: 1, maxRows: 3 }}
allowClear
onChange={(e) => {
setTableData(prev => {
return produce(prev, (draft) => {
if (type === 'design') {
draft[index].designReviewComment = e.target.value
} else {
draft[index].standardReviewComment = e.target.value
}
})
})
}}
/>
</Tooltip>
)
},
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment