临时用户
This commit is contained in:
parent
96cd6b48ba
commit
3501de1621
|
|
@ -360,7 +360,7 @@
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:title="title"
|
:title="title"
|
||||||
:visible.sync="open"
|
:visible.sync="open"
|
||||||
width="600px"
|
width="750px"
|
||||||
append-to-body
|
append-to-body
|
||||||
>
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
@ -512,8 +512,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="角色" prop="roleIds">
|
<el-form-item label="角色" prop="roleIds">
|
||||||
<el-select
|
<el-select
|
||||||
|
|
@ -533,6 +532,19 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="账号时效" prop="isPermanent">
|
||||||
|
<el-radio-group v-model="form.isPermanent">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.sys_user_permanent"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -549,16 +561,18 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="账号时效" prop="isPermanent">
|
<el-form-item label="时效日期" prop="" v-if="form.isPermanent==0">
|
||||||
<el-radio-group v-model="form.isPermanent">
|
<el-date-picker
|
||||||
<el-radio
|
v-model="effectiveDateRange"
|
||||||
v-for="dict in dict.type.sys_user_permanent"
|
type="daterange"
|
||||||
:key="dict.value"
|
align="right"
|
||||||
:label="dict.value"
|
unlink-panels
|
||||||
>
|
range-separator="至"
|
||||||
{{ dict.label }}
|
start-placeholder="开始日期"
|
||||||
</el-radio>
|
end-placeholder="结束日期" clearable
|
||||||
</el-radio-group>
|
format="yyyy-MM-dd" style="width: 220px"
|
||||||
|
:picker-options="pickerOptions" >
|
||||||
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -761,6 +775,12 @@ export default {
|
||||||
multipleLimit: 1,
|
multipleLimit: 1,
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
effectiveDateRange: [new Date(),new Date().setDate(new Date().getDate() + 90)],//临时用户起止日期
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(v) {
|
||||||
|
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天
|
||||||
|
}
|
||||||
|
},
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'label',
|
label: 'label',
|
||||||
|
|
@ -1020,12 +1040,14 @@ export default {
|
||||||
sex: undefined,
|
sex: undefined,
|
||||||
status: '0',
|
status: '0',
|
||||||
isCustomer: '0',
|
isCustomer: '0',
|
||||||
|
isPermanent:'1',
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
postIds: [],
|
postIds: [],
|
||||||
roleIds: [],
|
roleIds: [],
|
||||||
roleId: null,
|
roleId: null,
|
||||||
loginType: null,
|
loginType: null,
|
||||||
}
|
}
|
||||||
|
this.effectiveDateRange = [new Date().setDate(new Date().getDate()),new Date().setDate(new Date().getDate() + 90)]
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
this.checkUrlList = []
|
this.checkUrlList = []
|
||||||
this.checkUrlNameList = []
|
this.checkUrlNameList = []
|
||||||
|
|
@ -1211,6 +1233,13 @@ export default {
|
||||||
}else{
|
}else{
|
||||||
this.form.photoUrl = this.checkUrlList[0]
|
this.form.photoUrl = this.checkUrlList[0]
|
||||||
}
|
}
|
||||||
|
if(this.form.isPermanent==0){
|
||||||
|
this.form.effectiveStartDay = this.formatDate(this.effectiveDateRange[0])
|
||||||
|
this.form.effectiveEndDay = this.formatDate(this.effectiveDateRange[1])
|
||||||
|
}else{
|
||||||
|
this.form.effectiveStartDay = null
|
||||||
|
this.form.effectiveEndDay = null
|
||||||
|
}
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.userId != undefined) {
|
if (this.form.userId != undefined) {
|
||||||
updateUser(this.form).then((response) => {
|
updateUser(this.form).then((response) => {
|
||||||
|
|
@ -1371,7 +1400,16 @@ export default {
|
||||||
console.log(file)
|
console.log(file)
|
||||||
this.dialogImageUrl = file.url
|
this.dialogImageUrl = file.url
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
}
|
},
|
||||||
|
//日期
|
||||||
|
formatDate(sdate) {
|
||||||
|
let date = new Date(sdate);
|
||||||
|
// 格式化为 YYYY-MM-DD
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue