sunyize преди 2 години
родител
ревизия
392089aab9

+ 1 - 11
src/views/dashboard/IndexChart2.vue

@@ -366,7 +366,7 @@
         this.loading = !this.loading
       }, 1000)
       this.initLogInfo();
-      this.getMesFirst();
+      //this.getMesFirst();
     },
     methods: {
       initLogInfo () {
@@ -386,16 +386,6 @@
         this.getMsgList();
         this.getMainTaskList();
       },
-
-      getMesFirst(){
-        let httpUrl = '/sys/loginFirst';
-        let params = {};
-        getAction(httpUrl, params).then((res) => {
-          if (!res.success) {
-            this.$message.error( res.message);
-          }
-        })
-      },
       getMsgList() {
         let httpUrl = '/sys/sysAnnouncementSend/getMyAnnouncementSend?pageNo=1&pageSize=5';
         let params = {};

+ 3 - 3
src/views/system/DepartList.vue

@@ -134,9 +134,9 @@
             </a-empty>
           </a-card>
         </a-tab-pane>
-        <a-tab-pane tab="部门权限" key="2" forceRender>
-          <depart-auth-modal ref="departAuth"/>
-        </a-tab-pane>
+<!--        <a-tab-pane tab="部门权限" key="2" forceRender>-->
+<!--          <depart-auth-modal ref="departAuth"/>-->
+<!--        </a-tab-pane>-->
       </a-tabs>
 
     </a-col>

+ 3 - 3
src/views/system/DepartUserList.vue

@@ -38,9 +38,9 @@
           <a-tab-pane tab="用户信息" key="2">
             <Dept-User-Info ref="DeptUserInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"></Dept-User-Info>
           </a-tab-pane>
-          <a-tab-pane tab="部门角色" key="3" forceRender>
-            <dept-role-info ref="DeptRoleInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"/>
-          </a-tab-pane>
+<!--          <a-tab-pane tab="部门角色" key="3" forceRender>-->
+<!--            <dept-role-info ref="DeptRoleInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"/>-->
+<!--          </a-tab-pane>-->
         </a-tabs>
       </a-card>
     </a-col>

+ 5 - 0
src/views/system/RoleUserList.vue

@@ -110,6 +110,11 @@
                   <a-input placeholder="" v-model="queryParam2.username"></a-input>
                 </a-form-item>
               </a-col>
+              <a-col :md="12" :sm="12">
+                <a-form-item label="用户名称">
+                  <a-input placeholder="" v-model="queryParam2.realname"></a-input>
+                </a-form-item>
+              </a-col>
               <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
             <a-col :md="9" :sm="24">
              <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>

+ 15 - 5
src/views/system/UserList.vue

@@ -12,6 +12,11 @@
               <j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>
             </a-form-item>
           </a-col>
+          <a-col :md="6" :sm="12">
+            <a-form-item label="用户姓名">
+              <j-input placeholder="输入用户姓名模糊查询" v-model="queryParam.realname"></j-input>
+            </a-form-item>
+          </a-col>
 
 <!--          <a-col :md="6" :sm="8">-->
 <!--            <a-form-item label="性别">-->
@@ -25,11 +30,11 @@
 
 
           <template v-if="toggleSearchStatus">
-            <a-col :md="6" :sm="8">
-              <a-form-item label="真实名字">
-                <a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>
-              </a-form-item>
-            </a-col>
+<!--            <a-col :md="6" :sm="8">-->
+<!--              <a-form-item label="真实名字">-->
+<!--                <a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>-->
+<!--              </a-form-item>-->
+<!--            </a-col>-->
 
             <a-col :md="6" :sm="8">
               <a-form-item label="手机号码">
@@ -268,6 +273,11 @@
             align: "center",
             width: 100,
             dataIndex: 'phone'
+          }, {
+            title: '岗位',
+            align: "center",
+            width: 100,
+            dataIndex: 'position'
           },
           {
             title: '归属部门',

+ 2 - 2
src/views/system/modules/DeptBaseInfo.vue

@@ -4,8 +4,8 @@
       <a-descriptions-item label="机构名称">{{model.departName}}</a-descriptions-item>
       <a-descriptions-item label="上级部门"><span>{{model.parentId}}</span></a-descriptions-item>
       <a-descriptions-item label="机构编码"><span>{{model.orgCode}}</span></a-descriptions-item>
-      <a-descriptions-item label="机构类型"><span>{{model.orgCategory}}</span></a-descriptions-item>
-      <a-descriptions-item label="排序"><span>{{model.departOrder}}</span></a-descriptions-item>
+<!--      <a-descriptions-item label="机构类型"><span>{{model.orgCategory}}</span></a-descriptions-item>-->
+<!--      <a-descriptions-item label="排序"><span>{{model.departOrder}}</span></a-descriptions-item>-->
       <a-descriptions-item label="手机号"><span>{{model.mobile}}</span></a-descriptions-item>
       <a-descriptions-item label="地址"><span>{{model.address}}</span></a-descriptions-item>
       <a-descriptions-item label="备注"><span>{{model.memo}}</span></a-descriptions-item>

+ 23 - 4
src/views/system/modules/DeptUserInfo.vue

@@ -5,7 +5,7 @@
       <!-- 搜索区域 -->
       <a-form layout="inline">
         <a-row :gutter="10">
-          <a-col :md="10" :sm="12">
+          <a-col :md="7" :sm="4">
             <a-form-item label="用户账号" style="margin-left:8px">
               <a-input placeholder="请输入账号" v-model="queryParam.username"></a-input>
             </a-form-item>
@@ -15,7 +15,16 @@
               <a-switch default-checked @change="onChange" v-model="queryParam.info" />
             </a-form-item>
           </a-col>
-
+          <a-col :md="7" :sm="4">
+            <a-form-item label="岗位" style="margin-left:8px">
+              <a-input placeholder="请输入岗位" v-model="queryParam.position"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="7" :sm="4">
+            <a-form-item label="人员名称" style="margin-left:8px">
+              <a-input placeholder="请输入岗位" v-model="queryParam.realname"></a-input>
+            </a-form-item>
+          </a-col>
           <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
             <a-col :md="6" :sm="24">
              <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 18px">查询</a-button>
@@ -130,7 +139,17 @@
             title: '用户账号',
             align: "center",
             dataIndex: 'username'
-          },
+          },{
+          title: '岗位',
+          align: "center",
+          dataIndex: 'position',
+          width: 120
+        },{
+          title: '角色',
+          align: "center",
+          dataIndex: 'roleName',
+          width: 120
+        },
           {
             title: '用户名称',
             align: "center",
@@ -156,7 +175,7 @@
             dataIndex: 'action',
             scopedSlots: {customRender: 'action'},
             align: "center",
-            width: 150
+            width: 120
           }],
         url: {
           list: "/sys/user/departUserList",

+ 6 - 6
src/views/system/modules/SelectUserModal.vue

@@ -104,12 +104,12 @@
             width: 100,
             dataIndex: 'phone'
           },
