Compare commits

..

2 Commits

3 changed files with 18 additions and 8 deletions

View File

@ -133,7 +133,8 @@
<h4 :id="titleId" :class="titleClass">工单详情</h4> <h4 :id="titleId" :class="titleClass">工单详情</h4>
<el-button type="danger" @click="close">关闭</el-button> <el-button type="danger" @click="close">关闭</el-button>
</template> </template>
<component :is="currentComponent" :ticketId="ticketId" :modelId="modelId"></component> <component :is="currentComponent" :ticketId="ticketId" :t_id="t_id" @closed="drawer = false"
@success="()=>{drawer = false; $refs.table.refresh()}"></component>
</el-drawer> </el-drawer>
</el-container> </el-container>
</template> </template>
@ -179,7 +180,7 @@ export default {
wfOptions: [], wfOptions: [],
currentComponent: null, currentComponent: null,
ticketId: null, ticketId: null,
modelId: null, t_id: null,
}; };
}, },
mounted() { mounted() {
@ -220,7 +221,7 @@ export default {
handleShow(row) { handleShow(row) {
this.drawer = true; this.drawer = true;
this.ticketId = row.id; this.ticketId = row.id;
this.modelId = row.ticket_data.t_id; this.t_id = row.ticket_data.t_id;
const viewPath = row.workflow_.view_path; const viewPath = row.workflow_.view_path;
// import // import
this.currentComponent = markRaw( this.currentComponent = markRaw(

View File

@ -1,5 +1,5 @@
<template> <template>
<el-collapse v-model="activeNames"> <el-collapse v-model="activeNames" style="padding-left: 2px; padding-right: 2px;">
<el-collapse-item title="基本信息" name="1"> <el-collapse-item title="基本信息" name="1">
<el-descriptions :column="1"> <el-descriptions :column="1">
<el-descriptions-item> <el-descriptions-item>
@ -12,6 +12,10 @@
{{ actStateEnum[ticketDetail.act_state]?.text }} {{ actStateEnum[ticketDetail.act_state]?.text }}
</el-tag> </el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="可处理人:"
v-if="ticketDetail.participant_type == 2 || ticketDetail.participant_type == 1">
<span v-for="item in ticketDetail.participant_" :key="item.id">{{ item.name }}/</span>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-collapse-item> </el-collapse-item>
<el-collapse-item title="操作" name="2" v-if="actionShow"> <el-collapse-item title="操作" name="2" v-if="actionShow">
@ -85,12 +89,13 @@ const handleForm = ref({
suggestion: "" suggestion: ""
}) })
onMounted(() => { onMounted(() => {
console.log('props.ticketId', props.ticketId) console.log(props)
if (props.ticketId) { if (props.ticketId) {
getTicketDetail(); getTicketDetail();
getTicketLog(); getTicketLog();
} }
}); });
const emit = defineEmits(['success']);
const refreshTicket = async () => { const refreshTicket = async () => {
actionShow.value = false actionShow.value = false
isOwn.value = false isOwn.value = false
@ -100,6 +105,7 @@ const refreshTicket = async () => {
activeNames.value = ['1', '3'] // activeNames.value = ['1', '3'] //
getTicketDetail() getTicketDetail()
getTicketLog() getTicketLog()
emit('success')
} }
const getTicketDetail = () => { const getTicketDetail = () => {
@ -162,7 +168,7 @@ const handleTransition = (transitionId) => {
params.transition = transitionId; params.transition = transitionId;
if (props.ticket_data) { if (props.ticket_data) {
params.ticket_data = props.ticket_data; params.ticket_data = props.ticket_data;
}else{ } else {
params.ticket_data = {}; params.ticket_data = {};
} }
params.suggestion = handleForm.value.suggestion; params.suggestion = handleForm.value.suggestion;

View File

@ -27,9 +27,13 @@ const props = defineProps({
const workflow = ref(null); const workflow = ref(null);
const transitions = ref([]); const transitions = ref([]);
onMounted(async () => { onMounted(async () => {
init()
})
const init = async () => {
if (props.ticketId != null && props.ticketId != undefined) { if (props.ticketId != null && props.ticketId != undefined) {
API.wf.ticket.ticketTransitions.req(props.ticketId).then(res => { API.wf.ticket.ticketTransitions.req(props.ticketId).then(res => {
transitions.value = res; transitions.value = res;
console.log("res", res)
}); });
}else if (props.workflow_key !=null && props.workflow_key != undefined) { }else if (props.workflow_key !=null && props.workflow_key != undefined) {
let res = await API.wf.workflow.initkey.req(props.workflow_key); let res = await API.wf.workflow.initkey.req(props.workflow_key);
@ -38,8 +42,7 @@ onMounted(async () => {
}else{ }else{
ElMessage.error("缺少workflow_key或ticketId"); ElMessage.error("缺少workflow_key或ticketId");
} }
}
})
const isSaveing = ref(false); const isSaveing = ref(false);