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