From c19b65a66350ac7f3f1dde2d94cb16efdcddc41f Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期六, 22 八月 2026 17:18:08 +0800
Subject: [PATCH] refactor(collaborativeApproval): 统一日期格式化展示

---
 src/views/collaborativeApproval/sealManagement/index.vue |  102 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 66 insertions(+), 36 deletions(-)

diff --git a/src/views/collaborativeApproval/sealManagement/index.vue b/src/views/collaborativeApproval/sealManagement/index.vue
index 9d68848..5ebe27c 100644
--- a/src/views/collaborativeApproval/sealManagement/index.vue
+++ b/src/views/collaborativeApproval/sealManagement/index.vue
@@ -7,7 +7,6 @@
         </div>
       </template>
 
-      
    <!-- 鐢ㄥ嵃鐢宠绠$悊 -->
         <div class="tab-content">
             <el-row :gutter="20" class="mb-20 ">
@@ -45,7 +44,7 @@
               :isShowPagination="true"
               @pagination="paginationChange"
             />
-        </div> 
+        </div>
     </el-card>
 
     <!-- 鐢ㄥ嵃鐢宠瀵硅瘽妗� -->
@@ -119,7 +118,7 @@
           <el-descriptions-item label="鐢宠浜�">{{ currentSealDetail.createUserName }}</el-descriptions-item>
           <el-descriptions-item label="鎵�灞為儴闂�">{{ currentSealDetail.department }}</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="鐢宠鏃堕棿">{{ formatDate(currentSealDetail.createTime) }}</el-descriptions-item>
           <el-descriptions-item label="鐘舵��">
             <el-tag :type="getStatusType(currentSealDetail.status)">
               {{ getStatusText(currentSealDetail.status) }}
@@ -164,6 +163,10 @@
 import AttachmentUploadFile from '@/components/AttachmentUpload/file/index.vue'
 import FilePreview from '@/components/filePreview/index.vue'
 import download from '@/plugins/download.js'
+import { parseDate } from '@/utils/ruoyi'
+
+// 鏃ユ湡鍥炴樉鏍煎紡鍖栵紙YYYY-MM-DD锛�
+const formatDate = value => parseDate(value) || '-'
 
 // 鍝嶅簲寮忔暟鎹�
 // 鐢ㄥ嵃鐢宠鐩稿叧
