Browse Source

处理小程序上事件管理的相关改动

taidong
duanliangtao 1 year ago
parent
commit
3d3b8d6b94
  1. 2
      pages/work2/work2.wxml
  2. 4
      pages/work2/work2.wxss
  3. 71
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js
  4. 74
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml
  5. 80
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss
  6. 111
      subpages/myTroubleshootDemand/pages/event/event.js
  7. 8
      subpages/myTroubleshootDemand/pages/event/event.json
  8. 28
      subpages/myTroubleshootDemand/pages/event/event.wxml
  9. 17
      subpages/myTroubleshootDemand/pages/index/index.js
  10. 3
      utils/statisticsApi.js

2
pages/work2/work2.wxml

@ -43,7 +43,7 @@
<view class="text-wrapper_7-0">
<text lines="1" class="text_2-0">为民服务</text>
</view>
<view class="house">
<view class="content_1">
<view>
<image src="/images/work2/reporting.png" class="image_12-2" bind:tap="onDemandCheck"></image>
<text lines="1" class="text_3-0">诉求上报</text>

4
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);

71
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}`,
})
},
})

74
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml

@ -28,7 +28,7 @@
</radio-group>
</view>
<view wx:else>
{{tabVal ==0?'事件上报':'居民需求'}}
{{tabVal ==0?'事件上报':tabVal ==1?'居民需求':'城管事件'}}
</view>
</view>
<view class="item" wx:if="{{tabVal === '1'}}">
@ -159,10 +159,10 @@
<view class="item" wx:if="{{tabVal === '2' || fmData.demandType==='chengguan'}}">
<view class="field">
<text class="must">*</text>
<view class="field-text">有无责任单位</view>
<view class="field-text-small">有无责任单位</view>
</view>
<view hover-class="backC" class="value-dl" >
<radio-group class="radio-group" bind:change="handleChangeResponsibleUnit">
<radio-group class="radio-group-small" bind:change="handleChangeResponsibleUnit">
<radio checked="{{ruTabVal === 'yes'}}" value="yes" checked="true" color="#4193fe" class="radio">有</radio>
<radio checked="{{ruTabVal === 'no'}}" value="no" color="#4193fe" class="radio" >无</radio>
</radio-group>
@ -191,6 +191,74 @@
</view>
</view>
</view>
<view class="card" wx:if="{{tabVal === '0' || tabVal === '2'}}">
<view class="title" style="margin-bottom: 0;">处理进展</view>
<wux-steps wx:if="{{processData.length > 0}}" style="margin-top: 50rpx" direction="vertical" :current="0">
<wux-step wx:for="{{processData}}" wx:key="index" icon="none">
<view slot="title">
<view class="step-title" wx:if="{{item.agencyId}}">【指派】</view>
<view class="step-title" wx:if="{{!item.timeLimit}}">【完成并回复】</view>
<view class="step-title" wx:if="{{!item.agencyId && item.timeLimit}}">【{{ item.processName }}】
</view>
</view>
<view slot="content">
<view class="step-time">{{item.formattedTime}}</view>
<view wx:if="{{item.type === 'event'}}">
<view wx:if="{{item.agencyId}}">
<view class="card_content">
<view class="label">指派人:</view>
<view class="value">
{{ item.departmentName }}
</view>
</view>
<view class="card_content">
<view class="label">指派部门:</view>
<view class="value">
{{ item.agencyName }}
</view>
</view>
<view class="card_content">
<view class="label">转办意见:</view>
<view class="value">
{{ item.publicReply }}
</view>
</view>
<view class="card_content">
<view class="label">办结时限:</view>
<view class="value">
{{ item.timeLimit }}
</view>
</view>
</view>
<view wx:else>
<view class="card_content">
<view class="label">回复人:</view>
<view class="value">
{{ item.departmentName }}
</view>
</view>
<view class="card_content">
<view class="label">回复内容:</view>
<view class="value">
{{ item.publicReply }}
</view>
</view>
<view class="card_content" wx:if="{{item.timeLimit}}">
<view class="label">办结时限:</view>
<view class="value">
{{ item.timeLimit }}
</view>
</view>
</view>
</view>
</view>
</wux-step>
</wux-steps>
</view>
<view class="submit-button" wx:if="{{!optionsId}}">
<button disabled="{{ submitDisabled }}" bindtap="submitPersonalInfo" hover-class="hover-submit" >提交</button>
</view>

80
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;
@ -1021,3 +1045,59 @@ 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;
}

111
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,

8
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": "处理"
}

28
subpages/myTroubleshootDemand/pages/event/event.wxml

@ -57,7 +57,7 @@
<view class="field-text">附件</view>
</view>
<view>
<van-uploader file-list="{{ fileList }}" bind:delete="deleteFile" max-count="4" bind:after-read="afterRead" />
<van-uploader file-list="{{ fileList }}" accept="image/*, .pdf, .doc, .docx" bind:delete="deleteFile" max-count="4" bind:after-read="afterRead" />
</view>
</view>
@ -106,8 +106,30 @@
/>
</van-popup>
<van-calendar
<!-- <van-calendar
show="{{ showDate }}"
bind:close="onCloseDate"
bind:confirm="onConfirmDate"
/>
/> -->
<!-- <van-popup show="{{ showDate }}" close-icon="close" position="bottom" custom-style="height: 50%" bind:close="closePopup" round>
<van-datetime-picker
type="datetime"
value="{{ currentDate }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
bind:input="onInput"
bind:confirm="onConfirmDate"
bind:cancel="onCloseDate"
/>
</van-popup> -->
<wux-date-picker
visible="{{ showDate }}"
controlled
mode="datetime"
value="{{ form.timeLimit }}"
lang="zh_CN"
minDate="{{minDate}}"
maxDate="{{maxDate}}"
bind:confirm="onConfirmDate"
bind:cancel="onCloseDate"
/>

17
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}`,
})
},

3
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)

Loading…
Cancel
Save