Compare commits

...

2 Commits

2 changed files with 11 additions and 11 deletions

View File

@ -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) => {

View File

@ -4,7 +4,7 @@
</el-main>
<el-aside width="30%">
<ticketd :ticketId="props.ticketId"></ticketd>
<ticketd :ticket_full_data="props.ticket_full_data"></ticketd>
</el-aside>
</el-container>
</template>
@ -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(() => {