From 63accd72eb90e1c15724e86bf42a1c3081b55957 Mon Sep 17 00:00:00 2001 From: zhaomeijing Date: Wed, 8 Jun 2022 15:25:00 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E9=85=8D=E7=BD=AE=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectManagement/dialog/configure.vue | 99 ++++++++++++++----- 1 file changed, 77 insertions(+), 22 deletions(-) diff --git a/jero-web/src/views/projectManagement/dialog/configure.vue b/jero-web/src/views/projectManagement/dialog/configure.vue index b6678d682..f15450981 100644 --- a/jero-web/src/views/projectManagement/dialog/configure.vue +++ b/jero-web/src/views/projectManagement/dialog/configure.vue @@ -216,29 +216,84 @@ export default { this.visible = false }, handleSubmit() { - this.$refs.ruleForm.validate(valid => { - if (valid) { - let querycontentList = {} - let paramsManifestId = { paramsManifestId : this.itemId } - querycontentList = { - paramsConfigEOList: this.paramsConfigEOList, - deleteConfigIds: this.deleteConfigIds - } - let querycontentListItem = { ...querycontentList, ...paramsManifestId } - postAction(this.url.conAdd, querycontentListItem).then((res) => { - if (res.success) { - this.confirmLoading = false - this.$message.success(this.$t('OperationSuccessful')) - this.visible = false - this.deleteConfigIds = '' - this.deleteConfigIdsArray = [] - } else { - this.$message.warning(res.message) - this.confirmLoading = false - } - }) + let flag = 1 + this.paramsConfigEOList.forEach((item) => { + // 配置名称 + if(item.configName == ''){ + this.$message.warning(this.$t('configurationName')+this.$t('cannotEmpty')) + flag = 0 + return + } else if(item.configName.length > 25){ + this.$message.warning(this.$t('configurationName')+this.$t('cantExeed')+'25'+this.$t('characters')) + flag = 0 + return + } + // 车型 + if(item.carType == ''){ + this.$message.warning(this.$t('Model')+this.$t('cannotEmpty')) + flag = 0 + return + } else if(item.carType.length > 20){ + this.$message.warning(this.$t('Model')+this.$t('cantExeed')+'20'+this.$t('characters')) + flag = 0 + return + } + // 版本 + if(item.version == ''){ + this.$message.warning(this.$t('Version')+this.$t('cannotEmpty')) + flag = 0 + return + } else if(item.version.length > 20){ + this.$message.warning(this.$t('Version')+this.$t('cantExeed')+'20'+this.$t('characters')) + flag = 0 + return + } + // 电池 + if(item.battery == ''){ + this.$message.warning(this.$t('Battery')+this.$t('cannotEmpty')) + flag = 0 + return + } else if(item.battery.length > 20){ + this.$message.warning(this.$t('Battery')+this.$t('cantExeed')+'20'+this.$t('characters')) + flag = 0 + return + } + // 电机 + if(item.motor == ''){ + this.$message.warning(this.$t('electricMachinery')+this.$t('cannotEmpty')) + flag = 0 + return + } else if(item.motor.length > 20){ + this.$message.warning(this.$t('electricMachinery')+this.$t('cantExeed')+'20'+this.$t('characters')) + flag = 0 + return + } + }) + if(flag == 1){ + this.$refs.ruleForm.validate(valid => { + if (valid) { + let querycontentList = {} + let paramsManifestId = { paramsManifestId : this.itemId } + querycontentList = { + paramsConfigEOList: this.paramsConfigEOList, + deleteConfigIds: this.deleteConfigIds } - }) + let querycontentListItem = { ...querycontentList, ...paramsManifestId } + postAction(this.url.conAdd, querycontentListItem).then((res) => { + if (res.success) { + this.confirmLoading = false + this.$message.success(this.$t('OperationSuccessful')) + this.visible = false + this.deleteConfigIds = '' + this.deleteConfigIdsArray = [] + } else { + this.$message.warning(res.message) + this.confirmLoading = false + } + }) + } + }) + } }, } }