Browse Source

区分商户权限 将系统分为 工单和商城,延保,维保,辅材配件 几大块。支持配置各个商户的权限,小程序需适配

linwenxin 1 year ago
parent
commit
5435a38266

+ 41 - 26
src/views/setting/organizationManagement/settledManagement/index.vue

@@ -59,15 +59,23 @@
               <svg-icon icon-class="question" slot="reference" />
             </el-popover>
           </el-form-item>
-			<el-form-item label="到期时间" prop="expireTime">
-				<el-date-picker
-					style="width: 100%;"
-					v-model="step1Form.expireTime"
-					type="datetime"
-					value-format="yyyy-MM-dd HH:mm:ss"
-					placeholder="选择日期时间">
-				</el-date-picker>
-			</el-form-item>
+          <el-form-item label="到期时间" prop="expireTime">
+            <el-date-picker style="width: 100%;" v-model="step1Form.expireTime" type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="辅材配件权限" prop="moduleMaterialPart">
+            <el-switch v-model="step1Form.moduleMaterialPart" active-color="#13ce66" inactive-color="#ff4949">
+            </el-switch>
+          </el-form-item>
+          <el-form-item label="延保权限" prop="moduleYb">
+            <el-switch v-model="step1Form.moduleYb" active-color="#13ce66" inactive-color="#ff4949">
+            </el-switch>
+          </el-form-item>
+          <el-form-item label="工程维保权限" prop="moduleWb">
+            <el-switch v-model="step1Form.moduleWb" active-color="#13ce66" inactive-color="#ff4949">
+            </el-switch>
+          </el-form-item>
         </el-form>
       </el-card>
     </div>
@@ -165,8 +173,8 @@
           <div class="images">
             <div class="main-img">
               <div class="img" v-if="qrcode1_url" @mouseover="qrcode1_hover = true;" @mouseout="qrcode1_hover = false;">
-                <el-image ref="qrcode1" :src="qrcode1_url" :preview-src-list="[qrcode1_url]" style="width: 120px; height: 120px"
-                  fit="contain"></el-image>
+                <el-image ref="qrcode1" :src="qrcode1_url" :preview-src-list="[qrcode1_url]"
+                  style="width: 120px; height: 120px" fit="contain"></el-image>
                 <div class="mask" v-show="qrcode1_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('qrcode1')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('qrcode1')"></i>
@@ -183,8 +191,8 @@
           <div class="images">
             <div class="main-img">
               <div class="img" v-if="qrcode2_url" @mouseover="qrcode2_hover = true;" @mouseout="qrcode2_hover = false;">
-                <el-image ref="qrcode2" :src="qrcode2_url" :preview-src-list="[qrcode2_url]" style="width: 120px; height: 120px"
-                  fit="contain"></el-image>
+                <el-image ref="qrcode2" :src="qrcode2_url" :preview-src-list="[qrcode2_url]"
+                  style="width: 120px; height: 120px" fit="contain"></el-image>
                 <div class="mask" v-show="qrcode2_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('qrcode2')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('qrcode2')"></i>
@@ -268,7 +276,7 @@
           </el-form-item>
 
 
-          
+
           <el-form-item label="公众号appid" prop="pubAppId">
             <el-input v-model="step3Form.pubAppId" autocomplete="off" placeholder="请输入公众号appid"></el-input>
           </el-form-item>
