Merge branch 'main' of http://114.55.169.15:3000/qiushanhe/ss-oa-manage-web into dev-cl
This commit is contained in:
29
src/api/okr/comment.js
Normal file
29
src/api/okr/comment.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export const createComment = (data) => {
|
||||||
|
return request.post({
|
||||||
|
url: '/admin-api/okr/comments/create',
|
||||||
|
data,
|
||||||
|
isSubmitForm: true,
|
||||||
|
headers: { 'instance-id': 1016 }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
export const getCommentPage = (params) => {
|
||||||
|
return request.get({
|
||||||
|
url: '/admin-api/okr/comments/page',
|
||||||
|
params,
|
||||||
|
headers: { 'instance-id': 1016 }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取评论类型
|
||||||
|
export const getCommentTypeOptions = () => {
|
||||||
|
return request.get({
|
||||||
|
url: '/admin-api/okr/dict-data/get-by-type',
|
||||||
|
params: { dictType: 'comment_type' }
|
||||||
|
// headers: { 'instance-id': 1016 }
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -5,8 +5,8 @@ export const createOkrNode = (data) => {
|
|||||||
return request.post({
|
return request.post({
|
||||||
url: '/admin-api/okr/node/add',
|
url: '/admin-api/okr/node/add',
|
||||||
data,
|
data,
|
||||||
isSubmitForm: true,
|
isSubmitForm: true
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@ export const createOkrNode = (data) => {
|
|||||||
export const updateOkrNode = (data) => {
|
export const updateOkrNode = (data) => {
|
||||||
return request.put({
|
return request.put({
|
||||||
url: '/admin-api/okr/node/update',
|
url: '/admin-api/okr/node/update',
|
||||||
data,
|
data
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ export const updateOkrNode = (data) => {
|
|||||||
export const getOkrNodeDetail = (nodeId) => {
|
export const getOkrNodeDetail = (nodeId) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/node/get',
|
url: '/admin-api/okr/node/get',
|
||||||
params: { nodeId },
|
params: { nodeId }
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ export const getOkrNodeDetail = (nodeId) => {
|
|||||||
export const getMyNodeTree = (params) => {
|
export const getMyNodeTree = (params) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/node/my/list',
|
url: '/admin-api/okr/node/my/list',
|
||||||
params,
|
params
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,8 +41,8 @@ export const getMyNodeTree = (params) => {
|
|||||||
export const getMyOkrPage = (params) => {
|
export const getMyOkrPage = (params) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/node/my/object/list',
|
url: '/admin-api/okr/node/my/object/list',
|
||||||
params,
|
params
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ export const getMyOkrPage = (params) => {
|
|||||||
export const getAllNodeTree = (params) => {
|
export const getAllNodeTree = (params) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/node/all/list',
|
url: '/admin-api/okr/node/all/list',
|
||||||
params,
|
params
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,8 +59,8 @@ export const getAllNodeTree = (params) => {
|
|||||||
export const getAllOkrPage = (params) => {
|
export const getAllOkrPage = (params) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/node/all/object/list',
|
url: '/admin-api/okr/node/all/object/list',
|
||||||
params,
|
params
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,8 +68,8 @@ export const getAllOkrPage = (params) => {
|
|||||||
export const getOkrNodeHistory = (nodeId) => {
|
export const getOkrNodeHistory = (nodeId) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/record/list',
|
url: '/admin-api/okr/record/list',
|
||||||
params: { nodeId },
|
params: { nodeId }
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,16 @@ export const getOkrNodeHistory = (nodeId) => {
|
|||||||
export const getDefaultOkrOptions = () => {
|
export const getDefaultOkrOptions = () => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/dict-data/get-by-type',
|
url: '/admin-api/okr/dict-data/get-by-type',
|
||||||
params: { dictType: 'key_result_source' },
|
params: { dictType: 'key_result_source' }
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新OKR进度
|
||||||
|
export const updateOkrProgress = (data) => {
|
||||||
|
return request.put({
|
||||||
|
url: '/admin-api/okr/node/progress/update',
|
||||||
|
data
|
||||||
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ export const createWait = (data) => {
|
|||||||
return request.post({
|
return request.post({
|
||||||
url: '/admin-api/okr/agent-work/create',
|
url: '/admin-api/okr/agent-work/create',
|
||||||
data,
|
data,
|
||||||
isSubmitForm: true,
|
isSubmitForm: true
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@ export const createWait = (data) => {
|
|||||||
export const updateWait = (data) => {
|
export const updateWait = (data) => {
|
||||||
return request.put({
|
return request.put({
|
||||||
url: '/admin-api/okr/agent-work/update',
|
url: '/admin-api/okr/agent-work/update',
|
||||||
data,
|
data
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ export const updateWait = (data) => {
|
|||||||
export const getWaitPage = (params) => {
|
export const getWaitPage = (params) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/agent-work/page',
|
url: '/admin-api/okr/agent-work/page',
|
||||||
params,
|
params
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ export const getWaitPage = (params) => {
|
|||||||
export const getWaitDetail = (id) => {
|
export const getWaitDetail = (id) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/agent-work/get',
|
url: '/admin-api/okr/agent-work/get',
|
||||||
params: { id },
|
params: { id }
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,8 +41,8 @@ export const getWaitDetail = (id) => {
|
|||||||
export const deleteWait = (id) => {
|
export const deleteWait = (id) => {
|
||||||
return request.delete({
|
return request.delete({
|
||||||
url: '/admin-api/okr/agent-work/delete',
|
url: '/admin-api/okr/agent-work/delete',
|
||||||
params: { id },
|
params: { id }
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ export const deleteWait = (id) => {
|
|||||||
export const urgeWait = (workId) => {
|
export const urgeWait = (workId) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/agent-work/urge',
|
url: '/admin-api/okr/agent-work/urge',
|
||||||
params: { workId },
|
params: { workId }
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +60,8 @@ export const followWait = (data) => {
|
|||||||
return request.post({
|
return request.post({
|
||||||
url: '/admin-api/okr/agent-work-follow/create',
|
url: '/admin-api/okr/agent-work-follow/create',
|
||||||
data,
|
data,
|
||||||
isSubmitForm: true,
|
isSubmitForm: true
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,15 +69,15 @@ export const followWait = (data) => {
|
|||||||
export const getFollowWaitPage = (params) => {
|
export const getFollowWaitPage = (params) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/agent-work-follow/list',
|
url: '/admin-api/okr/agent-work-follow/list',
|
||||||
params,
|
params
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getWaitCount = (params) => {
|
export const getWaitCount = (params) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/admin-api/okr/agent-work/getAgentWorkNum',
|
url: '/admin-api/okr/agent-work/getAgentWorkNum',
|
||||||
params,
|
params
|
||||||
headers: { 'instance-id': 1016 }
|
// headers: { 'instance-id': 1016 }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
:default-expand-all="false"
|
:default-expand-all="false"
|
||||||
check-strictly
|
check-strictly
|
||||||
style="width: 400px"
|
style="width: 400px"
|
||||||
@change="getOkrList"
|
@change="nodeChange"
|
||||||
/>
|
/>
|
||||||
<el-button class="ml-10px" type="primary" @click="handleAddNode">新建节点</el-button>
|
<el-button class="ml-10px" type="primary" @click="handleAddNode">新建节点</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<OkrTable ref="okrTableRef" />
|
<OkrTable ref="okrTableRef" :canEdit="isCurrentLeafNode" />
|
||||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||||
<DialogOkrInfo ref="dialogOkrInfo" @success="handleSearchPeroid" />
|
<DialogOkrInfo ref="dialogOkrInfo" @success="handleSearchPeroid" />
|
||||||
</div>
|
</div>
|
||||||
@@ -35,7 +35,7 @@ import DialogOkrInfo from './DialogOkrInfo.vue'
|
|||||||
import DialogOkr from './DialogOkr.vue'
|
import DialogOkr from './DialogOkr.vue'
|
||||||
|
|
||||||
import { getAllNodeTree, getAllOkrPage } from '@/api/okr/okr'
|
import { getAllNodeTree, getAllOkrPage } from '@/api/okr/okr'
|
||||||
import { listToTree } from '@/utils/tree'
|
import { listToTree, findNode } from '@/utils/tree'
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
@@ -56,6 +56,10 @@ onMounted(() => {
|
|||||||
handleSearchPeroid()
|
handleSearchPeroid()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 当前是否是叶子节点
|
||||||
|
// 如果不是叶子节点,则表格数据不可修改
|
||||||
|
const isCurrentLeafNode = ref(false)
|
||||||
|
|
||||||
function handleSearchPeroid() {
|
function handleSearchPeroid() {
|
||||||
getAllNodeTree().then((resp) => {
|
getAllNodeTree().then((resp) => {
|
||||||
peroidList.value = listToTree(resp.tree, {
|
peroidList.value = listToTree(resp.tree, {
|
||||||
@@ -63,11 +67,23 @@ function handleSearchPeroid() {
|
|||||||
pid: 'parentId',
|
pid: 'parentId',
|
||||||
children: 'children'
|
children: 'children'
|
||||||
})
|
})
|
||||||
searchForm.value.nodeId = resp.nodeId
|
nodeChange(resp.nodeId)
|
||||||
getOkrList()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nodeChange(nodeId) {
|
||||||
|
searchForm.value.nodeId = nodeId
|
||||||
|
getOkrList()
|
||||||
|
const currentNode = findNode(peroidList.value, (node) => {
|
||||||
|
return node.nodeId == nodeId
|
||||||
|
})
|
||||||
|
if (!currentNode.children || currentNode.children.length == 0) {
|
||||||
|
isCurrentLeafNode.value = true
|
||||||
|
} else {
|
||||||
|
isCurrentLeafNode.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getOkrList() {
|
function getOkrList() {
|
||||||
getAllOkrPage(searchForm.value).then((resp) => {
|
getAllOkrPage(searchForm.value).then((resp) => {
|
||||||
const list = resp
|
const list = resp
|
||||||
@@ -88,13 +104,18 @@ function handleEditOkr() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleUpdateProcess() {
|
function handleUpdateProcess() {
|
||||||
message.success('更新进度成功')
|
okrTableRef.value.updateProcess(searchForm.value.nodeId).then(() => {
|
||||||
getOkrList()
|
message.success('更新成功')
|
||||||
|
getOkrList()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const dialogOkr = ref(null)
|
const dialogOkr = ref(null)
|
||||||
function handleShowOkr(id) {
|
function handleShowOkr(id) {
|
||||||
dialogOkr.value.open(id)
|
dialogOkr.value.open({
|
||||||
|
nodeId: id,
|
||||||
|
canEdit: isCurrentLeafNode.value
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<span class="text-14px ml-0.25">ork落地</span>
|
<span class="text-14px ml-0.25">ork落地</span>
|
||||||
<div class="ml-20px text-14px">
|
<div class="ml-20px text-14px">
|
||||||
<span>【节点】</span>
|
<span>【节点】</span>
|
||||||
<span>{{ nodeInfo.nodeName }}</span>
|
<span>{{ nodeInfo.allNodeName }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<el-tabs v-model="workIndex" style="flex: 1">
|
<el-tabs v-model="workIndex" style="flex: 1">
|
||||||
<el-tab-pane label="目标/关键成果" name="okr">
|
<el-tab-pane label="目标/关键成果" name="okr">
|
||||||
<div class="content-wrap">
|
<div class="content-wrap">
|
||||||
<OkrTable ref="okrTableRef" />
|
<OkrTable ref="okrTableRef" :canEdit="canEdit" />
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -134,11 +134,12 @@
|
|||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
@change="getCommentTemplate"
|
@change="getCommentTemplate"
|
||||||
>
|
>
|
||||||
<el-option label="总结" :value="1" />
|
<el-option
|
||||||
<el-option label="日报" :value="2" />
|
v-for="it in commentTypeOptions"
|
||||||
<el-option label="周报" :value="3" />
|
:label="it.label"
|
||||||
<el-option label="月报" :value="4" />
|
:value="it.id"
|
||||||
<!-- <el-option label="评论" :value="5" disabled /> -->
|
:key="it.id"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<div v-if="addNewComment">
|
<div v-if="addNewComment">
|
||||||
@@ -158,7 +159,12 @@
|
|||||||
:toolbarConfig="toolbarConfig"
|
:toolbarConfig="toolbarConfig"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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
|
<div
|
||||||
class="flex items-center justify-between overflow-hidden text-16px"
|
class="flex items-center justify-between overflow-hidden text-16px"
|
||||||
style="line-height: 30px"
|
style="line-height: 30px"
|
||||||
@@ -173,13 +179,13 @@
|
|||||||
"
|
"
|
||||||
fit="fill"
|
fit="fill"
|
||||||
>
|
>
|
||||||
<span class="text-12px">门庆</span>
|
<span class="text-12px">{{ it.creatorName }}</span>
|
||||||
</el-avatar>
|
</el-avatar>
|
||||||
<div class="ml-10px text-16px">西门庆</div>
|
<div class="ml-10px text-16px">{{ it.creatorName }}</div>
|
||||||
</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>
|
||||||
<div class="ml-10px" v-dompurify-html="commentListVal"></div>
|
<div class="ml-10px" v-dompurify-html="it.content"></div>
|
||||||
<div
|
<div
|
||||||
class="ml-10px mt-10px flex items-center text-12px"
|
class="ml-10px mt-10px flex items-center text-12px"
|
||||||
style="line-height: 20px; color: #aaa"
|
style="line-height: 20px; color: #aaa"
|
||||||
@@ -188,13 +194,13 @@
|
|||||||
<el-button link @click="good(index)">
|
<el-button link @click="good(index)">
|
||||||
<Icon icon="fa:thumbs-o-up" :size="16" />
|
<Icon icon="fa:thumbs-o-up" :size="16" />
|
||||||
</el-button>
|
</el-button>
|
||||||
<span class="ml-5px">6</span>
|
<span class="ml-5px">{{ it.likeCount }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center mr-50px">
|
<div class="flex items-center mr-50px">
|
||||||
<el-button link @click="showComment(index)">
|
<el-button link @click="showComment(index)">
|
||||||
<Icon icon="ep:chat-dot-square" :size="16" />
|
<Icon icon="ep:chat-dot-square" :size="16" />
|
||||||
</el-button>
|
</el-button>
|
||||||
<span class="ml-5px">1</span>
|
<span class="ml-5px">{{ it.commentCount }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 评论 -->
|
<!-- 评论 -->
|
||||||
@@ -248,7 +254,7 @@
|
|||||||
v-for="item in nodeRecords"
|
v-for="item in nodeRecords"
|
||||||
:key="item.recordId"
|
:key="item.recordId"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
:timestamp="formatDate(item.createTime)"
|
:timestamp="formatDate(item.createTime, 'YYYY-MM-DD HH:mm:ss')"
|
||||||
color="#30d1fc"
|
color="#30d1fc"
|
||||||
>
|
>
|
||||||
<div>{{ item.creator }}</div>
|
<div>{{ item.creator }}</div>
|
||||||
@@ -271,10 +277,12 @@ import { formatDate } from '@/utils/formatTime'
|
|||||||
import OkrTable from './OkrTable.vue'
|
import OkrTable from './OkrTable.vue'
|
||||||
|
|
||||||
import { getOkrNodeDetail, getOkrNodeHistory } from '@/api/okr/okr'
|
import { getOkrNodeDetail, getOkrNodeHistory } from '@/api/okr/okr'
|
||||||
|
import { getCommentTypeOptions, createComment, getCommentPage } from '@/api/okr/comment'
|
||||||
|
|
||||||
const emit = defineEmits(['edit'])
|
const emit = defineEmits(['edit'])
|
||||||
|
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
|
const canEdit = ref(false)
|
||||||
|
|
||||||
const toolbarConfig = {
|
const toolbarConfig = {
|
||||||
toolbarKeys: [
|
toolbarKeys: [
|
||||||
@@ -301,10 +309,19 @@ const okrTableRef = ref(null)
|
|||||||
const nodeInfo = ref({})
|
const nodeInfo = ref({})
|
||||||
|
|
||||||
const nodeRecords = 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 {
|
try {
|
||||||
getOkrNodeDetail(id).then((resp) => {
|
getOkrNodeDetail(curNode.nodeId).then((resp) => {
|
||||||
nodeInfo.value = resp
|
nodeInfo.value = resp
|
||||||
if (resp.objectives) {
|
if (resp.objectives) {
|
||||||
okrList.value = resp.objectives.map((item) => ({
|
okrList.value = resp.objectives.map((item) => ({
|
||||||
@@ -319,13 +336,15 @@ async function open(id) {
|
|||||||
okrTableRef.value.prepareData(okrList.value)
|
okrTableRef.value.prepareData(okrList.value)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
getOkrNodeHistory(id).then((resp) => {
|
getOkrNodeHistory(curNode.nodeId).then((resp) => {
|
||||||
nodeRecords.value = resp
|
nodeRecords.value = resp
|
||||||
})
|
})
|
||||||
|
getCommentTypeOptions().then((resp) => {
|
||||||
|
commentTypeOptions.value = resp
|
||||||
|
})
|
||||||
|
searchCommentList()
|
||||||
} finally {
|
} finally {
|
||||||
}
|
}
|
||||||
show.value = true
|
|
||||||
// 获取数据详情
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
@@ -335,7 +354,10 @@ function close() {
|
|||||||
defineExpose({ open, close })
|
defineExpose({ open, close })
|
||||||
|
|
||||||
function handleSaveProcess() {
|
function handleSaveProcess() {
|
||||||
console.log(okrList.value)
|
okrTableRef.value.updateProcess(nodeInfo.value.nodeId).then(() => {
|
||||||
|
message.success('更新成功')
|
||||||
|
searchInfo()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleChildItem() {
|
function handleChildItem() {
|
||||||
@@ -345,28 +367,60 @@ function handleChildItem() {
|
|||||||
const addNewComment = ref(false)
|
const addNewComment = ref(false)
|
||||||
const form = ref({
|
const form = ref({
|
||||||
commentValue: '',
|
commentValue: '',
|
||||||
commentType: 1
|
commentType: undefined
|
||||||
})
|
})
|
||||||
function handleInsertComment() {
|
function handleInsertComment() {
|
||||||
addNewComment.value = true
|
addNewComment.value = true
|
||||||
form.value = {
|
const defaultComment = commentTypeOptions.value[0]
|
||||||
commentValue: '',
|
if (defaultComment) {
|
||||||
commentType: 1
|
form.value = {
|
||||||
|
commentType: defaultComment.id,
|
||||||
|
mentionedUserIdList: []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getCommentTemplate()
|
getCommentTemplate()
|
||||||
}
|
}
|
||||||
|
|
||||||
function 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() {
|
function handleSaveComment() {
|
||||||
addNewComment.value = false
|
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(
|
function searchCommentList() {
|
||||||
`<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>`
|
getCommentPage({
|
||||||
)
|
businessType: 1,
|
||||||
|
businessId: nodeInfo.value.nodeId,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100
|
||||||
|
}).then((resp) => {
|
||||||
|
commentList.value = resp.list
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function good(index) {
|
function good(index) {
|
||||||
console.log(index)
|
console.log(index)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-if="show"
|
|
||||||
v-model="show"
|
v-model="show"
|
||||||
width="900px"
|
width="900px"
|
||||||
class="dialog-okr"
|
class="dialog-okr"
|
||||||
@@ -178,6 +177,7 @@
|
|||||||
allow-create
|
allow-create
|
||||||
:reserve-keyword="false"
|
:reserve-keyword="false"
|
||||||
class="flex-1 w-150px"
|
class="flex-1 w-150px"
|
||||||
|
@change="krChange(i, index)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="it in krOptions"
|
v-for="it in krOptions"
|
||||||
@@ -378,7 +378,6 @@ const defaultProps = {
|
|||||||
}
|
}
|
||||||
const sourceOptions = ref([])
|
const sourceOptions = ref([])
|
||||||
const objectList = ref([])
|
const objectList = ref([])
|
||||||
|
|
||||||
function open(type, val) {
|
function open(type, val) {
|
||||||
show.value = true
|
show.value = true
|
||||||
title.value = type == 'update' ? '修改Okr' : '新增Okr'
|
title.value = type == 'update' ? '修改Okr' : '新增Okr'
|
||||||
@@ -493,6 +492,18 @@ function getLastDayOfMonth(year, month) {
|
|||||||
return date.getDate()
|
return date.getDate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function krChange(idx, krIdx) {
|
||||||
|
const kr = objectList.value[idx].keyResults[krIdx]
|
||||||
|
if (kr.keyResultName) {
|
||||||
|
const obj = krOptions.value.find((item) => item.value == kr.keyResultName)
|
||||||
|
if (obj) {
|
||||||
|
kr.isSys = true
|
||||||
|
} else {
|
||||||
|
kr.isSys = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleSave() {
|
async function handleSave() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="flex items-center mt-10px ml-50px">
|
<div class="flex items-center mt-10px ml-50px">
|
||||||
<span>当前进度:</span>
|
<span>当前进度:</span>
|
||||||
<span v-if="row.isSys">{{ row.currentValue }}</span>
|
<span v-if="row.isSys || !props.canEdit">{{ row.currentValue }}</span>
|
||||||
<el-input
|
<el-input
|
||||||
v-else-if="row.resultType == 1"
|
v-else-if="row.resultType == 1"
|
||||||
v-model="row.currentValue"
|
v-model="row.currentValue"
|
||||||
@@ -41,8 +41,8 @@
|
|||||||
v-model="row.currentValue"
|
v-model="row.currentValue"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-radio :value="true">是</el-radio>
|
<el-radio :value="1">是</el-radio>
|
||||||
<el-radio :value="false">否</el-radio>
|
<el-radio :value="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -59,8 +59,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="OkrTable">
|
<script setup name="OkrTable">
|
||||||
|
import { updateOkrProgress } from '@/api/okr/okr'
|
||||||
|
|
||||||
const emit = defineEmits(['rowClick'])
|
const emit = defineEmits(['rowClick'])
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
canEdit: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const okrList = ref([])
|
const okrList = ref([])
|
||||||
const helpList = ref([])
|
const helpList = ref([])
|
||||||
|
|
||||||
@@ -80,12 +89,18 @@ function prepareData(list) {
|
|||||||
obj.children = item.keyResults.map((child) => {
|
obj.children = item.keyResults.map((child) => {
|
||||||
let kr = {
|
let kr = {
|
||||||
id: child.keyResultId,
|
id: child.keyResultId,
|
||||||
|
keyResultId: child.keyResultId,
|
||||||
|
objectiveId: child.objectiveId,
|
||||||
|
nodeId: child.nodeId,
|
||||||
|
isSys: child.isSys,
|
||||||
|
processId: child.id,
|
||||||
name: child.keyResultName,
|
name: child.keyResultName,
|
||||||
progress: child.progress,
|
progress: child.progress,
|
||||||
executorName: child.executorName,
|
executorName: child.executorName,
|
||||||
type: '关键成果',
|
type: '关键成果',
|
||||||
resultType: child.resultType,
|
resultType: child.resultType,
|
||||||
targetValue: child.targetValue
|
targetValue: child.targetValue,
|
||||||
|
currentValue: Number(child.currentValue)
|
||||||
}
|
}
|
||||||
helpList.value.push(kr)
|
helpList.value.push(kr)
|
||||||
return kr
|
return kr
|
||||||
@@ -96,9 +111,9 @@ function prepareData(list) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
prepareData
|
prepareData,
|
||||||
|
updateProcess
|
||||||
})
|
})
|
||||||
|
|
||||||
function getHeight(row, index) {
|
function getHeight(row, index) {
|
||||||
if (helpList.value.length - 1 == index || helpList.value[index + 1].type == '目标') {
|
if (helpList.value.length - 1 == index || helpList.value[index + 1].type == '目标') {
|
||||||
return '22px'
|
return '22px'
|
||||||
@@ -112,6 +127,25 @@ function handleExpand(row, expanded) {
|
|||||||
expandedRows.value[row.id] = !expanded
|
expandedRows.value[row.id] = !expanded
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateProcess(nodeId) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
let arr = []
|
||||||
|
okrList.value.map((item) => {
|
||||||
|
arr = [...arr, ...(item.children || []).map((it) => ({ ...it, id: it.processId }))]
|
||||||
|
})
|
||||||
|
updateOkrProgress({
|
||||||
|
nodeId,
|
||||||
|
keyResultProgressList: arr
|
||||||
|
}).then((resp) => {
|
||||||
|
resolve(resp)
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function handleRowClick(row) {
|
function handleRowClick(row) {
|
||||||
emit('rowClick', row)
|
emit('rowClick', row)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user