From 3d3b8d6b944af7f10b305ddcb537af81bfea66f8 Mon Sep 17 00:00:00 2001 From: duanliangtao <48194157+duanliangtao@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E4=B8=8A=E4=BA=8B=E4=BB=B6=E7=AE=A1=E7=90=86=E7=9A=84=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/work2/work2.wxml | 2 +- pages/work2/work2.wxss | 4 +- .../dissatisfied/demandCheck/demandCheck.js | 71 ++++++++--- .../dissatisfied/demandCheck/demandCheck.wxml | 74 +++++++++++- .../dissatisfied/demandCheck/demandCheck.wxss | 80 +++++++++++++ .../myTroubleshootDemand/pages/event/event.js | 111 ++++++++++++++++-- .../pages/event/event.json | 8 +- .../pages/event/event.wxml | 28 ++++- .../myTroubleshootDemand/pages/index/index.js | 17 +-- utils/statisticsApi.js | 3 + 10 files changed, 350 insertions(+), 48 deletions(-) diff --git a/pages/work2/work2.wxml b/pages/work2/work2.wxml index ec5273c..909774a 100644 --- a/pages/work2/work2.wxml +++ b/pages/work2/work2.wxml @@ -43,7 +43,7 @@ 为民服务 - + 诉求上报 diff --git a/pages/work2/work2.wxss b/pages/work2/work2.wxss index d4a9f9e..aebc665 100644 --- a/pages/work2/work2.wxss +++ b/pages/work2/work2.wxss @@ -86,7 +86,7 @@ display: flex; flex-direction: column; align-items: center; - width: 250rpx; + width: 230rpx; height:210rpx; } .data{ @@ -215,7 +215,7 @@ margin-top: 15rpx; } .text_5-0 { - width: 109rpx; + /* width: 109rpx; */ height: 27rpx; overflow-wrap: break-word; color: rgba(51,51,51,1); diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js index e18c048..9d8f331 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js @@ -1,6 +1,9 @@ import { $wuxActionSheet } from '../../../../../components/dist/index' +import { + icEventOldProcess +} from "../../../../../utils/statisticsApi"; const QQMapWX = require('../../../../../utils/qqmap-wx-jssdk') const config = require('../../../../../utils/config') const app = getApp() @@ -80,7 +83,10 @@ Page({ showWantServiceTimeTime: '', reportTypeList: [], //上报类型 - reportTypeVisible: false + reportTypeVisible: false, + + categoryIds:'', + processData: [] }, /** @@ -96,7 +102,7 @@ Page({ this.getDemandoption() this.getDictList() if (options.id) { - if (options.type === '0') { + if (options.type === '0' || options.type === '2') { this.getIcEventOldDetail(options.id) } else { this.getDemandDetail(options.id) @@ -180,7 +186,8 @@ Page({ uploaded: true })) : [], uploadRecord: res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0] : null, - totalTime: this.format(res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0].duration : 0) + totalTime: this.format(res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0].duration : 0), + categoryIds:res.data.parentCategoryId+","+res.data.categoryId }) if (this.data.uploadRecord) { this.downLoadAudio() @@ -188,6 +195,36 @@ Page({ }).catch(err => { console.log(err); }) + + icEventOldProcess({icEventId: id}).then(res => { + this.getProcess(res.data); + }) + }, + getProcess(data) { + // 处理数据 + const processedData = data.map(item => { + return { + ...item, + formattedTime: this.formatTimestamp(item.processTime) + }; + }); + + // 更新数据 + this.setData({ + processData: processedData + }); +}, + +// 格式化时间戳的方法 +formatTimestamp(timestamp) { + const date = new Date(parseInt(timestamp) * 1000); + const year = date.getFullYear(); + const month = ('0' + (date.getMonth() + 1)).slice(-2); + const day = ('0' + date.getDate()).slice(-2); + const hour = ('0' + date.getHours()).slice(-2); + const minute = ('0' + date.getMinutes()).slice(-2); + const second = ('0' + date.getSeconds()).slice(-2); + return `${year}-${month}-${day} ${hour}:${minute}:${second}`; }, update() { this.submitPersonalInfo() @@ -667,6 +704,8 @@ Page({ showTime: '', resiName: '', resiMobile: '', + responsibleName: '', + responsibleMobile: '', 'fmData.gridId': '', 'fmData.attachmentList': [], //图片 'fmData.voiceList': [], @@ -679,8 +718,8 @@ Page({ // 'fmData.reportType': '', // 'fmData.demandType': '', // 'fmData.responsibleUnit': '', - // 'fmData.responsibleName': '', - // 'fmData.responsibleMobile': '' + 'fmData.responsibleName': '', + 'fmData.responsibleMobile': '' }) wx.switchTab({ url: '/pages/work/work', @@ -1539,20 +1578,20 @@ Page({ }); _this.initAudio(); } else { - wx.showToast({ - title: '音频加载失败', - icon: 'none', - duration: 1500 - }); + // wx.showToast({ + // title: '音频加载失败', + // icon: 'none', + // duration: 1500 + // }); } }, fail(err) { console.log(err); - wx.showToast({ - title: '音频加载失败', - icon: 'none', - duration: 1500 - }); + // wx.showToast({ + // title: '音频加载失败', + // icon: 'none', + // duration: 1500 + // }); } }); }, @@ -1687,7 +1726,7 @@ Page({ process() { wx.navigateTo({ - url: `/subpages/myTroubleshootDemand/pages/event/event?id=${this.data.optionsId}`, + url: `/subpages/myTroubleshootDemand/pages/event/event?id=${this.data.optionsId}&categoryIds=${this.data.categoryIds}`, }) }, }) \ No newline at end of file diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml index f9c6cce..600cc6f 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml @@ -28,7 +28,7 @@ - {{tabVal ==0?'事件上报':'居民需求'}} + {{tabVal ==0?'事件上报':tabVal ==1?'居民需求':'城管事件'}} @@ -159,10 +159,10 @@ * - 有无责任单位 + 有无责任单位 - + @@ -191,6 +191,74 @@ + + + 处理进展 + + + + 【指派】 + 【完成并回复】 + 【{{ item.processName }}】 + + + + {{item.formattedTime}} + + + + 指派人: + + {{ item.departmentName }} + + + + 指派部门: + + {{ item.agencyName }} + + + + 转办意见: + + {{ item.publicReply }} + + + + 办结时限: + + {{ item.timeLimit }} + + + + + + 回复人: + + {{ item.departmentName }} + + + + 回复内容: + + {{ item.publicReply }} + + + + 办结时限: + + {{ item.timeLimit }} + + + + + + + + + + + diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss index 44fdc70..3b38350 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss @@ -431,6 +431,15 @@ font-family: Source Han Serif SC; font-weight: 400; color: #333; } + +.field .field-text-small { +font-size: 28rpx; +font-family: Source Han Serif SC; +font-weight: 400; +color: #333; +white-space: nowrap; +} + .value { position: relative; width: 410rpx; @@ -583,6 +592,21 @@ background: rgb(175, 1, 1); margin-left: 20rpx; } +.radio-group-small { + height: 100%; + display: flex; + align-items: center; + color: #999; + font-size: 28rpx; + font-weight: 300; + } + .radio-group-small radio { + margin-left: 50rpx; + } + .radio-group-small radio + radio { + margin-left: 50rpx; + } + .small-radio { /* 确保文本不换行 */ white-space: nowrap; @@ -1020,4 +1044,60 @@ background: rgb(175, 1, 1); .btn_red{ background: linear-gradient(87deg, #f1560e 0%, #f1560e 100%); +} + + + +.card { + background: #fff; + border-radius: 20rpx; + padding: 30rpx; + margin-top: 20rpx; +} +.card .title { + font-size: 34rpx; + font-weight: bold; + color: #333333; + display: flex; + align-items: center; + margin-left: -30rpx; + margin-bottom: 39rpx; + position: relative; +} +.card .title:before { + content: ''; + display: block; + width: 10rpx; + height: 28rpx; + background: #3A80E7; + border-radius: 4rpx; + margin-right: 20rpx; +} + +.step-title { + font-size: 32rpx; + font-weight: 500; + color: #333333; + margin-left: -.5em; +} + +.step-time { + font-size: 26rpx; + font-weight: 400; + color: #999999; + margin: 20rpx 0 30rpx; +} + +.card_content { + display: flex; + font-weight: 400; + color: #999999; +} +.label { + white-space: nowrap; + font-size: 30rpx; + margin-bottom: 22rpx; +} +.value { + color: #333; } \ No newline at end of file diff --git a/subpages/myTroubleshootDemand/pages/event/event.js b/subpages/myTroubleshootDemand/pages/event/event.js index 26f92b2..87c56fd 100644 --- a/subpages/myTroubleshootDemand/pages/event/event.js +++ b/subpages/myTroubleshootDemand/pages/event/event.js @@ -1,4 +1,4 @@ -import {agencygridtree, getCategoryTree, icEventOldReply} from "../../../../utils/statisticsApi"; +import {agencyGridDepttree, getCategoryTree, icEventOldReply} from "../../../../utils/statisticsApi"; const config = require('../../../../utils/config') Page({ @@ -20,6 +20,11 @@ Page({ fileList: [], timeLimit: [], operationType: ["0"], + categoryIds:'', + + currentDate: new Date().getTime(), + minDate: new Date(2024, 0, 1).getTime(), + maxDate: new Date().getTime(), form: { operationType: "0", //处理方式[0:已回复 5、指派 6、完成并回复] @@ -31,6 +36,8 @@ Page({ categoryList: [], files: [] //附件 }, + + categoryTreeData:[] }, /** @@ -42,7 +49,11 @@ Page({ id: options.id, }) } - console.log("eventId:"+this.data.id) + if (options.categoryIds) { + this.setData({ + categoryIds: options.categoryIds, + }) + } this.getCategoryList(); this.getOrgTreeList(); }, @@ -99,7 +110,7 @@ Page({ handleChangeType(e) { this.setData({ tabVal: e.detail.value, - "form.operationType": e.detail[0] + "form.operationType": e.detail.value }) }, @@ -108,19 +119,70 @@ Page({ let params = {}; getCategoryTree(params).then(res => { let treeDataNew = this.deepTree(res.data, "children"); - console.log(treeDataNew, 'treeDataNew') + // console.log('treeDataNew:'+JSON.stringify(treeDataNew)) this.setData({ - casOptions: this.deleteChildren(treeDataNew, "children") + casOptions: this.deleteChildren(treeDataNew, "children"), + categoryTreeData:treeDataNew }); + const ids = this.data.categoryIds.split(","); + const categoryPath = this.getCategoryPath(treeDataNew, ids); + console.log("ids:"+ids); + console.log("categoryPath:"+categoryPath); + this.setData({ + casOptions: this.deleteChildren(treeDataNew, "children"), + category:this.getCategoryPath(treeDataNew, ids) + }); + }) }, + getCategoryPath(tree, ids) { + let path = []; + + const traverse = (node) => { + // 如果当前节点的id在ids中,添加到路径数组 + if (ids.includes(node.id)) { + path.push(node.categoryName); + + // 如果当前节点是最后一个id,返回路径 + if (node.id === ids[ids.length - 1]) { + return true; + } + } + + // 递归遍历子节点 + if (node.children) { + for (let child of node.children) { + if (traverse(child)) { + return true; // 找到路径后停止遍历 + } + } + } + + // 如果当前节点不匹配或者没有找到路径,从路径中移除该节点 + if (path[path.length - 1] === node.categoryName) { + path.pop(); + } + + return false; + }; + + // 遍历整个树结构,查找路径 + for (let node of tree) { + if (traverse(node)) { + break; // 找到路径后停止遍历 + } + } + + return path.join('/'); + }, + getOrgTreeList() { let params = { agencyId: this.data.agencyId, purpose: "query" } - agencygridtree(params).then(res => { + agencyGridDepttree(params).then(res => { this.setData({ orgOptions: this.deleteChildren(res.data.subAgencyList, 'subAgencyList') }) @@ -171,6 +233,8 @@ Page({ "form.categoryList": {...params, children: null}, visible1: false }) + console.log("form.categoryId:"+this.data.form.categoryId); + console.log("form.categoryList:"+JSON.stringify(this.data.form.categoryList)); this.setData({category: data.selectedOptions.map(item => item.categoryName).join('/')}) }, @@ -207,8 +271,9 @@ Page({ filePath: file.url, success: (res) => { let data = JSON.parse(res.data) + console.log("data:"+JSON.stringify(file)); const fileList = this.data.fileList; - fileList.push({...file, url: data.data.url}); + fileList.push({...file, attachmentUrl: data.data.url,attachmentName:file.name,attachmentFormat:file.type,attachmentType:file.type}); console.log(fileList) this.setData({fileList}); }, @@ -226,10 +291,16 @@ Page({ }, openCalendar1() { + console.log("openCalendar1.....") this.setData({ showDate: true }) }, + + closePopup() { + this.setData({ showPopup: false }); + }, + onCloseDate() { this.setData({showDate: false}); }, @@ -237,13 +308,26 @@ Page({ date = new Date(date); return `${date.getFullYear()}-${date.getMonth() + 1 > 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1)}-${date.getDate() > 10 ? date.getDate() : '0' + date.getDate()}`; }, - onConfirmDate(event) { - console.log(event) - const date = event.detail; + + onInput(event) { + var date = new Date(event.detail); + var year = date.getFullYear(); + var month = ("0" + (date.getMonth() + 1)).slice(-2); + var day = ("0" + date.getDate()).slice(-2); + var hour = ("0" + date.getHours()).slice(-2); + var minute = ("0" + date.getMinutes()).slice(-2); + var second = ("0" + date.getSeconds()).slice(-2); + var formattedDateTime = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second; + this.setData({ + getData:formattedDateTime + }) + }, + + onConfirmDate(e) { this.setData({ + 'form.timeLimit': e.detail.label + ':00', showDate: false, - "form.timeLimit": `${this.formatDate(date)} 00:00:00`, - }); + }) }, // 双向绑定 内容输入框 @@ -256,7 +340,7 @@ Page({ submitEventReplyInfo(){ console.log("this.data.form:"+this.data.form.content); - if (!this.data.form.categoryId) { + if (!this.data.category) { this.showToast('事件类型不能为空') return } @@ -274,6 +358,7 @@ Page({ return } + let params = { ...this.data.form, files: this.data.fileList, diff --git a/subpages/myTroubleshootDemand/pages/event/event.json b/subpages/myTroubleshootDemand/pages/event/event.json index 7f8188d..3cf54e0 100644 --- a/subpages/myTroubleshootDemand/pages/event/event.json +++ b/subpages/myTroubleshootDemand/pages/event/event.json @@ -3,6 +3,10 @@ "van-cascader": "@vant/weapp/cascader/index", "van-popup": "@vant/weapp/popup/index", "van-calendar": "@vant/weapp/calendar/index", - "van-uploader": "@vant/weapp/uploader/index" - } + "van-uploader": "@vant/weapp/uploader/index", + "van-picker": "@vant/weapp/picker/index", + "wux-date-picker": "../../../../components/dist/date-picker/index" + + }, + "navigationBarTitleText": "处理" } \ No newline at end of file diff --git a/subpages/myTroubleshootDemand/pages/event/event.wxml b/subpages/myTroubleshootDemand/pages/event/event.wxml index 70ea8a1..c949792 100644 --- a/subpages/myTroubleshootDemand/pages/event/event.wxml +++ b/subpages/myTroubleshootDemand/pages/event/event.wxml @@ -57,7 +57,7 @@ 附件 - + @@ -106,8 +106,30 @@ /> - \ No newline at end of file +/> --> + + diff --git a/subpages/myTroubleshootDemand/pages/index/index.js b/subpages/myTroubleshootDemand/pages/index/index.js index c61fc82..41b9b08 100644 --- a/subpages/myTroubleshootDemand/pages/index/index.js +++ b/subpages/myTroubleshootDemand/pages/index/index.js @@ -23,6 +23,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { + console.log("onLoad.........") this.setData({ satisfactionCategory:options.category, inspRecordId:options.inspRecordId, @@ -34,19 +35,19 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady() { - + console.log("onReady.........") }, /** * 生命周期函数--监听页面显示 */ onShow() { - this.setData({ - pageNo:1, - tableData:[], - tableData1:[] - }) - this.getMyWaitTroubleshootDemandList() + // this.setData({ + // pageNo:1, + // tableData:[], + // tableData1:[] + // }) + // this.getMyWaitTroubleshootDemandList() }, /** @@ -163,7 +164,7 @@ Page({ toDetail(e){ console.log(e); wx.navigateTo({ - url: `/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck?id=${e.currentTarget.dataset.item.id}&type=${(e.currentTarget.dataset.item.type==="event" || e.currentTarget.dataset.item.type==="chengguan")?0:1}`, + url: `/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck?id=${e.currentTarget.dataset.item.id}&type=${e.currentTarget.dataset.item.type==="event"?0:e.currentTarget.dataset.item.type==="chengguan"?2:1}`, }) }, diff --git a/utils/statisticsApi.js b/utils/statisticsApi.js index eaa2586..33c749c 100644 --- a/utils/statisticsApi.js +++ b/utils/statisticsApi.js @@ -200,6 +200,9 @@ export function communitySelfOrgDetail(id) { export function agencygridtree(params) { return request.post('gov/org/customeragency/agencygridtree',params) } +export function agencyGridDepttree(params) { + return request.post('gov/org/customeragency/agencyGridDepttree',params) +} // 获取分类树 export function getCategoryTree(params) { return request.post('governance/icEvent/getCategoryTree',params)