-          {
-            title: '部门',
-            align: "center",
-            width: 150,
-            dataIndex: 'orgCode'
-          }
+          // {
+          //   title: '部门',
+          //   align: "center",
+          //   width: 150,
+          //   dataIndex: 'orgCode'
+          // }
         ],
         columns2: [
           {

+ 102 - 8
src/views/user/LoginAccount.vue

@@ -1,18 +1,18 @@
 <template>
     <div>
       <a-form-model ref="form" :model="model" :rules="validatorRules">
-        <a-form-model-item required prop="username">
+        <a-form-model-item required prop="username"v-if='isLogin'>
           <a-input v-model="model.username" size="large" placeholder="请输入帐户名">
             <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
           </a-input>
         </a-form-model-item>
-        <a-form-model-item required prop="password">
+        <a-form-model-item required prop="password" v-if='isLogin'>
           <a-input v-model="model.password" size="large" type="password" autocomplete="false" placeholder="请输入密码">
             <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
           </a-input>
         </a-form-model-item>
 
-        <a-row :gutter="0">
+        <a-row :gutter="0" v-if='isLogin'>
           <a-col :span="16">
             <a-form-model-item required prop="inputCode">
               <a-input v-model="model.inputCode" size="large" type="text" placeholder="请输入验证码">
@@ -25,12 +25,28 @@
             <img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/>
           </a-col>
         </a-row>
+
+        <a-form-model-item required  v-if='!isLogin' prop='passwordNew'>
+          <a-input v-model="model.passwordNew" size="large"  type="password" placeholder="请输入新密码"  >
+            <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
+          </a-input>
+        </a-form-model-item>
+        <a-form-model-item required  v-if='!isLogin' prop='passwordNew' >
+          <a-input v-model="model.passwordNew2"  size="large" type="password"  placeholder="请确认新密码"
+                    >
+            <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
+          </a-input>
+        </a-form-model-item>
+        <a-form-item style="margin-top:24px;width: 100px" v-if='!isLogin'>
+          <a-button size="large"  type="primary"  htmlType="submit" @click='updatePassword'  class="login-button"  >修改密码
+          </a-button>
+        </a-form-item>
       </a-form-model>
     </div>
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
+import { getAction, postAction, putAction } from '@/api/manage'
   import Vue from 'vue'
   import { mapActions } from 'vuex'
 
@@ -38,16 +54,24 @@
     name: 'LoginAccount',
     data(){
       return {
+        isLogin:true,
+        confirmDirty:false,
         requestCodeSuccess: false,
         randCodeImage: '',
         currdatetime: '',
         loginType: 0,
         model:{
+          passwordNew: '',
+          passwordNew2: '',
           username: '',
           password: '',
           inputCode: ''
         },
         validatorRules:{
+            passwordNew: [
+              { required: true, pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, message: '密码由8位数字、大小写字母和特殊符号组成!' },
+              { validator: this.validateToNextPassword, }
+            ],
           username: [
             { required: true, message: '请输入用户名!' },
             { validator: this.handleUsernameOrEmail }
@@ -57,8 +81,12 @@
           }],
           inputCode: [{
             required: true, message: '请输入验证码!'
-          }]
-        }
+          }],
+          confirmpassword: [
+            { required: true, message: '请确认新密码!', },
+            {
+              validator: this.validateToNextPassword, }],
+        },
 
       }
     },
