|
|
|
@ -14,8 +14,13 @@ |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-select v-model="searchForm.status" placeholder="选择完成状态" clearable filterable> |
|
|
|
|
<!-- <el-form-item> |
|
|
|
|
<el-select |
|
|
|
|
v-model="searchForm.completeStatus" |
|
|
|
|
placeholder="选择完成状态" |
|
|
|
|
clearable |
|
|
|
|
filterable |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in statusOptions" |
|
|
|
|
:key="item.value" |
|
|
|
@ -23,24 +28,16 @@ |
|
|
|
|
:value="item.value" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form-item> --> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="searchList"> 搜索</el-button> |
|
|
|
|
<el-button type="primary" @click="handleAdd"> 新增</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div> |
|
|
|
|
<Icon icon="ep:info-filled" /> |
|
|
|
|
<span>开发注意:</span> |
|
|
|
|
<div>列表排序 1 状态按照未完成在前、已关闭在后, 2优先级根据高中低排序 3截止日期正序</div> |
|
|
|
|
<div> |
|
|
|
|
表格全部操作按钮:创建人(修改、删除、催办->微信通知)、执行人(跟进);且与完成状态相关 |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-tabs v-model="tabIndex" @tab-click="searchList"> |
|
|
|
|
<el-tabs v-model="tabIndex" @tab-change="searchList"> |
|
|
|
|
<el-tab-pane :name="1"> |
|
|
|
|
<template #label> |
|
|
|
|
<el-badge :value="9" :max="99"> |
|
|
|
|
<el-badge :value="tabCount.dayEndAgentWorkNum" :max="99" :show-zero="false"> |
|
|
|
|
<el-tooltip content="截止日在今日及之前的未关闭事项" placement="top" effect="dark"> |
|
|
|
|
<Icon icon="ep:question-filled" /> |
|
|
|
|
</el-tooltip> |
|
|
|
@ -58,7 +55,7 @@ |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane :name="3"> |
|
|
|
|
<template #label> |
|
|
|
|
<el-badge :value="3" :max="99"> |
|
|
|
|
<el-badge :value="tabCount.urgeAgentWorkNum" :max="99" :show-zero="false"> |
|
|
|
|
<el-tooltip content="指派他人去办的事项" placement="top" effect="dark"> |
|
|
|
|
<Icon icon="ep:question-filled" /> |
|
|
|
|
</el-tooltip> |
|
|
|
@ -68,7 +65,7 @@ |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane :name="4"> |
|
|
|
|
<template #label> |
|
|
|
|
<el-badge :value="999" :max="99"> |
|
|
|
|
<el-badge :value="tabCount.notifyNum" :max="99" :show-zero="false"> |
|
|
|
|
<el-tooltip content="特指OKR中@我的消息" placement="top" effect="dark"> |
|
|
|
|
<Icon icon="ep:question-filled" /> |
|
|
|
|
</el-tooltip> |
|
|
|
@ -101,20 +98,22 @@ |
|
|
|
|
</el-tag> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="createUserName" label="创建人" /> |
|
|
|
|
<el-table-column prop="createDate" label="创建日期" /> |
|
|
|
|
<el-table-column prop="executorNames" label="执行人" /> |
|
|
|
|
<el-table-column prop="dueDate" label="截止日期" /> |
|
|
|
|
<el-table-column prop="creatorName" label="创建人" /> |
|
|
|
|
<el-table-column prop="createTime" label="创建日期" :formatter="dateFormatter" /> |
|
|
|
|
<el-table-column prop="userNameStr" label="执行人" /> |
|
|
|
|
<el-table-column prop="endDate" label="截止日期" :formatter="dateFormatter" /> |
|
|
|
|
<el-table-column label="状态"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<el-tag :type="statusFilter(row.status)">{{ statusNameFilter(row.status) }}</el-tag> |
|
|
|
|
<el-tag :type="statusFilter(row.completeStatus)">{{ |
|
|
|
|
statusNameFilter(row.completeStatus) |
|
|
|
|
}}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="completeDate" label="关闭日期" /> |
|
|
|
|
<el-table-column prop="completedDate" label="关闭日期" :formatter="dateFormatter" /> |
|
|
|
|
<el-table-column fixed="right" label="操作" width="140"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<el-button |
|
|
|
|
v-if="row.executorIds.includes(currentUserId) && row.status == 1" |
|
|
|
|
v-if="row.userIdList.includes(currentUserId) && row.completeStatus == 1" |
|
|
|
|
style="padding: 0; margin-right: 10px" |
|
|
|
|
type="primary" |
|
|
|
|
text |
|
|
|
@ -123,25 +122,25 @@ |
|
|
|
|
跟进 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="row.createUserId == currentUserId && row.status == 1" |
|
|
|
|
v-if="!row.userIdList.includes(currentUserId) && row.completeStatus == 1" |
|
|
|
|
style="padding: 0; margin-right: 10px; margin-left: 0" |
|
|
|
|
type="primary" |
|
|
|
|
text |
|
|
|
|
@click="handleEdit(row)" |
|
|
|
|
@click="handleNotice(row)" |
|
|
|
|
> |
|
|
|
|
修改 |
|
|
|
|
催办 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="!row.executorIds.includes(currentUserId) && row.status == 1" |
|
|
|
|
v-if="row.creator == currentUserId && row.completeStatus == 1" |
|
|
|
|
style="padding: 0; margin-right: 10px; margin-left: 0" |
|
|
|
|
type="primary" |
|
|
|
|
text |
|
|
|
|
@click="handleNotice(row)" |
|
|
|
|
@click="handleEdit(row)" |
|
|
|
|
> |
|
|
|
|
催办 |
|
|
|
|
修改 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="row.createUserId == currentUserId && row.status == 1" |
|
|
|
|
v-if="row.creator == currentUserId && row.completeStatus == 1" |
|
|
|
|
style="padding: 0; margin-right: 10px; margin-left: 0" |
|
|
|
|
type="danger" |
|
|
|
|
text |
|
|
|
@ -165,8 +164,11 @@ |
|
|
|
|
|
|
|
|
|
<script setup name="WaitTarget"> |
|
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
|
import DialogWait from './DialogWait.vue' |
|
|
|
|
|
|
|
|
|
import { getWaitPage, deleteWait, getWaitCount } from '@/api/okr/wait' |
|
|
|
|
|
|
|
|
|
const userStore = useUserStore() |
|
|
|
|
const currentUserId = userStore.getUser.id |
|
|
|
|
|
|
|
|
@ -174,7 +176,7 @@ const message = useMessage() |
|
|
|
|
|
|
|
|
|
const searchForm = ref({ |
|
|
|
|
title: undefined, |
|
|
|
|
status: undefined, |
|
|
|
|
completeStatus: undefined, |
|
|
|
|
priority: undefined, |
|
|
|
|
pageNo: 1, |
|
|
|
|
pageSize: 50 |
|
|
|
@ -186,25 +188,25 @@ const statusOptions = [ |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
const statusFilter = (status) => { |
|
|
|
|
return statusOptions.find((item) => item.value === status)?.tagType |
|
|
|
|
return statusOptions.find((item) => item.value == status)?.tagType |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const statusNameFilter = (status) => { |
|
|
|
|
return statusOptions.find((item) => item.value === status)?.label |
|
|
|
|
return statusOptions.find((item) => item.value == status)?.label |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const priorityOptions = [ |
|
|
|
|
{ label: '高', value: 1, tagType: 'danger' }, |
|
|
|
|
{ label: '中', value: 2, tagType: 'warning' }, |
|
|
|
|
{ label: '低', value: 3, tagType: 'info' } |
|
|
|
|
{ label: '高', value: '1', tagType: 'danger' }, |
|
|
|
|
{ label: '中', value: '2', tagType: 'warning' }, |
|
|
|
|
{ label: '低', value: '3', tagType: 'info' } |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
const priorityFilter = (priority) => { |
|
|
|
|
return priorityOptions.find((item) => item.value === priority)?.tagType |
|
|
|
|
return priorityOptions.find((item) => item.value == priority)?.tagType |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const priorityNameFilter = (priority) => { |
|
|
|
|
return priorityOptions.find((item) => item.value === priority)?.label |
|
|
|
|
return priorityOptions.find((item) => item.value == priority)?.label |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const tabIndex = ref(1) |
|
|
|
@ -218,6 +220,21 @@ function searchList() { |
|
|
|
|
getList() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const tabCount = ref({ |
|
|
|
|
dayEndAgentWorkNum: 0, |
|
|
|
|
myAgentWorkNum: 0, |
|
|
|
|
urgeAgentWorkNum: 0, |
|
|
|
|
notifyNum: 0 |
|
|
|
|
}) |
|
|
|
|
function getTabCount() { |
|
|
|
|
getWaitCount({ |
|
|
|
|
title: searchForm.value.title, |
|
|
|
|
priority: searchForm.value.priority |
|
|
|
|
}).then((res) => { |
|
|
|
|
tabCount.value = res |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const loading = ref(false) |
|
|
|
|
const tableList = ref([]) |
|
|
|
|
const mentionedList = ref([]) |
|
|
|
@ -225,97 +242,18 @@ const total = ref(0) |
|
|
|
|
function getList() { |
|
|
|
|
loading.value = true |
|
|
|
|
try { |
|
|
|
|
// 用settimeout模拟网络请求 |
|
|
|
|
setTimeout(() => { |
|
|
|
|
searchForm.value.queryType = tabIndex.value |
|
|
|
|
getWaitPage(searchForm.value).then((res) => { |
|
|
|
|
tableList.value = res.list |
|
|
|
|
total.value = res.total |
|
|
|
|
loading.value = false |
|
|
|
|
if (tabIndex.value == 4) { |
|
|
|
|
mentionedList.value = [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
content: '我是老六@张三', |
|
|
|
|
createUserName: '王二', |
|
|
|
|
createDate: '2025-03-07' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} else { |
|
|
|
|
const list = [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
title: '今日跟进数量达到100', |
|
|
|
|
description: '今日成交数量达到10', |
|
|
|
|
priority: 1, |
|
|
|
|
createUserId: 1, |
|
|
|
|
createUserName: '系统', |
|
|
|
|
createDate: '2025-03-07', |
|
|
|
|
executorIds: ['1818599239840960512'], |
|
|
|
|
executorNames: '张三', |
|
|
|
|
dueDate: '2025-03-07', |
|
|
|
|
status: 1, |
|
|
|
|
completeDate: '' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
title: '今日跟进数量达到100', |
|
|
|
|
description: '今日成交数量达到10', |
|
|
|
|
priority: 1, |
|
|
|
|
createUserId: '1818599239840960512', |
|
|
|
|
createUserName: '张三', |
|
|
|
|
createDate: '2025-03-07', |
|
|
|
|
executorIds: ['1818599239840960512', '123'], |
|
|
|
|
executorNames: '张三,李四', |
|
|
|
|
dueDate: '2025-02-07', |
|
|
|
|
status: 1, |
|
|
|
|
completeDate: '' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 3, |
|
|
|
|
title: '今日跟进数量达到100', |
|
|
|
|
description: '今日成交数量达到10', |
|
|
|
|
priority: 1, |
|
|
|
|
createUserId: '1818599239840960512', |
|
|
|
|
createUserName: '张三', |
|
|
|
|
createDate: '2025-03-07', |
|
|
|
|
executorIds: ['1818599239840960512'], |
|
|
|
|
executorNames: '张三', |
|
|
|
|
dueDate: '2025-03-17', |
|
|
|
|
status: 2, |
|
|
|
|
completeDate: '2025-03-07' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
title: '今日跟进数量达到100', |
|
|
|
|
description: '今日成交数量达到10', |
|
|
|
|
priority: 1, |
|
|
|
|
createUserId: '1818599239840960512', |
|
|
|
|
createUserName: '张三', |
|
|
|
|
createDate: '2025-03-07', |
|
|
|
|
executorIds: ['123'], |
|
|
|
|
executorNames: '李四', |
|
|
|
|
dueDate: '2025-02-07', |
|
|
|
|
status: 1, |
|
|
|
|
completeDate: '' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
tableList.value = list.filter((item) => { |
|
|
|
|
if (tabIndex.value == 1) { |
|
|
|
|
return item.status == 1 |
|
|
|
|
} else { |
|
|
|
|
return item |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
total.value = 1 |
|
|
|
|
}, 1000) |
|
|
|
|
// getWaitTargetList(searchForm.value).then((res) => { |
|
|
|
|
// tableList.value = res.data |
|
|
|
|
// total.value = res.total |
|
|
|
|
// loading.value = false |
|
|
|
|
// }) |
|
|
|
|
}) |
|
|
|
|
getTabCount() |
|
|
|
|
} catch (error) {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleDo(row) { |
|
|
|
|
waitDialogRef.value.open('do', row.id) |
|
|
|
|
waitDialogRef.value.open('do', row.workId) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const waitDialogRef = ref() |
|
|
|
@ -324,11 +262,16 @@ function handleAdd() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleEdit(row) { |
|
|
|
|
waitDialogRef.value.open('update', row.id) |
|
|
|
|
waitDialogRef.value.open('update', row.workId) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleDelete(row) { |
|
|
|
|
console.log(row) |
|
|
|
|
message.confirm('确定删除待办事项吗?').then(() => { |
|
|
|
|
deleteWait(row.workId).then(() => { |
|
|
|
|
message.success('删除成功') |
|
|
|
|
getList() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleNotice(row) { |
|
|
|
|