Jelajahi Sumber

居家养老默认一个管理机构

wgl 4 tahun lalu
induk
melakukan
f5f8f7cfcc
1 mengubah file dengan 23 tambahan dan 0 penghapusan
  1. 23 0
      src/projects/home/views/Register/Pension/Step1.vue

+ 23 - 0
src/projects/home/views/Register/Pension/Step1.vue

@@ -111,6 +111,9 @@
 				isLoading: false,
 
 				roleList: [],
+
+				//默认从里面读取第一条
+				companyList: [],
 			}
 		},
 		created() {
@@ -157,6 +160,24 @@
 				})
 			},
 
+			//获取服务机构公司列表,并设置默认第一条
+			getCompanyList() {
+				this.isLoading = true;
+				API_Person.getServiceCompanyIdList().then(response => {
+					this.isLoading = false;
+					this.companyList = response.list;
+					//设置默认第一条
+					if (this.companyList.length > 0) {
+						this.subForm.serviceCompanyId = this.companyList[0].id;
+						this.subForm.serviceCompanyName = this.companyList[0].name;
+						this.set_register_form_data(this.subForm);
+					}
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+				})
+			},
+
 			asynCallBack() {
 
 			},
@@ -167,6 +188,8 @@
 		mounted() {
 			//获取用户角色列表
 			this.getRoleList();
+			//获取服务机构公司列表
+			this.getCompanyList()
 		},
 		destroyed() {