|
@@ -18,8 +18,8 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="类别" prop="zgType" label-width="80px">
|
|
|
<el-select v-model="queryParams.userType" placeholder="请选择" clearable size="small">
|
|
|
- <el-option label="学生" value="11" />
|
|
|
- <el-option label="教师" value="22" />
|
|
|
+ <el-option label="学生" value="22" />
|
|
|
+ <el-option label="教师" value="11" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="授权时间段" prop="dateRange" style="margin-left:10px;">
|
|
@@ -64,7 +64,7 @@
|
|
|
<el-table-column label="失效时间" align="left" prop="invalidTime">
|
|
|
<template slot-scope="scope">
|
|
|
<el-date-picker
|
|
|
- @change="switchChange(scope.row)"
|
|
|
+ :picker-options="pickerOptions0"
|
|
|
v-model="scope.row.invalidTime"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
type="date"
|
|
@@ -96,6 +96,10 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div style="text-align: center;">
|
|
|
+ <el-button class="color_ff back_one" style="width: 300px;" @click="loseTimeSubmitForm()">确定</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
<!--关联实验室弹框-->
|
|
|
<el-dialog :title=dialogTitle @close="handleClose" :visible.sync="dialogVisible" width="80%">
|
|
@@ -154,6 +158,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-date-picker
|
|
|
@blur="invalidTimeFun(scope.row,$event)"
|
|
|
+ :picker-options="pickerOptions0"
|
|
|
v-model="scope.row.invalidTime"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
type="date"
|
|
@@ -183,6 +188,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="失效时间:" prop="name">
|
|
|
<el-date-picker
|
|
|
+ :picker-options="pickerOptions0"
|
|
|
v-model="configuration.invalidTime"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
type="date"
|
|
@@ -225,6 +231,7 @@ export default {
|
|
|
},
|
|
|
total:0,
|
|
|
tableData:[],
|
|
|
+ oldTableData:[],
|
|
|
dateRange:[],
|
|
|
dialogForm:{
|
|
|
pageNum: 1,
|
|
@@ -246,12 +253,19 @@ export default {
|
|
|
},
|
|
|
unifyDeploy:false,
|
|
|
//提交
|
|
|
- form:{}
|
|
|
+ form:{},
|
|
|
+ // 设置只能选择当前日期及之后的日期
|
|
|
+ pickerOptions0: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < Date.now() - 8.64e7;//如果没有后面的-8.64e7就是不可以选择今天的
|
|
|
+ }
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
//弹出层表格里验证方式改变重新赋值
|
|
|
verifyModeFun(){
|
|
|
//通过改变数组数据刷新视图
|
|
@@ -266,25 +280,23 @@ export default {
|
|
|
|
|
|
//获取当前日期
|
|
|
getdate() {
|
|
|
- var date = new Date();
|
|
|
- var seperator1 = "-";
|
|
|
- var year = date.getFullYear();
|
|
|
- var month = date.getMonth() + 1;
|
|
|
- var strDate = date.getDate();
|
|
|
-
|
|
|
- if (month >= 1 && month <= 9) {
|
|
|
- month = "0" + month;
|
|
|
+ const dates = new Date()
|
|
|
+ dates.setMonth(dates.getMonth() + 1)
|
|
|
+ var pastMonth = dates.getMonth() + 1
|
|
|
+ var pastDay = dates.getDate()
|
|
|
+ if (pastMonth >= 1 && pastMonth <= 9) {
|
|
|
+ pastMonth = '0' + pastMonth
|
|
|
}
|
|
|
- if (strDate >= 0 && strDate <= 9) {
|
|
|
- strDate = "0" + strDate;
|
|
|
+ if (pastDay >= 0 && pastDay <= 9) {
|
|
|
+ pastDay = '0' + pastDay
|
|
|
}
|
|
|
- var currentdate = year + "-" + month + "-" + strDate;
|
|
|
- return currentdate;
|
|
|
+ const endDate = dates.getFullYear() + '-' + pastMonth + '-' + pastDay
|
|
|
+ return endDate
|
|
|
},
|
|
|
//查询
|
|
|
onSearch() {
|
|
|
this.dialogForm.pageNo = 1;
|
|
|
- this.getUserList(this.userType);
|
|
|
+ this.getUserList();
|
|
|
},
|
|
|
//重置
|
|
|
resetForm() {
|
|
@@ -307,6 +319,8 @@ export default {
|
|
|
handleClose(){
|
|
|
console.log('弹窗关闭');
|
|
|
this.$refs.multipleTable.clearSelection();
|
|
|
+ this.dialogForm.searchValue='';
|
|
|
+ this.dialogForm.deptId='';
|
|
|
},
|
|
|
//取消选中
|
|
|
toggleSelection(rows) {
|
|
@@ -335,13 +349,13 @@ export default {
|
|
|
_this.dialogVisible=true;
|
|
|
_this.dialogTitle='选择学生';
|
|
|
_this.userType=1;
|
|
|
- this.getUserList(1);
|
|
|
+ this.getUserList();
|
|
|
}else if(doType=='addTeacher'){//新增教职工授权
|
|
|
_this.unifyDeploy=false;
|
|
|
_this.dialogVisible=true;
|
|
|
_this.dialogTitle='选择教职工';
|
|
|
_this.userType=2;
|
|
|
- this.getUserList(2);
|
|
|
+ this.getUserList();
|
|
|
}else if(doType=='delete'){//删除
|
|
|
let _this=this
|
|
|
console.log(row)
|
|
@@ -367,10 +381,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
/** 弹框查询列表 */
|
|
|
- getUserList(type) {//type 1学生 2教职工
|
|
|
+ getUserList() {//type 1学生 2教职工
|
|
|
let _this=this;
|
|
|
this.loading = true;
|
|
|
- if(type==1){
|
|
|
+ if(_this.userType==1){
|
|
|
listStudentUser(this.addDateRange(this.dialogForm, this.dateRange)).then(response => {
|
|
|
this.dialogTable = response.rows;
|
|
|
this.total = response.total;
|
|
@@ -381,7 +395,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
);
|
|
|
- }else if(type==2){
|
|
|
+ }else if(_this.userType==2){
|
|
|
listTeacherUser(this.addDateRange(this.dialogForm, this.dateRange)).then(response => {
|
|
|
this.dialogTable = response.rows;
|
|
|
this.total = response.total;
|
|
@@ -438,9 +452,33 @@ export default {
|
|
|
getHaikangUserList(_this.queryParams).then( response => {
|
|
|
let res=response.rows;
|
|
|
_this.tableData=res;
|
|
|
+ _this.oldTableData=res;
|
|
|
_this.total=response.total;
|
|
|
});
|
|
|
},
|
|
|
+ //失效时间修改后提交
|
|
|
+ loseTimeSubmitForm(){
|
|
|
+ let _this=this;
|
|
|
+ let arr=[];
|
|
|
+ // console.log(_this.oldTableData)
|
|
|
+ // console.log( _this.tableData)
|
|
|
+ // _this.oldTableData.forEach(function(item) {
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ _this.tableData.forEach(function(item2) {
|
|
|
+ arr.push({'invalidTime':item2.invalidTime,'userId':item2.userId,'verifyMode':item2.verifyMode})
|
|
|
+ })
|
|
|
+ console.log(arr)
|
|
|
+ _this.form.detailList=arr;
|
|
|
+ setTimeout(function () {
|
|
|
+ AddImpowerHaikang(_this.form).then(response => {
|
|
|
+ if(response.code==200){
|
|
|
+ _this.msgSuccess("修改成功");
|
|
|
+ _this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },100)
|
|
|
+ },
|
|
|
/* 新增授权*/
|
|
|
submitForm(){
|
|
|
let _this=this;
|
|
@@ -460,9 +498,11 @@ export default {
|
|
|
setTimeout(function () {
|
|
|
AddImpowerHaikang(_this.form).then(response => {
|
|
|
if(response.code==200){
|
|
|
- _this.msgSuccess("新增成功");
|
|
|
- _this.dialogVisible=false;
|
|
|
- _this.getList();
|
|
|
+ setTimeout(function () {
|
|
|
+ _this.msgSuccess("新增成功");
|
|
|
+ _this.dialogVisible=false;
|
|
|
+ _this.getList();
|
|
|
+ },1000)
|
|
|
}
|
|
|
});
|
|
|
},100)
|