Browse Source

登录验证,通知修改密码,实习登记新增及导出

sangwenwei 8 months ago
parent
commit
48ae4358b4

+ 15 - 0
src/api/human/register/RegisterService.js

@@ -23,6 +23,13 @@ export default {
 			data: inputForm
 		})
 	},
+	saveForm (inputForm) {
+		return request({
+			url: prefix +  `/register/saveForm`,
+			method: 'post',
+			data: inputForm
+		})
+	},
 	updateInfo (inputForm) {
 		return request({
 			url: prefix +  `/register/updateInfo`,
@@ -58,4 +65,12 @@ export default {
 			params: {idCard: idCard}
 		})
 	},
+	downloadRegistrationTpl (id) {
+		return request({
+			url: prefix + '/register/downloadRegistrationTpl',
+			method: 'get',
+			params: {id: id},
+			responseType: 'blob'
+		})
+	}
 }

+ 21 - 2
src/views/human/practice/register/RegistrationEditForm.vue

@@ -9,6 +9,11 @@
 			@close="close"
 			append-to-body
 			v-model="visible">
+			<div v-if="method == 'view'">
+				<el-row type="flex" justify="end">
+					<el-button @click="downloadRegistrationTpl">导出信息</el-button>
+				</el-row>
+			</div>
 			<el-row>
 				<el-row>
 					<el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="status === 'audit' || status === 'taskFormDetail' || method === 'view'"
@@ -274,7 +279,7 @@
 			<template #footer>
 			<span class="dialog-footer">
 			  <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
-			  <el-button  v-if="method === 'edit'" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+			  <el-button  v-if="method === 'edit'||method === 'add'" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
 			</span>
 			</template>
 		</el-dialog>
@@ -455,7 +460,7 @@
 								throw new Error('QQ号/微信号填写不正确,请重新填写')
 							}
 						}
-						registerService.updateInfo(this.inputForm).then((data) => {
+						registerService.saveForm(this.inputForm).then((data) => {
 							this.close()
 							this.$message.success(data)
 							this.$emit('refreshList')
@@ -627,6 +632,20 @@
 				})
 
 			},
+			downloadRegistrationTpl () {
+				// this.$utils.downloadExcel('/sys/project/import/template')
+				this.loading = true
+				registerService.downloadRegistrationTpl(this.inputForm.id).then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadWord(res, '实习用户信息')
+					this.loading = false
+				}).catch(function (err) {
+					this.loading = false
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
 		}
 	}
 </script>

+ 65 - 9
src/views/human/practice/register/RegistrationList.vue

@@ -5,7 +5,7 @@
 		<el-form-item label="姓名" prop="name">
 			<el-input v-model="searchForm.name" placeholder="请输入姓名" clearable></el-input>
 		</el-form-item>
-		<el-form-item label="归属部门" prop="department">
+		<el-form-item label="实习部门" prop="practiceOffice">
 			<SelectTree
 				ref="officeTree"
 				:props="{
@@ -14,25 +14,53 @@
                 children: 'children'    // 子级字段名
               }"
 				:url="`/system-server/sys/office/treeData?type=2`"
-				:value="searchForm.department"
+				:value="searchForm.practiceOffice"
 				:clearable="true"
 				:accordion="true"
 				size="default"
-				@getValue="(value,label) => {searchForm.department=value}"/>
+				@getValue="(value,label) => {searchForm.practiceOffice=value}"/>
 		</el-form-item>
 		<el-form-item label="联系电话" prop="mobilePhone">
 			<el-input v-model="searchForm.mobilePhone" placeholder="请输入联系电话" clearable></el-input>
 		</el-form-item>
-
+		<el-form-item v-if="showHideItem" label="性别" prop="sex">
+			<el-select v-model="searchForm.sex" placeholder="请选择" style="width:100%;" clearable>
+				<el-option
+					v-for="item in $dictUtils.getDictList('sex')"
+					:key="item.value"
+					:label="item.label"
+					:value="item.value">
+				</el-option>
+			</el-select>
+		</el-form-item>
+		<el-form-item v-if="showHideItem" label="身份证号码" prop="idCard">
+			<el-input v-model="searchForm.idCard" placeholder="请输入身份证号码" clearable></el-input>
+		</el-form-item>
+		<el-form-item v-if="showHideItem" label="就读/毕业院校" prop="graduatedFrom">
+			<el-input v-model="searchForm.graduatedFrom" placeholder="请输入就读/毕业院校" clearable></el-input>
+		</el-form-item>
+		<el-form-item v-if="showHideItem" label="专业" prop="speciality">
+			<el-input v-model="searchForm.speciality" placeholder="请输入专业" clearable></el-input>
+		</el-form-item>
+		<el-form-item v-if="showHideItem" label="QQ号/微信号" prop="qqNum">
+			<el-input v-model="searchForm.qqNum" placeholder="请输入QQ号/微信号" clearable></el-input>
+		</el-form-item>
+		<el-form-item v-if="showHideItem" label="实习单位名称" prop="practiceUnitName">
+			<el-input v-model="searchForm.practiceUnitName" placeholder="请输入实习单位名称" clearable></el-input>
+		</el-form-item>
+		<el-form-item v-if="showHideItem" label="项目经理" prop="projectManager">
+			<UserSelect2 :limit='1' :modelValue="searchForm.projectManager" @update:modelValue='(value, label) => {searchForm.projectManager = value}'></UserSelect2>
+		</el-form-item>
       <el-form-item>
