安全教育(安全培训):添加培训照片校验
This commit is contained in:
parent
8a78c8ed89
commit
d496c1cb3a
@ -287,7 +287,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 培训照片 -->
|
<!-- 培训照片 -->
|
||||||
<el-form-item :label="$t('message.laborDev.photo')" prop="photo" >
|
<el-form-item :label="$t('message.laborDev.photo')" prop="listPic" >
|
||||||
<div class="form-photo" >
|
<div class="form-photo" >
|
||||||
<el-upload
|
<el-upload
|
||||||
v-for="i in 3" :key="i"
|
v-for="i in 3" :key="i"
|
||||||
@ -515,7 +515,13 @@ export default {
|
|||||||
message: this.$t("message.personnelPosition.mandatory"),
|
message: this.$t("message.personnelPosition.mandatory"),
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
}
|
}
|
||||||
|
// const validatePass = (rule, value, callback) => {
|
||||||
|
// if(rule.length != 3){
|
||||||
|
// callback(new Error('请添加培训照片(3张)!'));
|
||||||
|
// }else{
|
||||||
|
// callback();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
return {
|
return {
|
||||||
uploadaurl:'',
|
uploadaurl:'',
|
||||||
fileList:[],
|
fileList:[],
|
||||||
@ -545,14 +551,16 @@ export default {
|
|||||||
eduEndTime: '',
|
eduEndTime: '',
|
||||||
eduType: 1,
|
eduType: 1,
|
||||||
list: [],
|
list: [],
|
||||||
|
listPic: [],
|
||||||
workernum: 0,
|
workernum: 0,
|
||||||
projectSn: this.$store.state.projectSn,
|
projectSn: this.$store.state.projectSn,
|
||||||
},
|
},
|
||||||
cardFormRules: {
|
cardFormRules: {
|
||||||
eduCourseName: [validateConfig],
|
eduCourseName: [validateConfig],
|
||||||
eduTime: [validateConfig],
|
eduTime: [validateConfig],
|
||||||
list: [validateConfig],
|
|
||||||
uploadAttachments: [validateConfig],
|
uploadAttachments: [validateConfig],
|
||||||
|
list:[],
|
||||||
|
listPic:[],
|
||||||
},
|
},
|
||||||
isAdd: false,
|
isAdd: false,
|
||||||
allPersonList: [],
|
allPersonList: [],
|
||||||
@ -580,7 +588,7 @@ export default {
|
|||||||
const imageUrl = res.data[0].imageUrl
|
const imageUrl = res.data[0].imageUrl
|
||||||
// console.log(res.data[0].imageUrl)
|
// console.log(res.data[0].imageUrl)
|
||||||
this.cardForm[`edu${num === 1 ? 'Before': num === 2 ? 'In' : 'After'}Photo`] = imageUrl
|
this.cardForm[`edu${num === 1 ? 'Before': num === 2 ? 'In' : 'After'}Photo`] = imageUrl
|
||||||
console.log(this.eduPhoto1,this.eduPhoto2,this.eduPhoto3, num);
|
// console.log(this.eduPhoto1,this.eduPhoto2,this.eduPhoto3, num);
|
||||||
},
|
},
|
||||||
handleSuccess(file,fileList){
|
handleSuccess(file,fileList){
|
||||||
console.log('成功的file',file)
|
console.log('成功的file',file)
|
||||||
@ -748,6 +756,10 @@ export default {
|
|||||||
this.$message.error(this.$t("message.laborMange.errorHint"));
|
this.$message.error(this.$t("message.laborMange.errorHint"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(this.cardForm.eduBeforePhoto == "" || this.cardForm.eduInPhoto == "" ||this.cardForm.eduAfterPhoto == ""){
|
||||||
|
this.$message.error('请添加培训照片(3张)!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.cardForm.workernum = this.cardForm.list.length;
|
this.cardForm.workernum = this.cardForm.list.length;
|
||||||
var json = this.cardForm;
|
var json = this.cardForm;
|
||||||
var arr = [];
|
var arr = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user