From cd406c6d8742951f87f588564bbde73a2273b916 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期一, 25 五月 2026 00:00:29 +0800
Subject: [PATCH] feat: 实际保养日期只保留年月日

---
 src/views/basicData/customerFile/index.vue |   95 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 69 insertions(+), 26 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index a080bd9..319db18 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -1,6 +1,7 @@
 <template>
   <div class="app-container">
-    <div class="search_form" style="margin-bottom: 20px;">
+    <div class="search_form"
+         style="margin-bottom: 20px;">
       <div>
         <span class="search_title">瀹㈡埛鍚嶇О锛�</span>
         <el-input v-model="searchForm.customerName"
@@ -27,6 +28,9 @@
       <div>
         <el-button type="primary"
                    @click="openForm('add')">鏂板瀹㈡埛</el-button>
+        <el-button type="primary"
+                   plain
+                   @click="back">娴佸叆鍏捣</el-button>
         <el-button @click="handleOut">瀵煎嚭</el-button>
         <el-button type="info"
                    plain
@@ -277,7 +281,8 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitReminderForm">纭</el-button>
+          <el-button type="primary"
+                     @click="submitReminderForm">纭</el-button>
           <el-button @click="closeReminderDialog">鍙栨秷</el-button>
         </div>
       </template>
@@ -360,7 +365,8 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitNegotiationForm">纭</el-button>
+          <el-button type="primary"
+                     @click="submitNegotiationForm">纭</el-button>
           <el-button @click="closeNegotiationDialog">鍙栨秷</el-button>
         </div>
       </template>
@@ -619,7 +625,14 @@
     addReturnVisit,
     getReturnVisit,
   } from "@/api/basicData/customerFile.js";
-  import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer} from "@/api/basicData/customer.js";
+  import {
+    listCustomer,
+    getCustomer,
+    addCustomer,
+    updateCustomer,
+    delCustomer,
+    backCustomer,
+  } from "@/api/basicData/customer.js";
   import { ElMessageBox } from "element-plus";
   import { userListNoPage } from "@/api/system/user.js";
   import useUserStore from "@/store/modules/user";
@@ -651,7 +664,7 @@
   const negotiationFormRef = ref();
   const negotiationForm = reactive({
     customerName: "",
-		customerId: "",
+    customerId: "",
     followUpMethod: "",
     followUpLevel: "",
     followUpTime: "",
@@ -801,13 +814,13 @@
             openForm("edit", row);
           },
         },
-				{
-					name: "娣诲姞娲借皥杩涘害",
-					type: "text",
-					clickFun: row => {
-						openNegotiationDialog(row);
-					},
-				},
+        {
+          name: "娣诲姞娲借皥杩涘害",
+          type: "text",
+          clickFun: row => {
+            openNegotiationDialog(row);
+          },
+        },
         {
           name: "鍥炶鎻愰啋",
           type: "text",
@@ -815,13 +828,13 @@
             openReminderDialog(row);
           },
         },
-				{
-					name: "璇︽儏",
-					type: "text",
-					clickFun: row => {
-						openDetailDialog(row);
-					},
-				},
+        {
+          name: "璇︽儏",
+          type: "text",
+          clickFun: row => {
+            openDetailDialog(row);
+          },
+        },
       ],
     },
   ]);
@@ -852,7 +865,7 @@
     searchForm: {
       customerName: "",
       customerType: "",
-      type: 0
+      type: 0,
     },
     form: {
       customerName: "",
@@ -867,7 +880,7 @@
       bankAccount: "",
       bankCode: "",
       customerType: "",
-      type: 0
+      type: 0,
     },
     rules: {
       customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -900,7 +913,7 @@
     // 涓婁紶鐨勫湴鍧�
     url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
     data: {
-      type: 0
+      type: 0,
     },
     // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
     beforeUpload: file => {
@@ -1083,7 +1096,7 @@
       type: "warning",
     })
       .then(() => {
-        proxy.download("/basic/customer/export", {type: 0}, "瀹㈡埛妗f.xlsx");
+        proxy.download("/basic/customer/export", { type: 0 }, "瀹㈡埛妗f.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -1123,6 +1136,36 @@
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+
+  const back = () => {
+    if (selectedRows.value.length === 0) {
+      proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+      return;
+    }
+    const ids = selectedRows.value.map(item => item.id);
+    ElMessageBox.confirm("閫変腑鐨勫鎴峰皢娴佸叆鍏捣锛屾槸鍚︾‘璁わ紵", "娴佸叆鍏捣鎻愮ず", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        tableLoading.value = true;
+        return Promise.all(ids.map(id => backCustomer(id)))
+          .then(() => {
+            proxy.$modal.msgSuccess("娴佸叆鍏捣鎴愬姛");
+            selectedRows.value = [];
+            getList();
+          })
+          .finally(() => {
+            tableLoading.value = false;
+          });
+      })
+      .catch(error => {
+        if (error === "cancel" || error === "close") {
+          proxy.$modal.msg("宸插彇娑�");
+        }
       });
   };
 
@@ -1166,7 +1209,7 @@
         if (reminderForm.id) {
           submitvalue.value = {
             id: reminderForm.id,
-						customerId: currentCustomerId.value,
+            customerId: currentCustomerId.value,
             isEnabled: reminderForm.reminderSwitch ? 1 : 0,
             content: reminderForm.reminderContent,
             reminderTime: reminderForm.reminderTime,
@@ -1285,7 +1328,7 @@
     // 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
     Object.assign(negotiationForm, {
       customerName: row.customerName,
-			customerId: row.customerId,
+      customerId: row.customerId,
       followUpMethod: row.followUpMethod,
       followUpLevel: row.followUpLevel,
       followUpTime: row.followUpTime,
@@ -1413,7 +1456,7 @@
   const downloadAttachment = row => {
     if (row.url) {
       // proxy.download(row.url, {}, row.name);
-      proxy.$download.name(row.url);
+      proxy.$download.byUrl(row.url, row.originalFilename);
     } else {
       proxy.$modal.msgError("涓嬭浇閾炬帴涓嶅瓨鍦�");
     }

--
Gitblit v1.9.3