2025-09-22 23:49:44 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-card>
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
<span>工作台</span> <span class="subHeaderTitle">- 系统通知</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<el-row :gutter="10" class="my_row">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" class="searchInputForm">
|
2025-09-26 19:34:36 +08:00
|
|
|
<el-form-item label="">
|
2025-09-26 22:22:21 +08:00
|
|
|
<el-input v-model="queryParams.noticeTitle" placeholder="请输入供应商/媒体名称" :prefix-icon="Search"
|
|
|
|
|
style="width: 400px;" />
|
2025-09-22 23:49:44 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12" style="text-align: right;">
|
|
|
|
|
<el-button type="primary" class="primaryBtn" @click="handleQuery">查询</el-button>
|
|
|
|
|
<el-button type="primary" class="primaryBtn" @click="resetQuery">重置</el-button>
|
|
|
|
|
<el-button type="primary" class="primaryBtn" @click="handleExport">导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
2025-09-26 19:34:36 +08:00
|
|
|
<el-table v-loading="loading" :data="noticeListData" height="calc(100vh - 306px)">
|
2025-09-22 23:49:44 +08:00
|
|
|
<el-table-column label="序号" align="center" width="80">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ scope.$index + 1 }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2025-09-26 19:34:36 +08:00
|
|
|
<el-table-column label="通知类型" align="center" prop="businessType" min-width="120">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span v-if="scope.row.businessType == 1">供应商</span>
|
|
|
|
|
<span v-if="scope.row.businessType == 2">媒体库</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="通知内容" align="left" prop="noticeTitle" min-width="300" />
|
|
|
|
|
<el-table-column label="通知时间" align="center" prop="createTime" min-width="210">
|
2025-09-22 23:49:44 +08:00
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" width="130" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template #default="scope">
|
2025-09-26 19:34:36 +08:00
|
|
|
<el-button link type="primary" @click="handleUpdate(scope.row)">去处理</el-button>
|
2025-09-22 23:49:44 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
2025-09-26 19:34:36 +08:00
|
|
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
|
|
|
|
@pagination="getNoticePageList" />
|
2025-09-22 23:49:44 +08:00
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name="Post">
|
|
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
|
|
import { Search } from '@element-plus/icons-vue'
|
2025-09-26 19:34:36 +08:00
|
|
|
import { noticeList, exportNotice } from "@/api/notice"
|
2025-09-26 22:22:21 +08:00
|
|
|
import { useRouter } from 'vue-router'
|
2025-09-22 23:49:44 +08:00
|
|
|
import { useBackgroundStore } from '@/store/modules/background'
|
|
|
|
|
import otherbg from '@/assets/images/otherbg.png'
|
|
|
|
|
const bgStore = useBackgroundStore()
|
|
|
|
|
|
2025-09-26 22:22:21 +08:00
|
|
|
const router = useRouter()
|
2025-09-22 23:49:44 +08:00
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
|
|
|
|
|
|
|
// 列表数据
|
2025-09-26 19:34:36 +08:00
|
|
|
const noticeListData = ref([])
|
2025-09-22 23:49:44 +08:00
|
|
|
const loading = ref(true)
|
|
|
|
|
const total = ref(0)
|
|
|
|
|
|
|
|
|
|
const data = reactive({
|
|
|
|
|
queryParams: {
|
2025-09-26 19:34:36 +08:00
|
|
|
pageNum: 1,
|
2025-09-22 23:49:44 +08:00
|
|
|
pageSize: 10,
|
2025-09-26 19:34:36 +08:00
|
|
|
noticeType: 1,
|
|
|
|
|
status: 0,
|
|
|
|
|
noticeTitle: undefined,
|
2025-09-22 23:49:44 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const { queryParams } = toRefs(data)
|
|
|
|
|
|
|
|
|
|
/** 查询通知列表 */
|
|
|
|
|
const getNoticePageList = () => {
|
|
|
|
|
loading.value = false
|
2025-09-26 19:34:36 +08:00
|
|
|
noticeList(queryParams.value).then(res => {
|
|
|
|
|
noticeListData.value = res.rows
|
|
|
|
|
total.value = res.total
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
2025-09-22 23:49:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
const handleQuery = () => {
|
2025-09-26 19:34:36 +08:00
|
|
|
queryParams.value.pageNum = 1
|
2025-09-22 23:49:44 +08:00
|
|
|
getNoticePageList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
function resetQuery() {
|
2025-09-26 19:34:36 +08:00
|
|
|
queryParams.value = {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
noticeType: 1,
|
|
|
|
|
status: 0,
|
|
|
|
|
noticeTitle: undefined,
|
|
|
|
|
}
|
2025-09-22 23:49:44 +08:00
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 去处理 */
|
|
|
|
|
const handleUpdate = (row) => {
|
2025-09-26 22:22:21 +08:00
|
|
|
if (row.businessType == 1) router.push('/supplier/formPage/' + row.businessId)
|
|
|
|
|
if (row.businessType == 2) router.push('/mediaLibrary/formPage/' + row.businessId)
|
2025-09-22 23:49:44 +08:00
|
|
|
}
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const handleExport = () => {
|
2025-09-26 19:34:36 +08:00
|
|
|
exportNotice(queryParams.value).then(res => {
|
|
|
|
|
// 通过a标签打开新页面下载文件
|
|
|
|
|
const a = document.createElement('a')
|
|
|
|
|
a.href = URL.createObjectURL(res)
|
|
|
|
|
// a标签里有download属性可以自定义文件名
|
|
|
|
|
const downLoadName = '通知信息导出_' + Date.now() + '.xlsx'
|
|
|
|
|
a.setAttribute('download', downLoadName)
|
|
|
|
|
document.body.appendChild(a)
|
|
|
|
|
a.click()
|
|
|
|
|
document.body.removeChild(a)
|
|
|
|
|
})
|
2025-09-22 23:49:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
bgStore.setBgImage(otherbg)
|
|
|
|
|
getNoticePageList()
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style lang='scss'>
|
|
|
|
|
.el-form-item__content {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
</style>
|