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