文件上传修改
This commit is contained in:
parent
df164c518d
commit
163c41a84b
|
|
@ -128,6 +128,12 @@ export default {
|
||||||
{ required: true, message: '请选择文件分类标记', trigger: 'change' }
|
{ required: true, message: '请选择文件分类标记', trigger: 'change' }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
errorObj: {
|
||||||
|
contentName: '档案名称',
|
||||||
|
term: '案卷期限',
|
||||||
|
unitName: '归档责任单位',
|
||||||
|
major: '所属专业',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -369,7 +375,7 @@ export default {
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.loading.close();
|
this.loading.close();
|
||||||
// this.$modal.msgError('提交失败,请重试');
|
this.$modal.msgError(this.errorMsg(error));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
formData.append('params', JSON.stringify(params));
|
formData.append('params', JSON.stringify(params));
|
||||||
|
|
@ -383,9 +389,20 @@ export default {
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.loading.close();
|
this.loading.close();
|
||||||
// this.$modal.msgError('提交失败,请重试');
|
this.$modal.msgError(this.errorMsg(error));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
errorMsg(error) {
|
||||||
|
const errorMessage = error.message;
|
||||||
|
const errorArr = errorMessage.split(':');
|
||||||
|
const errorObjData = errorArr.length > 1 ? JSON.parse(errorArr[1]) : '';
|
||||||
|
if(errorObjData){
|
||||||
|
return this.errorObj[errorObjData.paramName] + errorArr[0] + ':' + errorObjData.originalValue;
|
||||||
|
}else{
|
||||||
|
return errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue