From c8b65690b946b28b179796fbe2f020e732043c58 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期四, 08 一月 2026 18:10:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_天津军泰伟业' into dev_天津军泰伟业
---
src/views/collaborativeApproval/sealManagement/index.vue | 1186 ++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 738 insertions(+), 448 deletions(-)
diff --git a/src/views/collaborativeApproval/sealManagement/index.vue b/src/views/collaborativeApproval/sealManagement/index.vue
index a906f5e..aa7fcac 100644
--- a/src/views/collaborativeApproval/sealManagement/index.vue
+++ b/src/views/collaborativeApproval/sealManagement/index.vue
@@ -3,149 +3,148 @@
<el-card class="box-card">
<template #header>
<div class="card-header">
- <span>鐢ㄥ嵃绠$悊涓庤绔犲埗搴﹀彂甯�</span>
- <el-button type="primary" @click="showSealApplyDialog = true">
- <el-icon><Plus /></el-icon>
- 鐢宠鐢ㄥ嵃
- </el-button>
+ <span>鐢ㄥ嵃绠$悊鍙戝竷</span>
</div>
</template>
-
- <el-tabs v-model="activeTab" type="border-card">
- <!-- 鐢ㄥ嵃鐢宠绠$悊 -->
- <el-tab-pane label="鐢ㄥ嵃鐢宠绠$悊" name="seal">
- <div class="tab-content">
- <el-row :gutter="20" class="mb-20">
- <el-col :span="6">
- <el-input v-model="sealSearchForm.keyword" placeholder="璇疯緭鍏ョ敵璇锋爣棰樻垨鐢宠浜�" clearable />
- </el-col>
- <el-col :span="4">
- <el-select v-model="sealSearchForm.status" placeholder="瀹℃壒鐘舵��" clearable>
- <el-option label="寰呭鎵�" value="pending" />
- <el-option label="宸查�氳繃" value="approved" />
- <el-option label="宸叉嫆缁�" value="rejected" />
- </el-select>
- </el-col>
- <el-col :span="4">
- <el-button type="primary" @click="searchSealApplications">鎼滅储</el-button>
- <el-button @click="resetSealSearch">閲嶇疆</el-button>
- </el-col>
- </el-row>
-
- <el-table :data="sealApplications" style="width: 100%">
- <el-table-column prop="id" label="鐢宠缂栧彿" width="120" />
- <el-table-column prop="title" label="鐢宠鏍囬" min-width="200" />
- <el-table-column prop="applicant" label="鐢宠浜�" width="120" />
- <el-table-column prop="department" label="鎵�灞為儴闂�" width="150" />
- <el-table-column prop="sealType" label="鐢ㄥ嵃绫诲瀷" width="120" />
- <el-table-column prop="applyTime" label="鐢宠鏃堕棿" width="180" />
- <el-table-column prop="status" label="鐘舵��" width="100">
- <template #default="scope">
- <el-tag :type="getStatusType(scope.row.status)">
- {{ getStatusText(scope.row.status) }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="鎿嶄綔" width="200" fixed="right">
- <template #default="scope">
- <el-button link @click="viewSealDetail(scope.row)">鏌ョ湅</el-button>
- <el-button
- v-if="scope.row.status === 'pending'"
- link
- type="primary"
- @click="approveSeal(scope.row)"
- >
- 瀹℃壒
- </el-button>
- <el-button
- v-if="scope.row.status === 'pending'"
- link
- type="danger"
- @click="rejectSeal(scope.row)"
- >
- 鎷掔粷
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-tab-pane>
-
- <!-- 瑙勭珷鍒跺害绠$悊 -->
- <el-tab-pane label="瑙勭珷鍒跺害绠$悊" name="regulations">
- <div class="tab-content">
- <el-row :gutter="20" class="mb-20">
- <el-col :span="6">
- <el-input v-model="regulationSearchForm.keyword" placeholder="璇疯緭鍏ュ埗搴︽爣棰樻垨鍙戝竷浜�" clearable />
- </el-col>
- <el-col :span="4">
- <el-select v-model="regulationSearchForm.category" placeholder="鍒跺害鍒嗙被" clearable>
- <el-option label="浜轰簨鍒跺害" value="hr" />
- <el-option label="璐㈠姟鍒跺害" value="finance" />
- <el-option label="瀹夊叏鍒跺害" value="safety" />
- <el-option label="鎶�鏈埗搴�" value="tech" />
- </el-select>
- </el-col>
- <el-col :span="8">
- <el-button type="primary" @click="searchRegulations">鎼滅储</el-button>
- <el-button @click="resetRegulationSearch">閲嶇疆</el-button>
- <el-button type="success" @click="showRegulationDialog = true">
- 鍙戝竷鍒跺害
- </el-button>
- </el-col>
- </el-row>
-
- <el-table :data="regulations" style="width: 100%">
- <el-table-column prop="id" label="鍒跺害缂栧彿" width="120" />
- <el-table-column prop="title" label="鍒跺害鏍囬" min-width="200" />
- <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="80" />
- <el-table-column prop="publisher" label="鍙戝竷浜�" width="120" />
- <el-table-column prop="publishTime" 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="250" fixed="right">
- <template #default="scope">
- <el-button link @click="viewRegulation(scope.row)">鏌ョ湅</el-button>
- <el-button link type="primary" @click="editRegulation(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>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-tab-pane>
- </el-tabs>
+ <!-- 鐢ㄥ嵃鐢宠绠$悊 -->
+ <div class="tab-content">
+ <el-row :gutter="20"
+ class="mb-20 ">
+ <span class="ml-10">鐢ㄥ嵃鏍囬锛�</span>
+ <el-col :span="6">
+ <el-input v-model="sealSearchForm.title"
+ placeholder="璇疯緭鍏ョ敵璇锋爣棰�"
+ clearable />
+ </el-col>
+ <span class="search_title">瀹℃壒鐘舵�侊細</span>
+ <el-col :span="6">
+ <el-select v-model="sealSearchForm.status"
+ placeholder="瀹℃壒鐘舵��"
+ clearable>
+ <el-option label="寰呭鎵�"
+ value="pending" />
+ <el-option label="宸查�氳繃"
+ value="approved" />
+ <el-option label="宸叉嫆缁�"
+ value="rejected" />
+ </el-select>
+ </el-col>
+ <el-col :span="8">
+ <el-button type="primary"
+ @click="searchSealApplications">鎼滅储</el-button>
+ <el-button @click="resetSealSearch">閲嶇疆</el-button>
+ <el-button @click="handleExport">瀵煎嚭</el-button>
+ <el-button type="primary"
+ @click="showSealApplyDialog = true">鐢宠鐢ㄥ嵃
+ </el-button>
+ </el-col>
+ </el-row>
+ <el-table :data="sealApplications"
+ border
+ v-loading="tableLoading"
+ style="width: 100%">
+ <el-table-column prop="applicationNum"
+ label="鐢宠缂栧彿"
+ width="120" />
+ <el-table-column prop="title"
+ label="鐢宠鏍囬"
+ min-width="200" />
+ <el-table-column prop="createUserName"
+ label="鐢宠浜�"
+ width="120" />
+ <el-table-column prop="department"
+ label="鎵�灞為儴闂�"
+ width="150" />
+ <el-table-column prop="sealType"
+ label="鐢ㄥ嵃绫诲瀷"
+ width="120">
+ <template #default="scope">
+ {{ getSealTypeText(scope.row.sealType) }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="createTime"
+ label="鐢宠鏃堕棿"
+ width="180" />
+ <el-table-column prop="status"
+ label="鐘舵��"
+ width="100">
+ <template #default="scope">
+ <el-tag :type="getStatusType(scope.row.status)">
+ {{ getStatusText(scope.row.status) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔"
+ width="200"
+ fixed="right">
+ <template #default="scope">
+ <el-button link
+ @click="viewSealDetail(scope.row)">鏌ョ湅</el-button>
+ <el-button v-if="scope.row.status === 'pending'"
+ link
+ type="primary"
+ @click="approveSeal(scope.row)">
+ 瀹℃壒
+ </el-button>
+ <el-button v-if="scope.row.status === 'pending'"
+ link
+ type="danger"
+ @click="rejectSeal(scope.row)">
+ 鎷掔粷
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination v-show="total > 0"
+ :total="total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current"
+ :limit="page.size"
+ @pagination="paginationChange" />
+ </div>
</el-card>
-
<!-- 鐢ㄥ嵃鐢宠瀵硅瘽妗� -->
- <el-dialog v-model="showSealApplyDialog" title="鐢宠鐢ㄥ嵃" width="600px">
- <el-form :model="sealForm" :rules="sealRules" ref="sealFormRef" label-width="100px">
- <el-form-item label="鐢宠鏍囬" prop="title">
- <el-input v-model="sealForm.title" placeholder="璇疯緭鍏ョ敵璇锋爣棰�" />
+ <el-dialog v-model="showSealApplyDialog"
+ title="鐢宠鐢ㄥ嵃"
+ width="600px">
+ <el-form :model="sealForm"
+ :rules="sealRules"
+ ref="sealFormRef"
+ label-width="100px">
+ <el-form-item label="鐢宠缂栧彿"
+ prop="applicationNum">
+ <el-input v-model="sealForm.applicationNum"
+ placeholder="璇疯緭鍏ョ敵璇风紪鍙�" />
</el-form-item>
- <el-form-item label="鐢ㄥ嵃绫诲瀷" prop="sealType">
- <el-select v-model="sealForm.sealType" placeholder="璇烽�夋嫨鐢ㄥ嵃绫诲瀷" style="width: 100%">
- <el-option label="鍏珷" value="official" />
- <el-option label="鍚堝悓涓撶敤绔�" value="contract" />
- <el-option label="璐㈠姟涓撶敤绔�" value="finance" />
- <el-option label="娉曚汉绔�" value="legal" />
+ <el-form-item label="鐢宠鏍囬"
+ prop="title">
+ <el-input v-model="sealForm.title"
+ placeholder="璇疯緭鍏ョ敵璇锋爣棰�" />
+ </el-form-item>
+ <el-form-item label="鐢ㄥ嵃绫诲瀷"
+ prop="sealType">
+ <el-select v-model="sealForm.sealType"
+ placeholder="璇烽�夋嫨鐢ㄥ嵃绫诲瀷"
+ style="width: 100%">
+ <el-option label="鍏珷"
+ value="official" />
+ <el-option label="鍚堝悓涓撶敤绔�"
+ value="contract" />
+ <el-option label="璐㈠姟涓撶敤绔�"
+ value="finance" />
+ <el-option label="娉曚汉绔�"
+ value="legal" />
</el-select>
</el-form-item>
- <el-form-item label="鐢宠鍘熷洜" prop="reason">
- <el-input v-model="sealForm.reason" type="textarea" :rows="4" placeholder="璇疯缁嗚鏄庣敤鍗板師鍥�" />
+ <el-form-item label="鐢宠鍘熷洜"
+ prop="reason">
+ <el-input v-model="sealForm.reason"
+ type="textarea"
+ :rows="4"
+ placeholder="璇疯缁嗚鏄庣敤鍗板師鍥�" />
</el-form-item>
- <el-form-item label="绱ф�ョ▼搴�" prop="urgency">
+ <el-form-item label="绱ф�ョ▼搴�"
+ prop="urgency">
<el-radio-group v-model="sealForm.urgency">
<el-radio label="normal">鏅��</el-radio>
<el-radio label="urgent">绱ф��</el-radio>
@@ -155,15 +154,18 @@
</el-form>
<template #footer>
<span class="dialog-footer">
+ <el-button type="primary"
+ @click="submitSealApplication">鎻愪氦鐢宠</el-button>
<el-button @click="showSealApplyDialog = false">鍙栨秷</el-button>
- <el-button type="primary" @click="submitSealApplication">鎻愪氦鐢宠</el-button>
</span>
</template>
</el-dialog>
-
<!-- 瑙勭珷鍒跺害鍙戝竷瀵硅瘽妗� -->
- <el-dialog v-model="showRegulationDialog" title="鍙戝竷瑙勭珷鍒跺害" width="800px">
+ <!-- <el-dialog v-model="showRegulationDialog" :title="operationType === 'add' ? '鍙戝竷鍒跺害' : '缂栬緫鍒跺害'" width="800px">
<el-form :model="regulationForm" :rules="regulationRules" ref="regulationFormRef" label-width="100px">
+ <el-form-item label="鍒跺害缂栧彿" prop="regulationNum">
+ <el-input v-model="regulationForm.regulationNum" placeholder="璇疯緭鍏ュ埗搴︾紪鍙�" />
+ </el-form-item>
<el-form-item label="鍒跺害鏍囬" prop="title">
<el-input v-model="regulationForm.title" placeholder="璇疯緭鍏ュ埗搴︽爣棰�" />
</el-form-item>
@@ -178,8 +180,12 @@
<el-form-item label="鍒跺害鍐呭" prop="content">
<el-input v-model="regulationForm.content" type="textarea" :rows="10" placeholder="璇疯緭鍏ュ埗搴﹁缁嗗唴瀹�" />
</el-form-item>
+ <el-form-item label="鍒跺害鐗堟湰" prop="version">
+ <el-input v-model="regulationForm.version" placeholder="璇疯緭鍏ュ埗搴︾増鏈�" />
+ </el-form-item>
<el-form-item label="鐢熸晥鏃堕棿" prop="effectiveTime">
- <el-date-picker v-model="regulationForm.effectiveTime" type="datetime" placeholder="閫夋嫨鐢熸晥鏃堕棿" style="width: 100%" />
+ <el-date-picker v-model="regulationForm.effectiveTime" type="datetime" format="YYYY-MM-DD HH:mm:ss"
+ value-format="YYYY-MM-DD HH:mm:ss" placeholder="閫夋嫨鐢熸晥鏃堕棿" style="width: 100%" />
</el-form-item>
<el-form-item label="閫傜敤鑼冨洿" prop="scope">
<el-checkbox-group v-model="regulationForm.scope">
@@ -201,64 +207,103 @@
<el-button type="primary" @click="submitRegulation">鍙戝竷鍒跺害</el-button>
</span>
</template>
- </el-dialog>
-
+ </el-dialog> -->
<!-- 鐢ㄥ嵃璇︽儏瀵硅瘽妗� -->
- <el-dialog v-model="showSealDetailDialog" title="鐢ㄥ嵃鐢宠璇︽儏" width="700px">
- <div v-if="currentSealDetail" class="mb10">
- <el-descriptions :column="2" border>
+ <el-dialog v-model="showSealDetailDialog"
+ title="鐢ㄥ嵃鐢宠璇︽儏"
+ width="700px">
+ <div v-if="currentSealDetail"
+ class="mb10">
+ <el-descriptions :column="2"
+ border>
<el-descriptions-item label="鐢宠缂栧彿">{{ currentSealDetail.id }}</el-descriptions-item>
<el-descriptions-item label="鐢宠鏍囬">{{ currentSealDetail.title }}</el-descriptions-item>
- <el-descriptions-item label="鐢宠浜�">{{ currentSealDetail.applicant }}</el-descriptions-item>
+ <el-descriptions-item label="鐢宠浜�">{{ currentSealDetail.createUserName }}</el-descriptions-item>
<el-descriptions-item label="鎵�灞為儴闂�">{{ currentSealDetail.department }}</el-descriptions-item>
- <el-descriptions-item label="鐢ㄥ嵃绫诲瀷">{{ currentSealDetail.sealType }}</el-descriptions-item>
- <el-descriptions-item label="鐢宠鏃堕棿">{{ currentSealDetail.applyTime }}</el-descriptions-item>
+ <el-descriptions-item label="鐢ㄥ嵃绫诲瀷">{{ getSealTypeText(currentSealDetail.sealType) }}</el-descriptions-item>
+ <el-descriptions-item label="鐢宠鏃堕棿">{{ currentSealDetail.createTime }}</el-descriptions-item>
<el-descriptions-item label="鐘舵��">
<el-tag :type="getStatusType(currentSealDetail.status)">
{{ getStatusText(currentSealDetail.status) }}
</el-tag>
</el-descriptions-item>
- <el-descriptions-item label="鐢宠鍘熷洜" :span="2">{{ currentSealDetail.reason }}</el-descriptions-item>
+ <el-descriptions-item label="鐢宠鍘熷洜"
+ :span="2">{{ currentSealDetail.reason }}</el-descriptions-item>
</el-descriptions>
</div>
</el-dialog>
-
<!-- 瑙勭珷鍒跺害璇︽儏瀵硅瘽妗� -->
- <el-dialog v-model="showRegulationDetailDialog" title="瑙勭珷鍒跺害璇︽儏" width="800px">
+ <el-dialog v-model="showRegulationDetailDialog"
+ title="瑙勭珷鍒跺害璇︽儏"
+ width="800px">
<div v-if="currentRegulationDetail">
- <el-descriptions :column="2" border>
+ <el-descriptions :column="2"
+ border>
<el-descriptions-item label="鍒跺害缂栧彿">{{ currentRegulationDetail.id }}</el-descriptions-item>
<el-descriptions-item label="鍒跺害鏍囬">{{ currentRegulationDetail.title }}</el-descriptions-item>
<el-descriptions-item label="鍒嗙被">{{ getCategoryText(currentRegulationDetail.category) }}</el-descriptions-item>
<el-descriptions-item label="鐗堟湰">{{ currentRegulationDetail.version }}</el-descriptions-item>
- <el-descriptions-item label="鍙戝竷浜�">{{ currentRegulationDetail.publisher }}</el-descriptions-item>
- <el-descriptions-item label="鍙戝竷鏃堕棿">{{ currentRegulationDetail.publishTime }}</el-descriptions-item>
+ <el-descriptions-item label="鍙戝竷浜�">{{ currentRegulationDetail.createUserName }}</el-descriptions-item>
+ <el-descriptions-item label="鍙戝竷鏃堕棿">{{ currentRegulationDetail.createTime }}</el-descriptions-item>
</el-descriptions>
<div class="mt-20">
<h4>鍒跺害鍐呭</h4>
<div class="regulation-content">{{ currentRegulationDetail.content }}</div>
</div>
+ <!-- 濡傛灉tableData>0 鏄剧ず -->
+ <div style="margin: 10px 0;"
+ v-if="tableData && tableData.length > 0">
+ <el-button type="success"
+ @click="resetForm(currentRegulationDetail)">纭鏌ョ湅</el-button>
+ </div>
</div>
</el-dialog>
-
<!-- 鐗堟湰鍘嗗彶瀵硅瘽妗� -->
- <el-dialog v-model="showVersionHistoryDialog" title="鐗堟湰鍘嗗彶" width="800px">
- <el-table :data="versionHistory" style="width: 100%;margin-bottom: 10px">
- <el-table-column prop="version" label="鐗堟湰鍙�" width="100" />
- <el-table-column prop="updateTime" label="鏇存柊鏃堕棿" width="180" />
- <el-table-column prop="updater" label="鏇存柊浜�" width="120" />
- <el-table-column prop="changeLog" label="鍙樻洿璇存槑" />
+ <el-dialog v-model="showVersionHistoryDialog"
+ title="鐗堟湰鍘嗗彶"
+ width="800px">
+ <el-table :data="versionHistory"
+ style="width: 100%;margin-bottom: 10px">
+ <el-table-column prop="version"
+ label="鐗堟湰鍙�"
+ width="100" />
+ <el-table-column prop="updateTime"
+ label="鏇存柊鏃堕棿"
+ width="180" />
+ <el-table-column prop="createUserName"
+ label="鏇存柊浜�"
+ width="120" />
+ <el-table-column prop="changeLog"
+ label="鍙樻洿璇存槑">
+ <template #default="scope">
+ <el-tag :type="scope.row.status === 'active' ? 'success' : 'info'">
+ {{ scope.row.status === 'active' ? '鐢熸晥涓�' : '宸插簾姝�' }}
+ </el-tag>
+ </template>
+ </el-table-column>
</el-table>
</el-dialog>
-
<!-- 闃呰鐘舵�佸璇濇 -->
- <el-dialog v-model="showReadStatusDialog" title="闃呰鐘舵��" width="800px">
- <el-table :data="readStatusList" style="width: 100%;margin-bottom: 10px">
- <el-table-column prop="employee" label="鍛樺伐濮撳悕" width="120" />
- <el-table-column prop="department" label="鎵�灞為儴闂�" width="150" />
- <el-table-column prop="readTime" label="闃呰鏃堕棿" width="180" />
- <el-table-column prop="confirmTime" label="纭鏃堕棿" width="180" />
- <el-table-column prop="status" label="鐘舵��" width="100">
+ <el-dialog v-model="showReadStatusDialog"
+ title="闃呰鐘舵��"
+ width="800px">
+ <el-table :data="readStatusList"
+ style="width: 100%;margin-bottom: 10px">
+ <el-table-column prop="employee"
+ label="鍛樺伐濮撳悕"
+ width="120" />
+ <el-table-column prop="department"
+ label="鎵�灞為儴闂�"
+ width="150" />
+ <el-table-column prop="createTime"
+ label="闃呰鏃堕棿"
+ width="180" />
+ <el-table-column prop="confirmTime"
+ label="纭鏃堕棿"
+ width="180" />
+ <el-table-column prop="status"
+ label="鐘舵��"
+ width="100">
<template #default="scope">
<el-tag :type="scope.row.status === 'confirmed' ? 'success' : 'warning'">
{{ scope.row.status === 'confirmed' ? '宸茬‘璁�' : '鏈‘璁�' }}
@@ -271,318 +316,563 @@
</template>
<script setup>
-import { ref, reactive, onMounted } from 'vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { Plus } from '@element-plus/icons-vue'
+ import { ref, reactive, onMounted, getCurrentInstance } from "vue";
+ import { ElMessage, ElMessageBox } from "element-plus";
+ import { Plus } from "@element-plus/icons-vue";
+ import {
+ listSealApplication,
+ addSealApplication,
+ updateSealApplication,
+ listRuleManagement,
+ addRuleManagement,
+ updateRuleManagement,
+ delRuleManagement,
+ getReadingStatusByRuleId,
+ getReadingStatusList,
+ addReadingStatus,
+ updateReadingStatus,
+ } from "@/api/collaborativeApproval/sealManagement.js";
+ import { el } from "element-plus/es/locales.mjs";
+ import { getUserProfile } from "@/api/system/user.js";
+ import {
+ staffJoinDel,
+ staffJoinListPage,
+ } from "@/api/personnelManagement/onboarding.js";
+ import useUserStore from "@/store/modules/user";
+ import { userLoginFacotryList } from "@/api/system/user.js";
-// 鍝嶅簲寮忔暟鎹�
-const activeTab = ref('seal')
+ // 鍝嶅簲寮忔暟鎹�
+ const currentUser = ref(null);
+ const activeTab = ref("seal");
+ const operationType = ref("add");
+ const tableData = ref([]);
+ // 鐢ㄥ嵃鐢宠鐩稿叧
+ const userStore = useUserStore();
+ const showSealApplyDialog = ref(false);
+ const tableLoading = ref(false);
+ const showSealDetailDialog = ref(false);
+ const currentSealDetail = ref(null);
+ const sealFormRef = ref();
+ const sealForm = reactive({
+ applicationNum: "",
+ title: "",
+ sealType: "",
+ reason: "",
+ urgency: "normal",
+ status: "pending",
+ });
-// 鐢ㄥ嵃鐢宠鐩稿叧
-const showSealApplyDialog = ref(false)
-const showSealDetailDialog = ref(false)
-const currentSealDetail = ref(null)
-const sealFormRef = ref()
-const sealForm = reactive({
- title: '',
- sealType: '',
- reason: '',
- urgency: 'normal'
-})
+ const sealRules = {
+ applicationNum: [
+ { required: true, message: "璇疯緭鍏ョ敵璇风紪鍙�", trigger: "blur" },
+ ],
+ title: [{ required: true, message: "璇疯緭鍏ョ敵璇锋爣棰�", trigger: "blur" }],
+ sealType: [{ required: true, message: "璇烽�夋嫨鐢ㄥ嵃绫诲瀷", trigger: "change" }],
+ reason: [{ required: true, message: "璇疯緭鍏ョ敵璇峰師鍥�", trigger: "blur" }],
+ };
-const sealRules = {
- title: [{ required: true, message: '璇疯緭鍏ョ敵璇锋爣棰�', trigger: 'blur' }],
- sealType: [{ required: true, message: '璇烽�夋嫨鐢ㄥ嵃绫诲瀷', trigger: 'change' }],
- reason: [{ required: true, message: '璇疯緭鍏ョ敵璇峰師鍥�', trigger: 'blur' }]
-}
+ const sealSearchForm = reactive({
+ title: "",
+ status: "",
+ });
+ // 鍒嗛〉鍙傛暟
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ // 瑙勭珷鍒跺害鐩稿叧
+ const showRegulationDialog = ref(false);
+ const showRegulationDetailDialog = ref(false);
+ const showVersionHistoryDialog = ref(false);
+ const showReadStatusDialog = ref(false);
+ const currentRegulationDetail = ref(null);
+ const regulationFormRef = ref();
+ const regulationForm = reactive({
+ id: "",
+ regulationNum: "",
+ title: "",
+ category: "",
+ content: "",
+ version: "",
+ status: "active",
+ readCount: 0,
+ effectiveTime: "",
+ scope: [],
+ requireConfirm: false,
+ });
-const sealSearchForm = reactive({
- keyword: '',
- status: ''
-})
+ const readStatus = ref({
+ id: "",
+ ruleId: "",
+ employee: "",
+ department: "",
+ createTime: "",
+ confirmTime: "",
+ status: "unconfirmed",
+ });
-// 瑙勭珷鍒跺害鐩稿叧
-const showRegulationDialog = ref(false)
-const showRegulationDetailDialog = ref(false)
-const showVersionHistoryDialog = ref(false)
-const showReadStatusDialog = ref(false)
-const currentRegulationDetail = ref(null)
-const regulationFormRef = ref()
-const regulationForm = reactive({
- title: '',
- category: '',
- content: '',
- effectiveTime: '',
- scope: [],
- requireConfirm: true
-})
+ const regulationRules = {
+ title: [{ required: true, message: "璇疯緭鍏ュ埗搴︽爣棰�", trigger: "blur" }],
+ category: [{ required: true, message: "璇烽�夋嫨鍒跺害鍒嗙被", trigger: "change" }],
+ content: [{ required: true, message: "璇疯緭鍏ュ埗搴﹀唴瀹�", trigger: "blur" }],
+ effectiveTime: [
+ { required: true, message: "璇烽�夋嫨鐢熸晥鏃堕棿", trigger: "change" },
+ ],
+ scope: [{ required: true, message: "璇烽�夋嫨閫傜敤鑼冨洿", trigger: "change" }],
+ };
-const regulationRules = {
- title: [{ required: true, message: '璇疯緭鍏ュ埗搴︽爣棰�', trigger: 'blur' }],
- category: [{ required: true, message: '璇烽�夋嫨鍒跺害鍒嗙被', trigger: 'change' }],
- content: [{ required: true, message: '璇疯緭鍏ュ埗搴﹀唴瀹�', trigger: 'blur' }],
- effectiveTime: [{ required: true, message: '璇烽�夋嫨鐢熸晥鏃堕棿', trigger: 'change' }],
- scope: [{ required: true, message: '璇烽�夋嫨閫傜敤鑼冨洿', trigger: 'change' }]
-}
+ const regulationSearchForm = reactive({
+ title: "",
+ category: "",
+ });
-const regulationSearchForm = reactive({
- keyword: '',
- category: ''
-})
+ // 鍋囨暟鎹�
+ const sealApplications = ref([]);
-// 鍋囨暟鎹�
-const sealApplications = ref([
- {
- id: 'SEAL001',
- title: '鍚堝悓鐢ㄥ嵃鐢宠',
- applicant: '闄堝織寮�',
- department: '閿�鍞儴',
- sealType: '鍚堝悓涓撶敤绔�',
- applyTime: '2024-01-15 10:30:00',
- status: 'pending',
- reason: '瀹㈡埛鍚堝悓闇�瑕佺洊绔�'
- },
- {
- id: 'SEAL002',
- title: '璐㈠姟鎶ュ憡鐢ㄥ嵃',
- applicant: '鐜嬪缓鍥�',
- department: '璐㈠姟閮�',
- sealType: '璐㈠姟涓撶敤绔�',
- applyTime: '2024-01-14 14:20:00',
- status: 'approved',
- reason: '瀛e害璐㈠姟鎶ュ憡闇�瑕佺洊绔�'
- },
- {
- id: 'SEAL003',
- title: '鍏徃绔犵▼鐢ㄥ嵃',
- applicant: '瀛欐槑鍗�',
- department: '娉曞姟閮�',
- sealType: '鍏珷',
- applyTime: '2024-01-13 09:15:00',
- status: 'rejected',
- reason: '鍏徃绔犵▼淇敼闇�瑕佺洊绔�'
- }
-])
+ const regulations = ref([]);
-const regulations = ref([
- {
- id: 'REG001',
- title: '鍛樺伐鑰冨嫟绠$悊鍒跺害',
- category: 'hr',
- version: 'v2.1',
- publisher: '浜轰簨閮�',
- publishTime: '2024-01-10 09:00:00',
- status: 'active',
- readCount: 45,
- content: '涓鸿鑼冨憳宸ヨ�冨嫟绠$悊锛屾彁楂樺伐浣滄晥鐜囷紝鐗瑰埗瀹氭湰鍒跺害...'
- },
- {
- id: 'REG002',
- title: '璐㈠姟鎶ラ攢鍒跺害',
- category: 'finance',
- version: 'v1.5',
- publisher: '璐㈠姟閮�',
- publishTime: '2024-01-08 14:30:00',
- status: 'active',
- readCount: 38,
- content: '涓鸿鑼冭储鍔℃姤閿�娴佺▼锛屽姞寮鸿储鍔$鐞嗭紝鐗瑰埗瀹氭湰鍒跺害...'
- },
- {
- id: 'REG003',
- title: '瀹夊叏鐢熶骇绠$悊鍒跺害',
- category: 'safety',
- version: 'v3.0',
- publisher: '瀹夊叏閮�',
- publishTime: '2024-01-05 16:00:00',
- status: 'active',
- readCount: 52,
- content: '涓虹‘淇濆憳宸ヤ汉韬畨鍏紝棰勯槻瀹夊叏浜嬫晠鍙戠敓锛岀壒鍒跺畾鏈埗搴�...'
- }
-])
+ const versionHistory = ref([]);
-const versionHistory = ref([
- { version: 'v2.1', updateTime: '2024-01-10 09:00:00', updater: '浜轰簨閮�', changeLog: '鏇存柊鑰冨嫟鏃堕棿瑙勫畾' },
- { version: 'v2.0', updateTime: '2023-12-15 10:30:00', updater: '浜轰簨閮�', changeLog: '鏂板鍔犵彮绠$悊瑙勫畾' },
- { version: 'v1.0', updateTime: '2023-11-01 14:00:00', updater: '浜轰簨閮�', changeLog: '棣栨鍙戝竷' }
-])
+ const readStatusList = ref([]);
+ // { employee: '闄堝織寮�', department: '閿�鍞儴', readTime: '2025-01-11 10:30:00', confirmTime: '2025-01-11 10:35:00', status: 'confirmed' },
+ // { employee: '鍒橀泤濠�', department: '鎶�鏈儴', readTime: '2025-01-11 14:20:00', confirmTime: '', status: 'unconfirmed' },
+ // { employee: '鐜嬪缓鍥�', department: '璐㈠姟閮�', readTime: '2025-01-12 09:15:00', confirmTime: '2025-01-12 09:20:00', status: 'confirmed' }
-const readStatusList = ref([
- { employee: '闄堝織寮�', department: '閿�鍞儴', readTime: '2024-01-11 10:30:00', confirmTime: '2024-01-11 10:35:00', status: 'confirmed' },
- { employee: '鍒橀泤濠�', department: '鎶�鏈儴', readTime: '2024-01-11 14:20:00', confirmTime: '', status: 'unconfirmed' },
- { employee: '鐜嬪缓鍥�', department: '璐㈠姟閮�', readTime: '2024-01-12 09:15:00', confirmTime: '2024-01-12 09:20:00', status: 'confirmed' }
-])
+ // 鐢ㄥ嵃鐢宠鐘舵��
+ const getStatusType = status => {
+ const statusMap = {
+ pending: "warning",
+ approved: "success",
+ rejected: "danger",
+ };
+ return statusMap[status] || "info";
+ };
+ // 鍒跺害鐘舵��
+ const getStatusText = status => {
+ const statusMap = {
+ pending: "寰呭鎵�",
+ approved: "宸查�氳繃",
+ rejected: "宸叉嫆缁�",
+ };
+ return statusMap[status] || "鏈煡";
+ };
+ // 鐢ㄥ嵃绫诲瀷
+ const getSealTypeText = sealType => {
+ const sealTypeMap = {
+ official: "鍏珷",
+ contract: "鍚堝悓涓撶敤绔�",
+ finance: "璐㈠姟涓撶敤绔�",
+ tegal: "鎶�鏈笓鐢ㄧ珷",
+ };
+ return sealTypeMap[sealType] || "鏈煡";
+ };
+ // 鍒跺害鍒嗙被
+ const getCategoryText = category => {
+ const categoryMap = {
+ hr: "浜轰簨鍒跺害",
+ finance: "璐㈠姟鍒跺害",
+ safety: "瀹夊叏鍒跺害",
+ tech: "鎶�鏈埗搴�",
+ };
+ return categoryMap[category] || "鏈煡";
+ };
+ // 鎼滅储鍗扮珷鐢宠
+ const searchSealApplications = () => {
+ page.current = 1;
+ getSealApplicationList();
-// 鏂规硶
-const getStatusType = (status) => {
- const statusMap = {
- pending: 'warning',
- approved: 'success',
- rejected: 'danger'
- }
- return statusMap[status] || 'info'
-}
+ // ElMessage.success('鎼滅储瀹屾垚')
+ };
+ // 閲嶇疆鍗扮珷鐢宠鎼滅储
+ const resetSealSearch = () => {
+ sealSearchForm.title = "";
+ sealSearchForm.status = "";
+ searchSealApplications();
+ };
+ // 鎼滅储鍒跺害
+ const searchRegulations = () => {
+ page.current = 1;
+ getRegulationList();
+ };
+ // 閲嶇疆鍒跺害鎼滅储
+ const resetRegulationSearch = () => {
+ regulationSearchForm.title = "";
+ regulationSearchForm.category = "";
+ searchRegulations();
+ };
+ // 鎻愪氦鐢ㄥ嵃鐢宠
+ const submitSealApplication = async () => {
+ try {
+ await sealFormRef.value.validate();
+ addSealApplication(sealForm)
+ .then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鐢宠鎻愪氦鎴愬姛");
+ showSealApplyDialog.value = false;
+ getSealApplicationList();
+ Object.assign(sealForm, {
+ applicationNum: "",
+ title: "",
+ sealType: "",
+ reason: "",
+ urgency: "normal",
+ status: "pending",
+ });
+ }
+ })
+ .catch(err => {
+ ElMessage.error(err.msg);
+ });
+ } catch (error) {
+ ElMessage.error("璇峰畬鍠勭敵璇蜂俊鎭�");
+ }
+ };
+ // 鏂板
+ const handleAdd = () => {
+ operationType.value = "add";
+ resetRegulationForm();
+ showRegulationDialog.value = true;
+ };
-const getStatusText = (status) => {
- const statusMap = {
- pending: '寰呭鎵�',
- approved: '宸查�氳繃',
- rejected: '宸叉嫆缁�'
- }
- return statusMap[status] || '鏈煡'
-}
-
-const getCategoryText = (category) => {
- const categoryMap = {
- hr: '浜轰簨鍒跺害',
- finance: '璐㈠姟鍒跺害',
- safety: '瀹夊叏鍒跺害',
- tech: '鎶�鏈埗搴�'
- }
- return categoryMap[category] || '鏈煡'
-}
-
-const searchSealApplications = () => {
- ElMessage.success('鎼滅储瀹屾垚')
-}
-
-const resetSealSearch = () => {
- sealSearchForm.keyword = ''
- sealSearchForm.status = ''
- searchSealApplications()
-}
-
-const searchRegulations = () => {
- ElMessage.success('鎼滅储瀹屾垚')
-}
-
-const resetRegulationSearch = () => {
- regulationSearchForm.keyword = ''
- regulationSearchForm.category = ''
- searchRegulations()
-}
-
-const submitSealApplication = async () => {
- try {
- await sealFormRef.value.validate()
- ElMessage.success('鐢宠鎻愪氦鎴愬姛')
- showSealApplyDialog.value = false
- Object.assign(sealForm, {
- title: '',
- sealType: '',
- reason: '',
- urgency: 'normal'
+ // 缂栬緫
+ const handleEdit = row => {
+ operationType.value = "edit";
+ Object.assign(regulationForm, row);
+ showRegulationDialog.value = true;
+ };
+ // 搴熷純
+ const repealEdit = row => {
+ operationType.value = "edit";
+ Object.assign(regulationForm, row);
+ regulationForm.status = "repealed";
+ ElMessageBox.confirm("纭搴熷純璇ュ埗搴︼紵", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
- } catch (error) {
- ElMessage.error('璇峰畬鍠勭敵璇蜂俊鎭�')
- }
-}
-
-const submitRegulation = async () => {
- try {
- await regulationFormRef.value.validate()
- ElMessage.success('鍒跺害鍙戝竷鎴愬姛')
- showRegulationDialog.value = false
+ .then(() => {
+ updateRuleManagement(regulationForm).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害搴熷純鎴愬姛");
+ // showRegulationDialog.value = false
+ getRegulationList();
+ resetRegulationForm();
+ }
+ });
+ })
+ .catch(() => {
+ ElMessage({
+ type: "info",
+ message: "宸插彇娑堝簾寮�",
+ });
+ });
+ };
+ // 鍙戝竷鍒跺害
+ const submitRegulation = async () => {
+ try {
+ await regulationFormRef.value.validate();
+ if (operationType.value == "add") {
+ addRuleManagement(regulationForm).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害鍙戝竷鎴愬姛");
+ showRegulationDialog.value = false;
+ getRegulationList();
+ resetRegulationForm();
+ }
+ });
+ } else {
+ updateRuleManagement(regulationForm).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害缂栬緫鎴愬姛");
+ showRegulationDialog.value = false;
+ resetRegulationForm();
+ getRegulationList();
+ }
+ });
+ }
+ } catch (err) {
+ ElMessage.error(err.msg);
+ }
+ };
+ //閲嶇疆鍒跺害琛ㄥ崟
+ const resetRegulationForm = () => {
Object.assign(regulationForm, {
- title: '',
- category: '',
- content: '',
- effectiveTime: '',
+ id: "",
+ regulationNum: "",
+ title: "",
+ category: "",
+ content: "",
+ version: "",
+ status: "active",
+ readCount: 0,
+ effectiveTime: "",
scope: [],
- requireConfirm: true
- })
- } catch (error) {
- ElMessage.error('璇峰畬鍠勫埗搴︿俊鎭�')
- }
-}
+ requireConfirm: false,
+ });
+ };
-const viewSealDetail = (row) => {
- currentSealDetail.value = row
- showSealDetailDialog.value = true
-}
+ // 鏌ョ湅鐢ㄥ嵃鐢宠璇︽儏
+ const viewSealDetail = row => {
+ currentSealDetail.value = row;
+ showSealDetailDialog.value = true;
+ };
+ // 瀹℃壒鐢ㄥ嵃鐢宠
+ const approveSeal = row => {
+ console.log(row);
+ ElMessageBox.confirm("纭閫氳繃璇ョ敤鍗扮敵璇凤紵", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ row.status = "approved";
+ updateSealApplication(row).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("瀹℃壒閫氳繃");
+ }
+ });
+ });
+ };
+ // 鎷掔粷鐢ㄥ嵃鐢宠
+ const rejectSeal = row => {
+ ElMessageBox.prompt("璇疯緭鍏ユ嫆缁濆師鍥�", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ inputPattern: /\S+/,
+ inputErrorMessage: "鎷掔粷鍘熷洜涓嶈兘涓虹┖",
+ }).then(({ value }) => {
+ row.status = "rejected";
+ updateSealApplication(row).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("瀹℃壒鎷掔粷");
+ }
+ });
+ ElMessage.success("宸叉嫆缁濈敵璇�");
+ });
+ };
+ // 鑾峰彇鍦ㄨ亴鍛樺伐鍒楄〃
+ const getList = () => {
+ tableLoading.value = true;
+ //鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛淇℃伅
+ getUserProfile().then(res => {
+ if (res.code == 200) {
+ console.log(res.data.userName);
+ currentUser.value = res.data.userName;
+ }
+ });
+ staffJoinListPage({ staffState: 1, ...page })
+ .then(res => {
+ tableLoading.value = false;
+ // tableData.value = res.data.records
+ // //绛涢�夊嚭鍜宑urrentUser鍚屽悕鐨勪汉鍛�
+ tableData.value = res.data.records.filter(
+ item => item.staffName === currentUser.value
+ );
+ page.total = res.data.total;
-const approveSeal = (row) => {
- ElMessageBox.confirm('纭閫氳繃璇ョ敤鍗扮敵璇凤紵', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- row.status = 'approved'
- ElMessage.success('瀹℃壒閫氳繃')
- })
-}
+ if (tableData.value.length == 0) {
+ ElMessage.error("褰撳墠鐢ㄦ埛鏈姞鍏ヤ换浣曢儴闂�");
+ }
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
-const rejectSeal = (row) => {
- ElMessageBox.prompt('璇疯緭鍏ユ嫆缁濆師鍥�', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- inputPattern: /\S+/,
- inputErrorMessage: '鎷掔粷鍘熷洜涓嶈兘涓虹┖'
- }).then(({ value }) => {
- row.status = 'rejected'
- ElMessage.success('宸叉嫆缁濈敵璇�')
- })
-}
+ // 鏌ョ湅鍒跺害鐗堟湰鍘嗗彶
+ const viewVersionHistory = row => {
+ showVersionHistoryDialog.value = true;
+ const params = {
+ category: row.category,
+ };
+ listRuleManagement(page, params).then(res => {
+ if (res.code == 200) {
+ versionHistory.value = res.data.records;
+ }
+ });
+ };
+ // 鏌ョ湅鍒跺害璇︽儏
+ const viewRegulation = row => {
+ getList();
+ currentRegulationDetail.value = row;
+ showRegulationDetailDialog.value = true;
+ getReadingStatusByRuleId(row.id).then(res => {
+ if (res.code == 200) {
+ readStatusList.value = res.data;
+ if (readStatusList.value.length == 0 && tableData.value.length > 0) {
+ const params = {
+ ruleId: row.id,
+ employee: tableData.value[0].staffName,
+ department: tableData.value[0].postJob,
+ status: "unconfirmed",
+ };
+ addReadingStatus(params).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害闃呰鎴愬姛");
+ }
+ });
+ }
+ }
+ });
+ };
+ // 鏌ョ湅鍒跺害闃呰鐘舵��
+ const viewReadStatus = row => {
+ showReadStatusDialog.value = true;
+ //鏌ョ湅闃呰鐘舵�佸垪琛�
+ getReadingStatusByRuleId(row.id).then(res => {
+ if (res.code == 200) {
+ readStatusList.value = res.data;
+ }
+ });
+ };
-const viewRegulation = (row) => {
- currentRegulationDetail.value = row
- showRegulationDetailDialog.value = true
-}
+ //纭鏌ョ湅
+ const resetForm = row => {
+ console.log("row", row);
+ row.readCount = row.readCount + 1;
-const editRegulation = (row) => {
- ElMessage.info('缂栬緫鍔熻兘寮�鍙戜腑...')
-}
+ updateRuleManagement(row).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鏌ョ湅鏁伴噺淇敼鎴愬姛");
+ //淇敼闃呰鐘舵��
+ //鏍规嵁鍒跺害id鍜屽綋鍓嶇櫥褰曠殑鍛樺伐寰楀埌闃呰鐘舵��
+ // let item = readStatusList.value.filter(item => item.employee == tableData.value[0].staffName )
+ // if(item.length>0){
+ // item[0].status = 'confirmed',
+ // item[0].confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0];
+ // }
+ // 绛涢�夊綋鍓嶅憳宸ュ搴旇鍒跺害鐨勯槄璇荤姸鎬佽褰�
+ let statusItem = readStatusList.value.find(
+ item =>
+ item.employee === tableData.value[0].staffName &&
+ item.ruleId === row.id
+ );
-const viewVersionHistory = (row) => {
- showVersionHistoryDialog.value = true
-}
+ if (statusItem) {
+ // 濡傛灉鎵惧埌璁板綍锛屾洿鏂扮姸鎬佸拰纭鏃堕棿
+ statusItem.status = "confirmed";
+ // 鏍煎紡鍖栨椂闂翠负"YYYY-MM-DD HH:mm:ss"鏍煎紡
+ const now = new Date();
+ statusItem.confirmTime = `${now.getFullYear()}-${String(
+ now.getMonth() + 1
+ ).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")} ${String(
+ now.getHours()
+ ).padStart(2, "0")}:${String(now.getMinutes()).padStart(
+ 2,
+ "0"
+ )}:${String(now.getSeconds()).padStart(2, "0")}`;
+ // statusItem.confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0];
-const viewReadStatus = (row) => {
- showReadStatusDialog.value = true
-}
+ updateReadingStatus(statusItem).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害闃呰鐘舵�佷慨鏀规垚鍔�");
+ }
+ });
+ }
+ }
+ });
+ };
-onMounted(() => {
- // 鍒濆鍖�
-})
+ // 瀵煎嚭鐢ㄥ嵃鐢宠
+ const { proxy } = getCurrentInstance();
+ const handleExport = () => {
+ proxy.download(
+ "/sealApplicationManagement/export",
+ { ...sealSearchForm },
+ "鐢ㄥ嵃鐢宠.xlsx"
+ );
+ };
+
+ // 鑾峰彇鍗扮珷鐢宠鍒楄〃鏁版嵁
+ const getSealApplicationList = async () => {
+ tableLoading.value = true;
+ listSealApplication(page, sealSearchForm)
+ .then(res => {
+ //鑾峰彇褰撳墠鐧诲綍鐨勯儴闂ㄤ俊鎭�
+ // 鑾峰彇褰撳墠鐧诲綍鐨勯儴闂ㄤ俊鎭苟杩囨护鏁版嵁
+ const currentFactoryName = userStore.currentFactoryName;
+ if (currentFactoryName) {
+ // 鏍规嵁currentFactoryName杩囨护鍑篸epartment鐩稿悓鐨勬暟鎹�
+ sealApplications.value = res.data.records.filter(
+ item => item.department === currentFactoryName
+ );
+ // 鏇存柊杩囨护鍚庣殑鎬绘暟
+ page.total = sealApplications.value.length;
+ } else {
+ // 濡傛灉娌℃湁currentFactoryName锛屽垯鏄剧ず鎵�鏈夋暟鎹�
+ sealApplications.value = res.data.records;
+ page.total = res.data.total;
+ }
+ // sealApplications.value = res.data.records
+ // page.value.total = res.data.total;
+ tableLoading.value = false;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 鑾峰彇瑙勭珷鍒跺害鍒楄〃鏁版嵁
+ const getRegulationList = async () => {
+ tableLoading.value = true;
+ listRuleManagement(page, regulationSearchForm)
+ .then(res => {
+ regulations.value = res.data.records;
+ // 杩囨护鎺夊凡搴熷純鐨勫埗搴�
+ // regulations.value = res.data.records.filter(item => item.status !== 'repealed')
+ page.total = res.data.total;
+ tableLoading.value = false;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+
+ onMounted(() => {
+ // 鍒濆鍖�
+ getSealApplicationList();
+ getRegulationList();
+ });
</script>
<style scoped>
-.app-container {
- padding: 20px;
-}
+ .app-container {
+ padding: 20px;
+ }
-.card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
+ .card-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
-.tab-content {
- padding: 20px 0;
-}
+ .tab-content {
+ padding: 20px 0;
+ }
-.mb-20 {
- margin-bottom: 20px;
-}
+ .mb-20 {
+ margin-bottom: 20px;
+ }
-.mt-20 {
- margin-top: 20px;
-}
+ .mt-20 {
+ margin-top: 20px;
+ }
-.ml-10 {
- margin-left: 10px;
-}
+ .ml-10 {
+ margin-left: 10px;
+ }
-.regulation-content {
- background-color: #f5f5f5;
- padding: 15px;
- border-radius: 4px;
- line-height: 1.6;
- white-space: pre-wrap;
-}
+ .regulation-content {
+ background-color: #f5f5f5;
+ padding: 15px;
+ border-radius: 4px;
+ line-height: 1.6;
+ white-space: pre-wrap;
+ height: 200px;
+ }
-.dialog-footer {
- display: flex;
- justify-content: flex-end;
- gap: 10px;
-}
+ .dialog-footer {
+ display: flex;
+ justify-content: flex-end;
+ gap: 10px;
+ }
</style>
--
Gitblit v1.9.3