From 15940581e6ec2bb04ff054e727b86d41d3efb4a6 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 29 Jun 2022 15:30:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/modules/management/form-main.scss | 11 + .../communityParty/heart/heartForm.vue | 819 ++++++++++++++++++ .../communityParty/heart/heartList.vue | 495 +++++++++++ .../communityParty/heart/heartReview.vue | 450 ++++++++++ .../modules/workPc/guidance/DetailForm.vue | 2 +- 5 files changed, 1776 insertions(+), 1 deletion(-) create mode 100644 src/views/modules/communityParty/heart/heartForm.vue create mode 100644 src/views/modules/communityParty/heart/heartList.vue create mode 100644 src/views/modules/communityParty/heart/heartReview.vue diff --git a/src/assets/scss/modules/management/form-main.scss b/src/assets/scss/modules/management/form-main.scss index 6e0cfa6fa..d4fe24c3d 100644 --- a/src/assets/scss/modules/management/form-main.scss +++ b/src/assets/scss/modules/management/form-main.scss @@ -21,6 +21,10 @@ .list_item_width_2 { width: 135px; } + + .item_width_5{ + width: 320px; + } } @@ -51,7 +55,14 @@ } } +.form_flex{ + display:flex; + justify-content: space-around; + .form_item{ +width:50%; + } +} .twoline { display: -webkit-box; diff --git a/src/views/modules/communityParty/heart/heartForm.vue b/src/views/modules/communityParty/heart/heartForm.vue new file mode 100644 index 000000000..0feba9631 --- /dev/null +++ b/src/views/modules/communityParty/heart/heartForm.vue @@ -0,0 +1,819 @@ + + + + + + diff --git a/src/views/modules/communityParty/heart/heartList.vue b/src/views/modules/communityParty/heart/heartList.vue new file mode 100644 index 000000000..4cb2d955a --- /dev/null +++ b/src/views/modules/communityParty/heart/heartList.vue @@ -0,0 +1,495 @@ + + + + diff --git a/src/views/modules/communityParty/heart/heartReview.vue b/src/views/modules/communityParty/heart/heartReview.vue new file mode 100644 index 000000000..ec45e380c --- /dev/null +++ b/src/views/modules/communityParty/heart/heartReview.vue @@ -0,0 +1,450 @@ + + + + + + diff --git a/src/views/modules/workPc/guidance/DetailForm.vue b/src/views/modules/workPc/guidance/DetailForm.vue index 8b878642b..8bea54ce7 100644 --- a/src/views/modules/workPc/guidance/DetailForm.vue +++ b/src/views/modules/workPc/guidance/DetailForm.vue @@ -334,7 +334,7 @@ export default { this.$message.error(msg) } }, - dormatHtml(content) { + dormatHtml (content) { let c = '' if (content.indexOf('DOCTYPE') != -1) { c = content.slice(45, -16); From 65f7c94a415c09d5952137b7761b889d1c408431 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Thu, 30 Jun 2022 08:59:27 +0800 Subject: [PATCH 2/4] 111 --- .../scss/modules/management/form-main.scss | 5 + .../communityParty/heart/heartForm.vue | 159 +++++++++------ .../communityParty/heart/heartList.vue | 193 ++++++++++++------ 3 files changed, 237 insertions(+), 120 deletions(-) diff --git a/src/assets/scss/modules/management/form-main.scss b/src/assets/scss/modules/management/form-main.scss index d4fe24c3d..f864cd5d7 100644 --- a/src/assets/scss/modules/management/form-main.scss +++ b/src/assets/scss/modules/management/form-main.scss @@ -22,6 +22,11 @@ width: 135px; } + .list_item_width_3 { + width: 185px; + } + + .item_width_5{ width: 320px; } diff --git a/src/views/modules/communityParty/heart/heartForm.vue b/src/views/modules/communityParty/heart/heartForm.vue index 0feba9631..cf907040e 100644 --- a/src/views/modules/communityParty/heart/heartForm.vue +++ b/src/views/modules/communityParty/heart/heartForm.vue @@ -58,20 +58,18 @@ label-width="150px" prop="actStartTime"> @@ -137,8 +135,9 @@ prop="signUpEndTime" label-width="150px"> @@ -160,20 +159,18 @@ label-width="150px" prop="signInStartTime"> @@ -191,7 +188,7 @@
{//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 let nowData = Date.now() - if (this.formData.serviceTimeStart) { - let serviceTimeStart = new Date(this.formData.serviceTimeStart) - return time.getTime() > nowData || time.getTime() < serviceTimeStart || time.getTime() === serviceTimeStart + if (this.formData.actStartTime) { + let startTime = new Date(this.formData.actStartTime + ':00') + return time.getTime() < startTime } else { - return time.getTime() > nowData + return '' } } @@ -399,7 +396,12 @@ export default { uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile', // upload_url: '', // 上传URL upload_name: '', // 图片或视频名称 - replayImgList: [], + replayImgList: [ + { + id: '1', + url: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20220629/db05fed5cc56417299364ab8362ac9a0.png' + } + ], hideUploadBtn: false } @@ -409,6 +411,8 @@ export default { this.customerId = localStorage.getItem('customerId') this.initMap() this.loadSponsorlist() + + // this.replayImgList.push() }, methods: { @@ -495,20 +499,20 @@ export default { async handleComfirm () { - - this.btnDisable = true - setTimeout(() => { - this.btnDisable = false - }, 10000) - this.$refs['ref_form'].validate((valid, messageObj) => { - if (!valid) { - app.util.validateRule(messageObj) - this.btnDisable = false - } else { - this.addRecord() - } - - }) + console.log(this.formData) + // this.btnDisable = true + // setTimeout(() => { + // this.btnDisable = false + // }, 10000) + // this.$refs['ref_form'].validate((valid, messageObj) => { + // if (!valid) { + // app.util.validateRule(messageObj) + // this.btnDisable = false + // } else { + // this.addRecord() + // } + + // }) }, async addRecord () { @@ -546,8 +550,8 @@ export default { removePic (file, fileList) { - this.formData.imageList.splice(this.formData.imageList.findIndex(item => item === file.url), 1) - this.replayImgList.splice(this.replayImgList.findIndex(item => item.uid === file.uid), 1) + this.formData.coverPic = '' + this.replayImgList = [] this.hideUploadBtn = fileList.length >= 1; }, @@ -562,7 +566,7 @@ export default { }, handleSuccess (response, file, fileList) { this.replayImgList.push(file) - this.formData.imageList.push(response.data.url) + this.formData.coverPic = response.data.url }, @@ -745,16 +749,41 @@ export default { resetData () { this.formData = { - gridId: '',//网格Id - ninePlaceVal: '',//九小场所类型value值 - placeOrgId: '',//场所下的组织Id-场所名称 - placePatrolTeamId: '',//场所下分队Id - inspectorArray: [],//检查人员数组 - inspectors: '',//检查人员Id,逗号分隔 - firstTime: '',//首次巡查时间 - detailed: '',//隐患明细 - firstResult: '',//首次检查结果【0:合格 1:不合格】 - reviewTime: '',//拟复查时间 + actAddress: "市北区海泊桥青岛市市北区政府(延吉路北)", + actContent: "", + actDraftId: "", + actEndTime: "2022-08-30 13:34", + actId: "", + actLatitude: 36.08743, + actLongitude: 120.37479, + actQuota: "10", + actStartTime: "2022-07-30 13:34", + actType: "heart", + auditSwitch: true, + coverPic: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20220629/db05fed5cc56417299364ab8362ac9a0.png", + coverPicAuditStatus: "", + customerId: "45687aa479955f9d06204d415238f7cc", + + noticePassedPeople: false, + requirement: "", + reward: "10", + + signInAddress: "市北区海泊桥青岛市市北区政府(延吉路北)", + signInEndTime: "2022-07-30 10:34", + signInLatitude: 36.08743, + signInLongitude: 120.37479, + signInRadius: "100", + signInStartTime: "2022-07-29 13:34", + signUpEndTime: "2022-07-28 13:34", + sponsorContacts: "张三", + sponsorId: "7b6f9a9f9f38d5f9fa7ce94a93d6eb28", + sponsorName: "市北区", + sponsorTel: "15111111111", + sponsorType: "agency", + target: "", + title: "312313", + + volunteerLimit: false, } }, // 开启加载动画 @@ -815,5 +844,21 @@ export default { + + diff --git a/src/views/modules/communityParty/heart/heartList.vue b/src/views/modules/communityParty/heart/heartList.vue index 4cb2d955a..3e1f09304 100644 --- a/src/views/modules/communityParty/heart/heartList.vue +++ b/src/views/modules/communityParty/heart/heartList.vue @@ -17,33 +17,33 @@ - - + - + prop="status"> @@ -97,17 +97,17 @@ min-width="180"> - - @@ -141,8 +141,28 @@ class="div-table-button--edit" size="small" @click="handleEdit(scope.row)">修改 + 报名审核 + 取消活动 + 查看人员 + 结束活动 + 添加回顾 - 复查记录 + @click="handleReview(scope.row)">报名审核
@@ -165,7 +185,7 @@ size="small" class="div-table-button--more" slot="reference">更多 - + --> @@ -187,7 +207,7 @@ :close-on-click-modal="false" :close-on-press-escape="false" :title="formTitle" - width="1250px" + width="1350px" top="5vh" class="dialog-h" @closed="diaClose"> @@ -196,18 +216,51 @@ @dialogOk="addFormOk"> + + + +
+ + +
+ 取消 + 确定 +
+
+ +
+ + @closed="diaClose"> + @reviewDiaClose="diaClose">
@@ -227,9 +280,9 @@ export default { data () { let endDisabledDate = (time) => {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 let nowData = Date.now() - if (this.formData.startTime) { - let startTime = new Date(this.formData.startTime) - return time.getTime() > nowData || time.getTime() < startTime || time.getTime() === startTime + if (this.formData.actactStartTime) { + let actStartTime = new Date(this.formData.actactStartTime + ':00') + return time.getTime() < actStartTime || time.getTime() === actStartTime } else { return time.getTime() > nowData } @@ -253,18 +306,18 @@ export default { }, agencyId: '', - gridList: [],//所属网格list--场所区域 + statusList: [ { - value: '0', + value: 'published', label: '进行中' }, { - value: '1', + value: 'finished', label: '已结束' }, { - value: '2', + value: 'canceled', label: '已取消' } ],//是否合格list @@ -272,12 +325,9 @@ export default { formData: { title: '',//活动标题 - firstResult: '',//首次检查结果【0:合格 1:不合格】 - gridId: '',//场所区域【网格Id】 - ninePlaceVal: '',//场所类型【九小场所Value值】 - finalResult: '',//最终检查结果【0:合格 1:不合格】 - startTime: '', - endTime: '' + actStartTime: '', + actEndTime: '', + status: '' }, tableData: [], @@ -285,8 +335,14 @@ export default { //form相关 formShow: false, formTitle: '新增巡查', + actId: '', - reviewShow: false + cancelReason: '', + cancleShow: false,//活动取消 + auditShow: false,//报名审核 + personShow: false,//查看人员 + finishShow: false,//活动结束 + reviewShow: false,//添加回顾 } }, @@ -351,6 +407,15 @@ export default { this.reviewShow = false }, + diaClose () { + + this.cancleShow = false//活动取消 + this.auditShow = false//报名审核 + this.personShow = false//查看人员 + this.finishShow = false//活动结束 + this.reviewShow = false//添加回顾 + }, + handleDetail (row) { this.formTitle = '详情' this.formShow = true @@ -375,7 +440,7 @@ export default { }) }, - handleReview (row) { + handleAudit (row) { this.reviewShow = true this.$nextTick(() => { this.$refs.ref_review.initTable(row.placePatrolRecordId) @@ -391,38 +456,27 @@ export default { this.loadTable() }, - async handleDelete (row) { - - this.$confirm("确认删除?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(() => { - this.deleteRecord(row) - }) - .catch(err => { - if (err == "cancel") { - - } - - }); + async handleCancleAct (row) { + this.cancleShow = true + this.actId = row.actId }, - async deleteRecord (row) { - const url = "/gov/org/placepatrolrecord/del" + async cancleAct () { + const url = "/heart/work/act/cancelact" // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolrecord/del" let params = { - placePatrolRecordId: row.placePatrolRecordId + actId: this.actId, + cancelReason: this.cancelReason, } const { data, code, msg } = await requestPost(url, params) if (code === 0) { + this.cancleShow = false this.$message({ type: "success", - message: "删除成功" + message: "取消成功" }); this.loadTable() @@ -431,17 +485,30 @@ export default { } }, + cancleDiaClose () { + this.cancelReason = '' + this.cancleShow = false//活动取消 + }, + + diaClose () { + + + this.auditShow = false//报名审核 + this.personShow = false//查看人员 + this.finishShow = false//活动结束 + this.reviewShow = false//添加回顾 + }, + //重置搜索条件 resetSearch () { this.formData = { - title: '',//活动标题 - mobile: '',//联系电话 - scale: '',//场所规模【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 - gridId: '',//场所区域【网格Id】 - ninePlaceVal: '',//场所类型【九小场所Value值】 - isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 + title: '',//活动标题 + + actStartTime: '', + actEndTime: '', + status: '' } - this.pageSize = 10 + this.pageSize = 20 this.pageNo = 0 this.loadTable() }, From 0cd7874d77f000b788924d81a70e53844a4676dd Mon Sep 17 00:00:00 2001 From: jiangyy Date: Fri, 1 Jul 2022 10:50:04 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/modules/management/form-main.scss | 3 + .../communityParty/heart/heartAudit.vue | 387 ++++++++++++++ .../communityParty/heart/heartFinish.vue | 374 +++++++++++++ .../communityParty/heart/heartForm.vue | 358 ++++++++----- .../communityParty/heart/heartList.vue | 191 +++++-- .../communityParty/heart/heartPerson.vue | 338 ++++++++++++ .../communityParty/heart/heartReview.vue | 498 +++++------------- 7 files changed, 1617 insertions(+), 532 deletions(-) create mode 100644 src/views/modules/communityParty/heart/heartAudit.vue create mode 100644 src/views/modules/communityParty/heart/heartFinish.vue create mode 100644 src/views/modules/communityParty/heart/heartPerson.vue diff --git a/src/assets/scss/modules/management/form-main.scss b/src/assets/scss/modules/management/form-main.scss index f864cd5d7..60f243942 100644 --- a/src/assets/scss/modules/management/form-main.scss +++ b/src/assets/scss/modules/management/form-main.scss @@ -30,6 +30,9 @@ .item_width_5{ width: 320px; } + .item_width_6{ + width: 404px; + } } diff --git a/src/views/modules/communityParty/heart/heartAudit.vue b/src/views/modules/communityParty/heart/heartAudit.vue new file mode 100644 index 000000000..656ea08c7 --- /dev/null +++ b/src/views/modules/communityParty/heart/heartAudit.vue @@ -0,0 +1,387 @@ + + + + + + diff --git a/src/views/modules/communityParty/heart/heartFinish.vue b/src/views/modules/communityParty/heart/heartFinish.vue new file mode 100644 index 000000000..8567a5bdf --- /dev/null +++ b/src/views/modules/communityParty/heart/heartFinish.vue @@ -0,0 +1,374 @@ + + + + + + \ No newline at end of file diff --git a/src/views/modules/communityParty/heart/heartForm.vue b/src/views/modules/communityParty/heart/heartForm.vue index cf907040e..03b84a368 100644 --- a/src/views/modules/communityParty/heart/heartForm.vue +++ b/src/views/modules/communityParty/heart/heartForm.vue @@ -14,7 +14,7 @@ - - - @@ -87,7 +88,7 @@ prop="reward" style="display: block" label-width="150px"> - @@ -95,7 +96,7 @@ prop="sponsorContacts" label-width="150px" style="display: block"> - @@ -108,7 +109,7 @@ prop="sponsorTel" label-width="150px" style="display: block"> - @@ -127,6 +128,7 @@ label-width="150px" style="display: block"> + (选中后报名参加活动人员可以直接审核通过) @@ -134,11 +136,12 @@ style="display: block" prop="signUpEndTime" label-width="150px"> - + placeholder="选择时间"> @@ -146,7 +149,7 @@ prop="requirement" label-width="150px" style="display: block"> - - @@ -257,20 +260,20 @@
-

+ v-html="formData.actContentHtml">

@@ -325,54 +328,108 @@ export default { let nowData = Date.now() return time.getTime() > nowData } + const valActTime = (rule, value, callback) => { + if (value === '' || value === null) { + callback(new Error('请选择活动开始时间')) + } else if (!this.formData.actEndTime) { + callback(new Error('请选择活动结束时间')) + } else { + callback() + } + } + const valSigninTime = (rule, value, callback) => { + if (value === '' || value === null) { + callback(new Error('请选择签到开始时间')) + } else if (!this.formData.signInEndTime) { + callback(new Error('请选择签到结束时间')) + } else { + callback() + } + } return { formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 btnDisable: false, customerId: '', + actId: '', + valActTime: valActTime, + valSigninTime: valSigninTime, - placesList: [],//场景列表 - teamsList: [],//分队列表 - inspectorsList: [],//检查人员列表 - - placePatrolRecordId: '', formData: { - actAddress: "市北区海泊桥青岛市市北区政府(延吉路北)", - actContent: "", + actAddress: "", + actContentHtml: "", + actContent: {}, actDraftId: "", - actEndTime: "2022-08-30 13:34", + actEndTime: "", actId: "", - actLatitude: 36.08743, - actLongitude: 120.37479, - actQuota: "10", - actStartTime: "2022-07-30 13:34", + actLatitude: null, + actLongitude: null, + actQuota: undefined, + actStartTime: "", actType: "heart", - auditSwitch: true, - coverPic: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20220629/db05fed5cc56417299364ab8362ac9a0.png", + auditSwitch: false, + coverPic: "", coverPicAuditStatus: "", - customerId: "45687aa479955f9d06204d415238f7cc", + customerId: "", noticePassedPeople: false, requirement: "", - reward: "10", - - signInAddress: "市北区海泊桥青岛市市北区政府(延吉路北)", - signInEndTime: "2022-07-30 10:34", - signInLatitude: 36.08743, - signInLongitude: 120.37479, - signInRadius: "100", - signInStartTime: "2022-07-29 13:34", - signUpEndTime: "2022-07-28 13:34", - sponsorContacts: "张三", - sponsorId: "7b6f9a9f9f38d5f9fa7ce94a93d6eb28", - sponsorName: "市北区", - sponsorTel: "15111111111", - sponsorType: "agency", + reward: undefined, + + signInAddress: "", + signInEndTime: "", + signInLatitude: null, + signInLongitude: null, + signInRadius: undefined, + signInStartTime: "", + signUpEndTime: "", + sponsorContacts: "", + sponsorId: "", + sponsorPath: '', + sponsorName: "", + sponsorTel: "", + sponsorType: "", target: "", - title: "312313", + title: "", volunteerLimit: false, }, + formDataTemp: { + actAddress: "山东省青岛市市北区安达路", + actContent: {}, + actContentHtml: "", + actDraftId: "", + actEndTime: "2022-07-20 00:00", + actId: "", + actLatitude: 36.102321679746424, + actLongitude: 120.37441423359928, + actQuota: 50, + actStartTime: "2022-07-15 00:00", + actType: "heart", + auditSwitch: true, + coverPic: "", + coverPicAuditStatus: "", + customerId: "", + noticePassedPeople: false, + requirement: "报名条件报名条件报名条件", + reward: 100, + signInAddress: "山东省青岛市市南区南京路79号丁", + signInEndTime: "2022-07-14 11:00", + signInLatitude: 36.07208450171733, + signInLongitude: 120.38920734352655, + signInRadius: 100, + signInStartTime: "2022-07-14 10:00", + signUpEndTime: "2022-07-13 00:00", + sponsorContacts: "王二麻", + sponsorPath: "7b6f9a9f9f38d5f9fa7ce94a93d6eb28,63d5ff92ea981b1c58e4914ac894c610", + sponsorId: "7b6f9a9f9f38d5f9fa7ce94a93d6eb28", + sponsorName: "市北区", + sponsorTel: "1511111111", + sponsorType: "agency", + target: "", + title: "31231", + volunteerLimit: true, + }, orgOptions: [], orgOptionProps: { @@ -397,10 +454,10 @@ export default { // upload_url: '', // 上传URL upload_name: '', // 图片或视频名称 replayImgList: [ - { - id: '1', - url: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20220629/db05fed5cc56417299364ab8362ac9a0.png' - } + // { + // id: '1', + // url: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20220629/db05fed5cc56417299364ab8362ac9a0.png' + // } ], hideUploadBtn: false @@ -412,23 +469,29 @@ export default { this.initMap() this.loadSponsorlist() + + // this.replayImgList.push() }, methods: { - async initForm (type, placePatrolRecordId) { + async initForm (type, actId) { this.$refs.ref_form.resetFields(); - this.startLoading() + + this.formData = JSON.parse(JSON.stringify(this.formDataTemp)); + this.agencyIdArray = this.formData.sponsorPath.split(',') this.formType = type - if (placePatrolRecordId) { - this.placePatrolRecordId = placePatrolRecordId - this.formData.placePatrolRecordId = placePatrolRecordId + if (actId) { + this.startLoading() + this.actId = actId + this.formData.actId = actId await this.loadFormData() + this.endLoading() } - this.endLoading() + }, //获取主办方 @@ -457,39 +520,53 @@ export default { if (obj) { this.formData.sponsorId = obj.gridId this.formData.sponsorName = obj.agencyName + this.formData.sponsorPath = this.agencyIdArray.join(',') - if (obj.level === 'agency') { + if (obj.level === 'agency') { this.formData.sponsorType = 'agency' } else { - this.formData.sponsorType = 'grid' } } else { this.formData.sponsorId = '' + this.formData.sponsorPath = '' this.formData.sponsorName = '' this.formData.sponsorType = '' } - }, - //加载form async loadFormData () { - const url = '/gov/org/placepatrolrecord/detail' + const url = '/heart/work/act/detail' let params = { - placePatrolRecordId: this.placePatrolRecordId + actId: this.actId } const { data, code, msg } = await requestPost(url, params) if (code === 0) { - data.inspectorArray = data.inspectors.split(',') - this.formData = { ...data } + debugger + this.formData = JSON.parse(JSON.stringify(data)); + this.agencyIdArray = this.formData.sponsorPath.split(',') + if (this.formData.actContent && this.formData.actContent.length > 0) { + this.formData.actContentHtml = this.formData.actContent[0].content + } + + if (this.formData.coverPic) { + let obj = { + id: '111', + url: this.formData.coverPic + } + this.replayImgList = [] + this.replayImgList.push(obj) + + this.hideUploadBtn = true + } } else { @@ -497,30 +574,40 @@ export default { } }, - async handleComfirm () { console.log(this.formData) - // this.btnDisable = true - // setTimeout(() => { - // this.btnDisable = false - // }, 10000) - // this.$refs['ref_form'].validate((valid, messageObj) => { - // if (!valid) { - // app.util.validateRule(messageObj) - // this.btnDisable = false - // } else { - // this.addRecord() - // } - - // }) + + this.btnDisable = true + setTimeout(() => { + this.btnDisable = false + }, 3000) + + this.$refs['ref_form'].validate((valid, messageObj) => { + + if (!valid) { + + app.util.validateRule(messageObj) + this.btnDisable = false + } else { + this.addHeartAct() + } + + }) }, - async addRecord () { - this.formData.actContent = this.dormatHtml(this.formData.actContent) + async addHeartAct () { + let obj = { + contentType: 'rich_text', + content: this.dormatHtml(this.formData.actContentHtml) + } + this.formData.actContent = [] + this.formData.actContent.push(obj) + + this.formData.customerId = this.customerId - let url = "/gov/org/placepatrolrecord/add" + let url = "/heart/work/act/publishV2" // let url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolrecord/add" - this.formData.inspectors = this.formData.inspectorArray.join(',') + const { data, code, msg } = await requestPost(url, this.formData) @@ -749,39 +836,41 @@ export default { resetData () { this.formData = { - actAddress: "市北区海泊桥青岛市市北区政府(延吉路北)", - actContent: "", + actAddress: "", + actContentHtml: "", + actContent: {}, actDraftId: "", - actEndTime: "2022-08-30 13:34", + actEndTime: "", actId: "", - actLatitude: 36.08743, - actLongitude: 120.37479, - actQuota: "10", - actStartTime: "2022-07-30 13:34", + actLatitude: null, + actLongitude: null, + actQuota: undefined, + actStartTime: "", actType: "heart", - auditSwitch: true, - coverPic: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20220629/db05fed5cc56417299364ab8362ac9a0.png", + auditSwitch: false, + coverPic: "", coverPicAuditStatus: "", - customerId: "45687aa479955f9d06204d415238f7cc", + customerId: "", noticePassedPeople: false, requirement: "", - reward: "10", - - signInAddress: "市北区海泊桥青岛市市北区政府(延吉路北)", - signInEndTime: "2022-07-30 10:34", - signInLatitude: 36.08743, - signInLongitude: 120.37479, - signInRadius: "100", - signInStartTime: "2022-07-29 13:34", - signUpEndTime: "2022-07-28 13:34", - sponsorContacts: "张三", - sponsorId: "7b6f9a9f9f38d5f9fa7ce94a93d6eb28", - sponsorName: "市北区", - sponsorTel: "15111111111", - sponsorType: "agency", + reward: undefined, + + signInAddress: "", + signInEndTime: "", + signInLatitude: null, + signInLongitude: null, + signInRadius: undefined, + signInStartTime: "", + signUpEndTime: "", + sponsorContacts: "", + sponsorId: "", + sponsorPath: '', + sponsorName: "", + sponsorTel: "", + sponsorType: "", target: "", - title: "312313", + title: "", volunteerLimit: false, } @@ -806,31 +895,50 @@ export default { dataRule () { return { - gridId: [ - { required: true, message: '场所网格不能为空', trigger: 'blur' } - ], - ninePlaceVal: [ - { required: true, message: '场所类型不能为空', trigger: 'blur' }, + sponsorId: [ + { required: true, message: '主办方不能为空', trigger: 'change' } ], - placeOrgId: [ - { required: true, message: '场所名称不能为空', trigger: 'blur' } + title: [ + { required: true, message: '活动标题不能为空', trigger: 'change' }, ], - placePatrolTeamId: [ - { required: true, message: '分队不能为空', trigger: 'blur' } + + coverPic: [ + { required: true, message: '封面图不能为空', trigger: 'change' } ], - inspectorArray: [ - { required: true, message: '巡检人员不能为空', trigger: 'blur' } + actContentHtml: [ + { required: true, message: '活动详情不能为空', trigger: 'change' } + ], + actAddress: [ + { required: true, message: '活动地点不能为空', trigger: 'change' } ], - firstTime: [ - { required: true, message: '首次巡查时间不能为空', trigger: 'blur' } + actStartTime: [ + { required: true, validator: this.valActTime, message: '活动时间不能为空', trigger: 'change' } ], - detailed: [ - { required: true, message: '隐患明细不能为空', trigger: 'blur' } + actQuota: [ + { required: true, message: '活动人数不能为空', trigger: 'change' } + ], + reward: [ + { required: true, message: '活动积分不能为空', trigger: 'change' } + ], + signUpEndTime: [ + { required: true, message: '报名截止时间不能为空', trigger: 'change' } + ], + signInStartTime: [ + { required: true, validator: this.valSigninTime, message: '签到时间不能为空', trigger: 'change' } + ], + signInAddress: [ + { required: true, message: '签到地点不能为空', trigger: 'change' } + ], + signInRadius: [ + { required: true, message: '签到有效范围不能为空', trigger: 'change' } + ], + sponsorContacts: [ + { required: true, message: '联系人不能为空', trigger: 'change' } + ], + sponsorTel: [ + { required: true, message: '联系电话不能为空', trigger: 'change' } ], - firstResult: [ - { required: true, message: '首次巡查结果不能为空', trigger: 'blur' } - ] } }, @@ -848,6 +956,10 @@ export default { .avatar-uploader { margin: 0 0 0 20px; } +.div-tooltip { + margin-left: 10px; + color: red; +} diff --git a/src/views/modules/communityParty/heart/heartReview.vue b/src/views/modules/communityParty/heart/heartReview.vue index ec45e380c..8724d6404 100644 --- a/src/views/modules/communityParty/heart/heartReview.vue +++ b/src/views/modules/communityParty/heart/heartReview.vue @@ -1,138 +1,40 @@ @@ -141,252 +43,119 @@ import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 import { requestPost } from '@/js/dai/request' +import Tinymce from '@c/tinymce2/index.vue' + let loading // 加载动画 + + export default { data () { + return { - tableLoading: false, - placePatrolRecordId: '', - tableData: [], + formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 + btnDisable: false, + customerId: '', + actId: '', + + formData: { + actContent: '', + }, + + } }, - components: {}, + components: { Tinymce }, mounted () { + this.customerId = localStorage.getItem('customerId') }, methods: { - async initTable (placePatrolRecordId) { - this.placePatrolRecordId = placePatrolRecordId - await this.loadTeams() - - await this.loadTable() - - }, - - - //加载分队 - async loadTeams () { - const url = '/gov/org/placepatrolteam/getlist' - // const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteam/getlist' - let params = { - isPage: false - } - - const { data, code, msg } = await requestPost(url, params) - - if (code === 0) { - this.teamsList = data.list - - - } else { - this.$message.error(msg) - } - }, - - //点击分队切换人员 - async hancleChangeTeam (row, index, tableIndex) { - this.tableData[tableIndex].inspectorArray = [...[]] - let teamId = this.teamsList[index].teamId - await this.loadInspectors(teamId, tableIndex) - }, - - //加载分队下人员 - async loadInspectors (teamId, tableIndex) { + async initForm (type, actId) { + this.$refs.ref_form.resetFields(); + this.startLoading() - const url = '/gov/org/placepatrolteamstaff/getlist' - // const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteamstaff/getlist' - let params = { - teamId: teamId - } + this.formType = type + if (actId) { + this.actId = actId + this.formData.actId = actId - const { data, code, msg } = await requestPost(url, params) - if (code === 0) { - // let obj = this.tableData[tableIndex] - this.tableData[tableIndex].inspectorsList = [...data] - // this.tableData[tableIndex]= - // obj.inspectorsList = data - // this.$set(this.tableData, tableIndex, obj) - console.log(this.tableData) - } else { - this.$message.error(msg) } + this.endLoading() }, - //加载form - async loadTable () { - this.tableLoading = true - const url = '/gov/org/placepatrolreviewrecord/getlist' - // const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolreviewrecord/getlist' - let params = { - placePatrolRecordId: this.placePatrolRecordId - } - const { data, code, msg } = await requestPost(url, params) - this.tableLoading = false - if (code === 0) { - if (data.list && data.list.length > 0) { - data.list.forEach(item => { - item.isEdit = false - item.isNew = false - let arrayInspectors = item.inspectors.split(',') - item.inspectorArray = [...arrayInspectors] - let arrayReviewTime = item.reviewTime.split(' ') - item.reviewTime = arrayReviewTime[0] - }); - this.tableData = [...data.list] - } else { - this.tableData = [] - } + async handleComfirm () { + console.log(this.formData) + // this.btnDisable = true + // setTimeout(() => { + // this.btnDisable = false + // }, 10000) + // this.$refs['ref_form'].validate((valid, messageObj) => { + // if (!valid) { + // app.util.validateRule(messageObj) + // this.btnDisable = false + // } else { + // this.addRecord() + // } - } else { - this.$message.error(msg) - } - }, + // }) - handleAdd () { - let obj = { - isNew: true,//是否新增 - isEdit: true,//是否编辑 - placePatrolRecordId: this.placePatrolRecordId, - reviewTime: '', - placePatrolTeamId: '', - inspectors: '', - inspectorArray: [], - inspectorsList: [], - reviewResult: '', - } - this.tableData.push(obj) }, + async addRecord () { + this.formData.actContent = this.dormatHtml(this.formData.actContent) - async handleEdit (row, tableIndex) { - let teamId = row.placePatrolTeamId - await this.loadInspectors(teamId, tableIndex) + let url = "/gov/org/placepatrolrecord/add" + // let url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolrecord/add" + this.formData.inspectors = this.formData.inspectorArray.join(',') - let rowData = JSON.parse(JSON.stringify(row)) - rowData.isEdit = true - rowData.isNew = false - rowData.inspectorArray = rowData.inspectors.split(',') + const { data, code, msg } = await requestPost(url, this.formData) - console.log(rowData) - this.$set(this.tableData, tableIndex, rowData) - }, - - async handleComfirm (row, tableIndex) { - let valiMsg = this.validata(row) - if (valiMsg) { + if (code === 0) { this.$message({ - type: 'warning', - message: valiMsg + type: 'success', + message: '操作成功' }) - return false - } - - this.addReview(row, tableIndex) - - }, - async addReview (row, tableIndex) { - - let url = "/gov/org/placepatrolreviewrecord/add" - if (row.placePatrolReviewRecordId) { - url = "/gov/org/placepatrolreviewrecord/edit" - } - - let params = JSON.parse(JSON.stringify(row)) - params.inspectors = params.inspectorArray.join(',') - params.reviewTime = params.reviewTime + ' 00:00:00' - - const { data, code, msg } = await requestPost(url, params) - - if (code === 0) { - let array = data.reviewTime.split(' ') - data.reviewTime = array[0] - data.isEdit = false - data.isNew = false - - this.$set(this.tableData, tableIndex, data) - + this.resetData() + this.$emit('dialogOk') + this.btnDisable = false } else { - + this.btnDisable = false this.$message.error(msg) } }, - validata (row) { - let message = '' - if (row.reviewTime === '') { - message = message + '复查时间不能为空;' - } - if (row.placePatrolTeamId === '') { - message = message + '分队名称不能为空;' - } - if (row.inspectorArray.length === 0) { - message = message + '检查人员不能为空;' + dormatHtml (content) { + let c = '' + if (content.indexOf('DOCTYPE') != -1) { + c = content.slice(45, -16); } - if (row.reviewResult === '') { - message = message + '复查结论不能为空;' - } - return message + console.log('content', typeof content) + return c || content }, - async handleDelete (row, tableIndex) { - - this.$confirm("确认删除?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(() => { - if (row.placePatrolReviewRecordId) {//存在id,调用服务删除 - this.deleteRecord(row, tableIndex) - } else {//不存在id,直接删除数组数据 - this.tableData.splice(tableIndex, 1); - } - - }) - .catch(err => { - if (err == "cancel") { - - } - }); - }, - - async deleteRecord (row, tableIndex) { - - const url = "/gov/org/placepatrolreviewrecord/del" - - let params = { - placePatrolReviewRecordId: row.placePatrolReviewRecordId - } - const { data, code, msg } = await requestPost(url, params) - - if (code === 0) { - // this.$message({ - // type: "success", - // message: "删除成功" - // }); - - this.tableData.splice(tableIndex, 1); - } else { - this.$message.error(msg) - } - }, handleCancle () { + + this.resetData() this.$emit('dialogCancle') }, - + resetData () { + this.formData = { + actContent: '', + } + }, // 开启加载动画 startLoading () { loading = Loading.service({ @@ -404,47 +173,62 @@ export default { } }, computed: { - tableHeight () { - - return (this.clientHeight - 360) - + dataRule () { + return { + + gridId: [ + { required: true, message: '场所网格不能为空', trigger: 'blur' } + ], + ninePlaceVal: [ + { required: true, message: '场所类型不能为空', trigger: 'blur' }, + ], + placeOrgId: [ + { required: true, message: '场所名称不能为空', trigger: 'blur' } + ], + placePatrolTeamId: [ + { required: true, message: '分队不能为空', trigger: 'blur' } + ], + + inspectorArray: [ + { required: true, message: '巡检人员不能为空', trigger: 'blur' } + ], + firstTime: [ + { required: true, message: '首次巡查时间不能为空', trigger: 'blur' } + ], + detailed: [ + { required: true, message: '隐患明细不能为空', trigger: 'blur' } + ], + firstResult: [ + { required: true, message: '首次巡查结果不能为空', trigger: 'blur' } + ] + } }, - ...mapGetters(['clientHeight']) - }, props: { - resultList: { - type: Array, - default: [] - } } } - + + + From 56a9e9fbe8d66f2f292946cbb4d6b70ecbf68056 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Fri, 1 Jul 2022 11:20:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/communityParty/heart/heartForm.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/modules/communityParty/heart/heartForm.vue b/src/views/modules/communityParty/heart/heartForm.vue index 03b84a368..edcb283ac 100644 --- a/src/views/modules/communityParty/heart/heartForm.vue +++ b/src/views/modules/communityParty/heart/heartForm.vue @@ -549,7 +549,7 @@ export default { const { data, code, msg } = await requestPost(url, params) if (code === 0) { - debugger + this.formData = JSON.parse(JSON.stringify(data)); this.agencyIdArray = this.formData.sponsorPath.split(',') if (this.formData.actContent && this.formData.actContent.length > 0) { @@ -606,6 +606,12 @@ export default { this.formData.customerId = this.customerId let url = "/heart/work/act/publishV2" + if (this.actId) { + url = '/heart/work/act/republishV2' + } else { + url = "/heart/work/act/publishV2" + } + // let url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolrecord/add"