|
@@ -7,7 +7,7 @@ import consts from '@/basic/consts'
|
|
|
import { useDebounceFn } from 'ahooks'
|
|
import { useDebounceFn } from 'ahooks'
|
|
|
import { apiSoftwareAddLonglelog, apiReceiveLock } from '@/services/product'
|
|
import { apiSoftwareAddLonglelog, apiReceiveLock } from '@/services/product'
|
|
|
import { useDispatch, connect } from 'umi'
|
|
import { useDispatch, connect } from 'umi'
|
|
|
-import { ProFormTextArea } from '@ant-design/pro-form'
|
|
|
|
|
|
|
+import { ProFormText, ProFormTextArea } from '@ant-design/pro-form'
|
|
|
import styles from '@/pages/Customer/Company/components/ConnectCompany/index.less'
|
|
import styles from '@/pages/Customer/Company/components/ConnectCompany/index.less'
|
|
|
|
|
|
|
|
export const lockTypeEnum = {
|
|
export const lockTypeEnum = {
|
|
@@ -35,14 +35,13 @@ const OpreateLock = props => {
|
|
|
onCancel,
|
|
onCancel,
|
|
|
type,
|
|
type,
|
|
|
longleId,
|
|
longleId,
|
|
|
- isOperation,
|
|
|
|
|
- id,
|
|
|
|
|
- mark,
|
|
|
|
|
|
|
+ defaultValues,
|
|
|
keyNum,
|
|
keyNum,
|
|
|
prodList,
|
|
prodList,
|
|
|
upgradeProduct,
|
|
upgradeProduct,
|
|
|
...resetModalProps
|
|
...resetModalProps
|
|
|
} = props
|
|
} = props
|
|
|
|
|
+ console.log(defaultValues)
|
|
|
const [form] = Form.useForm()
|
|
const [form] = Form.useForm()
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
const scrollRef = useRef()
|
|
const scrollRef = useRef()
|
|
@@ -146,9 +145,11 @@ const OpreateLock = props => {
|
|
|
if (type === lockTypeEnum.RECOVER) {
|
|
if (type === lockTypeEnum.RECOVER) {
|
|
|
form.setFieldsValue({ longleId })
|
|
form.setFieldsValue({ longleId })
|
|
|
}
|
|
}
|
|
|
- // if (type === lockTypeEnum.REMARK) {
|
|
|
|
|
- // form.setFieldsValue({ id, mark })
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (defaultValues) {
|
|
|
|
|
+ if (type === lockTypeEnum.REMARK) {
|
|
|
|
|
+ form?.setFieldsValue({ mark: defaultValues.mark })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}, [resetModalProps.visible, type])
|
|
}, [resetModalProps.visible, type])
|
|
|
|
|
|
|
@@ -171,7 +172,7 @@ const OpreateLock = props => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (isOperation === true) {
|
|
|
|
|
|
|
+ if (defaultValues) {
|
|
|
const { code = -1 } = await apiUpdateLonglelog({ id })
|
|
const { code = -1 } = await apiUpdateLonglelog({ id })
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
// form.current?.setFieldsValue({
|
|
// form.current?.setFieldsValue({
|
|
@@ -383,7 +384,12 @@ const OpreateLock = props => {
|
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
) : null}
|
|
) : null}
|
|
|
|
|
|
|
|
- {type === lockTypeEnum.REMARK ? <ProFormTextArea name="mark" label="备注" /> : null}
|
|
|
|
|
|
|
+ {type === lockTypeEnum.REMARK ? (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <ProFormText name="id" hidden />
|
|
|
|
|
+ <ProFormTextArea name="mark" label="备注" />
|
|
|
|
|
+ </>
|
|
|
|
|
+ ) : null}
|
|
|
|
|
|
|
|
{type === lockTypeEnum.RECOVER || type === lockTypeEnum.RECEIVE ? (
|
|
{type === lockTypeEnum.RECOVER || type === lockTypeEnum.RECEIVE ? (
|
|
|
<>
|
|
<>
|