|  |  |  | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  | const [drawerVal, setDrawerVal] = useState(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [taskStsByComplete, setTaskStsByComplete] = useState(null); | 
|---|
|  |  |  | const [taskStsByCancel, setTaskStsByCancel] = useState(null); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | useEffect(() => { | 
|---|
|  |  |  | request.post('/taskSts/list', { | 
|---|
|  |  |  | uuid: 'COMPLETE' | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | headers: { | 
|---|
|  |  |  | 'Content-Type': 'application/x-www-form-urlencoded' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | setTaskStsByComplete(res.data.data[0]?.id); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | request.post('/taskSts/list', { | 
|---|
|  |  |  | uuid: 'CANCEL' | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | headers: { | 
|---|
|  |  |  | 'Content-Type': 'application/x-www-form-urlencoded' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | setTaskStsByCancel(res.data.data[0]?.id); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, []); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onComplete = (taskId) => { | 
|---|
|  |  |  | request.get("/task/complete/" + taskId).then(res => { | 
|---|
|  |  |  | const { code, msg, data } = res.data; | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg || 'common.response.fail', { type: 'error', messageArgs: { _: msg } }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }).catch(error => { | 
|---|
|  |  |  | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg || 'common.response.fail', { type: 'error', messageArgs: { _: msg } }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }).catch(error => { | 
|---|
|  |  |  | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> | 
|---|
|  |  |  | <TextField source="memo" label="common.field.memo" sortable={false} /> | 
|---|
|  |  |  | <FunctionField label="common.field.opt" cellClassName="opt" render={record => ( | 
|---|
|  |  |  | (record.taskSts === 15 || true) && ( | 
|---|
|  |  |  | (record.taskSts !== taskStsByComplete && record.taskSts !== taskStsByCancel) && ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <ConfirmButton | 
|---|
|  |  |  | label="common.action.complete" | 
|---|