其他分享
首页 > 其他分享> > 我的笔记

我的笔记

作者:互联网

//新开窗口下载
openwin(url) {
var a = document.createElement("a");
a.setAttribute("href", url);
a.setAttribute("target", "_blank");
a.setAttribute("id", "openwin");
document.body.appendChild(a);
a.click();
},

// 导出人员信息
exportInfo(){
let ids = this.selectedChangeData
const loading = this.$loading({
lock: true,
text: '拼命加载中',
spinner: 'el-icon-loading',
customClass: 'el-icon-loadings'
});
exportEmps(ids).then(res => {
let url = res.data.data
this.openwin(url)
}, this.err).finally(() => loading.close())
},


时间组件为空的一些判断
<el-date-picker v-model="cond.leaveDateReal"
value-format="yyyy-MM-dd" format="yyyy-MM-dd"
type="date" @change="changeDateTime"
placeholder="请选择实际离职日期">

</el-date-picker>
changeDateTime(value){
if (value == null) value = ''
},
this.cond.leaveDate == '1970-01-01'||this.cond.leaveDate== 'NaN-NaN-NaN'||this.cond.leaveDate== 'NaNNaNNaN'||!this.cond.leaveDate||this.cond.leaveDate==NaN||this.cond.leaveDate==null


this.$forceUpdate()
新增 清空校验
this.$nextTick(()=>{
// this.$refs[form].clearValidate();
this.$refs.form.resetFields();//等弹窗里的form表单的dom渲染完在执行this.$refs.staffForm.resetFields(),去除验证
});

修改时 清空校验显示数据
this.$nextTick(()=>{
// this.$refs[form].clearValidate();
this.$refs.form.resetFields();//等弹窗里的form表单的dom渲染完在执行this.$refs.staffForm.resetFields(),去除验证
});

this.$nextTick(()=>{
this.$refs.ruleForm.resetFields();
});
this.$nextTick(function(){
this.dialogVisible = true
this.Id = true
this.ruleForm.ID = r.tenantId
this.ruleForm.name = r.tenantName
this.ruleForm.imageUrl = r.logoUrl
let time1 = this.time(r.effectStartTime)
let time2 = null
if(r.effectEndTime){
time2 = this.time(r.effectEndTime)
}else{
time2 = ''
}
this.ruleForm.date1 = time1
this.ruleForm.date2 = time2
})
this.a this.a.b this.a.b='aaa'
this.$set(this.groupsTenan,?'group'+item,?res.data.data.list)

标签:leaveDate,form,resetFields,refs,笔记,ruleForm,cond
来源: https://www.cnblogs.com/dreammiao/p/14138620.html