Browse Source

添加调拨流程校验

dev
long 2 years ago
parent
commit
121182117c
  1. 55
      src/views/activiti/form/ProcessMaterialsAllotForm.vue

55
src/views/activiti/form/ProcessMaterialsAllotForm.vue

@ -828,6 +828,10 @@
}
let formData = this.classifyIntoFormData(allValues)
formData.fileId = getStringArry(formData.fileId)
if (formData.departId==formData.beAllotDepartment){
this.$message.warning("流程发起部门和被调拨部门不能相同!");
return;
}
// if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
// this.$message.error("")
// return;
@ -871,18 +875,18 @@
console.log('提交方法', method)
if(this.btndisabled === false){
this.btndisabled = true
// httpAction(url, formData, method).then((res) => {
// if (res.success) {
// this.$message.success('')
// //todo
// this.$emit('loadData')
// this.close()
// } else {
// this.$message.error(res.message)
// }
// }).finally(() => {
// this.btndisabled = false
// })
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success('提交申请成功!')
//todo
this.$emit('loadData')
this.close()
} else {
this.$message.error(res.message)
}
}).finally(() => {
this.btndisabled = false
})
}
}
})
@ -897,7 +901,34 @@
if (typeof this.classifyIntoFormData !== 'function') {
throw this.throwNotFunction('classifyIntoFormData')
}
if(!allValues.tablesValue[0].values[0] ){
this.$message.warning("请填写调拨物资!");
return
}else{
let all = false;
allValues.tablesValue[0].values.forEach( it => {
if(!it.allotNumber){
this.$message.warning("请填写完整调拨物资数据!");
all = true;
return
}
if(!it.allotTarget){
this.$message.warning("请选择接收调拨目标!");
all = true;
return
}
});
if(all){
return
}
}
let formData = this.classifyIntoFormData(allValues)
if (formData.departId==formData.beAllotDepartment){
this.$message.warning("流程发起部门和被调拨部门不能相同!");
return;
}
formData.fileId = getStringArry(formData.fileId)
// if (formData.materialType === null || formData.materialType ==='' || formData.materialType === undefined){
// this.$message.error("")

Loading…
Cancel
Save