diff --git a/src/views/wf/ticketd.vue b/src/views/wf/ticketd.vue index 6f4b8a66..50645f50 100644 --- a/src/views/wf/ticketd.vue +++ b/src/views/wf/ticketd.vue @@ -74,8 +74,8 @@ import API from '@/api'; import TOOL from "@/utils/tool.js"; import { ElMessageBox } from 'element-plus' const props = defineProps({ - ticketId: { type: String, required: true, default: null }, ticket_data: { type: Object, default: null }, + ticket_full_data: { type: Object, default: null, required: true }, }); const currentUser = ref(TOOL.data.get("USER_INFO").id) const actionShow = ref(false); @@ -88,10 +88,10 @@ const ticketLog = ref([]); const handleForm = ref({ suggestion: "" }) +const ticketId = ref(null); onMounted(() => { - console.log(props) - if (props.ticketId) { - getTicketDetail(); + if (props.ticket_full_data) { + ticketId.value = props.ticket_full_data.id; getTicketLog(); } }); @@ -109,7 +109,7 @@ const refreshTicket = async () => { } const getTicketDetail = () => { - API.wf.ticket.ticketItem.req(props.ticketId).then(res => { + API.wf.ticket.ticketItem.req(ticketId.value).then(res => { ticketDetail.value = res; if (res.create_by === currentUser.value) { isOwn.value = true; @@ -130,13 +130,13 @@ const getTicketDetail = () => { }; const getTransitions = () => { - API.wf.ticket.ticketTransitions.req(props.ticketId).then(res => { + API.wf.ticket.ticketTransitions.req(ticketId.value).then(res => { transitions.value = res; }); } const getTicketLog = () => { - API.wf.ticket.ticketFlowlogs.req(props.ticketId).then(res => { + API.wf.ticket.ticketFlowlogs.req(ticketId.value).then(res => { ticketLog.value = res; }) } @@ -154,7 +154,7 @@ const handleRetreat = () => { type: "warning", }).then(() => { API.wf.ticket.ticketRetreat - .req(props.ticketId, handleForm.value) + .req(ticketId.value, handleForm.value) .then((res) => { refreshTicket(); }); @@ -173,7 +173,7 @@ const handleTransition = (transitionId) => { } params.suggestion = handleForm.value.suggestion; submitLoading.value = true; - API.wf.ticket.ticketHandle.req(props.ticketId, params).then((res) => { + API.wf.ticket.ticketHandle.req(ticketId.value, params).then((res) => { submitLoading.value = false; refreshTicket(); }).catch((e) => { diff --git a/src/views/wf/ticketd_default.vue b/src/views/wf/ticketd_default.vue index dd5600e4..b21cb448 100644 --- a/src/views/wf/ticketd_default.vue +++ b/src/views/wf/ticketd_default.vue @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ import { ref, defineProps, onMounted} from "vue"; import ticketd from './ticketd.vue' import API from '@/api' const props = defineProps({ - ticketId: { type: String, required: false, default: null } + ticket_full_data: { type: Object, required: false, default: null } }); onMounted(() => {