@@ -354,9 +362,12 @@ export default {
         address: '', // 地址
         newPassword: '', // 登录密码
         confirmPassword: '', // 确认密码
-        qrcode1:'',
-        qrcode2:'',
-				expireTime: ''
+        qrcode1: '',
+        qrcode2: '',
+        expireTime: '',
+        moduleMaterialPart: false,
+        moduleYb: false,
+        moduleWb: false,
       },
       step1FormRules: {
         account: [
@@ -394,10 +405,10 @@ export default {
       img2_hover: false,
       img3_url: '',
       img3_hover: false,
-      qrcode1_url:'',
-      qrcode1_hover:false,
-      qrcode2_url:'',
-      qrcode2_hover:false,
+      qrcode1_url: '',
+      qrcode1_hover: false,
+      qrcode2_url: '',
+      qrcode2_hover: false,
 
       step3Form: {
         enterpriseId: '',
@@ -412,8 +423,8 @@ export default {
         childKey: '',
         childMerchantId: '',
         templateId: '',
-        pubAppId:'',
-        pubAppSecret:''
+        pubAppId: '',
+        pubAppSecret: ''
       },
       step3FormRules: {
         enterpriseId: [
@@ -565,8 +576,11 @@ export default {
             lng: this.step1Form.lng,
             address: this.step1Form.address,
             password: this.step1Form.confirmPassword,
-						expireTime: this.step1Form.expireTime,
-
+            expireTime: this.step1Form.expireTime,
+            moduleMaterialPart: this.step1Form.moduleMaterialPart,
+            moduleYb: this.step1Form.moduleYb,
+            moduleWb: this.step1Form.moduleWb,
+            
             minLogo1: this.img1_url,
             minLogo2: this.img2_url,
             minLogo3: this.img3_url,
@@ -750,4 +764,5 @@ export default {
       color: #ffffff;
     }
   }
-}</style>
+}
+</style>

+ 63 - 28
src/views/setting/organizationManagement/tenantDetails/index.vue

@@ -36,15 +36,24 @@
           <el-input v-model="step1Form.password" type="password" disabled></el-input>
           <el-button class="reset" @click="handleReset()">重置密码</el-button>
         </el-form-item>
-		<el-form-item label="到期时间" prop="companyExpireTime">
-		  <el-date-picker
-		        v-model="step1Form.companyExpireTime"
-		        type="datetime"
-				value-format="yyyy-MM-dd HH:mm:ss"
-		        placeholder="选择日期时间">
-		  </el-date-picker>
-		  <el-button type="primary" @click="saveTime()">保存</el-button>
-		</el-form-item>
+        <el-form-item label="到期时间" prop="companyExpireTime">
+          <el-date-picker v-model="step1Form.companyExpireTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+            placeholder="选择日期时间">
+          </el-date-picker>
+          <el-button type="primary" @click="saveTime()">保存</el-button>
+        </el-form-item>
+        <el-form-item label="辅材配件权限" prop="moduleMaterialPart">
+          <el-switch v-model="step1Form.moduleMaterialPart" active-color="#13ce66" inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+        <el-form-item label="延保权限" prop="moduleYb">
+          <el-switch v-model="step1Form.moduleYb" active-color="#13ce66" inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+        <el-form-item label="工程维保权限" prop="moduleWb">
+          <el-switch v-model="step1Form.moduleWb" active-color="#13ce66" inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
         <!-- <el-form-item class="tr">
           <el-button type="primary" @click="submitStep1Form">保存</el-button>
         </el-form-item> -->
@@ -200,7 +209,7 @@
           </el-form-item>
 
 
-          
+
           <el-form-item label="公众号appid" prop="pubAppId">
             <el-input v-model="step3Form.pubAppId" autocomplete="off" placeholder="请输入公众号appid"></el-input>
           </el-form-item>
@@ -280,6 +289,8 @@
     </div>
     <div class="page-footer">
       <div class="footer" :class="classObj">
+        <el-button type="primary" @click="submitStep1Form" :loading="formLoading" v-if="step == 'first'">{{ formLoading ?
+          '保存中 ...' : '保 存' }}</el-button>
         <el-button type="primary" @click="submitStep2Form" :loading="formLoading" v-if="step == 'second'">{{ formLoading ?
           '保存中 ...' : '保 存' }}</el-button>
         <el-button type="primary" @click="submitStep3Form" :loading="formLoading" v-if="step == 'third'">{{ formLoading ?
@@ -368,7 +379,10 @@ export default {
         address: '', // 地址
         newPassword: '', // 新密码
         confirmPassword: '', // 确认密码
-		companyExpireTime: ''
+        companyExpireTime: '',
+        moduleMaterialPart: '',
+        moduleYb: '',
+        moduleWb: '',
       },
 
       passwordType1: 'password',
@@ -489,7 +503,10 @@ export default {
         this.step1Form.email = res.data.email;
         this.step1Form.address = res.data.address;
         this.step1Form.password = '************';
-		this.step1Form.companyExpireTime = res.data.companyExpireTime
+        this.step1Form.companyExpireTime = res.data.companyExpireTime
+        this.step1Form.moduleMaterialPart = res.data.moduleMaterialPart
+        this.step1Form.moduleYb = res.data.moduleYb
+        this.step1Form.moduleWb = res.data.moduleWb
 
         this.img1_url = res.data.minLogo1;
         this.img2_url = res.data.minLogo2;
@@ -531,22 +548,22 @@ export default {
       this.passwordType2 = 'password';
       this.$refs.resetForm.resetFields();
     },
-	
-	saveTime(){
-		request({
-			url: '/admin/user/user/updateCompanyWechat',
-			method: 'post',
-			data: {
-				expireTime: this.step1Form.companyExpireTime,
-				companyWechatId: this.companyWechatId
-			}
-		}).then(res =>{
-			if(res.code == 200){
-				this.$successMsg('保存成功');
-				this.getDetail()
-			}
-		})
-	},
+
+    saveTime() {
+      request({
+        url: '/admin/user/user/updateCompanyWechat',
+        method: 'post',
+        data: {
+          expireTime: this.step1Form.companyExpireTime,
+          companyWechatId: this.companyWechatId
+        }
+      }).then(res => {
+        if (res.code == 200) {
+          this.$successMsg('保存成功');
+          this.getDetail()
+        }
+      })
+    },
 
     // 提交重置密码
     submitResetForm() {
@@ -613,6 +630,24 @@ export default {
       this.$refs[type].showViewer = true;
     },
 
+    submitStep1Form() {
+      this.formLoading = true;
+      let params = {
+        // adminUserId: this.id,
+        companyWechatId: this.companyWechatId,
+        moduleMaterialPart: this.step1Form.moduleMaterialPart,
+        moduleYb: this.step1Form.moduleYb,
+        moduleWb: this.step1Form.moduleWb,
+      }
+      editAccount(params).then(res => {
+        this.$successMsg('保存成功');
+        setTimeout(() => {
+          this.goBack();
+        }, 1500)
+      }).finally(res => {
+        this.formLoading = false;
+      })
+    },
 
     submitStep2Form() {
       if (!this.img1_url) {