From 01fe9929805fc9e73b72033f9717fc3f32005b03 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 29 十一月 2023 16:47:38 +0800
Subject: [PATCH] 销售管理模块整体新建增加默认负责人

---
 src/views/sales/quotation/AddQuotationDialog.vue |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue
index d2647fb..c1a036b 100644
--- a/src/views/sales/quotation/AddQuotationDialog.vue
+++ b/src/views/sales/quotation/AddQuotationDialog.vue
@@ -372,7 +372,7 @@
         quotationName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
         quotation_status_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
         sale_chance_name: [{ required: true, validator: this.checkChance, trigger: "change" }],
-        member_id: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }]
+        member_id: [{ required: true, validator: this.validateMemberId, trigger: "change" }]
       },
       memberOptions: [],
       quotationStatusOptions: [], // 鎶ヤ环鍗曠姸鎬�
@@ -436,6 +436,14 @@
       getAllData()
         .then((res) => {
           this.memberOptions = res.data.member
+          if (this.editConfig.title === "鏂板缓") {
+            let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1")
+            this.memberOptions.map((item) => {
+              if (item.username == username) {
+                this.editConfig.infomation.member_id = item.id
+              }
+            })
+          }
           this.quotationStatusOptions = res.data.quotationStatus
           this.dataProcess()
         })
@@ -682,6 +690,14 @@
       } else {
         callback(new Error("璇烽�夋嫨閿�鍞満浼�"))
       }
+    },
+    // 閿�鍞礋璐d汉鑷畾涔夋牎楠岃鍒�
+    validateMemberId(rule, value, callback) {
+      if (this.editConfig.infomation?.member_id > 0) {
+        callback()
+      } else {
+        callback(new Error("璇疯緭鍏ラ攢鍞礋璐d汉"))
+      }
     }
   }
 }

--
Gitblit v1.8.0