From ebe3507d1382bb124c1fb895a5e27f7063fdffdc Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 13 一月 2026 16:19:14 +0800
Subject: [PATCH] fix: 规章制度加一个附件功能

---
 src/views/collaborativeApproval/sealManagement/index.vue |  134 +++++++++++++++++++-------------------------
 1 files changed, 59 insertions(+), 75 deletions(-)

diff --git a/src/views/collaborativeApproval/sealManagement/index.vue b/src/views/collaborativeApproval/sealManagement/index.vue
index 4c9f2c3..8e0d054 100644
--- a/src/views/collaborativeApproval/sealManagement/index.vue
+++ b/src/views/collaborativeApproval/sealManagement/index.vue
@@ -12,11 +12,15 @@
         <div class="tab-content">
             <el-row :gutter="20" class="mb-20 ">
               <span class="ml-10">鐢ㄥ嵃鏍囬锛�</span>
-              <el-col :span="6">
+              <el-col :span="4">
                 <el-input v-model="sealSearchForm.title" placeholder="璇疯緭鍏ョ敵璇锋爣棰�" clearable />
               </el-col>
+              <span class="ml-10">鐢ㄥ嵃缂栧彿锛�</span>
+              <el-col :span="4">
+                <el-input v-model="sealSearchForm.applicationNum" placeholder="璇疯緭鍏ョ敤鍗扮紪鍙�" clearable />
+              </el-col>
               <span class="search_title">瀹℃壒鐘舵�侊細</span>
-              <el-col :span="6">
+              <el-col :span="4">
                 <el-select v-model="sealSearchForm.status" placeholder="瀹℃壒鐘舵��" clearable>
                   <el-option label="寰呭鎵�" value="pending" />
                   <el-option label="宸查�氳繃" value="approved" />
@@ -26,6 +30,7 @@
               <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>
@@ -71,69 +76,10 @@
                 </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>
-      
-        
-          
-        
-
-        <!-- 瑙勭珷鍒跺害绠$悊 -->
-        
-          <!-- <div class="tab-content">
-            <el-row :gutter="20" class="mb-20">
-              <el-col :span="6">
-                <el-input v-model="regulationSearchForm.title" 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="handleAdd">
-                  鍙戝竷鍒跺害
-                </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="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="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="250" 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>
-                </template>
-              </el-table-column>
-            </el-table>
-                
-          </div> -->
-        
 
     <!-- 鐢ㄥ嵃鐢宠瀵硅瘽妗� -->
     <el-dialog v-model="showSealApplyDialog" title="鐢宠鐢ㄥ嵃" width="600px">
@@ -154,6 +100,16 @@
         </el-form-item>
         <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="approveUserId">
+          <el-select v-model="sealForm.approveUserId" placeholder="璇烽�夋嫨瀹℃壒浜�" style="width: 100%" filterable>
+            <el-option
+                v-for="user in userList"
+                :key="user.userId"
+                :label="user.nickName"
+                :value="user.userId"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="绱ф�ョ▼搴�" prop="urgency">
           <el-radio-group v-model="sealForm.urgency">
@@ -298,12 +254,13 @@
 </template>
 
 <script setup>
-import { ref, reactive, onMounted } from 'vue'
+import { ref, reactive, onMounted, getCurrentInstance, watch } from 'vue'
+import { useRoute } from 'vue-router'
 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 { getUserProfile, userListNoPageByTenantId } 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"
@@ -315,16 +272,19 @@
 const tableData = ref([])
 // 鐢ㄥ嵃鐢宠鐩稿叧
 const userStore = useUserStore()
+const route = useRoute()
 const showSealApplyDialog = ref(false)
 const tableLoading = ref(false)
 const showSealDetailDialog = ref(false)
 const currentSealDetail = ref(null)
 const sealFormRef = ref()
+const userList = ref([])
 const sealForm = reactive({
   applicationNum: '',
   title: '',
   sealType: '',
   reason: '',
+  approveUserId: '',
   urgency: 'normal',
   status: 'pending'
 })
