Browse Source

事件管理的0815日禅道内容的改动

taidong
duanliangtao 1 year ago
parent
commit
3545925632
  1. 61
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js
  2. 41
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml
  3. 31
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss
  4. 59
      subpages/myTroubleshootDemand/pages/event/event.js
  5. 2
      subpages/myTroubleshootDemand/pages/event/event.wxml
  6. 4
      subpages/myTroubleshootDemand/pages/index/index.wxml
  7. 4
      subpages/myTroubleshootDemand/pages/index/index.wxss

61
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

@ -676,7 +676,7 @@ formatTimestamp(timestamp) {
'fmData.responsibleUnit': 'yes'
})
}else{
his.setData({
this.setData({
'fmData.responsibleUnit': 'no'
})
}
@ -752,7 +752,9 @@ formatTimestamp(timestamp) {
})
})
setTimeout(function () {
wx.hideLoading()
wx.navigateBack({
delta: 1
})
}, 1000)
},
// 个性服务提交
@ -1222,6 +1224,13 @@ formatTimestamp(timestamp) {
resiMobile: resiDetail.resiMobile
})
}
console.log("on Show:"+this.data.optionsId)
if(this.data.optionsId){
icEventOldProcess({icEventId: this.data.optionsId}).then(res => {
this.getProcess(res.data);
})
}
},
/**
@ -1731,4 +1740,52 @@ formatTimestamp(timestamp) {
url: `/subpages/myTroubleshootDemand/pages/event/event?id=${this.data.optionsId}&categoryIds=${this.data.categoryIds}`,
})
},
previewImage(e) {
const currentUrl = e.currentTarget.dataset.url;
const urls = this.data.item.internalFile
.filter(file => file.attachmentType === 'image')
.map(file => file.attachmentUrl);
wx.previewImage({
current: currentUrl, // 当前显示图片的http链接
urls: urls // 需要预览的图片http链接列表
});
},
downloadFile: function (event) {
const url = event.currentTarget.dataset.url;
wx.downloadFile({
url: url,
success: function (res) {
if (res.statusCode === 200) {
wx.saveFile({
tempFilePath: res.tempFilePath,
success: function (res) {
wx.showToast({
title: '下载成功',
icon: 'success'
});
},
fail: function () {
wx.showToast({
title: '保存失败',
icon: 'none'
});
}
});
} else {
wx.showToast({
title: '下载失败',
icon: 'none'
});
}
},
fail: function () {
wx.showToast({
title: '下载失败',
icon: 'none'
});
}
});
},
})

41
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml

@ -227,7 +227,24 @@
<view class="card_content">
<view class="label1">办结时限:</view>
<view class="value1">
{{ item.timeLimit }}
{{ item.limitTime }}
</view>
</view>
<view class="card_content" wx:if="{{item.internalFile.length > 0}}">
<view class="label1">附件:</view>
<view class="value1">
<block wx:for="{{item.internalFile}}" wx:key="*this">
<view wx:if="{{item.attachmentType === 'image'}}">
<view class="image-row">
<image src="{{item.attachmentUrl}}" mode="aspectFill" bindtap="previewImage" data-url="{{item.attachmentUrl}}" />
</view>
</view>
<!-- <view wx:else>
<navigator url="{{item.attachmentUrl}}" open-type="navigateTo" class="download-link">
下载附件
</navigator>
</view> -->
</block>
</view>
</view>
</view>
@ -247,7 +264,25 @@
<view class="card_content" wx:if="{{item.timeLimit}}">
<view class="label1">办结时限:</view>
<view class="value1">
{{ item.timeLimit }}
{{ item.limitTime }}
</view>
</view>
<view class="card_content" wx:if="{{item.internalFile.length > 0}}">
<view class="label1">附件:</view>
<view class="value1">
<block wx:for="{{item.internalFile}}" wx:key="*this">
<view wx:if="{{item.attachmentType === 'image'}}">
<view class="image-row">
<image src="{{item.attachmentUrl}}" mode="aspectFill" bindtap="previewImage" data-url="{{item.attachmentUrl}}" />
</view>
</view>
<view wx:else>
<navigator url="{{item.attachmentUrl}}" data-url="{{item.attachmentUrl}}" bindtap="downloadFile" open-type="navigateTo" class="download-link">
下载附件
</navigator>
</view>
</block>
</view>
</view>
</view>
@ -265,7 +300,7 @@
<view class="bto_btn" wx:else>
<button hover-class="btn-hover" bind:tap="update" class="btn_blue" >修改</button>
<button bind:tap="delete" class="btn_yellow">删除</button>
<button bind:tap="process" class="btn_red">处理</button>
<button bind:tap="process" class="btn_red" wx:if="{{tabVal === '0' || tabVal === '2'}}">处理</button>
</view>
</view>
</block>

31
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss

@ -1016,9 +1016,19 @@ background: rgb(175, 1, 1);
}
.bto_btn{
display: flex;
/* display: flex;
margin-top: 20rpx;
padding: 0 20rpx 30rpx;
padding: 0 20rpx 30rpx; */
display: flex;
justify-content: space-between;
padding: 10rpx 20rpx;
position: fixed;
bottom: 50rpx; /* 调整为20rpx,距离底部20rpx */
left: 0;
width: 100%;
background-color: #ffffff;
box-shadow: 0 -5rpx 10rpx rgba(0, 0, 0, 0.1);
z-index: 1000;
}
.btn_blue ,
.btn_yellow,
@ -1110,4 +1120,21 @@ background: rgb(175, 1, 1);
flex-direction: row;
align-items: center; /* 垂直居中对齐 */
margin-top: 35rpx;
}
.download-link {
color: #007aff; /* 下载链接颜色 */
}
.image-row {
display: flex;
justify-content: space-between;
align-items: center; /* 保证图片垂直居中 */
}
.image-row image {
flex: 1;
margin: 0 5px; /* 控制图片之间的间距 */
max-width: 100%; /* 防止图片过大 */
max-height: 150px; /* 设置图片最大高度 */
object-fit: cover; /* 保持图片比例 */
}

