From 5a9be998d3dc8097d19d6f4833c0538c34bd6dcb Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期四, 09 一月 2025 10:29:18 +0800
Subject: [PATCH] 111

---
 src/views/system/tijian/index.vue |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index 0f4b28c..f164347 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -994,7 +994,8 @@
                 <el-button
                   type="primary"
                   @click="submitPrice"
-                  :disabled="confirm"
+                  :loading="loadingSubmit"
+                  :disabled="confirm || loadingSubmit"
                   v-if="showHidden.has_charge == 'N'"
                   size="mini"
                   >绛惧埌鐧昏</el-button
@@ -1528,6 +1529,7 @@
       hide: true,
       beat: false,
       dialogVisibles: false,
+      loadingSubmit: false,
       charge: false,
       src: "",
       url: "",
@@ -2478,6 +2480,7 @@
     // 鏈�鏂颁娇鐢╳ebSocket閫氫俊
     readCardWebSocket(resultObj) {
       let _this = this;
+
       if (resultObj.code === 200 && resultObj.data.name != null) {
         //鍥炴樉鐩稿叧鏁版嵁
         _this.form.cusName = resultObj.data.name;
@@ -2489,6 +2492,29 @@
             /^(\d{4})(\d{2})(\d{2})$/,
             "$1-$2-$3"
           );
+        } else if (_this.form.cusIdcard) {
+          // 浠庤韩浠借瘉鍙风爜鎻愬彇鍑虹敓鏃ユ湡
+          var org_birthday = _this.form.cusIdcard.substring(6, 14);
+          _this.form.cusBrithday =
+            org_birthday.substring(0, 4) +
+            "-" +
+            org_birthday.substring(4, 6) +
+            "-" +
+            org_birthday.substring(6, 8);
+        }
+        // 濡傛灉鍑虹敓鏃ユ湡瀛樺湪锛岃绠楀勾榫�
+        if (_this.form.cusBrithday) {
+          var birthdays = new Date(_this.form.cusBrithday);
+          let d = new Date();
+          let age =
+            d.getFullYear() -
+            birthdays.getFullYear() -
+            (d.getMonth() < birthdays.getMonth() ||
+            (d.getMonth() == birthdays.getMonth() &&
+              d.getDate() < birthdays.getDate())
+              ? 1
+              : 0);
+          _this.form.age = age; // 璧嬪�艰绠楃殑骞撮緞
         }
         _this.form.cusAddr = resultObj.data.addres;
         _this.form.cusIdcard = resultObj.data.card;
@@ -3736,6 +3762,7 @@
     submitPrice() {
       let _this = this;
       if (_this.tjCategory !== "") {
+        this.loadingSubmit = true;
         let List = _this.tableData1; //鍗曚釜椤圭洰淇℃伅
         if (this.responseList.cusId) {
           var userId = this.responseList.cusId;
@@ -3786,6 +3813,7 @@
           })); // 鍒涘缓鏂扮殑瀵硅薄锛屽寘鍚� discount 鍜� id
         gaibianzhekou(newArray).then((res) => {
           if (res.code === 200) {
+            this.loadingSubmit = false;
             let data;
 
             if (pacId || this.tjOrderList.length > 0) {
@@ -3823,10 +3851,12 @@
               });
             }
           } else {
+            this.loadingSubmit = false;
             this.$modal.msgError("鏀瑰彉鎶樻墸閿欒");
           }
         });
       } else {
+        this.loadingSubmit = false;
         this.$modal.msgError("璇烽�夋嫨浣撴绫诲埆");
       }
     },

--
Gitblit v1.8.0