瀏覽代碼

主备小程序必选/随访医生逻辑判断

三七 2 周之前
父節點
當前提交
fd44dc691f
共有 2 個文件被更改,包括 33 次插入3 次删除
  1. 17 2
      src/views/company/company/index.vue
  2. 16 1
      src/views/his/company/index.vue

+ 17 - 2
src/views/company/company/index.vue

@@ -509,9 +509,15 @@ export default {
         this.form = response.data;
         this.form.status = response.data.status.toString();
         this.form.companyType = response.data.companyType.toString();
-        if(this.form.followDoctorIds!=null){
-           this.form.followDoctorIds= JSON.parse(this.form.followDoctorIds)
+
+        if (this.form.followDoctorIds==null || this.form.followDoctorIds.length==0){
+          this.form.followDoctorIds=null;
+        }
+
+        if(this.form.followDoctorIds!=null && this.form.followDoctorIds.length>0){
+          this.form.followDoctorIds= JSON.stringify(this.form.followDoctorIds)
         }
+
         if(this.form.packageIds!=null){
           var packageList=this.form.packageIds.split(",");
           packageList.forEach(element => {
@@ -527,6 +533,15 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+
+          if (this.form.followDoctorIds==null || this.form.followDoctorIds.length==0){
+            this.form.followDoctorIds=null;
+          }
+
+          if(this.form.followDoctorIds!=null && this.form.followDoctorIds.length>0){
+            this.form.followDoctorIds= JSON.stringify(this.form.followDoctorIds)
+          }
+
           if (this.form.companyId != null) {
             updateCompany(this.form).then(response => {
               if (response.code === 200) {

+ 16 - 1
src/views/his/company/index.vue

@@ -472,6 +472,7 @@ export default {
         courseMaAppId: null,
         courseMiniAppId: null,
         miniAppMaster: [],
+        miniAppServer:[],
         miniAppList: [],
       },
       // 表单校验
@@ -753,9 +754,15 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if(this.form.followDoctorIds!=null){
+
+          if (this.form.followDoctorIds==null || this.form.followDoctorIds.length==0){
+            this.form.followDoctorIds=null;
+          }
+
+          if(this.form.followDoctorIds!=null && this.form.followDoctorIds.length>0){
              this.form.followDoctorIds= JSON.stringify(this.form.followDoctorIds)
           }
+
           if(this.form.packageCateIds!=null){
              this.form.packageCateIds= JSON.stringify(this.form.packageCateIds)
           }
@@ -765,6 +772,14 @@ export default {
           if(this.doctorIds!=null){
             this.form.doctorIds= (this.doctorIds).toString()
           }
+          if (this.form.miniAppMaster==null || this.form.miniAppMaster.length ===0 ){
+            return this.$message.error("请选择主小程序")
+          }
+
+          if (this.form.miniAppServer==null || this.form.miniAppServer.length ===0 ){
+            return this.$message.error("请选择主小程序")
+          }
+
           if (this.form.companyId != null) {
             updateCompany(this.form).then(response => {
               this.msgSuccess("修改成功");