From 0997c4a419a7b1cba14f293fc03075987aa521d2 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Wed, 12 Apr 2023 13:53:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=BF=E7=AD=96=E6=89=BE=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityService/policy/addPolicy.vue | 71 ++++++++++++------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/src/views/modules/communityService/policy/addPolicy.vue b/src/views/modules/communityService/policy/addPolicy.vue index d0c1f2a84..8fcb1e644 100644 --- a/src/views/modules/communityService/policy/addPolicy.vue +++ b/src/views/modules/communityService/policy/addPolicy.vue @@ -244,6 +244,7 @@ ref="ref_policy_form1" v-if="newFormData" > + { // this.btnDisable = false; // }, 5000); - // this.$refs["ref_form"].validate((valid, messageObj) => { - // if (!valid) { - // // app.util.validateRule(messageObj) - // this.btnDisable = false; - // } else { - // this.addFuwu(); - // } - // }); - await this.addFuwu(); + const form = new Promise((resolve, reject) => { + this.$refs["ref_form"].validate((valid) => { + if (valid) resolve(); + }); + }); + + const form1 = new Promise((resolve, reject) => { + this.$refs["ref_policy_form1"].validate((valid) => { + if (valid) resolve(); + }); + }); + Promise.all([form1, form]) + .then(() => { + var oDate1 = new Date(this.formData.serviceTimeStart); + var oDate2 = new Date(this.formData.serviceTimeEnd); + if (oDate1.getTime() > oDate2.getTime()) { + this.$message.error("服务截止时间必须大于服务开始时间"); + return false; + } + this.addFuwu(); + }) + .catch(() => { + app.util.validateRule(messageObj); + this.btnDisable = false; + }); }, getLastItem(list, vals, key) { let LIST = list || []; @@ -822,17 +840,17 @@ export default { async addFuwu() { // 处理服务范围数据 await this.operationOption(); - // 文件上传新增没问题,编辑执行这一步会多多一个文件对象 - // this.formData.attachmentList = [...this.fileList]; - // this.fileList.forEach(item=>{ - // this.formData.attachmentList.push({ - // name:item.attachmentName, - // type:item.attachmentType, - // url:item.attachmentUrl, - // format:item.attachmentFormat, - // duration:0, - // }) - // }) + this.formData.attachmentList = [...this.fileList] + let arr = [] + this.formData.attachmentList.map(item=>{ + arr.push({ name:item.attachmentName|| item.name, + type:item.attachmentType || item.type, + url:item.attachmentUrl || item.url, + format:item.attachmentFormat|| item.format, + duration:0,}) + return arr + }) + this.formData.attachmentList = arr this.formData.assignInfo = this.newFormData; let url = ""; @@ -1021,8 +1039,11 @@ export default { // 服务类型下拉框选中事件 handleChangeServiceTypeLevel1() { - // this.formData.policyCategoryL2 = ""; - this.$http + this.formData.policyCategoryL2 = ""; + this.getCommonServiceTypeSelectList() + }, + getCommonServiceTypeSelectList(){ + this.$http .get( "/governance/commonServiceType/selectList/" + this.formData.policyCategoryL1 From de4865e5a247eced882a0345c06ac8b76916289e Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Wed, 12 Apr 2023 15:51:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?scss=E6=9C=8D=E5=8A=A1=E7=B1=BB=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/scss/modules/management/list-main.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/assets/scss/modules/management/list-main.scss b/src/assets/scss/modules/management/list-main.scss index fb26d15c5..f0989da24 100644 --- a/src/assets/scss/modules/management/list-main.scss +++ b/src/assets/scss/modules/management/list-main.scss @@ -57,6 +57,9 @@ .m-form-box-height-auto{ height: auto; } + .u-item-width-service{ + width: 218px; + } }