<template>
|
<!-- 清单详情 -->
|
<CloseButton v-show="show" @close="closeEdit">
|
<el-button
|
v-if="!isInternal"
|
class="push-btn"
|
:type="clueData.cuploaded ? 'success' : 'danger'"
|
@click="pushCheck"
|
:disabled="clueData.cuploaded"
|
>
|
<div class="flex-col">
|
<template v-if="clueData.cuploaded">
|
<el-icon><Check /></el-icon>
|
<div>已</div>
|
<div>推</div>
|
<div>送</div>
|
</template>
|
<template v-else>
|
<el-icon><Upload /></el-icon>
|
<div>推</div>
|
<div>送</div>
|
<div>反</div>
|
<div>馈</div>
|
</template>
|
</div>
|
</el-button>
|
<el-button
|
v-else-if="clueTask"
|
class="push-btn"
|
:type="clueTask.finished ? 'success' : 'danger'"
|
@click="finishTask"
|
:disabled="clueTask.finished"
|
>
|
<div class="flex-col">
|
<template v-if="clueTask.finished">
|
<el-icon><Check /></el-icon>
|
<div>任</div>
|
<div>务</div>
|
<div>完</div>
|
<div>成</div>
|
</template>
|
<template v-else>
|
<el-icon><Upload /></el-icon>
|
<div>结</div>
|
<div>束</div>
|
<div>任</div>
|
<div>务</div>
|
</template>
|
</div>
|
</el-button>
|
<el-button
|
class="task-btn"
|
:type="clueTask ? 'success' : 'danger'"
|
@click="publishTask"
|
>
|
<div class="flex-col">
|
<template v-if="clueTask">
|
<el-icon><Check /></el-icon>
|
<div>查</div>
|
<div>看</div>
|
<div>任</div>
|
<div>务</div>
|
</template>
|
<template v-else>
|
<el-icon><Upload /></el-icon>
|
<div>发</div>
|
<div>布</div>
|
<div>任</div>
|
<div>务</div>
|
</template>
|
</div>
|
</el-button>
|
<div class="fy-card">
|
<div class="fy-h1">线索反馈</div>
|
<el-scrollbar height="80vh" class="p-h-1">
|
<ClueReportClue :clue="clueData"></ClueReportClue>
|
<ClueReportConclusion
|
:clueId="clueData.cid"
|
></ClueReportConclusion>
|
<ClueReportQuestion :clueData="clueData"></ClueReportQuestion>
|
</el-scrollbar>
|
</div>
|
</CloseButton>
|
<ClueTaskEdit
|
v-model="clueTaskDialog"
|
:clue-task="clueTask"
|
:clue-data="clueData"
|
:create="isCreateMode"
|
@on-submit="handelClueTaskEdit"
|
></ClueTaskEdit>
|
</template>
|
|
<script>
|
import ClueReportClue from './components/ClueReportClue.vue';
|
import ClueReportConclusion from './components/ClueReportConclusion.vue';
|
import ClueReportQuestion from './components/ClueReportQuestion.vue';
|
import ClueTaskEdit from '@/views/overlay-clue/task/ClueTaskEdit.vue';
|
|
import { useMessageBoxTip } from '@/composables/messageBox';
|
import clueApi from '@/api/clue/clueApi';
|
import clueTaskApi from '@/api/clue/clueTaskApi';
|
|
export default {
|
inject: {
|
// 是否是内部线索相关操作
|
isInternal: {
|
default: false
|
}
|
},
|
components: {
|
ClueReportClue,
|
ClueReportConclusion,
|
ClueReportQuestion,
|
ClueTaskEdit
|
},
|
props: {
|
clueData: {
|
type: Object,
|
default: () => {
|
return {};
|
}
|
},
|
show: Boolean
|
},
|
emits: ['update:show', 'pushed', 'onClueTaskChange'],
|
data() {
|
return {
|
clueTask: undefined,
|
clueTaskDialog: false,
|
isCreateMode: true
|
};
|
},
|
watch: {
|
clueData(nV, oV) {
|
if (nV && nV != oV) {
|
this.getClueTask();
|
}
|
}
|
},
|
methods: {
|
closeEdit() {
|
this.$emit('update:show', false);
|
},
|
pushCheck() {
|
useMessageBoxTip({
|
confirmMsg: '线索推送后无法再修改结论与问题,确认推送?',
|
confirmTitle: '线索推送',
|
onConfirm: () => {
|
return this.pushClue();
|
}
|
});
|
},
|
pushClue() {
|
return clueApi.pushClue(this.clueData.cid).then((res) => {
|
this.finishTask();
|
this.$emit('pushed', res);
|
});
|
},
|
|
getClueTask() {
|
clueTaskApi
|
.fetchClueTask({
|
clueId: this.clueData.cid,
|
internalTask: this.isInternal
|
})
|
.then((res) => {
|
this.isCreateMode = res.data.length == 0;
|
if (res.data.length > 0) {
|
this.clueTask = res.data[0];
|
} else {
|
this.clueTask = undefined;
|
}
|
});
|
},
|
publishTask() {
|
this.clueTaskDialog = true;
|
},
|
handelClueTaskEdit() {
|
this.getClueTask();
|
this.$emit('onClueTaskChange');
|
},
|
finishTask() {
|
useMessageBoxTip({
|
confirmMsg: '是否结束线索任务?',
|
confirmTitle: '结束线索任务',
|
onConfirm: () => {
|
return clueTaskApi
|
.finishClueTask(this.clueTask.guid)
|
.then((res) => {
|
if (res.data == 1) {
|
this.clueTask.finished = true;
|
}
|
});
|
}
|
});
|
}
|
}
|
};
|
</script>
|
|
<style scoped>
|
.push-btn {
|
position: absolute;
|
z-index: 1;
|
top: 2rem;
|
left: -2.5rem;
|
width: 2.5rem;
|
height: initial;
|
margin: initial;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
/* background-color: white; */
|
/* border-color: white; */
|
/* border-top: 1px solid;
|
border-left: 1px solid;
|
border-bottom: 1px solid; */
|
border-top-right-radius: 0px;
|
border-bottom-right-radius: 0px;
|
/* box-shadow: var(--el-box-shadow-light); */
|
}
|
|
.task-btn {
|
position: absolute;
|
z-index: 1;
|
bottom: 2rem;
|
left: -2.5rem;
|
width: 2.5rem;
|
height: initial;
|
margin: initial;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
/* background-color: white; */
|
/* border-color: white; */
|
/* border-top: 1px solid;
|
border-left: 1px solid;
|
border-bottom: 1px solid; */
|
border-top-right-radius: 0px;
|
border-bottom-right-radius: 0px;
|
/* box-shadow: var(--el-box-shadow-light); */
|
}
|
</style>
|