|
@@ -13,9 +13,10 @@ type Props = {
|
|
|
sId: number
|
|
|
succToLookFu: (id: number) => void
|
|
|
closeFu: () => void
|
|
|
+ isLook: boolean
|
|
|
}
|
|
|
|
|
|
-function D2edit({ sId, succToLookFu, closeFu }: Props) {
|
|
|
+function D2edit({ sId, succToLookFu, closeFu, isLook }: Props) {
|
|
|
// 获取用户列表
|
|
|
const dispatch = useDispatch()
|
|
|
useEffect(() => {
|
|
@@ -75,7 +76,7 @@ function D2edit({ sId, succToLookFu, closeFu }: Props) {
|
|
|
<Modal
|
|
|
wrapClassName={styles.D2edit}
|
|
|
open={true}
|
|
|
- title={sId > 0 ? '编辑' : '新增'}
|
|
|
+ title={isLook ? '查看' : sId > 0 ? '编辑' : '新增'}
|
|
|
footer={
|
|
|
[] // 设置footer为空,去掉 取消 确定默认按钮
|
|
|
}
|
|
@@ -95,15 +96,15 @@ function D2edit({ sId, succToLookFu, closeFu }: Props) {
|
|
|
name='name'
|
|
|
rules={[{ required: true, message: '请输入仓库名称' }]}
|
|
|
>
|
|
|
- <Input maxLength={30} showCount placeholder='请输入内容' />
|
|
|
+ <Input readOnly={isLook} maxLength={30} showCount placeholder='请输入内容' />
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item
|
|
|
- label='仓库编码'
|
|
|
+ label='分库缩写'
|
|
|
name='num'
|
|
|
- rules={[{ required: true, message: '请输入仓库编码' }]}
|
|
|
+ rules={[{ required: true, message: '请输入分库缩写' }]}
|
|
|
>
|
|
|
- <Input maxLength={30} showCount placeholder='请输入内容' />
|
|
|
+ <Input readOnly={isLook} maxLength={30} showCount placeholder='请输入内容' />
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item
|
|
@@ -112,6 +113,7 @@ function D2edit({ sId, succToLookFu, closeFu }: Props) {
|
|
|
rules={[{ required: true, message: '请选择仓库负责人' }]}
|
|
|
>
|
|
|
<Select
|
|
|
+ disabled={isLook}
|
|
|
placeholder='请选择'
|
|
|
options={userList.map(v => ({ value: v.id, label: v.realName || v.userName }))}
|
|
|
/>
|
|
@@ -120,21 +122,27 @@ function D2edit({ sId, succToLookFu, closeFu }: Props) {
|
|
|
{/* 库保员 */}
|
|
|
<Form.Item label='库保员' name='memberUserIds'>
|
|
|
<Select
|
|
|
+ disabled={isLook}
|
|
|
showSearch={false}
|
|
|
mode='multiple'
|
|
|
allowClear
|
|
|
style={{ width: '100%' }}
|
|
|
- placeholder='请选择'
|
|
|
+ placeholder={isLook ? '(空)' : '请选择'}
|
|
|
options={userList.map(v => ({ value: v.id, label: v.realName || v.userName }))}
|
|
|
/>
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item label='仓库说明' name='description'>
|
|
|
- <TextArea maxLength={500} showCount placeholder='请输入内容' />
|
|
|
+ <TextArea
|
|
|
+ readOnly={isLook}
|
|
|
+ maxLength={500}
|
|
|
+ showCount
|
|
|
+ placeholder={isLook ? '(空)' : '请输入内容'}
|
|
|
+ />
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item label='仓库状态' name='enable' rules={[{ required: true, message: '' }]}>
|
|
|
- <Radio.Group>
|
|
|
+ <Radio.Group disabled={isLook}>
|
|
|
<Radio value={1}>启用</Radio>
|
|
|
<Radio value={0}>禁用</Radio>
|
|
|
</Radio.Group>
|
|
@@ -143,11 +151,19 @@ function D2edit({ sId, succToLookFu, closeFu }: Props) {
|
|
|
{/* 确定和取消按钮 */}
|
|
|
<br />
|
|
|
<Form.Item wrapperCol={{ offset: 9, span: 16 }}>
|
|
|
- <Button type='primary' htmlType='submit'>
|
|
|
- 提交
|
|
|
- </Button>
|
|
|
-  
|
|
|
- <MyPopconfirm txtK='取消' onConfirm={closeFu} />
|
|
|
+ {isLook ? (
|
|
|
+ <Button style={{ marginLeft: 50 }} onClick={closeFu}>
|
|
|
+ 关闭
|
|
|
+ </Button>
|
|
|
+ ) : (
|
|
|
+ <>
|
|
|
+ <Button type='primary' htmlType='submit'>
|
|
|
+ 提交
|
|
|
+ </Button>
|
|
|
+  
|
|
|
+ <MyPopconfirm txtK='取消' onConfirm={closeFu} />
|
|
|
+ </>
|
|
|
+ )}
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
|
</div>
|