|
@@ -49,165 +49,121 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
-
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="queryList" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
<el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div class="mb20">
|
|
|
- <el-button type="primary" @click="onNoticeAdd('0')" v-if="listType === '0'" v-auth="'auxiliary:notice:add'" title="新增通知">
|
|
|
- <SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
- </el-button>
|
|
|
- <el-button type="primary" @click="onNoticeAdd('1')" v-else v-auth="'auxiliary:bulletin:add'" title="新增公告">
|
|
|
- <SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <!-- 表格 -->
|
|
|
- <el-table :data="state.tableData" v-loading="state.loading" row-key="id" ref="multipleTableRef" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" />
|
|
|
- <!-- 通知 -->
|
|
|
- <template v-if="listType === '0'">
|
|
|
- <el-table-column prop="circularTypeName" label="通知类型" show-overflow-tooltip width="120"></el-table-column>
|
|
|
- <el-table-column prop="circularStateText" label="通知状态" show-overflow-tooltip width="120"></el-table-column>
|
|
|
- <el-table-column prop="title" label="通知标题" show-overflow-tooltip width="150"></el-table-column>
|
|
|
- <el-table-column prop="commonTypeText" label="必须阅读" show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- {{ row.isMustRead ? '是' : '否' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="已阅读数" show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- <el-popover placement="right" :width="450" trigger="click" popper-class="notice-container" v-if="[2].includes(row.circularState)">
|
|
|
- <template #reference>
|
|
|
- <el-button link type="primary">{{ row.readedNum + '/' + row.needReadNum }}</el-button>
|
|
|
- </template>
|
|
|
- <div class="notice-container-box">
|
|
|
- <div class="notice-container-box-inner">
|
|
|
- 已读:{{ row.readedNum }}
|
|
|
- <el-scrollbar class="mt5" v-if="row.circularReadGroups?.length">
|
|
|
- <el-tag v-for="item in row.circularReadGroups.filter((i) => i.isRead)"
|
|
|
- >{{ row.circularType === 1 ? item.userName : item.orgName }}
|
|
|
- <span v-if="item.isTimeOut" class="color-danger">(超时阅读)</span>
|
|
|
- </el-tag>
|
|
|
- </el-scrollbar>
|
|
|
- </div>
|
|
|
- <div class="notice-container-box-inner">
|
|
|
- 未读:{{ row.needReadNum - row.readedNum }}
|
|
|
- <el-scrollbar class="mt5 mb10" v-if="row.circularReadGroups?.length">
|
|
|
- <el-tag v-for="item in row.circularReadGroups.filter((i) => !i.isRead)">{{
|
|
|
- row.circularType === 1 ? item.userName : item.orgName
|
|
|
- }}</el-tag>
|
|
|
- </el-scrollbar>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="circularTypeText" label="通知对象" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="commonTypeText" label="通知时间" show-overflow-tooltip width="170">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="失效时间" show-overflow-tooltip width="170">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.lostEfficacyTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="sourceOrgName" label="来源单位" show-overflow-tooltip width="120"></el-table-column>
|
|
|
- <el-table-column prop="circularStateText" label="审核状态" show-overflow-tooltip width="120"></el-table-column>
|
|
|
+ <!-- 通知表格 -->
|
|
|
+ <ProTable
|
|
|
+ ref="proTableNoticeRef"
|
|
|
+ :columns="columnsNotice"
|
|
|
+ :data="state.tableData"
|
|
|
+ @updateTable="queryList"
|
|
|
+ :loading="state.loading"
|
|
|
+ :total="state.total"
|
|
|
+ v-model:page-index="state.queryParams.PageIndex"
|
|
|
+ v-model:page-size="state.queryParams.PageSize"
|
|
|
+ v-if="listType === '0'"
|
|
|
+ >
|
|
|
+ <!-- 表格 header 按钮 -->
|
|
|
+ <template #tableHeader="scope">
|
|
|
+ <el-button type="primary" @click="onNoticeAdd('0')" v-if="listType === '0'" v-auth="'auxiliary:notice:add'" title="新增通知">
|
|
|
+ <SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
- <!-- 公告 -->
|
|
|
- <template v-if="listType === '1'">
|
|
|
- <el-table-column prop="bulletinTypeName" label="公告类型" show-overflow-tooltip width="120"></el-table-column>
|
|
|
- <el-table-column prop="bulletinStateText" label="公告状态" show-overflow-toolti width="120"></el-table-column>
|
|
|
- <el-table-column prop="title" label="公告标题" show-overflow-tooltip width="150"></el-table-column>
|
|
|
- <el-table-column prop="readedNum" label="已阅次数" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="pushRangesText" label="公告范围" show-overflow-tooltip width="300"></el-table-column>
|
|
|
- <el-table-column prop="commonTypeText" label="通知时间" show-overflow-tooltip width="170">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="失效时间" show-overflow-tooltip width="170">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.loseEfficacyTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="creatorOrgName" label="来源单位" show-overflow-tooltip width="120"></el-table-column>
|
|
|
- <el-table-column prop="bulletinStateText" label="审核状态" show-overflow-tooltip width="120"></el-table-column>
|
|
|
+ <template #isProvince="{ row }">
|
|
|
+ <span>{{ row.isProvince ? '省工单' : '市工单' }}</span>
|
|
|
</template>
|
|
|
-
|
|
|
- <el-table-column prop="examinOpinion" label="审核理由" show-overflow-tooltip width="150"></el-table-column>
|
|
|
- <el-table-column prop="examinMan.name" label="审核人" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="examinOpinion" label="审核时间" show-overflow-tooltip width="170">
|
|
|
- <template #default="{ row }">
|
|
|
- <span>{{ formatDate(row.examinTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="200" fixed="right" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <template v-if="listType === '0'">
|
|
|
- <el-button link type="primary" @click="onEdit(row, '0')" v-if="[0, 3].includes(row.circularState)" v-auth="'auxiliary:bulletin:edit'">
|
|
|
- 编辑
|
|
|
- </el-button>
|
|
|
- <el-button link type="danger" @click="onDelete(row, '0')" v-if="[0].includes(row.circularState)" v-auth="'auxiliary:bulletin:delete'">
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="onCommit(row, '0')"
|
|
|
- v-if="[0, 3].includes(row.circularState)"
|
|
|
- title="提交审批"
|
|
|
- v-auth="'auxiliary:bulletin:commit'"
|
|
|
- >
|
|
|
- 提交
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="onDetail(row, '0')"
|
|
|
- v-if="[1, 2].includes(row.circularState)"
|
|
|
- >
|
|
|
- 查看详情
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template v-if="listType === '1'">
|
|
|
- <el-button link type="primary" @click="onEdit(row, '1')" v-if="[0, 3].includes(row.bulletinState)" v-auth="'auxiliary:notice:edit'">
|
|
|
- 编辑
|
|
|
- </el-button>
|
|
|
- <el-button link type="danger" @click="onDelete(row, '1')" v-if="[0].includes(row.bulletinState)" v-auth="'auxiliary:notice:delete'">
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="onCommit(row, '1')"
|
|
|
- v-if="[0, 3].includes(row.bulletinState)"
|
|
|
- title="提交审批"
|
|
|
- v-auth="'auxiliary:notice:commit'"
|
|
|
- >
|
|
|
- 提交
|
|
|
- </el-button>
|
|
|
- <el-button link type="primary" @click="onDetail(row, '1')" v-if="[1, 2].includes(row.bulletinState)">
|
|
|
- 查看详情
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <template #empty>
|
|
|
- <Empty />
|
|
|
+ <template #isMustRead="{ row }">
|
|
|
+ {{ row.isMustRead ? '是' : '否' }}
|
|
|
+ </template>
|
|
|
+ <template #readedNum="{ row }">
|
|
|
+ <el-popover placement="right" :width="450" trigger="click" popper-class="notice-container" v-if="[2].includes(row.circularState)">
|
|
|
+ <template #reference>
|
|
|
+ <el-button link type="primary">{{ row.readedNum + '/' + row.needReadNum }}</el-button>
|
|
|
+ </template>
|
|
|
+ <div class="notice-container-box">
|
|
|
+ <div class="notice-container-box-inner">
|
|
|
+ 已读:{{ row.readedNum }}
|
|
|
+ <el-scrollbar class="mt5" v-if="row.circularReadGroups?.length">
|
|
|
+ <el-tag v-for="item in row.circularReadGroups.filter((i) => i.isRead)"
|
|
|
+ >{{ row.circularType === 1 ? item.userName : item.orgName }}
|
|
|
+ <span v-if="item.isTimeOut" class="color-danger">(超时阅读)</span>
|
|
|
+ </el-tag>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div class="notice-container-box-inner">
|
|
|
+ 未读:{{ row.needReadNum - row.readedNum }}
|
|
|
+ <el-scrollbar class="mt5 mb10" v-if="row.circularReadGroups?.length">
|
|
|
+ <el-tag v-for="item in row.circularReadGroups.filter((i) => !i.isRead)">{{
|
|
|
+ row.circularType === 1 ? item.userName : item.orgName
|
|
|
+ }}</el-tag>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ <!-- 表格操作 -->
|
|
|
+ <template #operation="{ row }">
|
|
|
+ <el-button link type="primary" @click="onEdit(row, '0')" v-if="[0, 3].includes(row.circularState)" v-auth="'auxiliary:bulletin:edit'">
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="danger" @click="onDelete(row, '0')" v-if="[0].includes(row.circularState)" v-auth="'auxiliary:bulletin:delete'">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="onCommit(row, '0')"
|
|
|
+ v-if="[0, 3].includes(row.circularState)"
|
|
|
+ title="提交审批"
|
|
|
+ v-auth="'auxiliary:bulletin:commit'"
|
|
|
+ >
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="primary" @click="onDetail(row, '0')" v-if="[1, 2].includes(row.circularState)"> 查看详情 </el-button>
|
|
|
</template>
|
|
|
- </el-table>
|
|
|
- <!-- 分页 -->
|
|
|
- <pagination
|
|
|
+ </ProTable>
|
|
|
+ <!-- 公告表格 -->
|
|
|
+ <ProTable
|
|
|
+ ref="proTableBulletinRef"
|
|
|
+ :columns="columnsBulletin"
|
|
|
+ :data="state.tableData"
|
|
|
+ @updateTable="queryList"
|
|
|
+ :loading="state.loading"
|
|
|
:total="state.total"
|
|
|
- v-model:page="state.queryParams.PageIndex"
|
|
|
- v-model:limit="state.queryParams.PageSize"
|
|
|
- @pagination="queryList"
|
|
|
- />
|
|
|
+ v-model:page-index="state.queryParams.PageIndex"
|
|
|
+ v-model:page-size="state.queryParams.PageSize"
|
|
|
+ v-else
|
|
|
+ >
|
|
|
+ <!-- 表格 header 按钮 -->
|
|
|
+ <template #tableHeader="scope">
|
|
|
+ <el-button type="primary" @click="onNoticeAdd('1')" v-auth="'auxiliary:bulletin:add'" title="新增公告">
|
|
|
+ <SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <!-- 表格操作 -->
|
|
|
+ <template #operation="{ row }">
|
|
|
+ <el-button link type="primary" @click="onEdit(row, '1')" v-if="[0, 3].includes(row.bulletinState)" v-auth="'auxiliary:notice:edit'">
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="danger" @click="onDelete(row, '1')" v-if="[0].includes(row.bulletinState)" v-auth="'auxiliary:notice:delete'">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="onCommit(row, '1')"
|
|
|
+ v-if="[0, 3].includes(row.bulletinState)"
|
|
|
+ title="提交审批"
|
|
|
+ v-auth="'auxiliary:notice:commit'"
|
|
|
+ >
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="primary" @click="onDetail(row, '1')" v-if="[1, 2].includes(row.bulletinState)"> 查看详情 </el-button>
|
|
|
+ </template>
|
|
|
+ </ProTable>
|
|
|
</el-card>
|
|
|
<!-- 流程审批 -->
|
|
|
<process-audit ref="processAuditRef" @orderProcessSuccess="queryList" />
|
|
@@ -218,13 +174,12 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script lang="ts" setup name="auxiliaryNotice">
|
|
|
+<script lang="tsx" setup name="auxiliaryNotice">
|
|
|
import { defineAsyncComponent, onActivated, onMounted, reactive, ref } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
|
|
+import { ElButton, ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
|
|
import { shortcuts } from '@/utils/constants';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
-import { auth } from '@/utils/authFunction';
|
|
|
import {
|
|
|
bulletinBaseData,
|
|
|
bulletinCommit,
|
|
@@ -235,15 +190,91 @@ import {
|
|
|
circularDelete,
|
|
|
circularList,
|
|
|
} from '@/api/auxiliary/notice';
|
|
|
-import { businessTagDelete } from '@/api/auxiliary/businessTag';
|
|
|
|
|
|
// 引入组件
|
|
|
const ProcessAudit = defineAsyncComponent(() => import('@/components/ProcessAudit/index.vue')); // 流程审批
|
|
|
const NoticeAdd = defineAsyncComponent(() => import('@/views/auxiliary/notice/component/Notice-add.vue')); // 通知公告新增
|
|
|
const NoticeEdit = defineAsyncComponent(() => import('@/views/auxiliary/notice/component/Notice-edit.vue')); // 通知公告编辑
|
|
|
|
|
|
+const proTableNoticeRef = ref<RefType>(); // 表格ref
|
|
|
+// 表格配置项
|
|
|
+const columnsNotice = ref<any[]>([
|
|
|
+ { prop: 'circularTypeName', label: '通知类型', width: 120 },
|
|
|
+ { prop: 'circularStateText', label: '通知状态', width: 120 },
|
|
|
+ { prop: 'title', label: '通知标题', width: 150 },
|
|
|
+ { prop: 'isMustRead', label: '必须阅读' },
|
|
|
+ { prop: 'readedNum', label: '已阅读数' },
|
|
|
+ { prop: 'circularTypeText', label: '通知对象' },
|
|
|
+ {
|
|
|
+ prop: 'creationTime',
|
|
|
+ label: '通知时间',
|
|
|
+ width: 170,
|
|
|
+ render: (scope) => {
|
|
|
+ return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'lostEfficacyTime',
|
|
|
+ label: '失效时间',
|
|
|
+ width: 170,
|
|
|
+ render: (scope) => {
|
|
|
+ return <span>{formatDate(scope.row.lostEfficacyTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { prop: 'sourceOrgName', label: '来源单位', width: 120 },
|
|
|
+ { prop: 'circularStateText', label: '审核状态', width: 120 },
|
|
|
+ { prop: 'examinOpinion', label: '审核理由', width: 150 },
|
|
|
+ { prop: 'examinMan.name', label: '审核人' },
|
|
|
+ {
|
|
|
+ prop: 'examinTime',
|
|
|
+ label: '审核时间',
|
|
|
+ width: 170,
|
|
|
+ render: (scope) => {
|
|
|
+ return <span>{formatDate(scope.row.examinTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { prop: 'operation', label: '操作', fixed: 'right', width: 200, align: 'center' },
|
|
|
+]);
|
|
|
+const proTableBulletinRef = ref<RefType>(); // 表格ref
|
|
|
+// 表格配置项
|
|
|
+const columnsBulletin = ref<any[]>([
|
|
|
+ { prop: 'bulletinTypeName', label: '公告类型', width: 120 },
|
|
|
+ { prop: 'bulletinStateText', label: '公告状态', width: 120 },
|
|
|
+ { prop: 'title', label: '公告标题', width: 150 },
|
|
|
+ { prop: 'readedNum', label: '已阅次数' },
|
|
|
+ { prop: 'pushRangesText', label: '公告范围', width: 300 },
|
|
|
+ {
|
|
|
+ prop: 'creationTime',
|
|
|
+ label: '通知时间',
|
|
|
+ width: 170,
|
|
|
+ render: (scope) => {
|
|
|
+ return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'loseEfficacyTime',
|
|
|
+ label: '失效时间',
|
|
|
+ width: 170,
|
|
|
+ render: (scope) => {
|
|
|
+ return <span>{formatDate(scope.row.loseEfficacyTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { prop: 'creatorOrgName', label: '来源单位', width: 120 },
|
|
|
+ { prop: 'bulletinStateText', label: '审核状态', width: 120 },
|
|
|
+ { prop: 'examinOpinion', label: '审核理由', width: 150 },
|
|
|
+ { prop: 'examinMan.name', label: '审核人' },
|
|
|
+ {
|
|
|
+ prop: 'examinTime',
|
|
|
+ label: '审核时间',
|
|
|
+ width: 170,
|
|
|
+ render: (scope) => {
|
|
|
+ return <span>{formatDate(scope.row.examinTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { prop: 'operation', label: '操作', fixed: 'right', width: 200, align: 'center' },
|
|
|
+]);
|
|
|
// 定义变量内容
|
|
|
-const state = reactive<any>({
|
|
|
+const state = reactive({
|
|
|
loading: false, // 加载状态
|
|
|
queryParams: {
|
|
|
// 查询参数
|
|
@@ -422,12 +453,6 @@ const onCommit = (row: any, type: string) => {
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
-// 表格多选
|
|
|
-const multipleTableRef = ref<RefType>();
|
|
|
-const multipleSelection = ref<any>([]);
|
|
|
-const handleSelectionChange = (val: any[]) => {
|
|
|
- multipleSelection.value = val;
|
|
|
-};
|
|
|
const params = history.state;
|
|
|
// 页面加载时
|
|
|
onMounted(() => {
|