@@ -333,17 +293,19 @@
   applicationNum: [{ required: true, message: '璇疯緭鍏ョ敵璇风紪鍙�', trigger: 'blur' }],
   title: [{ required: true, message: '璇疯緭鍏ョ敵璇锋爣棰�', trigger: 'blur' }],
   sealType: [{ required: true, message: '璇烽�夋嫨鐢ㄥ嵃绫诲瀷', trigger: 'change' }],
-  reason: [{ required: true, message: '璇疯緭鍏ョ敵璇峰師鍥�', trigger: 'blur' }]
+  reason: [{ required: true, message: '璇疯緭鍏ョ敵璇峰師鍥�', trigger: 'blur' }],
+  approveUserId: [{ required: true, message: '璇烽�夋嫨瀹℃壒浜�', trigger: 'change' }]
 }
 
 const sealSearchForm = reactive({
   title: '',
-  status: ''
+  status: '',
+  applicationNum: ''
 })
 // 鍒嗛〉鍙傛暟
 const page = reactive({
   current: 1,
-  size: 10,
+  size: 100,
   total: 0
 })
 // 瑙勭珷鍒跺害鐩稿叧
@@ -451,6 +413,7 @@
 const resetSealSearch = () => {
   sealSearchForm.title = ''
   sealSearchForm.status = ''
+  sealSearchForm.applicationNum = ''
   searchSealApplications()
 }
 // 鎼滅储鍒跺害
@@ -478,6 +441,7 @@
         title: '',
         sealType: '',
         reason: '',
+        approveUserId: '',
         urgency: 'normal',
         status: 'pending'
       })
@@ -619,12 +583,11 @@
       currentUser.value = res.data.userName
     }
   })
-  staffJoinListPage({staffState: 1}).then(res => {
+  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)
-    console.log("tableData",tableData.value) 
     page.total = res.data.total;
       
     if(tableData.value.length == 0){
@@ -723,6 +686,12 @@
   })
 }
 
+// 瀵煎嚭鐢ㄥ嵃鐢宠
+const { proxy } = getCurrentInstance()
+const handleExport = () => {
+  proxy.download('/sealApplicationManagement/export', { ...sealSearchForm }, '鐢ㄥ嵃鐢宠.xlsx')
+}
+
 // 鑾峰彇鍗扮珷鐢宠鍒楄〃鏁版嵁
 const getSealApplicationList = async () => {
   tableLoading.value = true
@@ -735,11 +704,11 @@
       // 鏍规嵁currentFactoryName杩囨护鍑篸epartment鐩稿悓鐨勬暟鎹�
       sealApplications.value = res.data.records.filter(item => item.department === currentFactoryName)
       // 鏇存柊杩囨护鍚庣殑鎬绘暟
-      page.value.total = sealApplications.value.length
+      page.total = sealApplications.value.length
     } else {
       // 濡傛灉娌℃湁currentFactoryName锛屽垯鏄剧ず鎵�鏈夋暟鎹�
       sealApplications.value = res.data.records
-      page.value.total = res.data.total
+      page.total = res.data.total
     }
     // sealApplications.value = res.data.records
     // page.value.total = res.data.total;
@@ -758,7 +727,7 @@
     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 => {
@@ -766,9 +735,24 @@
   })
 }
 
+// 鐩戝惉瀵硅瘽妗嗘墦寮�锛岃幏鍙栫敤鎴峰垪琛�
+watch(showSealApplyDialog, (newVal) => {
+  if (newVal) {
+    userListNoPageByTenantId().then((res) => {
+      userList.value = res.data;
+    });
+  }
+});
+
 onMounted(() => {
-  // 鍒濆鍖�
-  getSealApplicationList()
+  // 璺敱鎼哄甫 applicationNum 鏃讹紝棰勫~骞舵煡璇�
+  if (route.query.applicationNum) {
+    sealSearchForm.applicationNum = String(route.query.applicationNum)
+    page.current = 1
+    getSealApplicationList()
+  } else {
+    getSealApplicationList()
+  }
   getRegulationList()
 })
 </script>

--
Gitblit v1.9.3