Compare commits
No commits in common. '5c6c3df4d0e0d7fd1606de68e15c45b371c21d95' and 'acdcc670de14dd247fe82eb53c74c59cfb3a0d82' have entirely different histories.
5c6c3df4d0
...
acdcc670de
@ -1,25 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 获取角色快报配置
|
||||
export const getRoleDaliyReport = async (roleId) => { |
||||
return await request.get({ |
||||
url: '/admin-api/system/role-message-setting/get', |
||||
params: { roleId } |
||||
}) |
||||
} |
||||
|
||||
// 保存角色每日快报配置
|
||||
export const updateRoleDaliyReport = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/system/role-message-setting/save', |
||||
data, |
||||
isSubmitForm: true |
||||
}) |
||||
} |
||||
|
||||
// 获取每日快报发送内容
|
||||
export const getDaliyReportContent = async () => { |
||||
return await request.get({ |
||||
url: '/admin-api/system/message-item/list-all-simple' |
||||
}) |
||||
} |
@ -1,133 +0,0 @@ |
||||
<template> |
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" width="800px"> |
||||
<el-form ref="formRef" :model="formData" label-width="130px"> |
||||
<el-form-item label="每日跟进指标数"> |
||||
<el-input-number v-model="formData.targetNum" :controls="false" style="width: 150px" /> |
||||
</el-form-item> |
||||
<el-form-item label="跟进指标生效日期"> |
||||
<el-date-picker |
||||
v-model="formData.startDate" |
||||
type="date" |
||||
placeholder="选择日期时间" |
||||
format="YYYY-MM-DD" |
||||
value-format="YYYY-MM-DD" |
||||
style="width: 150px" |
||||
/> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-divider direction="horizontal" content-position="left">成交额指标</el-divider> |
||||
<el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button> |
||||
<el-table :data="formData.deptSignPriceTargetVOList" border> |
||||
<el-table-column label="年份" width="120"> |
||||
<template #default="{ row }"> |
||||
<el-date-picker |
||||
v-model="row.year" |
||||
type="year" |
||||
placeholder="选择年份" |
||||
size="small" |
||||
format="YYYY" |
||||
value-format="YYYY" |
||||
style="width: 100%" |
||||
/> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px"> |
||||
<template #default="{ row }"> |
||||
<el-input-number |
||||
v-model="row.monthTargetVOList[col - 1].targetPrice" |
||||
size="small" |
||||
:controls="false" |
||||
style="width: 100%" |
||||
/> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<template #footer> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</template> |
||||
|
||||
<script setup name="DialogTarget"> |
||||
import * as DeptApi from '@/api/system/dept' |
||||
|
||||
const message = useMessage() // 消息弹窗 |
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
const dialogTitle = ref('') // 弹窗的标题 |
||||
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
const formData = ref({ |
||||
remark: undefined |
||||
}) |
||||
|
||||
/** 打开弹窗 */ |
||||
const open = async (deptId) => { |
||||
dialogVisible.value = true |
||||
dialogTitle.value = '业绩指标' |
||||
resetForm() |
||||
// 修改时,设置数据 |
||||
if (deptId) { |
||||
formLoading.value = true |
||||
try { |
||||
formData.value = await DeptApi.getDeptTarget(deptId) |
||||
formData.value.deptId = deptId |
||||
if (formData.value?.deptSignPriceTargetVOList) { |
||||
formData.value.deptSignPriceTargetVOList.forEach((it) => { |
||||
it.year = it.year + '' |
||||
}) |
||||
} |
||||
} finally { |
||||
formLoading.value = false |
||||
} |
||||
} |
||||
} |
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
||||
/** 提交表单 */ |
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
||||
const formRef = ref() // 表单 Ref |
||||
const submitForm = async () => { |
||||
// 提交请求 |
||||
formLoading.value = true |
||||
try { |
||||
await DeptApi.updateDeptTarget(formData.value) |
||||
message.success('修改成功') |
||||
dialogVisible.value = false |
||||
// 发送操作成功的事件 |
||||
emit('success') |
||||
} finally { |
||||
formLoading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 重置表单 */ |
||||
const resetForm = () => { |
||||
formData.value = { |
||||
targetNum: undefined, |
||||
startDate: undefined, |
||||
deptSignPriceTargetVOList: [] |
||||
} |
||||
formRef.value?.resetFields() |
||||
} |
||||
|
||||
function handleAddPrice() { |
||||
const obj = { |
||||
year: undefined, |
||||
monthTargetVOList: [] |
||||
} |
||||
for (let i = 1; i <= 12; i++) { |
||||
obj.monthTargetVOList.push({ |
||||
month: i, |
||||
targetPrice: undefined |
||||
}) |
||||
} |
||||
if (!formData.value.deptSignPriceTargetVOList) { |
||||
formData.value.deptSignPriceTargetVOList = [] |
||||
} |
||||
formData.value.deptSignPriceTargetVOList.push(obj) |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,192 +1,7 @@ |
||||
<template> |
||||
<!-- 搜索工作栏 --> |
||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="0"> |
||||
<el-form-item> |
||||
<el-select |
||||
v-model="queryParams.messageType" |
||||
placeholder="消息类型" |
||||
clearable |
||||
filterable |
||||
@change="handleQuery" |
||||
> |
||||
<el-option |
||||
v-for="item in typeOptions" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select |
||||
v-model="queryParams.readStatus" |
||||
placeholder="状态" |
||||
clearable |
||||
filterable |
||||
@change="handleQuery" |
||||
> |
||||
<el-option label="已读" :value="true" /> |
||||
<el-option label="未读" :value="false" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button :disabled="selectedIds.length == 0" @click="handleUpdateList"> |
||||
标记已读 |
||||
</el-button> |
||||
<el-button @click="handleUpdateAll"> 全部已读 </el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-text class="mb-10px" type="danger">tips: 双击展示消息详情</el-text> |
||||
|
||||
<!-- 列表 --> |
||||
<el-table |
||||
ref="tableRef" |
||||
v-loading="loading" |
||||
:data="list" |
||||
row-key="id" |
||||
@selection-change="handleSelectionChange" |
||||
@row-dblclick="handleDetail" |
||||
> |
||||
<el-table-column type="selection" :selectable="selectable" reserve-selection width="60px" /> |
||||
<el-table-column label="类型" align="left" prop="messageType" width="200px" /> |
||||
<el-table-column label="标题" align="left" prop="title" /> |
||||
<el-table-column |
||||
label="时间" |
||||
align="left" |
||||
prop="createTime" |
||||
width="180" |
||||
:formatter="dateFormatter" |
||||
/> |
||||
<el-table-column label="状态" align="left" width="100px"> |
||||
<template #default="{ row }"> |
||||
<el-tag :type="row.readStatus ? 'success' : 'info'"> |
||||
{{ row.readStatus ? '已读' : '未读' }} |
||||
</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<!-- 分页 --> |
||||
<Pagination |
||||
:total="total" |
||||
v-model:page="queryParams.pageNo" |
||||
v-model:limit="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
<div> 站内信 </div> |
||||
</template> |
||||
<script lang="ts" setup name="NotifyMessage"> |
||||
import { dateFormatter } from '@/utils/formatTime' |
||||
import * as NotifyMessageApi from '@/api/system/notify/message' |
||||
import { useUserStore } from '@/store/modules/user' |
||||
import { getGeneralSysDictData } from '@/api/system/dict/dict.data' |
||||
|
||||
const router = useRouter() |
||||
|
||||
const userStore = useUserStore() |
||||
const message = useMessage() // 消息 |
||||
|
||||
const loading = ref(true) // 列表的加载中 |
||||
const total = ref(0) // 列表的总页数 |
||||
const list = ref<any[]>([]) // 列表的数据 |
||||
const queryParams = reactive({ |
||||
pageNo: 1, |
||||
pageSize: 20, |
||||
messageType: undefined, |
||||
readStatus: undefined |
||||
}) |
||||
const queryFormRef = ref() // 搜索的表单 |
||||
|
||||
/** 查询列表 */ |
||||
const getList = async () => { |
||||
loading.value = true |
||||
try { |
||||
const data = await NotifyMessageApi.getNotifyMessagePage(queryParams) |
||||
list.value = data.list |
||||
total.value = data.total |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 某一行,是否允许选中 */ |
||||
const selectable = (row: any) => { |
||||
return !row.readStatus |
||||
} |
||||
|
||||
/** 搜索按钮操作 */ |
||||
const handleQuery = () => { |
||||
queryParams.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
function handleDetail(row: any) { |
||||
if (!row.readStatus) { |
||||
handleReadOne(row.id) |
||||
} |
||||
|
||||
const url = router.resolve({ |
||||
path: '/nm-detail', |
||||
query: { id: row.id } |
||||
}) |
||||
window.open(url.href, '_blank') |
||||
} |
||||
|
||||
const tableRef = ref() // 表格的 Ref |
||||
const selectedIds = ref<number[]>([]) // 表格的选中 ID 数组 |
||||
|
||||
/** 标记全部站内信已读 **/ |
||||
const handleUpdateAll = async () => { |
||||
await NotifyMessageApi.updateAllNotifyMessageRead({ |
||||
roleId: userStore.getUser?.currentRole |
||||
}) |
||||
message.success('全部已读成功!') |
||||
tableRef.value.clearSelection() |
||||
await getList() |
||||
} |
||||
|
||||
/** 标记一些站内信已读 **/ |
||||
const handleUpdateList = async () => { |
||||
if (selectedIds.value.length === 0) { |
||||
return |
||||
} |
||||
await NotifyMessageApi.updateNotifyMessageRead({ |
||||
ids: selectedIds.value, |
||||
roleId: userStore.getUser?.currentRole |
||||
}) |
||||
message.success('批量已读成功!') |
||||
tableRef.value.clearSelection() |
||||
await getList() |
||||
} |
||||
|
||||
/** 标记一条站内信已读 */ |
||||
const handleReadOne = async (id: number) => { |
||||
await NotifyMessageApi.updateNotifyMessageRead({ |
||||
ids: [id], |
||||
roleId: userStore.getUser?.currentRole |
||||
}) |
||||
await getList() |
||||
} |
||||
|
||||
/** 当表格选择项发生变化时会触发该事件 */ |
||||
const handleSelectionChange = (array: NotifyMessageApi.NotifyMessageVO[]) => { |
||||
selectedIds.value = [] |
||||
if (!array) { |
||||
return |
||||
} |
||||
array.forEach((row) => selectedIds.value.push(row.id)) |
||||
} |
||||
|
||||
const typeOptions = ref<any[]>([]) |
||||
|
||||
function getOptions() { |
||||
getGeneralSysDictData('message_type').then((data) => { |
||||
typeOptions.value = data |
||||
}) |
||||
} |
||||
<script setup name="NotifyMessage"></script> |
||||
|
||||
/** 初始化 **/ |
||||
onMounted(() => { |
||||
getOptions() |
||||
getList() |
||||
}) |
||||
</script> |
||||
<style lang="scss" scoped></style> |
||||
|
@ -1,65 +0,0 @@ |
||||
<template> |
||||
<div class="p-20px"> |
||||
<ContentWrap style="max-width: 1000px; margin: 0 auto"> |
||||
<div class="text-center"> |
||||
<div class="mb-10px" style="font-size: 24px; letter-spacing: 2px"> |
||||
{{ info.title }} |
||||
</div> |
||||
<el-text> |
||||
{{ formatDate(info.createTime, 'YYYY-MM-DD hh:mm:ss') }} |
||||
</el-text> |
||||
</div> |
||||
<el-divider direction="horizontal" /> |
||||
|
||||
<div v-dompurify-html="info.content"></div> |
||||
</ContentWrap> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="NMDetail"> |
||||
import { getNotifyMessageDetail } from '@/api/system/notify/message' |
||||
import { formatDate } from '@/utils/formatTime' |
||||
|
||||
const route = useRoute() |
||||
const info = ref({}) |
||||
|
||||
function init() { |
||||
getNotifyMessageDetail(route.query.id).then((data) => { |
||||
info.value = data |
||||
}) |
||||
} |
||||
|
||||
onMounted(() => { |
||||
init() |
||||
}) |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
:deep(p) { |
||||
font-size: 14px; |
||||
} |
||||
:deep(table) { |
||||
margin-top: 10px; |
||||
border-collapse: separate; |
||||
text-indent: initial; |
||||
border-spacing: 1px; |
||||
text-align: left; |
||||
border-width: 1px; |
||||
box-sizing: border-box; |
||||
} |
||||
:deep(th) { |
||||
font-size: 14px; |
||||
text-align: left; |
||||
border-width: 1px; |
||||
box-sizing: border-box; |
||||
} |
||||
:deep(td) { |
||||
font-size: 12px; |
||||
text-align: left; |
||||
border-width: 1px; |
||||
box-sizing: border-box; |
||||
} |
||||
:deep(.el-card__body) { |
||||
padding: 20px 10px; |
||||
} |
||||
</style> |
Loading…
Reference in new issue