|
|
|
@ -4,8 +4,8 @@ |
|
|
|
|
<div class="flex justify-between mb-4 bg-white" v-if="!isDetail"> |
|
|
|
|
<b class="text-20px">{{ form.meetingId ? '修改会议' : '新增会议' }}</b> |
|
|
|
|
<div> |
|
|
|
|
<el-button @click="submit()">保存至草稿</el-button> |
|
|
|
|
<el-button type="success" @click="submit()">保存</el-button> |
|
|
|
|
<el-button @click="submit(true)">保存至草稿</el-button> |
|
|
|
|
<el-button type="success" @click="submit(false)">保存</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- </el-affix> --> |
|
|
|
@ -108,7 +108,7 @@ |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24" :offset="0" v-if="!isAllActived"> |
|
|
|
|
<el-col :span="24" :offset="0" v-if="isDetail && !isAllActived"> |
|
|
|
|
<el-form-item label="缺席原因" prop="absentReason"> |
|
|
|
|
<el-input v-model="form.absentReason" placeholder="请输入缺席原因" /> |
|
|
|
|
</el-form-item> |
|
|
|
@ -116,22 +116,22 @@ |
|
|
|
|
</el-row> |
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24"> |
|
|
|
|
<el-tabs v-model="currentUserId" tab-position="top"> |
|
|
|
|
<el-tabs v-model="currentUserId" tab-position="top" @tab-click="userTabChange"> |
|
|
|
|
<el-tab-pane |
|
|
|
|
v-for="item in form.contentList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:name="item.id" |
|
|
|
|
@click="userTabChange(item)" |
|
|
|
|
v-for="item in form.meetingContentList" |
|
|
|
|
:key="item.userId" |
|
|
|
|
:label="item.userName" |
|
|
|
|
:name="item.userId + ''" |
|
|
|
|
/> |
|
|
|
|
</el-tabs> |
|
|
|
|
<el-tabs v-model="currentContentId" tab-position="left" addable @edit="handleTabsEdit"> |
|
|
|
|
<el-tab-pane |
|
|
|
|
v-for="(item, index) in form.contentList.find((it) => it.id == currentUserId) |
|
|
|
|
?.contentArr" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.title" |
|
|
|
|
:name="item.id" |
|
|
|
|
v-for="(item, index) in form.meetingContentList.find( |
|
|
|
|
(it) => it.userId == currentUserId |
|
|
|
|
)?.userMeetingContentList" |
|
|
|
|
:key="index" |
|
|
|
|
:label="'内容' + (index + 1)" |
|
|
|
|
:name="index" |
|
|
|
|
:closable="index > 0" |
|
|
|
|
> |
|
|
|
|
<div v-if="!!isDetail" v-dompurify-html="item.content" class="w-full"></div> |
|
|
|
@ -149,31 +149,31 @@ |
|
|
|
|
<div v-else> |
|
|
|
|
<el-tabs v-model="summaryIdx" addable @edit="meetingSummaryEdit"> |
|
|
|
|
<el-tab-pane |
|
|
|
|
v-for="(item, index) in form.meetingList" |
|
|
|
|
v-for="(item, index) in form.meetingSummaryList" |
|
|
|
|
:key="index" |
|
|
|
|
:label="`会议纪要${index || ''}`" |
|
|
|
|
:name="index" |
|
|
|
|
:closable="index > 0" |
|
|
|
|
> |
|
|
|
|
<Editor |
|
|
|
|
v-model="item.meetingSummary" |
|
|
|
|
v-model="item.summary" |
|
|
|
|
:toolbarConfig="toolbarConfig" |
|
|
|
|
height="300px" |
|
|
|
|
height="350px" |
|
|
|
|
placeholder="请输入会议纪要" |
|
|
|
|
style="width: 100%" |
|
|
|
|
/> |
|
|
|
|
<div class="mt-10px"> |
|
|
|
|
<el-form-item label="是否创建待办" label-width="auto"> |
|
|
|
|
<el-radio-group v-model="item.createWait"> |
|
|
|
|
<el-radio-group v-model="item.isCreateAgentWork"> |
|
|
|
|
<el-radio :label="true" :value="true"> 创建待办 </el-radio> |
|
|
|
|
<el-radio :label="false" :value="false"> 不创建待办 </el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="flex items-center" v-if="item.createWait"> |
|
|
|
|
<div class="flex items-center" v-if="item.isCreateAgentWork"> |
|
|
|
|
<el-select |
|
|
|
|
class="flex-1" |
|
|
|
|
v-model="item.userIdList" |
|
|
|
|
v-model="item.agentUserList" |
|
|
|
|
placeholder="选择执行人" |
|
|
|
|
clearable |
|
|
|
|
filterable |
|
|
|
@ -204,7 +204,21 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="mt-10px"> |
|
|
|
|
<el-form-item label="会议纪要发送至群聊:" label-width="auto"> |
|
|
|
|
<el-input v-model="form.groupName" placeholder="请输入群聊名称" /> |
|
|
|
|
<!-- <el-input v-model="form.wxId" placeholder="请输入群聊名称" /> --> |
|
|
|
|
<el-select |
|
|
|
|
filterable |
|
|
|
|
clearable |
|
|
|
|
v-model="form.wxId" |
|
|
|
|
placeholder="请输入群聊名称" |
|
|
|
|
style="width: 100%" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in groupOptions" |
|
|
|
|
:key="item.wxGroupId" |
|
|
|
|
:label="item.wxGroupName" |
|
|
|
|
:value="item.wxGroupId" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -246,7 +260,7 @@ const defaultProps = { |
|
|
|
|
|
|
|
|
|
const isDetail = route.query.isDetail |
|
|
|
|
const currentUserId = ref(undefined) |
|
|
|
|
const currentContentId = ref('') // 默认选中第一个标签页 |
|
|
|
|
const currentContentId = ref(0) // 默认选中第一个标签页 |
|
|
|
|
const summaryIdx = ref(0) // 会议纪要的索引 |
|
|
|
|
|
|
|
|
|
const toolbarConfig = { |
|
|
|
@ -254,25 +268,24 @@ const toolbarConfig = { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
getWxGroupOptions() |
|
|
|
|
await getOptions() |
|
|
|
|
if (route.params.id && route.params.id != 0) { |
|
|
|
|
// 这里可以调用API获取会议详情数据 |
|
|
|
|
getMeetingInfo(route.params.id) |
|
|
|
|
} else { |
|
|
|
|
form.value.contentList = [ |
|
|
|
|
form.value.meetingContentList = [ |
|
|
|
|
{ |
|
|
|
|
id: userStore.getUser.id + '', |
|
|
|
|
name: userStore.getUser.nickname, |
|
|
|
|
contentArr: [ |
|
|
|
|
userId: userStore.getUser.id + '', |
|
|
|
|
userName: userStore.getUser.nickname, |
|
|
|
|
userMeetingContentList: [ |
|
|
|
|
{ |
|
|
|
|
id: crypto.randomUUID(), |
|
|
|
|
title: '主要内容', |
|
|
|
|
content: '' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
currentContentId.value = form.value.contentList[0].contentArr[0].id |
|
|
|
|
currentContentId.value = 0 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -287,24 +300,12 @@ function getOptions() { |
|
|
|
|
}) |
|
|
|
|
userOptions.value = employeeResp.map((it) => ({ ...it, id: it.id + '' })) |
|
|
|
|
form.value.expectUsers = [userStore.getUser.id + ''] // 默认添加当前用户为预约参会人员 |
|
|
|
|
// form.value.actualUsers = [userStore.getUser.id + ''] |
|
|
|
|
currentUserId.value = userStore.getUser.id + '' // 默认选中当前用户 |
|
|
|
|
// handleUserChange() |
|
|
|
|
}) |
|
|
|
|
.catch((error) => { |
|
|
|
|
console.error('获取数据失败:', error) |
|
|
|
|
}) |
|
|
|
|
// // 获取OKR节点数据 |
|
|
|
|
// getAllNodeTree().then((resp) => { |
|
|
|
|
// peroidList.value = listToTree(resp?.tree || [], { |
|
|
|
|
// id: 'nodeId', |
|
|
|
|
// pid: 'parentId', |
|
|
|
|
// children: 'children' |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// // 获取人员数据 |
|
|
|
|
// getEmployeeSimpleList().then((data) => { |
|
|
|
|
// userOptions.value = data.map((it) => ({ ...it, id: it.id + '' })) |
|
|
|
|
// }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const form = ref({ |
|
|
|
@ -320,8 +321,8 @@ const form = ref({ |
|
|
|
|
meetingContent: '', |
|
|
|
|
meetingSummary: '', |
|
|
|
|
absentReason: '', |
|
|
|
|
contentList: [], |
|
|
|
|
meetingList: [] |
|
|
|
|
meetingContentList: [], |
|
|
|
|
meetingSummaryList: [] |
|
|
|
|
}) |
|
|
|
|
const rules = { |
|
|
|
|
meetingSubject: [{ required: true, message: '请输入会议主题', trigger: 'blur' }], |
|
|
|
@ -356,16 +357,22 @@ const getMeetingInfo = async (meetingId) => { |
|
|
|
|
expectEndTime: formatDate(resp.expectEndTime, 'YYYY-MM-DD HH:mm'), |
|
|
|
|
expectUsers: resp.expectUsers || [], |
|
|
|
|
actualUsers: resp.actualUsers || [], |
|
|
|
|
meetingList: resp.meetingList || [ |
|
|
|
|
meetingSummaryList: resp.meetingSummaryList.map((item) => ({ |
|
|
|
|
...item, |
|
|
|
|
isCreateAgentWork: !!item.isCreateAgentWork |
|
|
|
|
})) || [ |
|
|
|
|
{ |
|
|
|
|
meetingSummary: resp.meetingSummary || '', |
|
|
|
|
userIdList: [], |
|
|
|
|
summary: resp.meetingSummary || '', |
|
|
|
|
agentUserList: [], |
|
|
|
|
endDate: '', |
|
|
|
|
createWait: true |
|
|
|
|
isCreateAgentWork: true |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
handleUserChange(resp.expectUsers) |
|
|
|
|
currentContentId.value = 0 |
|
|
|
|
expectUserOptions.value = userOptions.value.filter((user) => |
|
|
|
|
form.value.expectUsers.some((it) => it == user.id) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
loading.value = false |
|
|
|
@ -373,61 +380,57 @@ const getMeetingInfo = async (meetingId) => { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function userTabChange(val) { |
|
|
|
|
currentContentId.value = val.contentArr[0].id |
|
|
|
|
const groupOptions = ref([]) |
|
|
|
|
|
|
|
|
|
function getWxGroupOptions() { |
|
|
|
|
MeetingApi.refreshWxGroupList().then(() => { |
|
|
|
|
MeetingApi.getWxGroupList() |
|
|
|
|
.then((resp) => { |
|
|
|
|
groupOptions.value = resp || [] |
|
|
|
|
}) |
|
|
|
|
.catch((error) => { |
|
|
|
|
console.error('获取微信群列表失败:', error) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function userTabChange() { |
|
|
|
|
currentContentId.value = 0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleTabsEdit(targetName, action) { |
|
|
|
|
if (action === 'add') { |
|
|
|
|
form.value.contentList.forEach((item) => { |
|
|
|
|
if (item.id === currentUserId.value) { |
|
|
|
|
item.contentArr.push({ |
|
|
|
|
id: crypto.randomUUID(), |
|
|
|
|
title: '次要内容', |
|
|
|
|
form.value.meetingContentList.forEach((item) => { |
|
|
|
|
if (item.userId == currentUserId.value) { |
|
|
|
|
item.userMeetingContentList.push({ |
|
|
|
|
content: '' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else if (action === 'remove') { |
|
|
|
|
form.value.contentList.forEach((item) => { |
|
|
|
|
if (item.id === currentUserId.value) { |
|
|
|
|
const idx = item.contentArr.findIndex((item) => item.id == targetName) |
|
|
|
|
item.contentArr.splice(idx, 1) |
|
|
|
|
form.value.meetingContentList.forEach((item) => { |
|
|
|
|
if (item.userId == currentUserId.value) { |
|
|
|
|
item.userMeetingContentList.splice(targetName, 1) |
|
|
|
|
// 如果删除的是当前选中的标签页,则切换到下一个标签页 |
|
|
|
|
if (currentContentId.value === targetName) { |
|
|
|
|
currentContentId.value = item.contentArr[idx - 1]?.id || item.contentArr[idx + 1]?.id |
|
|
|
|
if (currentContentId.value == targetName) { |
|
|
|
|
currentContentId.value = targetName - 1 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
const tabs = editableTabs.value |
|
|
|
|
let activeName = editableTabsValue.value |
|
|
|
|
if (activeName === targetName) { |
|
|
|
|
tabs.forEach((tab, index) => { |
|
|
|
|
if (tab.name === targetName) { |
|
|
|
|
const nextTab = tabs[index + 1] || tabs[index - 1] |
|
|
|
|
if (nextTab) { |
|
|
|
|
activeName = nextTab.name |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
editableTabsValue.value = activeName |
|
|
|
|
editableTabs.value = tabs.filter((tab) => tab.name !== targetName) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function meetingSummaryEdit(targetName, action) { |
|
|
|
|
if (action === 'add') { |
|
|
|
|
form.value.meetingList.push({ |
|
|
|
|
meetingSummary: '', |
|
|
|
|
userIdList: [], |
|
|
|
|
form.value.meetingSummaryList.push({ |
|
|
|
|
summary: '', |
|
|
|
|
agentUserList: [], |
|
|
|
|
endDate: '', |
|
|
|
|
createWait: true |
|
|
|
|
isCreateAgentWork: true |
|
|
|
|
}) |
|
|
|
|
} else if (action === 'remove') { |
|
|
|
|
form.value.meetingList.splice(targetName, 1) |
|
|
|
|
summaryIdx.value = 0 |
|
|
|
|
form.value.meetingSummaryList.splice(targetName, 1) |
|
|
|
|
summaryIdx.value = targetName - 1 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -440,19 +443,17 @@ function handleUserChange(val) { |
|
|
|
|
form.value.actualUsers = [...form.value.expectUsers] |
|
|
|
|
} |
|
|
|
|
// 先过滤掉不存在的参会人员 |
|
|
|
|
form.value.contentList = form.value.contentList.filter((item) => { |
|
|
|
|
return val.some((it) => it == item.id) |
|
|
|
|
form.value.meetingContentList = form.value.meetingContentList.filter((item) => { |
|
|
|
|
return val.some((it) => it == item.userId) |
|
|
|
|
}) |
|
|
|
|
// 再补充新增的 |
|
|
|
|
val.map((item) => { |
|
|
|
|
if (!form.value.contentList.some((it) => it.id == item)) { |
|
|
|
|
form.value.contentList.push({ |
|
|
|
|
id: item, |
|
|
|
|
name: userOptions.value.find((it) => it.id == item).name, |
|
|
|
|
contentArr: [ |
|
|
|
|
if (!form.value.meetingContentList.some((it) => it.userId == item)) { |
|
|
|
|
form.value.meetingContentList.push({ |
|
|
|
|
userId: item, |
|
|
|
|
userName: userOptions.value.find((it) => it.id == item).name, |
|
|
|
|
userMeetingContentList: [ |
|
|
|
|
{ |
|
|
|
|
id: crypto.randomUUID(), |
|
|
|
|
title: '主要内容', |
|
|
|
|
content: '' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
@ -462,16 +463,20 @@ function handleUserChange(val) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
|
async function submit() { |
|
|
|
|
async function submit(isDraft = false) { |
|
|
|
|
// 校验表单 |
|
|
|
|
if (!formRef.value) return |
|
|
|
|
const valid = await formRef.value.validate() |
|
|
|
|
if (!valid) return |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
form.value.isDraft = isDraft |
|
|
|
|
// 提交表单数据 |
|
|
|
|
if (form.value.meetingId) { |
|
|
|
|
if (form.value.status == 2 && !form.value.meetingSummary) { |
|
|
|
|
if ( |
|
|
|
|
form.value.status == 2 && |
|
|
|
|
form.value.meetingSummaryList.some((it) => it.summary.trim() == '') |
|
|
|
|
) { |
|
|
|
|
message.error('会议结束时,会议纪要不能为空') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
@ -479,10 +484,6 @@ async function submit() { |
|
|
|
|
await MeetingApi.updateMeeting(form.value) |
|
|
|
|
message.success('会议更新成功') |
|
|
|
|
} else { |
|
|
|
|
if (form.value.status == 1 && !form.value.meetingContent) { |
|
|
|
|
message.error('预约会议时,会议内容不能为空') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
form.value.actualUsers = [] |
|
|
|
|
// 新增会议 |
|
|
|
|
await MeetingApi.createMeeting(form.value) |
|
|
|
|