@@ -177,6 +180,7 @@
 const sealFormRef = ref()
 const userList = ref([])
 const sealForm = reactive({
+  id: null,
   applicationNum: '',
   title: '',
   sealType: '',
@@ -241,9 +245,9 @@
 
 // 鐢ㄥ嵃鐢宠琛ㄦ牸鍒楅厤缃紙闇�鍦� getStatusText/getSealTypeText 绛変箣鍚庡畾涔夛級
 const sealTableColumn = ref([
-  { label: '鐢宠缂栧彿', prop: 'applicationNum',},
+  { label: '鐢宠缂栧彿', prop: 'applicationNum' },
   { label: '鐢宠鏍囬', prop: 'title', showOverflowTooltip: true },
-  { label: '鐢宠浜�', prop: 'createUserName', },
+  { label: '鐢宠浜�', prop: 'createUserName' },
   { label: '鎵�灞為儴闂�', prop: 'department', width: 150 },
   {
     label: '鐢ㄥ嵃绫诲瀷',
@@ -252,7 +256,7 @@
     formatData: (v) => getSealTypeText(v),
     formatType: () => 'info'
   },
-  { label: '鐢宠鏃堕棿', prop: 'createTime', width: 180 },
+  { label: '鐢宠鏃堕棿', prop: 'createTime', width: 180,dataType: "date" },
   {
     label: '鐘舵��',
     prop: 'status',
@@ -261,34 +265,38 @@
     formatData: (v) => getStatusText(v),
     formatType: (v) => getStatusType(v)
   },
+  { label: '瀹℃壒浜�', prop: 'approveUserName', width: 100 },
   {
     dataType: 'action',
     label: '鎿嶄綔',
-    width: 200,
+    width: 250,
     fixed: 'right',
     align: 'center',
     operation: [
       {
         name: '瀹℃壒',
         clickFun: (row) => approveSeal(row),
-        showHide: (row) => row.status === 'pending'
+        showHide: (row) => row.status === 'pending' && Number(userStore.id) === row.approveUserId
       },
       {
         name: '鎷掔粷',
         clickFun: (row) => rejectSeal(row),
-        showHide: (row) => row.status === 'pending'
+        showHide: (row) => row.status === 'pending' && Number(userStore.id) === row.approveUserId
       },
-			{ name: '璇︽儏', clickFun: (row) => viewSealDetail(row) }
+      {
+        name: '閲嶆柊鐢宠',
+        clickFun: (row) => reapplySeal(row),
+        showHide: (row) => row.status === 'rejected' && Number(userStore.id) === row.createUser
+      },
+      { name: '璇︽儏', clickFun: (row) => viewSealDetail(row) }
     ]
   }
 ])
 
 // 鎼滅储鍗扮珷鐢宠
 const searchSealApplications = () => {
-  page.current=1
+  page.current = 1
   getSealApplicationList()
-
-  // ElMessage.success('鎼滅储瀹屾垚')
 }
 // 閲嶇疆鍗扮珷鐢宠鎼滅储
 const resetSealSearch = () => {
@@ -297,37 +305,58 @@
   sealSearchForm.applicationNum = ''
   searchSealApplications()
 }
+
+// 閲嶆柊鐢宠鐢ㄥ嵃
+const reapplySeal = (row) => {
+  // 棰勫~琛ㄥ崟鏁版嵁
+  Object.assign(sealForm, {
+    id: row.id,
+    applicationNum: row.applicationNum,
+    title: row.title,
+    sealType: row.sealType,
+    reason: row.reason,
+    approveUserId: row.approveUserId,
+    urgency: row.urgency || 'normal',
+    status: 'pending',
+    storageBlobDTOs: row.storageBlobVOList || []
+  })
+  showSealApplyDialog.value = true
+}
+
 // 鎻愪氦鐢ㄥ嵃鐢宠
 const submitSealApplication = async () => {
   try {
     await sealFormRef.value.validate()
-    addSealApplication(sealForm).then(res => {
-      if(res.code == 200){
-        ElMessage.success('鐢宠鎻愪氦鎴愬姛')
+    const request = sealForm.id ? updateSealApplication : addSealApplication
+    request(sealForm).then(res => {
+      if (res.code == 200) {
+        ElMessage.success(sealForm.id ? '閲嶆柊鐢宠鎴愬姛' : '鐢宠鎻愪氦鎴愬姛')
         closeSealApplyDialog()
         getSealApplicationList()
         Object.assign(sealForm, {
-        applicationNum: '',
-        title: '',
-        sealType: '',
-        reason: '',
-        approveUserId: '',
-        urgency: 'normal',
-        status: 'pending',
-        storageBlobDTOs: []
-      })
+          id: null,
+          applicationNum: '',
+          title: '',
+          sealType: '',
+          reason: '',
+          approveUserId: '',
+          urgency: 'normal',
+          status: 'pending',
+          storageBlobDTOs: []
+        })
       }
     }).catch(err => {
       console.log(err.msg)
     })
-  
   } catch (error) {
   }
 }
+
 // 鍏抽棴鐢ㄥ嵃鐢宠瀵硅瘽妗�
 const closeSealApplyDialog = () => {
   // 娓呯┖琛ㄥ崟鏁版嵁
   Object.assign(sealForm, {
+    id: null,
     applicationNum: '',
     title: '',
     sealType: '',
@@ -383,7 +412,7 @@
   }).then(() => {
     row.status = 'approved'
     updateSealApplication(row).then(res => {
-      if(res.code == 200){
+      if (res.code == 200) {
         ElMessage.success('瀹℃壒閫氳繃')
         getSealApplicationList()
       }
@@ -399,8 +428,9 @@
     inputErrorMessage: '鎷掔粷鍘熷洜涓嶈兘涓虹┖'
   }).then(({ value }) => {
     row.status = 'rejected'
+    row.reason = value
     updateSealApplication(row).then(res => {
-      if(res.code == 200){
+      if (res.code == 200) {
         ElMessage.success('宸叉嫆缁濈敵璇�')
         getSealApplicationList()
       }
@@ -418,13 +448,13 @@
 const getSealApplicationList = async () => {
   tableLoading.value = true
   listSealApplication(page, sealSearchForm)
-  .then(res => {
-    sealApplications.value = res.data.records
-    page.total = res.data.total
-    tableLoading.value = false
-  }).catch(err => {
-    tableLoading.value = false
-  })
+    .then(res => {
+      sealApplications.value = res.data.records
+      page.total = res.data.total
+      tableLoading.value = false
+    }).catch(err => {
+      tableLoading.value = false
+    })
 }
 // 鍒嗛〉鍙樺寲澶勭悊
 const paginationChange = (obj) => {
@@ -491,4 +521,4 @@
 .attachment-table {
   border-radius: 4px;
 }
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.3