-        <el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
+		  <el-button type="default" @click="showHide" :icon="showHideIcon">{{showHideName}}</el-button>
+		  <el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
         <el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
       </el-form-item>
     </el-form>
     <div class="jp-table top" style="">
       <vxe-toolbar :refresh="{query: refreshList}" ref="toolbarRef" export custom>
         <template #buttons>
-<!--          <el-button type="primary" icon="el-icon-plus" @click="start()">新建</el-button>-->
+          <el-button type="primary" icon="el-icon-plus" @click="add()">新建</el-button>
         </template>
       </vxe-toolbar>
       <div style="height: calc(100% - 90px)">
@@ -76,7 +104,11 @@
           <vxe-column min-width="160" align="center" title="毕业院校" field="graduatedFrom"></vxe-column>
           <vxe-column min-width="160" align="center" title="所属部门" field="departmentName"></vxe-column>
           <vxe-column min-width="160" align="center" title="项目经理" field="projectManagerName"></vxe-column>
-          <vxe-column min-width="160" align="center" title="实习状态" field="practiceStatus"></vxe-column>
+          <vxe-column min-width="160" align="center" title="实习状态" field="practiceStatus">
+			  <template #default="scope">
+				  {{$dictUtils.getDictLabel('practice_type', scope.row.practiceStatus, '')}}
+			  </template>
+		  </vxe-column>
 			<vxe-column min-width="100" title="状态" fixed="right" align="center" field="type">
 				<template #default="scope">
 					<el-button @click="detail(scope.row)" :type="$dictUtils.getDictLabel('status_info', scope.row.type, '')" effect="dark" >{{$dictUtils.getDictLabel("status", scope.row.type, '未开始')}} </el-button>
@@ -119,14 +151,25 @@
   import taskService from '@/api/flowable/TaskService'
   import RegistrationEditForm from './RegistrationEditForm'
   import pick from "lodash.pick";
+	import UserSelect2 from '@/components/userSelect'
   export default {
     data () {
       return {
+		  showHideItem: false,
+		  showHideIcon: 'el-icon-arrow-down',
+		  showHideName: '展示',
         num: 0,
         searchForm: {
 			name: '',
-			department: '',
+			practiceOffice: '',
 			mobilePhone: '',
+			sex:'',
+			idCard:'',
+			graduatedFrom:'',
+			speciality:'',
+			qqNum:'',
+			practiceUnitName:'',
+			projectManager:'',
         },
         dataList: [],
         tablePage: {
@@ -148,7 +191,8 @@
     },
     components: {
 		SelectTree,
-		RegistrationEditForm
+		RegistrationEditForm,
+		UserSelect2
     },
     computed: {
       userName () {
@@ -172,8 +216,20 @@
       this.refreshList()
     },
     methods: {
+		showHide () {
+			if (this.showHideItem === false) {
+				this.showHideItem = true
+				this.showHideIcon = 'el-icon-arrow-up'
+				this.showHideName = '隐藏'
+			} else {
+				this.showHideItem = false
+				this.showHideIcon = 'el-icon-arrow-down'
+				this.showHideName = '展示'
+			}
+		},
       // 新增
       add () {
+		  this.$refs.registrationEditForm.init('add', '')
       },
 		// 查看
 		view (id) {

+ 1 - 1
src/views/layout/UpdatePassword2.vue

@@ -11,7 +11,7 @@
 					 label-width="80px" @submit.native.prevent>
 				<div style="margin-bottom: 20px;" v-if="showTip">
 					<el-alert
-						title="当前账号的密码仍为初始密码,风险较大,请及时修改"
+						title="当前账号的密码仍为初始密码/已超过90天未修改过密码,风险较大,请及时修改"
 						type="warning"
 						:closable="false"
 						center

+ 16 - 4
src/views/sys/login/components/login-form.vue

@@ -113,6 +113,7 @@
 						:loading="loading"
 						class="login-submit"
 						@click="login"
+						:disabled="isLoginDisabled"
 					>登录</el-button>
 				</el-form-item>
 			</el-form></div>
@@ -236,7 +237,8 @@ export default {
 			whichPage: '1', // 1为登录页面,2为忘记密码页面
 			showPhoneCode: true,
 			count: '', // 初始化次数
-			timer: null
+			timer: null,
+			isLoginDisabled: false, //登录按钮禁用状态
 		};
 	},
 	created() {
@@ -380,11 +382,21 @@ export default {
 		getLoginCodeNumber(username) {
 			loginService.getLoginCodeNumber(username).then((data) => {
 				if (data.redisLoginNumber >= data.loginNumber) {
-					if (!this.inputForm.isShow) {
-						this.getCaptcha()
-						this.inputForm.isShow = true
+					if (data.redisLoginNumber >= 5 && data.redisLoginNumber <10){
+						if (!this.inputForm.isShow) {
+							this.getCaptcha()
+							this.inputForm.isShow = true
+							this.isLoginDisabled = false
+						}
+					}else if (data.redisLoginNumber >= 10){
+						this.inputForm.isShow = false
+						this.isLoginDisabled = true
+						this.$message.error('当日登录已达最大次数,请明天再登录')
+
 					}
+
 				} else {
+					this.isLoginDisabled = false
 					this.inputForm.isShow = false
 				}
 			})