fix(project): detail all task list fix
This commit is contained in:
@@ -15,14 +15,16 @@ import {
|
||||
} from "@mantine/core"
|
||||
import { useForm } from "@mantine/form"
|
||||
import { notifications } from "@mantine/notifications"
|
||||
import { selectedDataProps } from "../TaskTableContainer"
|
||||
|
||||
export default function DispatchModal(props: {
|
||||
opened: boolean
|
||||
record: Task.DataProps | null
|
||||
dispatchData?: selectedDataProps
|
||||
task_ids: Task.DataProps[]
|
||||
userOptions: Array<{ label: string; value: string }>
|
||||
onCloseAction: (refresh?: boolean) => void
|
||||
}) {
|
||||
const { opened, record, userOptions, onCloseAction } = props
|
||||
const { opened, dispatchData, task_ids, userOptions, onCloseAction } = props
|
||||
const operation_uid = usePermissionStore((s) => s.user_id)
|
||||
|
||||
const form = useForm({
|
||||
@@ -33,7 +35,7 @@ export default function DispatchModal(props: {
|
||||
},
|
||||
})
|
||||
|
||||
const taskStatusSrc = record?.label_status ?? 0
|
||||
const taskStatusSrc = dispatchData?.status ?? 0
|
||||
const dstOptions =
|
||||
dispatchOpts[taskStatusSrc]?.opts?.map((o) => ({
|
||||
label: o.label,
|
||||
@@ -53,7 +55,9 @@ export default function DispatchModal(props: {
|
||||
typeof operation_uid === "number"
|
||||
? operation_uid
|
||||
: Number(operation_uid ?? 0)
|
||||
if (!record?.id || !opUid) {
|
||||
console.log(dispatchData, operation_uid)
|
||||
|
||||
if (!values?.uid_dst || !opUid) {
|
||||
notifications.show({
|
||||
color: "red",
|
||||
title: "操作失败",
|
||||
@@ -85,10 +89,10 @@ export default function DispatchModal(props: {
|
||||
await taskDispatch({
|
||||
operation_uid: opUid,
|
||||
reject: values.reject,
|
||||
task_ids: [record.id],
|
||||
task_ids: task_ids.map((item) => item.id),
|
||||
task_status_src: taskStatusSrc,
|
||||
task_status_dst: taskStatusDst,
|
||||
uid_src: record.current_uid ?? null,
|
||||
uid_src: dispatchData?.uid ?? null,
|
||||
uid_dst: uidDst,
|
||||
})
|
||||
notifications.show({
|
||||
@@ -107,7 +111,11 @@ export default function DispatchModal(props: {
|
||||
})}>
|
||||
<Stack gap="sm">
|
||||
<Text size="sm" c="dimmed">
|
||||
当前任务:{record?.id ?? "-"}(源状态:{taskStatusSrc})
|
||||
当前任务:
|
||||
{task_ids.map((item) => item.project_name).join("、") ?? "-"}
|
||||
</Text>
|
||||
<Text size="sm" c="dimmed">
|
||||
(源状态:{taskStatusSrc})
|
||||
</Text>
|
||||
|
||||
<Select
|
||||
|
||||
Reference in New Issue
Block a user