qymljy 2 سال پیش
والد
کامیت
875d28f80c

+ 6 - 2
src/HManagement/accountManage/modules/account_detail.vue

@@ -21,7 +21,8 @@
         <!-- <changeData class="inline-16"></changeData> -->
         <restPas v-if="tool.checkAuth($route.name,'restpas')" :userid="mainData.userid" class="inline-16"></restPas>
         <useTemp v-if="tool.checkAuth($route.name,'use')" :data="mainData" @onSuccess="queryMainData"></useTemp>
-        <unuseTemp v-if="tool.checkAuth($route.name,'use')" :data="mainData" @onSuccess="queryMainData"></unuseTemp>
+        <removeSite v-if="tool.checkAuth($route.name,'removeSite')" :data="mainData"></removeSite>
+<!--        <unuseTemp v-if="tool.checkAuth($route.name,'use')" :data="mainData" @onSuccess="queryMainData"></unuseTemp>-->
       </div>
       <div slot="slot0" >
         <detailInfo :more="true" :data="detailInfo"></detailInfo>
@@ -49,6 +50,8 @@ import restPas from "@/HManagement/department/staff/detail/modules/restPassword"
 import detailInfo from '@/components/detailInfo/index'
 import teamInformation from './teamInformation/index'
 
+import removeSite from "@/HManagement/accountManage/modules/removeSite";
+
 export default {
   name: "detail",
   data() {
@@ -71,7 +74,8 @@ export default {
     detailInfo,
     teamInformation,
     restPas,
-    selectPeople
+    selectPeople,
+    removeSite
   },
   methods:{
     async queryMainData(id) {

+ 1 - 1
src/HManagement/accountManage/modules/edit.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button size="mini" type="default" :disabled="data.status === 'ACTIVE'" @click="onShow">编 辑</el-button>
+    <el-button size="mini" :type="data.status !== 'ACTIVE'?'primary':''" :disabled="data.status === 'ACTIVE'" @click="onShow">编 辑</el-button>
     <el-drawer
       title="编辑用户"
       :visible.sync="drawer"

+ 34 - 0
src/HManagement/accountManage/modules/removeSite.vue

@@ -0,0 +1,34 @@
+<template>
+  <div class="inline-16" v-if="data.status === 'INACTIVE'">
+    <el-popconfirm
+        title="确定移除当前选中账号吗?"
+        @confirm="remove()">
+      <el-button slot="reference"  size="mini" type="primary">移除站点</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "removeSite",
+  props:['data'],
+  methods:{
+    async remove(){
+      const res = await this.$api.requested({
+        "classname": "webmanage.users.users",
+        "method": "deleteUserSite",
+        "content": {
+          "userid": this.data.userid
+        }
+      })
+      this.tool.showMessage(res,() => {
+        this.$store.dispatch('changeDetailDrawer',false)
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/HManagement/accountManage/modules/useAccdount.vue

@@ -3,7 +3,7 @@
     <el-popconfirm
       title="确定启用当前选中账号吗?"
       @confirm="start()">
-      <el-button slot="reference" type="default" size="mini">启 用</el-button>
+      <el-button slot="reference"  size="mini" type="primary">启 用</el-button>
     </el-popconfirm>
   </div>
 </template>

+ 48 - 17
src/views/login/login.vue

@@ -134,14 +134,30 @@ export default {
       })
       let that = this
       if (res.code === 1) {
-        this.checked?localStorage.setItem('phonenumber',this.loginForm.phonenumber):localStorage.clear('phonenumber')
-        sessionStorage.setItem('account_list',JSON.stringify(res.account_list))
-        sessionStorage.setItem('active_account',JSON.stringify(res.account_list[0]))
-        this.basicData.query_userauth().then(()=>{
-          this.basicData.querySite_Parameter()
-          this.$router.push({path:'/main'})
-          this.getAccountInfo()
-        })
+        var flag = 0
+        for (var i = 0;i<res.account_list.length ;i++){
+          if (res.account_list[i].status === 'ACTIVE'){
+            flag = 1
+            break
+          }
+        }
+        if (flag === 1){
+          this.checked?localStorage.setItem('phonenumber',this.loginForm.phonenumber):localStorage.clear('phonenumber')
+          sessionStorage.setItem('account_list',JSON.stringify(res.account_list))
+          sessionStorage.setItem('active_account',JSON.stringify(res.account_list[0]))
+          this.basicData.query_userauth().then(()=>{
+            this.basicData.querySite_Parameter()
+            this.$router.push({path:'/main'})
+            this.getAccountInfo()
+          })
+        }else {
+          this.$notify({
+            title: '失败',
+            message: '该账号已停用',
+            type: 'error'
+          })
+        }
+
       } else {
         this.$notify({
           title: '失败',
@@ -169,17 +185,32 @@ export default {
         "systemclient":"web"
       })
       if (res.code === 1) {
-        
-        this.checked?localStorage.setItem('phonenumber',this.loginForm.phonenumber):localStorage.clear('phonenumber')
-        sessionStorage.setItem('account_list',JSON.stringify(res.account_list))
+        var flag = 0
+        for (var i = 0;i<res.account_list.length ;i++){
+          if (res.account_list[i].status === 'ACTIVE'){
+            flag = 1
+            break
+          }
+        }
+        if (flag === 1){
+          this.checked?localStorage.setItem('phonenumber',this.loginForm.phonenumber):localStorage.clear('phonenumber')
+          sessionStorage.setItem('account_list',JSON.stringify(res.account_list))
 
-        sessionStorage.setItem('active_account',JSON.stringify(res.account_list[0]))
+          sessionStorage.setItem('active_account',JSON.stringify(res.account_list[0]))
+
+          this.basicData.query_userauth().then(()=>{
+            this.basicData.querySite_Parameter()
+            this.$router.push({path:'/main'})
+            this.getAccountInfo()
+          })
+        }else {
+          this.$notify({
+            title: '失败',
+            message: '该账号已停用',
+            type: 'error'
+          })
+        }
 
-        this.basicData.query_userauth().then(()=>{
-          this.basicData.querySite_Parameter()
-          this.$router.push({path:'/main'})
-          this.getAccountInfo()
-        })
       } else {
         this.$notify({
           title: '失败',