| 
					
				 | 
			
			
				@@ -2,10 +2,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   <div class="m-container"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <h2> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <el-page-header @back="onCancel" :content="(payType == 'create' ? '新增机构' : '修改机构')"></el-page-header> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-page-header @back="onCancel" :content="title"></el-page-header> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </h2> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <div class="m-core" style="overflow: hidden"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <div style="display: block;overflow: hidden;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div style="display: block;overflow: hidden;" v-if="payType != 'look'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-col :span="8" :lg="10" :md="18" :sm="18" :xs="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <el-steps :active="active" finish-status="success" simple align-center> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-step title="机构信息" ></el-step> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -14,18 +14,20 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </el-steps> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </el-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <!-- 机构基本信息 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <organInfo ref="organInfo" v-show="active == 0" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <!-- 产品定价 确认设置 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <div v-show="[1, 2].includes(active)"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <openService ref="openService" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <memberSetting ref="memberSetting" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <roomRules ref="roomRules" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <rateSetting ref="rateSetting" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <div style="padding-left: 120px;display: flex;width: 100%;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <el-button type="primary" size="small" v-if="active > 0" @click="active -= 1">上一步</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <el-button type="primary" size="small" @click="onNext">{{ active >= 2 ? '提交' : '下一步' }}</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div v-if="status"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <!-- 机构基本信息 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <organInfo ref="organInfo" :data="info" v-show="active == 0" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <!-- 产品定价 确认设置 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div v-show="[1, 2].includes(active)"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <openService ref="openService" :data="productInfo" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <memberSetting ref="memberSetting" :data="config" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <roomRules ref="roomRules" :data="config" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <rateSetting ref="rateSetting" :data="config" :type="getType" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div style="padding-left: 140px;display: flex;width: 100%;" v-if="payType != 'look'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button type="primary" size="small" v-if="active > 0" @click="active -= 1">上一步</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button type="primary" size="small" @click="onNext">{{ active >= 2 ? '提交' : '下一步' }}</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </div> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -37,7 +39,7 @@ import openService from './components/openService' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import memberSetting from './components/memberSetting' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import roomRules from './components/roomRules' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import rateSetting from './components/rateSetting' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { tenantInfoAdd } from './api' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { tenantInfoAdd, tenantInfoInfo, tenantInfoUpdate } from './api' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   name: 'serviceManger', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   components: { organInfo, openService, memberSetting, roomRules, rateSetting }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -45,10 +47,35 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const query = this.$route.query 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       payType: query.type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      id: query.id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       active: 0, // 当前第几步 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      config: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      productInfo: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      info: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      status: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      title: '新增机构', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      payState: null, // 支付状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  mounted () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  async mounted () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if(this.payType !== 'create') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(this.payType == 'look') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.active = 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.title = '查看机构' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.title = '修改机构' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const res = await tenantInfoInfo({ id: this.id }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const { config, productInfo, ...other } = res.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.config = config 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.productInfo = productInfo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.info = { ...other } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.productInfo.payState = this.info.payState 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } catch(e) {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.status = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   computed: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getType() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -82,7 +109,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const { member_config, teachingMaterialId } = memberData 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let config = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           member_config, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          ruleData 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          ...ruleData 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let params = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           ...organData, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -95,8 +122,17 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         console.log(params) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          const res = await tenantInfoAdd(params) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          console.log(res) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if(this.payType == 'create') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const res = await tenantInfoAdd(params) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            console.log(res) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message.success('新增机构成功') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.onCancel() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } else if(this.payType == 'update') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const res = await tenantInfoUpdate(params) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            console.log(res) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message.success('修改机构成功') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.onCancel() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch(e) {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 |