fix/mobileApproval (#1074)
Reviewed-on: daoyoucloud/tachybase#1074 Co-authored-by: wangjiahui <wwwjh0710@163.com> Co-committed-by: wangjiahui <wwwjh0710@163.com>
This commit is contained in:
parent
f988b2ba30
commit
6522373a07
@ -13,7 +13,6 @@ export function useSubmit() {
|
|||||||
const form = useForm();
|
const form = useForm();
|
||||||
const { id } = useContextApprovalExecution();
|
const { id } = useContextApprovalExecution();
|
||||||
const { status } = useContextApprovalAction();
|
const { status } = useContextApprovalAction();
|
||||||
const { setVisible, setSubmitted } = useActionContext() as any;
|
|
||||||
return {
|
return {
|
||||||
run: async () => {
|
run: async () => {
|
||||||
try {
|
try {
|
||||||
@ -23,7 +22,6 @@ export function useSubmit() {
|
|||||||
await form.submit();
|
await form.submit();
|
||||||
field.data = field.data ?? {};
|
field.data = field.data ?? {};
|
||||||
field.data.loading = true;
|
field.data.loading = true;
|
||||||
setVisible(false);
|
|
||||||
const res = await api.resource('approvalRecords').submit({
|
const res = await api.resource('approvalRecords').submit({
|
||||||
filterByTk: id,
|
filterByTk: id,
|
||||||
values: { ...form.values, status },
|
values: { ...form.values, status },
|
||||||
@ -37,7 +35,6 @@ export function useSubmit() {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
location.reload();
|
location.reload();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
setSubmitted(true);
|
|
||||||
} else {
|
} else {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
icon: 'fail',
|
icon: 'fail',
|
||||||
|
Loading…
Reference in New Issue
Block a user