import { Loading } from 'element-ui'; //引用loading数据
export default {
created () {
},
mounted () {
},
components: {
},
data () {
let personnelCategoryReg = (rule, value, callback) => {
if (value.length == 0 && this.isHaveNo) {
callback(new Error('请选择可见人员类别'))
}else {
callback()
}
}
return {
isHaveTo:false, //判断是否必填
appForm: {
nonediting:'1', //是否非在编
personnelCategory:[], //人员类别
},
appFormRules: { // 添加应用规则
personnelCategory: [
{ validator: personnelCategoryReg }
],
}
}
},
methods: {
isShowInfo () { //点击是否非在编
if(this.appForm.nonediting == 2) { //否
this.ChoiceE = true //是否非在编选择是,人员类别不可选择
this.isHaveNo = false //是不必填的
this.appForm.personnelCategory = []
}else { //是 人员类别默认全选
this.ChoiceE = false //可选
this.isHaveNo = true //必填
this.appForm.personnelCategory = this.categoryArr
}
}
}
}