|
@@ -138,24 +138,31 @@ const OpreateLock = props => {
|
|
|
}, [resetModalProps.visible, type])
|
|
}, [resetModalProps.visible, type])
|
|
|
|
|
|
|
|
const handleonOk = () => {
|
|
const handleonOk = () => {
|
|
|
- form.validateFields().then(async values => {
|
|
|
|
|
- if (type === lockTypeEnum.RECEIVE) {
|
|
|
|
|
- const { code = -1 } = await apiReceiveLock({ longleId })
|
|
|
|
|
- if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
- message.success('接收成功')
|
|
|
|
|
- resetModalProps.onCancel()
|
|
|
|
|
- dispatch({
|
|
|
|
|
- type: 'refresh/commitAction',
|
|
|
|
|
- payload: {
|
|
|
|
|
- main: 'software',
|
|
|
|
|
- target: longleId
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ form
|
|
|
|
|
+ .validateFields()
|
|
|
|
|
+ .then(async values => {
|
|
|
|
|
+ setState({ ...state, loading: true })
|
|
|
|
|
+ if (type === lockTypeEnum.RECEIVE) {
|
|
|
|
|
+ const { code = -1 } = await apiReceiveLock({ longleId })
|
|
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
+ message.success('接收成功')
|
|
|
|
|
+ onCancel()
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'refresh/commitAction',
|
|
|
|
|
+ payload: {
|
|
|
|
|
+ main: 'software',
|
|
|
|
|
+ target: longleId
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const isSuccess = await onConfirm({ ...values, preserveStatus: type })
|
|
|
|
|
+ isSuccess && onCancel()
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- onConfirm({ ...values, preserveStatus: type })
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ setState({ ...state, loading: false })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const checkGroupOnChange = e => {
|
|
const checkGroupOnChange = e => {
|