@@ -66,6 +94,47 @@
       this.handleChangeCheckCode();
     },
     methods:{
+
+      updatePassword() {
+            const that = this;
+            that.confirmLoading = true;
+            //let params = Object.assign({username:this.model.username},values)
+            let params={
+              username:this.model.username,
+              oldpassword:this.model.password,
+              confirmpassword:this.model.passwordNew2,
+             password:this.model.passwordNew
+            }
+            console.log("修改密码提交数据",params)
+            putAction("sys/updatePassword",params).then((res)=>{
+              if(res.success){
+                console.log(res)
+                that.$message.success(res.message);
+                that.close();
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+      },
+      compareToFirstPassword (rule, value, callback) {
+        if (value && value !== this.model.passwordNew) {
+          callback('两次输入的密码不一样!');
+        } else {
+          callback()
+        }
+      },
+      validateToNextPassword (rule, value, callback) {
+        const confirmpassword=this.model.passwordNew2;
+        if (value && confirmpassword && value !== confirmpassword) {
+          callback('两次输入的密码不一样!');
+        }
+        if (value && this.confirmDirty) {
+          this.$refs.form.validateField(['confirmpassword']);
+        }
+        callback();
+      },
       ...mapActions(['Login']),
       /**刷新验证码*/
       handleChangeCheckCode(){
@@ -134,7 +203,16 @@
             }
             //console.log("登录参数", loginParams)
             this.Login(loginParams).then((res) => {
-              this.$emit('success', res.result)
+              //判断是否首次登录
+              let httpUrl = '/sys/loginFirst';
+              postAction(httpUrl, loginParams).then((resa) => {
+                if (!resa.success) {
+                  this.$message.error( resa.message);
+                  this.isLogin=false
+                }else {
+                  this.$emit('success', res.result)
+                }
+              })
             }).catch((err) => {
               this.$emit('fail', err)
             });
@@ -142,7 +220,23 @@
             this.$emit('validateFail')
           }
         })
-      }
+      },
+      handleConfirmBlur  (e) {
+        const value = e.target.value
+        this.confirmDirty = this.confirmDirty || !!value
+      },
+      getMesFirst(loginParams){
+        let info = false;
+        let httpUrl = '/sys/loginFirst';
+        postAction(httpUrl, loginParams).then((res) => {
+          if (!res.success) {
+            this.$message.error( res.message);
+            info=true;
+            return info
+          }
+        })
+        return info;
+      },
 
 
     }