Parcourir la source

更换管理员增加新增新管理员姓名字段

hangb il y a 7 ans
Parent
commit
4c90182df0

+ 2 - 2
components/change/ChangeManager.vue

@@ -249,7 +249,7 @@
     },
     computed: {
       logged () {
-//        console.log(this.$store.state.option.isLogin.data.content)
+        // console.log(this.$store.state.option.isLogin.data.content)
         return this.$store.state.option.isLogin.data.content
       }
     },
@@ -271,7 +271,7 @@
 //      判断用户是否登录
       isLogin () {
         if (!this.logged.isLogin) {
-//          console.log(this.logged.isLogin)
+          // console.log(this.logged.isLogin)
 //          未登录跳到登录页面
           window.location.href = '/appeals/changeManagerAppeal'
         }

+ 27 - 2
components/change/ChangeManagerSecondStep.vue

@@ -12,6 +12,9 @@
         <div class="content-bottom">
           <div>
             <el-form :model="valid2" :rules="rules2" ref="valid2" label-width="100px" class="demo-ruleForm">
+              <el-form-item prop="mobile">
+                <el-input v-model="valid2.newAdminName" placeholder="新管理员姓名"></el-input>
+              </el-form-item>
               <el-form-item prop="mobile">
                 <el-input v-model="valid2.mobile" placeholder="新管理员手机号"></el-input>
               </el-form-item>
@@ -37,7 +40,7 @@
               </el-form-item>
               <el-form-item>
                 <a class="btn finish"
-                    :disabled="!mobileSecondChecked || !secondCodeChecked || !changeReasonChecked || !contactTelChecked"
+                    :disabled="!newAdminNameChecked || !mobileSecondChecked || !secondCodeChecked || !changeReasonChecked || !contactTelChecked"
                     @click="setNewMobile">确认</a>
               </el-form-item>
             </el-form>
@@ -59,6 +62,22 @@
     middleware: 'authenticated',
     data () {
 //      第二步验证手机
+      var validateNewAdminName = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写新管理员姓名'))
+          this.newAdminNameChecked = false
+        } else {
+          if (this.valid2.newAdminName !== '') {
+            if (value.length >= 20) {
+              callback(new Error('输入长度过长,20个字符以内'))
+              this.newAdminNameChecked = false
+            } else {
+              this.newAdminNameChecked = true
+            }
+          }
+          callback()
+        }
+      }
       var validateSecondMobile = (rule, value, callback) => {
         if (value === '') {
           callback(new Error('请填写正确的手机号'))
@@ -166,16 +185,21 @@
         contactTelChecked: false,
         descriptionTip: true,
         secondCodeErrorMsg: '',
+        newAdminNameChecked: false,
         mobileSecondChecked: false,
         getCodeBtnIsDisabled: true,
         showSecondStepCode: true,
         valid2: {
+          newAdminName: '',
           mobile: '',
           code: '',
           changeReason: '',
           contactTel: ''
         },
         rules2: {
+          newAdminName: [
+            {validator: validateNewAdminName, trigger: 'blur'}
+          ],
           mobile: [
             {validator: validateSecondMobile, trigger: 'blur'}
           ],
@@ -236,10 +260,11 @@
       },
 //      更换管理员确认
       setNewMobile () {
-        if (this.mobileSecondChecked && this.secondCodeChecked && this.changeReasonChecked && this.contactTelChecked) {
+        if (this.newAdminNameChecked && this.mobileSecondChecked && this.secondCodeChecked && this.changeReasonChecked && this.contactTelChecked) {
           this.isShowLoading = true
           let param = new FormData()
           console.log(this.firstStepToken.token)
+          param.append('newAdminName', this.valid2.newAdminName)
           param.append('mobile', this.valid2.mobile)
           param.append('code', this.valid2.code)
           param.append('token', this.firstStepToken.token)

+ 0 - 1
components/login/Login.vue

@@ -239,7 +239,6 @@
               let bgLink = response.data.content.bgLink
               let title = response.data.content.title || '欢迎登录'
               let appId = response.data.content.appId
-              console.log(appId)
               let nb = document.getElementById('navbar-brand')
               nb.style.backgroundImage = 'url(' + logoUrlStyle + ')'
               nb.innerHTML = title