附件验证提示优化

master
Harry Yang 2023-01-03 16:21:01 +08:00
parent 579603df55
commit c9126f11b5
2 changed files with 16 additions and 8 deletions

View File

@ -806,15 +806,16 @@
const processType = this.processType const processType = this.processType
const supplierMaterialsForm = this.supplierMaterialsForm const supplierMaterialsForm = this.supplierMaterialsForm
if (fileList && fileList.length === 0) {
this.$message.error("未上传附件");
return false
}
let validStatus = !needValid let validStatus = !needValid
if (needValid) { if (needValid) {
// 校验表单 // 校验表单
this.$refs["contractProcessForm"].validate((valid) => { this.$refs["contractProcessForm"].validate((valid) => {
if (valid) { if (valid) {
if (fileList.length === 0) {
this.$message.error("未上传附件");
return false
}
if (processType === saleContract) { if (processType === saleContract) {
if (!this.checkExpirationDate()) { if (!this.checkExpirationDate()) {
return false return false

View File

@ -832,6 +832,9 @@
this.filteredProcurementDetails = [] this.filteredProcurementDetails = []
}, },
resetProjectNo() {
this.processForm.projectNo = ""
},
/** /**
* 搜索项目 * 搜索项目
* @param q 用户输入的字符串 * @param q 用户输入的字符串
@ -855,6 +858,7 @@
} }
}) })
.catch(({ response }) => { .catch(({ response }) => {
this.resetProjectNo()
if (response) { if (response) {
parseJSON(response) parseJSON(response)
.then(json => { .then(json => {
@ -932,6 +936,8 @@
}) })
.catch(({ response }) => { .catch(({ response }) => {
// 加载失败重置
this.resetProjectNo()
if (response) { if (response) {
parseJSON(response) parseJSON(response)
.then(json => { .then(json => {
@ -975,15 +981,16 @@
this.$message.error("未选择项目"); this.$message.error("未选择项目");
return false return false
} }
if (fileList && fileList.length === 0) {
this.$message.error("未上传附件");
return false
}
let validStatus = !needValid let validStatus = !needValid
if (needValid) { if (needValid) {
// 校验表单 // 校验表单
this.$refs["contractProcessForm"].validate((valid) => { this.$refs["contractProcessForm"].validate((valid) => {
if (valid) { if (valid) {
if (fileList.length === 0) {
this.$message.error("未上传附件");
return false
}
if (processType === saleContract) { if (processType === saleContract) {
if (!this.checkExpirationDate()) { if (!this.checkExpirationDate()) {
return false return false