|
|
|
@ -18,7 +18,7 @@ |
|
|
|
|
<span class="text-14px ml-0.25">ork落地</span> |
|
|
|
|
<div class="ml-20px text-14px"> |
|
|
|
|
<span>【节点】</span> |
|
|
|
|
<span>{{ nodeInfo.nodeName }}</span> |
|
|
|
|
<span>{{ nodeInfo.allNodeName }}</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="flex items-center"> |
|
|
|
@ -68,7 +68,7 @@ |
|
|
|
|
<el-tabs v-model="workIndex" style="flex: 1"> |
|
|
|
|
<el-tab-pane label="目标/关键成果" name="okr"> |
|
|
|
|
<div class="content-wrap"> |
|
|
|
|
<OkrTable ref="okrTableRef" /> |
|
|
|
|
<OkrTable ref="okrTableRef" :canEdit="canEdit" /> |
|
|
|
|
</div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
@ -134,11 +134,12 @@ |
|
|
|
|
style="width: 120px" |
|
|
|
|
@change="getCommentTemplate" |
|
|
|
|
> |
|
|
|
|
<el-option label="总结" :value="1" /> |
|
|
|
|
<el-option label="日报" :value="2" /> |
|
|
|
|
<el-option label="周报" :value="3" /> |
|
|
|
|
<el-option label="月报" :value="4" /> |
|
|
|
|
<!-- <el-option label="评论" :value="5" disabled /> --> |
|
|
|
|
<el-option |
|
|
|
|
v-for="it in commentTypeOptions" |
|
|
|
|
:label="it.label" |
|
|
|
|
:value="it.id" |
|
|
|
|
:key="it.id" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
|
<div v-if="addNewComment"> |
|
|
|
@ -158,7 +159,12 @@ |
|
|
|
|
:toolbarConfig="toolbarConfig" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div v-for="index in 12" :key="index" class="border-b-1" style="padding: 10px 5px"> |
|
|
|
|
<div |
|
|
|
|
v-for="it in commentList" |
|
|
|
|
:key="it.commentId" |
|
|
|
|
class="border-b-1" |
|
|
|
|
style="padding: 10px 5px" |
|
|
|
|
> |
|
|
|
|
<div |
|
|
|
|
class="flex items-center justify-between overflow-hidden text-16px" |
|
|
|
|
style="line-height: 30px" |
|
|
|
@ -173,13 +179,13 @@ |
|
|
|
|
" |
|
|
|
|
fit="fill" |
|
|
|
|
> |
|
|
|
|
<span class="text-12px">门庆</span> |
|
|
|
|
<span class="text-12px">{{ it.creatorName }}</span> |
|
|
|
|
</el-avatar> |
|
|
|
|
<div class="ml-10px text-16px">西门庆</div> |
|
|
|
|
<div class="ml-10px text-16px">{{ it.creatorName }}</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="ml-10px text-13px text-gray-400">01-01 12:15</div> |
|
|
|
|
<div class="ml-10px text-13px text-gray-400">{{ it.createTime }}</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="ml-10px" v-dompurify-html="commentListVal"></div> |
|
|
|
|
<div class="ml-10px" v-dompurify-html="it.content"></div> |
|
|
|
|
<div |
|
|
|
|
class="ml-10px mt-10px flex items-center text-12px" |
|
|
|
|
style="line-height: 20px; color: #aaa" |
|
|
|
@ -188,13 +194,13 @@ |
|
|
|
|
<el-button link @click="good(index)"> |
|
|
|
|
<Icon icon="fa:thumbs-o-up" :size="16" /> |
|
|
|
|
</el-button> |
|
|
|
|
<span class="ml-5px">6</span> |
|
|
|
|
<span class="ml-5px">{{ it.likeCount }}</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="flex items-center mr-50px"> |
|
|
|
|
<el-button link @click="showComment(index)"> |
|
|
|
|
<Icon icon="ep:chat-dot-square" :size="16" /> |
|
|
|
|
</el-button> |
|
|
|
|
<span class="ml-5px">1</span> |
|
|
|
|
<span class="ml-5px">{{ it.commentCount }}</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- 评论 --> |
|
|
|
@ -248,7 +254,7 @@ |
|
|
|
|
v-for="item in nodeRecords" |
|
|
|
|
:key="item.recordId" |
|
|
|
|
placement="bottom" |
|
|
|
|
:timestamp="formatDate(item.createTime)" |
|
|
|
|
:timestamp="formatDate(item.createTime, 'YYYY-MM-DD HH:mm:ss')" |
|
|
|
|
color="#30d1fc" |
|
|
|
|
> |
|
|
|
|
<div>{{ item.creator }}</div> |
|
|
|
@ -271,10 +277,12 @@ import { formatDate } from '@/utils/formatTime' |
|
|
|
|
import OkrTable from './OkrTable.vue' |
|
|
|
|
|
|
|
|
|
import { getOkrNodeDetail, getOkrNodeHistory } from '@/api/okr/okr' |
|
|
|
|
import { getCommentTypeOptions, createComment, getCommentPage } from '@/api/okr/comment' |
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['edit']) |
|
|
|
|
|
|
|
|
|
const show = ref(false) |
|
|
|
|
const canEdit = ref(false) |
|
|
|
|
|
|
|
|
|
const toolbarConfig = { |
|
|
|
|
toolbarKeys: [ |
|
|
|
@ -301,10 +309,19 @@ const okrTableRef = ref(null) |
|
|
|
|
const nodeInfo = ref({}) |
|
|
|
|
|
|
|
|
|
const nodeRecords = ref([]) |
|
|
|
|
const commentTypeOptions = ref([]) |
|
|
|
|
|
|
|
|
|
async function open(id) { |
|
|
|
|
async function open(curNode) { |
|
|
|
|
canEdit.value = curNode.canEdit |
|
|
|
|
nodeInfo.value.nodeId = curNode.nodeId |
|
|
|
|
// 获取数据详情 |
|
|
|
|
searchInfo(curNode) |
|
|
|
|
show.value = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function searchInfo(curNode) { |
|
|
|
|
try { |
|
|
|
|
getOkrNodeDetail(id).then((resp) => { |
|
|
|
|
getOkrNodeDetail(curNode.nodeId).then((resp) => { |
|
|
|
|
nodeInfo.value = resp |
|
|
|
|
if (resp.objectives) { |
|
|
|
|
okrList.value = resp.objectives.map((item) => ({ |
|
|
|
@ -319,13 +336,15 @@ async function open(id) { |
|
|
|
|
okrTableRef.value.prepareData(okrList.value) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
getOkrNodeHistory(id).then((resp) => { |
|
|
|
|
getOkrNodeHistory(curNode.nodeId).then((resp) => { |
|
|
|
|
nodeRecords.value = resp |
|
|
|
|
}) |
|
|
|
|
getCommentTypeOptions().then((resp) => { |
|
|
|
|
commentTypeOptions.value = resp |
|
|
|
|
}) |
|
|
|
|
searchCommentList() |
|
|
|
|
} finally { |
|
|
|
|
} |
|
|
|
|
show.value = true |
|
|
|
|
// 获取数据详情 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function close() { |
|
|
|
@ -335,7 +354,10 @@ function close() { |
|
|
|
|
defineExpose({ open, close }) |
|
|
|
|
|
|
|
|
|
function handleSaveProcess() { |
|
|
|
|
console.log(okrList.value) |
|
|
|
|
okrTableRef.value.updateProcess(nodeInfo.value.nodeId).then(() => { |
|
|
|
|
message.success('更新成功') |
|
|
|
|
searchInfo() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleChildItem() { |
|
|
|
@ -345,28 +367,60 @@ function handleChildItem() { |
|
|
|
|
const addNewComment = ref(false) |
|
|
|
|
const form = ref({ |
|
|
|
|
commentValue: '', |
|
|
|
|
commentType: 1 |
|
|
|
|
commentType: undefined |
|
|
|
|
}) |
|
|
|
|
function handleInsertComment() { |
|
|
|
|
addNewComment.value = true |
|
|
|
|
form.value = { |
|
|
|
|
commentValue: '', |
|
|
|
|
commentType: 1 |
|
|
|
|
const defaultComment = commentTypeOptions.value[0] |
|
|
|
|
if (defaultComment) { |
|
|
|
|
form.value = { |
|
|
|
|
commentType: defaultComment.id, |
|
|
|
|
mentionedUserIdList: [] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
getCommentTemplate() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getCommentTemplate() { |
|
|
|
|
form.value.commentValue = `<h2 style=\"text-align: start;\">一、工作概况</h2><p> </p><h2 style=\"text-align: start;\">二、数据统计</h2><ol><li>呼出电话数:</li><li>有效沟通数:</li><li>销售成果</li></ol><h2 style=\"text-align: start;\">三、问题与改进方案</h2><p><br></p>` |
|
|
|
|
if (form.value.commentType) { |
|
|
|
|
form.value.commentValue = commentTypeOptions.value.find( |
|
|
|
|
(item) => item.id == form.value.commentType |
|
|
|
|
).remark |
|
|
|
|
} else { |
|
|
|
|
form.value.commentValue = `<h2 style=\"text-align: start;\">一、工作概况</h2><p> </p><h2 style=\"text-align: start;\">二、数据统计</h2><ol><li>呼出电话数:</li><li>有效沟通数:</li><li>销售成果</li></ol><h2 style=\"text-align: start;\">三、问题与改进方案</h2><p><br></p>` |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleSaveComment() { |
|
|
|
|
addNewComment.value = false |
|
|
|
|
try { |
|
|
|
|
const data = { |
|
|
|
|
businessType: 1, |
|
|
|
|
businessId: nodeInfo.value.nodeId, |
|
|
|
|
contentType: 1, |
|
|
|
|
content: form.value.commentValue, |
|
|
|
|
mentionedUserIdList: form.value.mentionedUserIdList |
|
|
|
|
} |
|
|
|
|
createComment(data).then(() => { |
|
|
|
|
message.success('评论成功') |
|
|
|
|
searchCommentList() |
|
|
|
|
}) |
|
|
|
|
} catch (error) { |
|
|
|
|
message.error('评论失败') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
const commentList = ref([]) |
|
|
|
|
|
|
|
|
|
const commentListVal = ref( |
|
|
|
|
`<h2 style=\"text-align: start;\">一、工作概况</h2><p> 刷牙洗脸吃饭穿鞋出门开车上班捣台球 </p><h2 style=\"text-align: start;\">二、数据统计</h2><ol><li>呼出电话数:666</li><li>有效沟通数:123</li><li>销售成果:今日成交20,本月成交120,距离目标还差888</li></ol><h2 style=\"text-align: start;\">三、问题与改进方案</h2><p>无<br></p>` |
|
|
|
|
) |
|
|
|
|
function searchCommentList() { |
|
|
|
|
getCommentPage({ |
|
|
|
|
businessType: 1, |
|
|
|
|
businessId: nodeInfo.value.nodeId, |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 100 |
|
|
|
|
}).then((resp) => { |
|
|
|
|
commentList.value = resp.list |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function good(index) { |
|
|
|
|
console.log(index) |
|
|
|
|