From 3960a146999f82053bec81333095b0637f7738b2 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 12 一月 2026 13:20:24 +0800
Subject: [PATCH] fix: 完成消息通知

---
 src/layout/components/NotificationCenter/index.vue             |    2 
 src/views/basicData/customerFile/index.vue                     |   98 ++++++++++++++++++++------------
 src/api/system/message.js                                      |   18 +++---
 src/views/basicData/supplierManage/components/BlacklistTab.vue |    9 ++
 src/views/basicData/supplierManage/components/HomeTab.vue      |    9 ++
 5 files changed, 88 insertions(+), 48 deletions(-)

diff --git a/src/api/system/message.js b/src/api/system/message.js
index d2f3ac6..b046016 100644
--- a/src/api/system/message.js
+++ b/src/api/system/message.js
@@ -3,7 +3,7 @@
 // 鏌ヨ娑堟伅閫氱煡鍒楄〃
 export function listMessage(query) {
   return request({
-    url: "/system/message/list",
+    url: "/system/notice/list",
     method: "get",
     params: query,
   });
@@ -12,33 +12,33 @@
 // 鏌ヨ鏈娑堟伅鏁伴噺
 export function getUnreadCount() {
   return request({
-    url: "/system/message/unreadCount",
+    url: "/system/notice/getCount",
     method: "get",
   });
 }
 
 // 鏍囪娑堟伅涓哄凡璇�
-export function markAsRead(messageId) {
+export function markAsRead(noticeId) {
   return request({
-    url: "/system/message/markAsRead",
+    url: "/system/notice/markAsRead",
     method: "post",
-    data: { messageId },
+    data: { noticeId },
   });
 }
 
 // 涓�閿爣璁版墍鏈夋秷鎭负宸茶
 export function markAllAsRead() {
   return request({
-    url: "/system/message/markAllAsRead",
+    url: "/system/notice/markAllAsRead",
     method: "post",
   });
 }
 
 // 纭娑堟伅
-export function confirmMessage(messageId) {
+export function confirmMessage(noticeId, status) {
   return request({
-    url: "/system/message/confirm",
+    url: "/system/notice/confirm",
     method: "post",
-    data: { messageId },
+    data: { noticeId, status },
   });
 }
diff --git a/src/layout/components/NotificationCenter/index.vue b/src/layout/components/NotificationCenter/index.vue
index 2864aae..ea365ee 100644
--- a/src/layout/components/NotificationCenter/index.vue
+++ b/src/layout/components/NotificationCenter/index.vue
@@ -137,7 +137,7 @@
 // 纭娑堟伅
 const handleConfirm = async (messageId) => {
   try {
-    const res = await confirmMessage(messageId)
+    const res = await confirmMessage(messageId, 1)
     if (res.code === 200) {
       ElMessage.success('纭鎴愬姛')
       // 鏍囪涓哄凡璇�
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index ea75164..0f39e25 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -47,14 +47,11 @@
         @pagination="pagination"
       ></PIMTable>
     </div>
-    <FormDialog
+    <el-dialog
       v-model="dialogFormVisible"
-      :title="(type) => type === 'add' ? '鏂板瀹㈡埛淇℃伅' : '缂栬緫瀹㈡埛淇℃伅'"
-      :operation-type="operationType"
+      :title="operationType === 'add' ? '鏂板瀹㈡埛淇℃伅' : '缂栬緫瀹㈡埛淇℃伅'"
       width="70%"
       @close="closeDia"
-      @confirm="submitForm"
-      @cancel="closeDia"
     >
       <el-form
         :model="form"
@@ -196,31 +193,63 @@
           </el-col>
         </el-row>
       </el-form>
-    </FormDialog>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="submitForm">纭</el-button>
+          <el-button @click="closeDia">鍙栨秷</el-button>
+        </div>
+      </template>
+    </el-dialog>
     <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
-    <ImportDialog
-      ref="importDialogRef"
-      v-model="upload.open"
+    <el-dialog
       :title="upload.title"
+      v-model="upload.open"
       width="400px"
-      :action="upload.url"
-      :headers="upload.headers"
-      :disabled="upload.isUploading"
-      :before-upload="upload.beforeUpload"
-      :on-progress="upload.onProgress"
-      :on-success="upload.onSuccess"
-      :on-error="upload.onError"
-      :on-change="upload.onChange"
-      @confirm="submitFileForm"
-      @cancel="handleImportCancel"
-      @download-template="importTemplate"
-    />
+      append-to-body
+    >
+      <el-upload
+        ref="uploadRef"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :before-upload="upload.beforeUpload"
+        :on-progress="upload.onProgress"
+        :on-success="upload.onSuccess"
+        :on-error="upload.onError"
+        :on-change="upload.onChange"
+        :auto-upload="false"
+        drag
+      >
+        <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+        <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+        <template #tip>
+          <div class="el-upload__tip text-center">
+            <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
+            <el-link
+              type="primary"
+              :underline="false"
+              style="font-size: 12px; vertical-align: baseline"
+              @click="importTemplate"
+              >涓嬭浇妯℃澘</el-link
+            >
+          </div>
+        </template>
+      </el-upload>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
+          <el-button @click="upload.open = false">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import {onMounted, ref} from "vue";
-import { Search, Close } from "@element-plus/icons-vue";
+import { Search } from "@element-plus/icons-vue";
 import {
   addCustomer,
   delCustomer,
@@ -232,9 +261,6 @@
 import { userListNoPage } from "@/api/system/user.js";
 import useUserStore from "@/store/modules/user";
 import { getToken } from "@/utils/auth.js";
-import { getCurrentDate } from "@/utils/index.js";
-import FormDialog from "@/components/Dialog/FormDialog.vue";
-import ImportDialog from "@/components/Dialog/ImportDialog.vue";
 const { proxy } = getCurrentInstance();
 const userStore = useUserStore();
 
@@ -312,7 +338,6 @@
 const selectedRows = ref([]);
 const userList = ref([]);
 const tableLoading = ref(false);
-const importDialogRef = ref(null);
 const page = reactive({
   current: 1,
   size: 100,
@@ -401,9 +426,7 @@
     if(response.code === 200){
       proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
       upload.open = false;
-      if (importDialogRef.value) {
-        importDialogRef.value.clearFiles();
-      }
+      proxy.$refs["uploadRef"].clearFiles();
       getList();
     }else if(response.code === 500){
       proxy.$modal.msgError(response.msg);
@@ -461,13 +484,7 @@
 /** 鎻愪氦涓婁紶鏂囦欢 */
 function submitFileForm() {
   upload.isUploading = true;
-  if (importDialogRef.value) {
-    importDialogRef.value.submit();
-  }
-}
-/** 鍙栨秷瀵煎叆 */
-function handleImportCancel() {
-  upload.open = false;
+  proxy.$refs["uploadRef"].submit();
 }
 /** 瀵煎叆鎸夐挳鎿嶄綔 */
 function handleImport() {
@@ -597,6 +614,15 @@
     });
 };
 
+// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+function getCurrentDate() {
+  const today = new Date();
+  const year = today.getFullYear();
+  const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+  const day = String(today.getDate()).padStart(2, "0");
+  return `${year}-${month}-${day}`;
+}
+
 onMounted(() => {
 	getList();
 });
diff --git a/src/views/basicData/supplierManage/components/BlacklistTab.vue b/src/views/basicData/supplierManage/components/BlacklistTab.vue
index 7365e90..894a286 100644
--- a/src/views/basicData/supplierManage/components/BlacklistTab.vue
+++ b/src/views/basicData/supplierManage/components/BlacklistTab.vue
@@ -240,7 +240,6 @@
 import useUserStore from "@/store/modules/user";
 import { getToken } from "@/utils/auth.js";
 import FilesDia from "../filesDia.vue";
-import { getCurrentDate } from "@/utils/index.js";
 const { proxy } = getCurrentInstance();
 const userStore = useUserStore();
 
@@ -542,6 +541,14 @@
       });
 };
 
+// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+function getCurrentDate() {
+  const today = new Date();
+  const year = today.getFullYear();
+  const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+  const day = String(today.getDate()).padStart(2, "0");
+  return `${year}-${month}-${day}`;
+}
 // 鎵撳紑闄勪欢寮规
 const openFilesFormDia = (row) => {
   nextTick(() => {
diff --git a/src/views/basicData/supplierManage/components/HomeTab.vue b/src/views/basicData/supplierManage/components/HomeTab.vue
index b2debcb..67e3646 100644
--- a/src/views/basicData/supplierManage/components/HomeTab.vue
+++ b/src/views/basicData/supplierManage/components/HomeTab.vue
@@ -246,7 +246,6 @@
 import useUserStore from "@/store/modules/user";
 import { getToken } from "@/utils/auth.js";
 import FilesDia from "../filesDia.vue";
-import { getCurrentDate } from "@/utils/index.js";
 const { proxy } = getCurrentInstance();
 const userStore = useUserStore();
 
@@ -548,6 +547,14 @@
       });
 };
 
+// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+function getCurrentDate() {
+  const today = new Date();
+  const year = today.getFullYear();
+  const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+  const day = String(today.getDate()).padStart(2, "0");
+  return `${year}-${month}-${day}`;
+}
 // 鎵撳紑闄勪欢寮规
 const openFilesFormDia = (row) => {
   nextTick(() => {

--
Gitblit v1.9.3