Forráskód Böngészése

销售端新增客户信息表

cgp 6 napja
szülő
commit
2bb3fbac82
1 módosított fájl, 10 hozzáadás és 7 törlés
  1. 10 7
      src/views/qw/companyCustomer/index.vue

+ 10 - 7
src/views/qw/companyCustomer/index.vue

@@ -299,19 +299,22 @@ export default {
     },
     handleAdd() {
       this.reset();
+      //获取回填信息(当前登录销售和绑定的医生)
       getCompanyUserAndDoctor().then(response => {
         const data = response.data;
-        if (data) {
-          this.form.companyUserId = data.companyUserId;
-          this.form.companyUserName = data.companyUserName;
-          this.form.doctorId = data.doctorId;
-          this.form.doctorName = data.doctorName;
+        if (!data || !data.doctorId) {
+          this.$modal.msgError("未找到绑定医生!请绑定医生后再操作!");
+          return;
         }
+        this.form.companyUserId = data.companyUserId;
+        this.form.companyUserName = data.companyUserName;
+        this.form.doctorId = data.doctorId;
+        this.form.doctorName = data.doctorName;
+        this.open = true;
+        this.title = "添加客户信息";
       }).catch(() => {
         this.$modal.msgError("获取销售与医生信息失败");
       });
-      this.open = true;
-      this.title = "添加客户信息";
     },
     handleUpdate(row) {
       this.reset();