From 7c44202f4e4a6ebcecd9b63c4615824793ff0f9f Mon Sep 17 00:00:00 2001 From: liy <3101763317@qq.com> Date: Thu, 25 Jul 2024 10:38:59 +0800 Subject: [PATCH] =?UTF-8?q?li=E9=A2=84=E6=A1=88=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../emergency_agencies/components/list.vue | 14 +- .../assurance_management/components/list.vue | 14 +- .../components/list.vue | 6 + .../technical_management/components/list.vue | 6 + .../components/list.vue | 228 +++++++++--------- .../emergency_map_icon/components/list.vue | 4 +- .../components/yingjizhuangjia.vue | 2 +- .../expert_group/components/list.vue | 10 +- .../rescue_expert/components/list.vue | 24 +- .../rescue_team/components/list.vue | 14 +- .../closed_bayonet/components/list.vue | 52 ++-- .../drainage_well/components/list.vue | 14 +- .../emergency_shelter/components/list.vue | 6 + .../components/equipment.vue | 6 + .../components/facilities.vue | 6 + .../equipment_library/components/list.vue | 77 +++--- .../equipment_library/components/supplies.vue | 6 + 17 files changed, 302 insertions(+), 187 deletions(-) diff --git a/src/views/emergen_cyrescue/emergency_information/emergency_management_agency/emergency_agencies/components/list.vue b/src/views/emergen_cyrescue/emergency_information/emergency_management_agency/emergency_agencies/components/list.vue index 70e3cd3..155a4c7 100644 --- a/src/views/emergen_cyrescue/emergency_information/emergency_management_agency/emergency_agencies/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_information/emergency_management_agency/emergency_agencies/components/list.vue @@ -266,6 +266,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + ORG_NAME: [ + { required: true, message: '机构名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, form: { ORG_NAME: '', ORG_TYPE_NAME: '', @@ -558,7 +564,13 @@ export default { this.$refs.upload.clearFiles() }, confirm() { - this.dataSave() + this.$refs.form.validate(valid => { + if (valid) { + this.dataSave() + } else { + return false + } + }) }, dataSave() { this.listLoading = true diff --git a/src/views/emergen_cyrescue/emergency_information/security_agency/assurance_management/components/list.vue b/src/views/emergen_cyrescue/emergency_information/security_agency/assurance_management/components/list.vue index f93a0be..98bd1ac 100644 --- a/src/views/emergen_cyrescue/emergency_information/security_agency/assurance_management/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_information/security_agency/assurance_management/components/list.vue @@ -336,6 +336,12 @@ export default { EMERGENCY_CAPACITY_DESCRIPTION: '', REMARK: '' }, + rules: { + ORG_NAME: [ + { required: true, message: '通信机构名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, // rules: { // ORG_NAME: [ // { required: true, message: '通信机构名称不能为空', trigger: 'blur' }, @@ -739,7 +745,13 @@ export default { this.$refs.upload.clearFiles() }, confirm() { - this.dataSave() + this.$refs.form.validate(valid => { + if (valid) { + this.dataSave() + } else { + return false + } + }) }, dataSave() { this.listLoading = true diff --git a/src/views/emergen_cyrescue/emergency_information/security_agency/institutional_management/components/list.vue b/src/views/emergen_cyrescue/emergency_information/security_agency/institutional_management/components/list.vue index 83a2656..040f23a 100644 --- a/src/views/emergen_cyrescue/emergency_information/security_agency/institutional_management/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_information/security_agency/institutional_management/components/list.vue @@ -330,6 +330,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + INSTITUTION_NAME: [ + { required: true, message: '机构名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, form: { // 医疗机构名称 INSTITUTION_NAME: '', diff --git a/src/views/emergen_cyrescue/emergency_information/security_agency/technical_management/components/list.vue b/src/views/emergen_cyrescue/emergency_information/security_agency/technical_management/components/list.vue index b53ab43..d91e765 100644 --- a/src/views/emergen_cyrescue/emergency_information/security_agency/technical_management/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_information/security_agency/technical_management/components/list.vue @@ -233,6 +233,12 @@ export default { // 备注 REMARKSS: '' }, + rules: { + SKILL_NAME: [ + { required: true, message: '机构名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, // rules: { // SKILL_NAME: [ // { required: true, message: '医疗机构名称不能为空', trigger: 'blur' }, diff --git a/src/views/emergen_cyrescue/emergency_information/security_agency/transportation_management/components/list.vue b/src/views/emergen_cyrescue/emergency_information/security_agency/transportation_management/components/list.vue index d7cf08f..b9d7c2d 100644 --- a/src/views/emergen_cyrescue/emergency_information/security_agency/transportation_management/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_information/security_agency/transportation_management/components/list.vue @@ -311,116 +311,116 @@ export default { EMERGENCY_CAPACITY_DESCRIPTION: '', REMARK: '' }, - // rules: { - // ORG_NAME: [ - // { required: true, message: '运输机构名称不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // ORG_TYPE: [ - // { required: true, message: '运输机构类型不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // ORG_LEVEL: [ - // { required: true, message: '运输机构级别不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // ADDRESS: [ - // { required: true, message: '地址不能为空', trigger: 'blur' }, - // { min: 5, max: 255, message: '长度在 5 到 255 个字符', trigger: 'blur' } - // ], - // POSTAL_CODE: [ - // { required: true, message: '邮编不能为空', trigger: 'blur' }, - // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } - // ], - // SECURITY_LEVEL: [ - // { required: true, message: '机构密级不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // DUTY_PHONE: [ - // { required: true, message: '值班电话不能为空', trigger: 'blur' }, - // { min: 5, max: 255, message: '长度在 5 到 255 个字符', trigger: 'blur' } - // ], - // ADMINISTRATIVE_REGION: [ - // { required: true, message: '所属区域不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // LONGITUDE: [ - // { required: true, message: '经度不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // LATITUDE: [ - // { required: true, message: '纬度不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // EMERGENCY_TRANSPORT_MODE: [ - // { required: true, message: '应急运输方式不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // RESPONSIBLE_PERSON: [ - // { required: true, message: '负责人不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // RESPONSIBLE_OFFICE_PHONE: [ - // { required: true, message: '负责人办公电话不能为空', trigger: 'blur' }, - // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } - // ], - // RESPONSIBLE_MOBILE_PHONE: [ - // { required: true, message: '负责人移动电话不能为空', trigger: 'blur' }, - // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } - // ], - // RESPONSIBLE_HOME_PHONE: [ - // { required: true, message: '负责人住宅电话不能为空', trigger: 'blur' }, - // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } - // ], - // CONTACT_PERSON: [ - // { required: true, message: '联系人不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // CONTACT_OFFICE_PHONE: [ - // { required: true, message: '联系人办公电话不能为空', trigger: 'blur' }, - // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } - // ], - // CONTACT_MOBILE_PHONE: [ - // { required: true, message: '联系人移动电话不能为空', trigger: 'blur' }, - // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } - // ], - // CONTACT_HOME_PHONE: [ - // { required: true, message: '联系人住宅电话不能为空', trigger: 'blur' }, - // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } - // ], - // CONTACT_EMAIL: [ - // { required: true, message: '联系人电子邮箱不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // SUPERVISING_UNIT: [ - // { required: true, message: '主管单位不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // SUPERVISING_UNIT_ADDRESS: [ - // { required: true, message: '主管单位地址不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // COMPANY_OVERVIEW: [ - // { required: true, message: '企业基本情况不能为空', trigger: 'blur' }, - // { min: 1, max: 1000, message: '长度在 1 到 1000 个字符', trigger: 'blur' } - // ], - // PASSENGER_TRANSPORT_CAPACITY: [ - // { required: true, message: '客运能力不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // CARGO_TRANSPORT_CAPACITY: [ - // { required: true, message: '货运能力不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // EMERGENCY_CAPACITY_DESCRIPTION: [ - // { required: true, message: '应急能力描述不能为空', trigger: 'blur' }, - // { min: 1, max: 1000, message: '长度在 1 到 1000 个字符', trigger: 'blur' } - // ], - // REMARK: [ - // { required: true, message: '备注不能为空', trigger: 'blur' }, - // { min: 1, max: 1000, message: '长度在 1 到 1000 个字符', trigger: 'blur' } - // ] - // }, + rules: { + ORG_NAME: [ + { required: true, message: '运输机构名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + ORG_TYPE: [ + { required: true, message: '运输机构类型不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + ORG_LEVEL: [ + { required: true, message: '运输机构级别不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + ADDRESS: [ + { required: true, message: '地址不能为空', trigger: 'blur' }, + { min: 5, max: 255, message: '长度在 5 到 255 个字符', trigger: 'blur' } + ], + POSTAL_CODE: [ + { required: true, message: '邮编不能为空', trigger: 'blur' }, + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } + ], + SECURITY_LEVEL: [ + { required: true, message: '机构密级不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + DUTY_PHONE: [ + { required: true, message: '值班电话不能为空', trigger: 'blur' }, + { min: 5, max: 255, message: '长度在 5 到 255 个字符', trigger: 'blur' } + ], + ADMINISTRATIVE_REGION: [ + { required: true, message: '所属区域不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + LONGITUDE: [ + { required: true, message: '经度不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + LATITUDE: [ + { required: true, message: '纬度不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + EMERGENCY_TRANSPORT_MODE: [ + { required: true, message: '应急运输方式不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + RESPONSIBLE_PERSON: [ + { required: true, message: '负责人不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + RESPONSIBLE_OFFICE_PHONE: [ + { required: true, message: '负责人办公电话不能为空', trigger: 'blur' }, + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } + ], + RESPONSIBLE_MOBILE_PHONE: [ + { required: true, message: '负责人移动电话不能为空', trigger: 'blur' }, + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } + ], + RESPONSIBLE_HOME_PHONE: [ + { required: true, message: '负责人住宅电话不能为空', trigger: 'blur' }, + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } + ], + CONTACT_PERSON: [ + { required: true, message: '联系人不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + CONTACT_OFFICE_PHONE: [ + { required: true, message: '联系人办公电话不能为空', trigger: 'blur' }, + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } + ], + CONTACT_MOBILE_PHONE: [ + { required: true, message: '联系人移动电话不能为空', trigger: 'blur' }, + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } + ], + CONTACT_HOME_PHONE: [ + { required: true, message: '联系人住宅电话不能为空', trigger: 'blur' }, + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } + ], + CONTACT_EMAIL: [ + { required: true, message: '联系人电子邮箱不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + SUPERVISING_UNIT: [ + { required: true, message: '主管单位不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + SUPERVISING_UNIT_ADDRESS: [ + { required: true, message: '主管单位地址不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + COMPANY_OVERVIEW: [ + { required: true, message: '企业基本情况不能为空', trigger: 'blur' }, + { min: 1, max: 1000, message: '长度在 1 到 1000 个字符', trigger: 'blur' } + ], + PASSENGER_TRANSPORT_CAPACITY: [ + { required: true, message: '客运能力不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + CARGO_TRANSPORT_CAPACITY: [ + { required: true, message: '货运能力不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + EMERGENCY_CAPACITY_DESCRIPTION: [ + { required: true, message: '应急能力描述不能为空', trigger: 'blur' }, + { min: 1, max: 1000, message: '长度在 1 到 1000 个字符', trigger: 'blur' } + ], + REMARK: [ + { required: true, message: '备注不能为空', trigger: 'blur' }, + { min: 1, max: 1000, message: '长度在 1 到 1000 个字符', trigger: 'blur' } + ] + }, FFILE: [], caseSummaryList: [], treeData: [], @@ -697,7 +697,13 @@ export default { this.$refs.upload.clearFiles() }, confirm() { - this.dataSave() + this.$refs.form.validate(valid => { + if (valid) { + this.dataSave() + } else { + return false + } + }) }, dataSave() { this.listLoading = true diff --git a/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue b/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue index 8200f05..834d8bc 100644 --- a/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue @@ -30,7 +30,7 @@ + style="width: 50px; height: 50px"/> @@ -98,7 +98,7 @@ export default { requestFN('bi/emergency/iconList?showCount=' + this.page.limit + '¤tPage=' + this.page.page, this.form).then((data) => { this.loading = false this.list = data.varList - this.page.total = data.page.totalResult + this.total = data.page.totalResult this.hasButton() }).catch((e) => { this.loading = false diff --git a/src/views/emergen_cyrescue/emergency_plan/company_plan-check/components/yingjizhuangjia.vue b/src/views/emergen_cyrescue/emergency_plan/company_plan-check/components/yingjizhuangjia.vue index 0d0605a..497cc52 100644 --- a/src/views/emergen_cyrescue/emergency_plan/company_plan-check/components/yingjizhuangjia.vue +++ b/src/views/emergen_cyrescue/emergency_plan/company_plan-check/components/yingjizhuangjia.vue @@ -73,7 +73,7 @@ export default { zhuangjianame: '', dialogzhuangjiaShow: false, yjzjvarList: [], - yjzhuangjiatotal: [], + yjzhuangjiatotal: 0, zhuanjiaList: [], listQueryzj: { page: 1, diff --git a/src/views/emergen_cyrescue/emergency_team/expert_group/components/list.vue b/src/views/emergen_cyrescue/emergency_team/expert_group/components/list.vue index afa3937..e716e24 100644 --- a/src/views/emergen_cyrescue/emergency_team/expert_group/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_team/expert_group/components/list.vue @@ -48,12 +48,12 @@ - + - + @@ -204,6 +204,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + EXPERT_GROUP_NAME: [ + { required: true, message: '名称不能为空', trigger: 'blur' }, + { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }] + + }, form: { // 专家组名称 EXPERT_GROUP_NAME: '', diff --git a/src/views/emergen_cyrescue/emergency_team/rescue_expert/components/list.vue b/src/views/emergen_cyrescue/emergency_team/rescue_expert/components/list.vue index db5f5b6..2b15ca7 100644 --- a/src/views/emergen_cyrescue/emergency_team/rescue_expert/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_team/rescue_expert/components/list.vue @@ -48,7 +48,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -71,12 +71,12 @@ - + - + @@ -84,12 +84,12 @@ - + - + @@ -97,12 +97,12 @@ - + - + @@ -110,7 +110,7 @@ - + @@ -298,6 +298,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + EXPERT_NAME: [ + { required: true, message: '名称不能为空', trigger: 'blur' }, + { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }] + + }, form: { // 名称 EXPERT_NAME: '', diff --git a/src/views/emergen_cyrescue/emergency_team/rescue_team/components/list.vue b/src/views/emergen_cyrescue/emergency_team/rescue_team/components/list.vue index f7f5423..d294e7a 100644 --- a/src/views/emergen_cyrescue/emergency_team/rescue_team/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_team/rescue_team/components/list.vue @@ -413,6 +413,12 @@ export default { REQUIRES_BACKUP_SUPPORT: '', REMARK: '' }, + rules: { + RESCUE_TEAM_NAME: [ + { required: true, message: '救援队名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, // rules: { // RESCUE_TEAM_NAME: [ // { required: true, message: '救援队名称不能为空', trigger: 'blur' }, @@ -831,7 +837,13 @@ export default { this.$refs.upload.clearFiles() }, confirm() { - this.dataSave() + this.$refs.form.validate(valid => { + if (valid) { + this.dataSave() + } else { + return false + } + }) }, dataSave() { this.listLoading = true diff --git a/src/views/emergen_cyrescue/resource_management/closed_bayonet/components/list.vue b/src/views/emergen_cyrescue/resource_management/closed_bayonet/components/list.vue index 0d2443a..52a6c91 100644 --- a/src/views/emergen_cyrescue/resource_management/closed_bayonet/components/list.vue +++ b/src/views/emergen_cyrescue/resource_management/closed_bayonet/components/list.vue @@ -97,29 +97,29 @@ export default { CONTACT_PERSON: '', CONTACT_PHONE: '', DESCRIPTION: '' + }, + rules: { + NAME: [ + { required: true, message: '名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + ADDRESS: [ + { required: true, message: '地址不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + CONTACT_PERSON: [ + { required: true, message: '联系人不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + CONTACT_PHONE: [ + { required: true, message: '联系电话不能为空', trigger: 'blur' }, + { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' } + ], + DESCRIPTION: [ + { required: true, message: '描述不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] } - // rules: { - // NAME: [ - // { required: true, message: '名称不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // ADDRESS: [ - // { required: true, message: '地址不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // CONTACT_PERSON: [ - // { required: true, message: '联系人不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // CONTACT_PHONE: [ - // { required: true, message: '联系电话不能为空', trigger: 'blur' }, - // { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' } - // ], - // DESCRIPTION: [ - // { required: true, message: '描述不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ] - // } } }, created() { @@ -174,7 +174,13 @@ export default { } }, confirm() { - this.dataSave() + this.$refs.form.validate(valid => { + if (valid) { + this.dataSave() + } else { + return false + } + }) }, dataSave() { this.listLoading = true diff --git a/src/views/emergen_cyrescue/resource_management/drainage_well/components/list.vue b/src/views/emergen_cyrescue/resource_management/drainage_well/components/list.vue index ca2abc1..f309dff 100644 --- a/src/views/emergen_cyrescue/resource_management/drainage_well/components/list.vue +++ b/src/views/emergen_cyrescue/resource_management/drainage_well/components/list.vue @@ -114,6 +114,12 @@ export default { CONTACT_PHONE: '', DESCRIPTION: '' }, + rules: { + NAME: [ + { required: true, message: '名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, yjTypeData: [], normalizer(node) { return { @@ -205,7 +211,13 @@ export default { console.log('Form initialized:', this.form) }, confirm() { - this.dataSave() + this.$refs.form.validate(valid => { + if (valid) { + this.dataSave() + } else { + return false + } + }) }, dataSave() { this.listLoading = true diff --git a/src/views/emergen_cyrescue/resource_management/emergency_shelter/components/list.vue b/src/views/emergen_cyrescue/resource_management/emergency_shelter/components/list.vue index edbb3a9..f2ed040 100644 --- a/src/views/emergen_cyrescue/resource_management/emergency_shelter/components/list.vue +++ b/src/views/emergen_cyrescue/resource_management/emergency_shelter/components/list.vue @@ -210,6 +210,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + SHELTER_NAME: [ + { required: true, message: '场区名称不能为空', trigger: 'blur' }, + { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }] + + }, form: { // 名称 SHELTER_NAME: '', diff --git a/src/views/emergen_cyrescue/resource_management/equipment_library/components/equipment.vue b/src/views/emergen_cyrescue/resource_management/equipment_library/components/equipment.vue index bbaf2d3..bbf4f88 100644 --- a/src/views/emergen_cyrescue/resource_management/equipment_library/components/equipment.vue +++ b/src/views/emergen_cyrescue/resource_management/equipment_library/components/equipment.vue @@ -201,6 +201,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + EQUIP_NAME: [ + { required: true, message: '名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, form: { // 名称 EQUIP_NAME: '', diff --git a/src/views/emergen_cyrescue/resource_management/equipment_library/components/facilities.vue b/src/views/emergen_cyrescue/resource_management/equipment_library/components/facilities.vue index d0a1996..509ff45 100644 --- a/src/views/emergen_cyrescue/resource_management/equipment_library/components/facilities.vue +++ b/src/views/emergen_cyrescue/resource_management/equipment_library/components/facilities.vue @@ -198,6 +198,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + FAC_NAME: [ + { required: true, message: '名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, form: { // 医疗名称 FAC_NAME: '', diff --git a/src/views/emergen_cyrescue/resource_management/equipment_library/components/list.vue b/src/views/emergen_cyrescue/resource_management/equipment_library/components/list.vue index 0388dcc..77e731a 100644 --- a/src/views/emergen_cyrescue/resource_management/equipment_library/components/list.vue +++ b/src/views/emergen_cyrescue/resource_management/equipment_library/components/list.vue @@ -134,41 +134,41 @@ export default { CONTACT_PHONE: '', CONTACT_MOBILE_PHONE: '', COMPANY_NAME: '' + }, + rules: { + RESOURCE_LIBRARY_NAME: [ + { required: true, message: '资源库名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + LOCATION: [ + { required: true, message: '所在地点不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + RESOURCE_CATEGORY: [ + { required: true, message: '存放资源类别不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + RESOURCE_QUANTITY: [ + { required: true, message: '资源数量不能为空', trigger: 'blur' }, + { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } + ], + CONTACT_PERSON: [ + { required: true, message: '联系人不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + CONTACT_PHONE: [ + { required: true, message: '联系电话不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ], + CONTACT_MOBILE_PHONE: [ + { required: true, message: '联系人手机号码不能为空', trigger: 'blur' }, + { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' } + ], + COMPANY_NAME: [ + { required: true, message: '企业名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] } - // rules: { - // RESOURCE_LIBRARY_NAME: [ - // { required: true, message: '资源库名称不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // LOCATION: [ - // { required: true, message: '所在地点不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // RESOURCE_CATEGORY: [ - // { required: true, message: '存放资源类别不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // RESOURCE_QUANTITY: [ - // { required: true, message: '资源数量不能为空', trigger: 'blur' }, - // { min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' } - // ], - // CONTACT_PERSON: [ - // { required: true, message: '联系人不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // CONTACT_PHONE: [ - // { required: true, message: '联系电话不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ], - // CONTACT_MOBILE_PHONE: [ - // { required: true, message: '联系人手机号码不能为空', trigger: 'blur' }, - // { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' } - // ], - // COMPANY_NAME: [ - // { required: true, message: '企业名称不能为空', trigger: 'blur' }, - // { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } - // ] - // } } }, created() { @@ -235,7 +235,14 @@ export default { } }, confirm() { - this.dataSave() + /* this.dataSave()*/ + this.$refs.form.validate(valid => { + if (valid) { + this.dataSave() + } else { + return false + } + }) }, dataSave() { this.listLoading = true diff --git a/src/views/emergen_cyrescue/resource_management/equipment_library/components/supplies.vue b/src/views/emergen_cyrescue/resource_management/equipment_library/components/supplies.vue index 3d51093..5370f36 100644 --- a/src/views/emergen_cyrescue/resource_management/equipment_library/components/supplies.vue +++ b/src/views/emergen_cyrescue/resource_management/equipment_library/components/supplies.vue @@ -201,6 +201,12 @@ export default { dialogFormEdit: false, dialogFormShow: false, dialogType: 'add', + rules: { + SUPPLIES_NAME: [ + { required: true, message: '名称不能为空', trigger: 'blur' }, + { min: 2, max: 255, message: '长度在 2 到 255 个字符', trigger: 'blur' } + ] + }, form: { // 名称 SUPPLIES_NAME: '',