| | |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="regulations" |
| | | border |
| | | v-loading="tableLoading" |
| | | style="width: 100%"> |
| | | <el-table-column prop="regulationNum" |
| | | label="制度编号" |
| | | width="120" /> |
| | | <el-table-column prop="title" |
| | | label="制度标题" |
| | | min-width="150" /> |
| | | <el-table-column prop="category" |
| | | label="分类" |
| | | width="120"> |
| | | <template #default="scope"> |
| | | <el-tag>{{ getCategoryText(scope.row.category) }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="version" |
| | | label="版本" |
| | | width="120" /> |
| | | <el-table-column prop="createUserName" |
| | | label="发布人" |
| | | width="120" /> |
| | | <el-table-column prop="createTime" |
| | | label="发布时间" |
| | | width="180" /> |
| | | <el-table-column prop="status" |
| | | label="状态" |
| | | width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === 'active' ? 'success' : 'info'"> |
| | | {{ scope.row.status === 'active' ? '生效中' : '已废止' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="readCount" |
| | | label="已读人数" |
| | | width="100" /> |
| | | <el-table-column label="操作" |
| | | width="320" |
| | | fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button link |
| | | @click="viewRegulation(scope.row)">查看</el-button> |
| | | <el-button link |
| | | type="primary" |
| | | @click="handleEdit(scope.row)">编辑</el-button> |
| | | <el-button link |
| | | type="danger" |
| | | @click="repealEdit(scope.row)">废弃</el-button> |
| | | <el-button link |
| | | type="success" |
| | | @click="viewVersionHistory(scope.row)">版本历史</el-button> |
| | | <!-- <el-button link type="warning" @click="viewReadStatus(scope.row)">阅读状态</el-button> --> |
| | | <el-button link |
| | | type="primary" |
| | | @click="openFileDialog(scope.row)">附件</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="regulationTableColumn" |
| | | :tableData="regulations" |
| | | :tableLoading="tableLoading" |
| | | :page="page" |
| | | :isShowPagination="true" |
| | | @pagination="paginationChange" |
| | | /> |
| | | </div> |
| | | </el-card> |
| | | <!-- 用印申请对话框(已移除) --> |
| | |
| | | delRuleFile, |
| | | addRuleFile, |
| | | } from "@/api/collaborativeApproval/rulesRegulationsManagementFile.js"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | |
| | | // 响应式数据 |
| | | const operationType = ref("add"); |
| | |
| | | const currentFileRuleId = ref(null); |
| | | const filePage = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | size: 1000, |
| | | total: 0, |
| | | }); |
| | | // 规章制度相关 |
| | |
| | | }); |
| | | |
| | | const regulations = ref([]); |
| | | |
| | | // 表格列配置 |
| | | const regulationTableColumn = ref([ |
| | | { label: "制度编号", prop: "regulationNum"}, |
| | | { label: "制度标题", prop: "title" }, |
| | | { |
| | | label: "分类", |
| | | prop: "category", |
| | | dataType: "tag", |
| | | formatData: (v) => getCategoryText(v), |
| | | formatType: () => "info", |
| | | }, |
| | | { label: "版本", prop: "version", width: 120 }, |
| | | { label: "发布人", prop: "createUserName", width: 120 }, |
| | | { label: "发布时间", prop: "createTime", width: 180 }, |
| | | { |
| | | label: "状态", |
| | | prop: "status", |
| | | width: 100, |
| | | dataType: "tag", |
| | | formatData: (v) => (v === "active" ? "生效中" : "已废止"), |
| | | formatType: (v) => (v === "active" ? "success" : "info"), |
| | | }, |
| | | { label: "已读人数", prop: "readCount", width: 100 }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | width: 320, |
| | | fixed: "right", |
| | | align: "center", |
| | | operation: [ |
| | | { name: "查看", clickFun: (row) => viewRegulation(row) }, |
| | | { name: "编辑", clickFun: (row) => handleEdit(row) }, |
| | | { name: "废弃", clickFun: (row) => repealEdit(row) }, |
| | | { name: "版本历史", clickFun: (row) => viewVersionHistory(row) }, |
| | | { name: "附件", clickFun: (row) => openFileDialog(row) }, |
| | | ], |
| | | }, |
| | | ]); |
| | | |
| | | const versionHistory = ref([]); |
| | | |
| | |
| | | regulations.value = res.data.records; |
| | | // 过滤掉已废弃的制度 |
| | | // regulations.value = res.data.records.filter(item => item.status !== 'repealed') |
| | | page.value.total = res.data.total; |
| | | page.total = res.data.total; |
| | | tableLoading.value = false; |
| | | }) |
| | | .catch(err => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | // 分页变化处理 |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getRegulationList(); |
| | | }; |
| | | onMounted(() => { |
| | | // 初始化 |
| | | getRegulationList(); |