59
subpages/myTroubleshootDemand/pages/event/event.js

@ -254,7 +254,7 @@ Page({
this.setData({
"form.deptId": params.agencyId,
"form.deptName": params.agencyName,
"form.orgType": params.level
"form.level": params.level
})
this.setData({orgName: data.selectedOptions.map(item => item.agencyName).join('/')})
},
@ -265,33 +265,44 @@ Page({
this.setData({
"form.deptId": params.agencyId,
"form.deptName": params.agencyName,
"form.orgType": params.level,
"form.level": params.level,
visible2: false
})
this.setData({orgName: data.selectedOptions.map(item => item.agencyName).join('/')})
},
afterRead(event) {
const {file} = event.detail;
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
wx.uploadFile({
url: `${config.BASEURL()}oss/file/uploadvariedfile`,
name: 'file',
header: {
'Content-type': 'application/json;charset=UTF-8',
'Authorization': wx.getStorageSync('token')
},
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, attachmentUrl: data.data.url,attachmentName:file.name,attachmentFormat:file.type,attachmentType:file.type});
console.log(fileList)
this.setData({fileList});
},
const { file } = event.detail;
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
const files = Array.isArray(file) ? file : [file];
files.forEach(fileItem => {
wx.uploadFile({
url: `${config.BASEURL()}oss/file/uploadvariedfile`,
name: 'file',
header: {
'Content-type': 'application/json;charset=UTF-8',
'Authorization': wx.getStorageSync('token')
},
filePath: fileItem.url,
success: (res) => {
let data = JSON.parse(res.data);
console.log("data:" + JSON.stringify(fileItem));
const fileList = this.data.fileList;
fileList.push({
...fileItem,
attachmentUrl: data.data.url,
attachmentName: fileItem.url.split('/').pop(),
attachmentFormat: fileItem.type,
attachmentType: fileItem.type
});
console.log(fileList);
this.setData({ fileList });
},
});
});
},
deleteFile(e) {
console.log(e)
@ -392,6 +403,14 @@ Page({
close() {
this.triggerEvent('close')
setTimeout(() => {
//返回上一级,关闭当前页面
wx.navigateBack({
delta: 1
})
}, 1000); // 1000毫秒 = 1秒
},
// 代码简化,弹窗统一封装

2
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 }}" bind:delete="deleteFile" max-count="4" bind:after-read="afterRead" multiple/>
</view>
</view>

4
subpages/myTroubleshootDemand/pages/index/index.wxml

@ -32,13 +32,13 @@
<text class="{{item.type == 'event'?'blue_small':item.type == 'chengguan'?'green_small':'red_small'}}">{{item.type == 'event'?'事件':item.type == 'chengguan'?'城管':'需求'}}</text>
{{item.name}} {{item.mobile}}
</view>
<text class="gray_small">{{item.status == 'processing'?'处理中':'已完成'}}</text>
</view>
<view style="margin-top: 10rpx;">
<text class="card_content" maxLines="{{2}}" overflow="ellipsis">{{item.content}}</text>
</view>
<view class="bottom">
<view style="color: #C1C1C1;font-size: 26rpx;">{{item.time}}</view>
<view style="color: #c1c1c1;font-size: 26rpx;">{{item.time}}</view>
<view style="color: {{item.status == 'processing'?'#e07f2f':'#C1C1C1'}};font-size: 28rpx;">{{item.status == 'processing'?'处理中':'已完成'}}</view>
</view>
</view>
<load-more loadVisible="{{loadMoreVisible}}" loadType="{{loadMoreType}}" ></load-more>

4
subpages/myTroubleshootDemand/pages/index/index.wxss

@ -21,7 +21,9 @@ page {
background-color: #4f94ff;
}
.blue_small,
.red_small{
.red_small,
.green_small,
.gray_small{
font-size: 26rpx;
width: fit-content;
padding: 8rpx 16rpx;

Loading…
Cancel
Save