提交代码

main
姜玉琦 2024-03-25 01:40:33 +08:00
parent 5354f292be
commit 34ef6dd8f9
14 changed files with 757 additions and 382 deletions

View File

@ -0,0 +1,19 @@
import {request} from '../utils/request'
// 项目文件传达列表
export function fileList(data){
return request({
url: '/wechat/projectFiles/list',
method: 'get',
data: data
})
}
// 根据条件统计项目文件传达
export function findCountByType(data){
return request({
url: '/wechat/projectFiles/findCountByType',
method: 'get',
data: data
})
}

View File

@ -29,10 +29,10 @@ App({
userProjectId:'',
appId: "wx9997d071b4996f23",
// 智慧工地后台接口访问域名
reqUrl:'https://szgcwx.jhncidg.com',
//reqUrl:'http://127.0.0.1:8091',
uploadUrl:"https://szgcwx.jhncidg.com/wechat",
//uploadUrl:'http://127.0.0.1:8091/wechat',
//reqUrl:'https://szgcwx.jhncidg.com',
reqUrl:'http://127.0.0.1:8091',
//uploadUrl:"https://szgcwx.jhncidg.com/wechat",
uploadUrl:'http://127.0.0.1:8091/wechat',
//御景路数字化集成管控平台接口访问域名
szhUrl:'https://szh.makalu.cc',

View File

@ -107,7 +107,8 @@
"project_deptWorks/list/index",
"project_standard/list/index",
"project_standard/add/index",
"project_standard/info/index"
"project_standard/info/index",
"project_files/index"
],
"independent": false
}

View File

@ -3,6 +3,6 @@ module.exports = {
timeout: 60000,
appId: "wx9997d071b4996f23",
baseUrl: 'https://szgcwx.jhncidg.com',
//baseUrl: 'http://127.0.0.1:8091',
baseUrl: 'http://127.0.0.1:8091',
noSecuritys:['/wechat/captchaImage','/wxApi/login']
};

View File

@ -0,0 +1,222 @@
import {
fileList,
findCountByType,
} from '../../api/projectFiles'
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
initData: {},
listData: [],
qbCount: 0,
sjbmCount: 0,
jtgsCount: 0,
zgsCount: 0,
activeState: "1",
pageNum: 1,
pageSize: 10,
lastDataSize: 10,
list: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
},
pageNum: 1,
pageSize: 10,
lastDataSize: 10,
listData: []
})
this.getListData();
},
/**
* 查询文件列表
*/
getListData() {
//进入这里说明数据加载完毕
if (this.data.lastDataSize < this.data.pageSize) {
//app.toast("已经到底了,暂无可继续加载数据!")
return;
}
let that = this;
this.queryCount();
fileList({
fileBelong: this.data.activeState,
pageNum: this.data.pageNum,
pageSize: this.data.pageSize
}).then(res => {
//这里处理this.data.lastDataSize=this.data.pageSize
if (that.data.list.length > 0 && res.rows.length > 0 && that.data.list[0].id == res.rows[0].id) {
that.setData({
lastDataSize: 0,
})
} else {
that.setData({
pageNum: that.data.pageNum + 1,
lastDataSize: res.rows.length,
list: res.rows,
listData: that.data.listData.concat(res.rows)
})
}
});
},
/**
* 统计文件传达
*/
queryCount() {
let that = this;
findCountByType({}).then(res => {
if (res.data.length > 0) {
let sjbm = 0,
jtgs = 0,
zgs = 0;
res.data.forEach(item => {
if (item.fileBelong == "1") {
sjbm += item.total;
} else if (item.fileBelong == "2") {
jtgs += item.total;
} else {
zgs += item.total;
}
});
that.setData({
sjbmCount: sjbm,
jtgsCount: jtgs,
zgsCount: zgs
})
}
});
},
/**
* 加载新数据
*/
onScrollToLower() {
console.log("滚动条到底了,开始加载新数据");
this.getListData();
},
/**
* 下载并打开文档
* @param {*} e
*/
openFile: function (e) {
let {
filePath
} = e.currentTarget.dataset.set
wx.downloadFile({
// 示例 url并非真实存在
url: app.globalData.uploadUrl + '/common/download/resource?resource=' + filePath,
success: function (res) {
const _path = res.tempFilePath
let fpt = _path.split(".");
wx.openDocument({
filePath: _path,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
//app.toast("暂不支持下载!如需下载请前往后台管理系统!!")
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
/**
* 标签切换
*/
trainingTypeJump(e) {
let index = e.currentTarget.dataset.index;
this.setData({
activeState: index + '',
pageNum: 1,
pageSize: 10,
lastDataSize: 10,
list: [],
listData: [],
});
this.getListData();
},
/**
* 项目切换
* @param {*} e
*/
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.projectId = projectId;
app.globalData.projectName = projectName;
this.onLoad();
},
returnToPage: function () {
wx.redirectTo({
url: '../../pages/safety_manage/index',
})
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,65 @@
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">文件传达查看</view>
</van-col>
</van-row>
</view>
</view>
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
<view class="modify_video_nav" style="margin-top: 5rpx;">
<view class="{{activeState=='1'?'active':''}}" bindtap="trainingTypeJump" data-index="1"><text>上级部门({{sjbmCount}}</text></view>
<view class="{{activeState=='2'?'active':''}}" bindtap="trainingTypeJump" data-index="2"><text>集团公司({{jtgsCount}}</text></view>
<view class="{{activeState=='3'?'active':''}}" bindtap="trainingTypeJump" data-index="3"><text>子公司({{zgsCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" bindtap="openFile">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{index < 9 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title module_title_flex inspect_list_title_text" wx:if="{{item.fileBelong=='1'}}">上级部门</view>
<view class="module_title module_title_flex inspect_list_title_text" wx:if="{{item.fileBelong=='2'}}">集团公司</view>
<view class="module_title module_title_flex inspect_list_title_text" wx:if="{{item.fileBelong=='3'}}">子公司</view>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<van-image wx:if="{{item.fileType=='PDF'}}" width="120rpx" height="120rpx" fit="cover" src="https://szgcwx.jhncidg.com/staticFiles/icon/pdf.png" />
<van-image wx:if="{{item.fileType=='XLS' || item.fileType=='XLSX'}}" width="120rpx" height="120rpx" fit="cover" src="https://szgcwx.jhncidg.com/staticFiles/img/base/XLSX.png" />
<van-image wx:if="{{item.fileType=='DOC' || item.fileType=='DOCX'}}" width="120rpx" height="120rpx" fit="cover" src="https://szgcwx.jhncidg.com/staticFiles/img/base/doc.png" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">{{item.fileName}}</view>
<view class="inspect_list_info_data_prop">
<van-row>
<van-col span="18">
{{item.createTime}}
</van-col>
<van-col span="6" class="module_see_info_ear">
<van-icon name="eye-o" class="ss"></van-icon> {{item.readNum}}
</van-col>
</van-row>
</view>
</view>
</view>
</view>
</view>
</view>
<view wx:if="{{listData.length==0}}">
<view style="padding-top: 70px;text-align: -webkit-center;">
<image src="https://szgcwx.jhncidg.com/staticFiles/images/nodata.png" style="width: 130px;height: 105px;"></image>
<view style="color: #a5abbb;">暂无数据</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1,6 @@
.module_see_info_ear {
color: #00a3ff;
}
.ss{
top: 1rpx;
}

View File

@ -56,12 +56,12 @@ page{
}
.login_logo{
width: 100%;
height:80rpx;
margin-top: 100rpx;
height:100rpx;
text-align: center;
}
.login_logo image{
height: 65rpx;
height: 70rpx;
margin-top: 30rpx;
}
.login_input .pass {

View File

@ -6,92 +6,116 @@ Page({
* 页面的初始数据
*/
data: {
maxDate:new Date(2088,1,1).getTime(),
deptName:"",
userId:"",
myUserId:"",
nickName:"",
loginName:"",
projectId:"",
projectName:"",
procInsId:"",
infoData:{},
procDefName:"",
deployId:"",
activeName:"",
flowNodeList:[],
flowNodes:[],
imageList:[],
filesData:[],
taskId:"",
procInsId:"",
taskName:"",
passState:true,
backName:"",
stopShow:false,
deleteShow:false,
revocationShow:false,
finishTime:"",
ret:"",
comment:"",
stopBtnShow:false,
imageType:["png","jpg","jpeg"],
fileType:["pdf"],
maxDate: new Date(2088, 1, 1).getTime(),
deptName: "",
userId: "",
myUserId: "",
nickName: "",
loginName: "",
projectId: "",
projectName: "",
procInsId: "",
infoData: {},
procDefName: "",
deployId: "",
activeName: "",
flowNodeList: [],
flowNodes: [],
imageList: [],
filesData: [],
taskId: "",
procInsId: "",
taskName: "",
passState: true,
backName: "",
stopShow: false,
deleteShow: false,
revocationShow: false,
finishTime: "",
ret: "",
comment: "",
stopBtnShow: false,
imageType: ["png", "jpg", "jpeg"],
fileType: ["pdf"],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {deployId,procInsId,procDefName,deptName,nickName,taskId,taskName,projectName,userId,finishTime,ret} = options
let {
deployId,
procInsId,
procDefName,
deptName,
nickName,
taskId,
taskName,
projectName,
userId,
finishTime,
ret
} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
projectId:app.globalData.projectId,
projectName,
procInsId,
procDefName,
deployId,
deptName,
nickName,
taskId,
taskName,
userId,
finishTime,
ret,
myUserId:res.data.userId,
loginName:res.data.loginName,
})
this.getFlowNodes();
this.getFlowRecordList();
this.getFormDatasList();
}
})
key: 'userinfo',
success: res => {
this.setData({
projectId: app.globalData.projectId,
projectName,
procInsId,
procDefName,
deployId,
deptName,
nickName,
taskId,
taskName,
userId,
finishTime,
ret,
myUserId: res.data.userId,
loginName: res.data.loginName,
})
this.getFlowNodes();
this.getFlowRecordList();
this.getFormDatasList();
}
})
},
getFlowNode(val){
getFlowNode(val) {
let flowNodeList = this.data.flowNodeList;
for(let i=0;i<flowNodeList.length;i++){
if(flowNodeList[i].id==val){
for (let i = 0; i < flowNodeList.length; i++) {
if (flowNodeList[i].id == val) {
let list = this.data.flowNodes;
if(this.data.passState){
if(flowNodeList[i].name==this.data.taskName){
list.push({id:flowNodeList[i].id,name:flowNodeList[i].name,state:'transact'});
if (this.data.passState) {
if (flowNodeList[i].name == this.data.taskName) {
list.push({
id: flowNodeList[i].id,
name: flowNodeList[i].name,
state: 'transact'
});
this.setData({
passState:false
passState: false
})
}else{
list.push({id:flowNodeList[i].id,name:flowNodeList[i].name,state:'pass'});
} else {
list.push({
id: flowNodeList[i].id,
name: flowNodeList[i].name,
state: 'pass'
});
}
}else{
list.push({id:flowNodeList[i].id,name:flowNodeList[i].name,state:'none'});
} else {
list.push({
id: flowNodeList[i].id,
name: flowNodeList[i].name,
state: 'none'
});
}
this.setData({
flowNodes:list
flowNodes: list
})
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
if (flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length > 0) {
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
}
}
@ -99,30 +123,34 @@ Page({
},
//查询工作流节点
getFlowNodes(){
getFlowNodes() {
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
method:"get",
data:{},
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/' + that.data.deployId,
method: "get",
data: {},
header: {
"Content-Type": "application/json"
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
if (res.code == 200) {
that.setData({
flowNodeList:res.data
flowNodeList: res.data
})
if(res.data.length>0){
if (res.data.length > 0) {
let list = that.data.flowNodes;
list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
list.push({
id: res.data[0].id,
name: res.data[0].name,
state: 'pass'
});
that.setData({
flowNodes:list
flowNodes: list
})
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
}
}else{
} else {
app.toast(res.msg);
}
}
@ -130,37 +158,37 @@ Page({
},
//查询审批日志
getFlowRecordList(){
getFlowRecordList() {
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
method:"get",
data:{
procInsId:this.data.procInsId
method: "get",
data: {
procInsId: this.data.procInsId
},
header: {
"Content-Type": "application/json"
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
if (res.code == 200) {
that.setData({
flowRecordList:res.data
flowRecordList: res.data
})
let list=[];
res.data.forEach(item=>{
if(item.deleteReason){
item.deleteReason=that.getDeleteReason(item.deleteReason);
let list = [];
res.data.forEach(item => {
if (item.deleteReason) {
item.deleteReason = that.getDeleteReason(item.deleteReason);
}
if(item.duration){
item.duration=that.getDurationDate(item.duration);
if (item.duration) {
item.duration = that.getDurationDate(item.duration);
}
list.push(item);
})
that.setData({
flowRecordList:list
flowRecordList: list
})
}else{
} else {
app.toast(res.msg);
}
}
@ -168,353 +196,363 @@ Page({
},
//查询审批表单参数
getFormDatasList(){
getFormDatasList() {
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
method:"get",
data:{
procInsId:this.data.procInsId
method: "get",
data: {
procInsId: this.data.procInsId
},
header: {
"Content-Type": "application/json"
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
if (res.code == 200) {
that.setData({
infoData:res.data
infoData: res.data
})
let filesData = [];
let imageList = [];
//判断附件
if(res.data.files){
res.data.files.split(',').forEach(element => {
let ft = element.split('.');
if(that.data.imageType.indexOf(ft[ft.length-1].toLowerCase())>-1){
imageList.push({minPath:config.baseUrl+element,path:element});
}else{
let it = element.split('/');
filesData.push({name:it[it.length-1],path:element});
}
});
if (res.data.files) {
res.data.files.split(',').forEach(element => {
let ft = element.split('.');
if (that.data.imageType.indexOf(ft[ft.length - 1].toLowerCase()) > -1) {
imageList.push({
minPath: config.baseUrl + element,
path: element
});
} else {
let it = element.split('/');
filesData.push({
name: it[it.length - 1],
path: element
});
}
});
}
that.setData({
filesData,
imageList,
stopShow:!that.data.finishTime && that.data.userId==that.myUserId,
deleteShow:!that.data.finishTime && that.data.userId==that.myUserId,
revocationShow:!that.data.finishTime
stopShow: !that.data.finishTime && that.data.userId == that.myUserId,
deleteShow: !that.data.finishTime && that.data.userId == that.myUserId,
revocationShow: !that.data.finishTime
})
}else{
} else {
app.toast(res.msg);
}
}
})
},
//退回
onStop(){
if(!this.data.stopBtnShow){
app.toast("请填写终止原因!")
this.setData({
stopBtnShow:true
})
return;
}else{
if(this.data.comment==""){
//退回
onStop() {
if (!this.data.stopBtnShow) {
app.toast("请填写终止原因!")
this.setData({
stopBtnShow:true
stopBtnShow: true
})
return;
}
}
this.setData({
loadShow:true
})
let that = this
let params = {
instanceId:this.data.procInsId,
comment:this.data.comment,
userId:this.data.myUserId,
taskId:this.data.taskId
}
//弹出确认
wx.showModal({
title: '提示',
content: '是否终止当前流程申请?',
success: function (sm) {
if (sm.confirm) {
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/stopProcess',
method:"POST",
data:params,
header: {
"Username": that.data.loginName,
"Content-Type": "application/json"
},
success(res){
that.setData({
loadShow:false
})
res = res.data
if(res.code == 200){
app.toast("终止流程申请成功!")
if(that.data.ret=="finished"){
setTimeout(()=>{
wx.redirectTo({
url: '../finished/index',
})
},200)
}else{
setTimeout(()=>{
wx.redirectTo({
url: '../myProcessIns/index',
})
},200)
}
}else{
app.toast(res.msg);
}
}
})
} else if (sm.cancel) {
that.setData({
loadShow:false
})
console.log('用户点击取消');
} else {
if (this.data.comment == "") {
app.toast("请填写终止原因!")
this.setData({
stopBtnShow: true
})
return;
}
}
})
this.setData({
loadShow: true
})
let that = this
let params = {
instanceId: this.data.procInsId,
comment: this.data.comment,
userId: this.data.myUserId,
taskId: this.data.taskId
}
//弹出确认
wx.showModal({
title: '提示',
content: '是否终止当前流程申请?',
success: function (sm) {
if (sm.confirm) {
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/stopProcess',
method: "POST",
data: params,
header: {
"Username": that.data.loginName,
"Content-Type": "application/json"
},
success(res) {
that.setData({
loadShow: false
})
res = res.data
if (res.code == 200) {
app.toast("终止流程申请成功!")
if (that.data.ret == "finished") {
setTimeout(() => {
wx.redirectTo({
url: '../finished/index',
})
}, 200)
} else {
setTimeout(() => {
wx.redirectTo({
url: '../myProcessIns/index',
})
}, 200)
}
} else {
app.toast(res.msg);
}
}
})
} else if (sm.cancel) {
that.setData({
loadShow: false
})
console.log('用户点击取消');
}
}
})
},
//通过
onDelete(){
this.setData({
loadShow:true
})
let that = this
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认删除流程申请?',
success: function (sm) {
if (sm.confirm) {
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/delete/'+that.data.procInsId,
method:"delete",
data:{},
header: {
"Username": that.data.loginName,
"Content-Type": "application/json"
},
success(res){
that.setData({
loadShow:false
})
res = res.data
if(res.code == 200){
app.toast("删除流程申请成功!")
if(that.data.ret=="finished"){
setTimeout(()=>{
wx.redirectTo({
url: '../finished/index',
})
},200)
}else{
setTimeout(()=>{
wx.redirectTo({
url: '../myProcessIns/index',
})
},200)
onDelete() {
this.setData({
loadShow: true
})
let that = this
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认删除流程申请?',
success: function (sm) {
if (sm.confirm) {
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/delete/' + that.data.procInsId,
method: "delete",
data: {},
header: {
"Username": that.data.loginName,
"Content-Type": "application/json"
},
success(res) {
that.setData({
loadShow: false
})
res = res.data
if (res.code == 200) {
app.toast("删除流程申请成功!")
if (that.data.ret == "finished") {
setTimeout(() => {
wx.redirectTo({
url: '../finished/index',
})
}, 200)
} else {
setTimeout(() => {
wx.redirectTo({
url: '../myProcessIns/index',
})
}, 200)
}
} else {
app.toast(res.msg);
}
}
}else{
app.toast(res.msg);
}
})
} else if (sm.cancel) {
that.setData({
loadShow: false
})
console.log('用户点击取消');
}
})
} else if (sm.cancel) {
that.setData({
loadShow:false
})
console.log('用户点击取消');
}
}
})
})
},
//撤回
onRevocation(){
onRevocation() {
this.setData({
loadShow:true
loadShow: true
})
let that = this
let params = {
procInsId: this.data.procInsId,
instanceId: this.data.procInsId,
taskId:this.data.taskId,
userId:this.data.myUserId,
assignee:this.data.nickName
taskId: this.data.taskId,
userId: this.data.myUserId,
assignee: this.data.nickName
}
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认撤回当前任务流程?',
success: function (sm) {
if (sm.confirm) {
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/revokeProcess',
method:"POST",
data:params,
header: {
"Username": that.data.loginName,
"Content-Type": "application/json"
},
success(res){
that.setData({
loadShow:false
})
res =res.data
if(res.code == 200){
app.toast("撤回流程申请成功!")
if(that.data.ret=="finished"){
setTimeout(()=>{
wx.redirectTo({
url: '../finished/index',
})
},200)
}else{
setTimeout(()=>{
wx.redirectTo({
url: '../myProcessIns/index',
})
},200)
if (sm.confirm) {
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/revokeProcess',
method: "POST",
data: params,
header: {
"Username": that.data.loginName,
"Content-Type": "application/json"
},
success(res) {
that.setData({
loadShow: false
})
res = res.data
if (res.code == 200) {
app.toast("撤回流程申请成功!")
if (that.data.ret == "finished") {
setTimeout(() => {
wx.redirectTo({
url: '../finished/index',
})
}, 200)
} else {
setTimeout(() => {
wx.redirectTo({
url: '../myProcessIns/index',
})
}, 200)
}
} else {
app.toast(res.msg);
}
}else{
app.toast(res.msg);
}
}
})
})
} else if (sm.cancel) {
that.setData({
loadShow:false
})
console.log('用户点击取消');
loadShow: false
})
console.log('用户点击取消');
}
}
})
},
},
// 手风琴
onChange(event) {
this.setData({
activeName: event.detail,
});
},
// 手风琴
onChange(event) {
this.setData({
activeName: event.detail,
});
},
getDeleteReason(val){
val = val.replace("Change activity to ","");
let flowRecordList = this.data.flowRecordList;
for(let i=0;i<flowRecordList.length;i++){
if(flowRecordList[i].taskDefKey==val){
return "驳回至"+flowRecordList[i].taskName;
}
}
},
getDeleteReason(val) {
val = val.replace("Change activity to ", "");
let flowRecordList = this.data.flowRecordList;
for (let i = 0; i < flowRecordList.length; i++) {
if (flowRecordList[i].taskDefKey == val) {
return "驳回至" + flowRecordList[i].taskName;
}
}
},
getDurationDate(val){
// 计算出相差天数
let days = Math.floor(val / (24 * 3600 * 1000))
// 计算出小时数
let leave1 = val % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数
let hours = Math.floor(leave1 / (3600 * 1000))
// 计算相差分钟数
let leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数
let minutes = Math.floor(leave2 / (60 * 1000))
// 计算相差秒数
let leave3 = leave2 % (60 * 1000) // 计算分钟数后剩余的毫秒数
let seconds = Math.round(leave3 / 1000)
if(days>0){
if(days<10) days = "0"+days;
if(hours<10) hours = "0"+hours;
if(minutes<10) minutes = "0"+minutes;
if(seconds<10) seconds = "0"+seconds;
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒';
}
if(hours>0){
if(hours<10) hours = "0"+hours;
if(minutes<10) minutes = "0"+minutes;
if(seconds<10) seconds = "0"+seconds;
return hours + '小时' + minutes + '分钟' + seconds + '秒';
}
if(minutes>0){
if(minutes<10) minutes = "0"+minutes;
if(seconds<10) seconds = "0"+seconds;
return minutes + '分钟' + seconds + '秒';
}
if(seconds>0){
if(seconds<10) seconds = "0"+seconds;
return seconds + '秒';
}
},
getDurationDate(val) {
// 计算出相差天数
let days = Math.floor(val / (24 * 3600 * 1000))
// 计算出小时数
let leave1 = val % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数
let hours = Math.floor(leave1 / (3600 * 1000))
// 计算相差分钟数
let leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数
let minutes = Math.floor(leave2 / (60 * 1000))
// 计算相差秒数
let leave3 = leave2 % (60 * 1000) // 计算分钟数后剩余的毫秒数
let seconds = Math.round(leave3 / 1000)
if (days > 0) {
if (days < 10) days = "0" + days;
if (hours < 10) hours = "0" + hours;
if (minutes < 10) minutes = "0" + minutes;
if (seconds < 10) seconds = "0" + seconds;
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒';
}
if (hours > 0) {
if (hours < 10) hours = "0" + hours;
if (minutes < 10) minutes = "0" + minutes;
if (seconds < 10) seconds = "0" + seconds;
return hours + '小时' + minutes + '分钟' + seconds + '秒';
}
if (minutes > 0) {
if (minutes < 10) minutes = "0" + minutes;
if (seconds < 10) seconds = "0" + seconds;
return minutes + '分钟' + seconds + '秒';
}
if (seconds > 0) {
if (seconds < 10) seconds = "0" + seconds;
return seconds + '秒';
}
},
//选择退回节点
onSelectTargetKey(e){
onSelectTargetKey(e) {
this.setData({
targetKey:e.detail.id,
backName:e.detail.name
targetKey: e.detail.id,
backName: e.detail.name
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if(this.data.ret=="finished"){
if (this.data.ret == "finished") {
wx.redirectTo({
url: '../finished/index',
})
}else{
} else {
wx.redirectTo({
url: '../myProcessIns/index',
})
}
},
//展示图片详细
showImg:function(e){
let {path} = e.currentTarget.dataset.set
wx.previewImage({
urls: this.data.imageList,
current: path
})
},
//展示图片详细
showImg: function (e) {
let {
path
} = e.currentTarget.dataset.set
wx.previewImage({
urls: this.data.imageList,
current: path
})
},
/**
* 下载并打开文档
* @param {*} e
*/
downFile:function(e){
let {path} = e.currentTarget.dataset.set
/**
* 下载并打开文档
* @param {*} e
*/
downFile: function (e) {
let {
path
} = e.currentTarget.dataset.set
wx.downloadFile({
// 示例 url并非真实存在
url: app.globalData.uploadUrl+'/common/download/resource?resource='+path,
success: function (res) {
const filePath = res.tempFilePath
let fpt = filePath.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length-1],
success: function (res) {
console.log('打开文档成功')
},
fail:function(res) {
console.log(res)
}
})
}
})
//app.toast("暂不支持下载!如需下载请前往后台管理系统!!")
},
// 示例 url并非真实存在
url: app.globalData.uploadUrl + '/common/download/resource?resource=' + path,
success: function (res) {
const filePath = res.tempFilePath
let fpt = filePath.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
//app.toast("暂不支持下载!如需下载请前往后台管理系统!!")
},
//终止原因
commentblur: function (options) {

View File

@ -25,7 +25,8 @@ Page({
flowNodeList: [],
flowNodes: [],
isFiles: false,
imageInfoData:[],
imageInfoData: [],
active: "",
},
/**
@ -73,7 +74,8 @@ Page({
let list = this.data.flowNodes;
list.push({
id: flowNodeList[i].id,
name: flowNodeList[i].name
name: flowNodeList[i].name,
text: flowNodeList[i].name.length > 4 ? flowNodeList[i].name.substring(0, 4) : flowNodeList[i].name
});
this.setData({
flowNodes: list
@ -105,7 +107,8 @@ Page({
let list = that.data.flowNodes;
list.push({
id: res.data[0].id,
name: res.data[0].name
name: res.data[0].name,
text: res.data[0].name
});
that.setData({
flowNodes: list
@ -199,7 +202,7 @@ Page({
imageInfoData
} = that.data;
let fileUrls = [];
filesData.forEach( f =>{
filesData.forEach(f => {
imageInfoData.push(f.path);
});
imageInfoData.forEach(async (item) => {
@ -327,13 +330,13 @@ Page({
this.setData({
isFiles: !this.data.isFiles,
});
if(this.data.isFiles){
if(this.data.filesData.length==0){
if (this.data.isFiles) {
if (this.data.filesData.length == 0) {
let myImages = this.selectComponent("#myImage");
myImages.upload();
}
}else{
if(this.data.imageInfoData.length==0){
} else {
if (this.data.imageInfoData.length == 0) {
let myFiles = this.selectComponent("#myFiles");
myFiles.upload();
}

View File

@ -2,6 +2,7 @@
"usingComponents": {
"van-overlay": "@vant/weapp/overlay/index",
"van-collapse": "@vant/weapp/collapse",
"van-steps": "@vant/weapp/steps/index",
"van-collapse-item": "@vant/weapp/collapse-item"
},
"navigationStyle":"custom"

View File

@ -14,11 +14,12 @@
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="module_title module_title_flex">
<view>{{projectName}}</view>
</view>
<view class="gk_open" style="margin-top: 20rpx;border: 1px solid transparent;">
<!-- <view class="gk_open" style="margin-top: 20rpx;border: 1px solid transparent;">
<van-collapse value="{{activeName}}" bind:change="onChange">
<van-collapse-item title="申请流程" name="1">
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
@ -26,7 +27,7 @@
</view>
</van-collapse-item>
</van-collapse>
</view>
</view> -->
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
<view class="inspect_info_content">
@ -66,8 +67,11 @@
<file-uploader-all id="myImage" bindfiles="fileUpload" limit="{{limit}}" fileUrlArray="{{filesData}}"></file-uploader-all>
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{imageInfoData.length==0 || filesData.length==0}}">
<text class="color_orange">新版本默认上传图片PDF文件从上方右侧切换上传。</text>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{imageInfoData.length>0 && filesData.length>0}}">
<text class="color_orange">已同时选择PDF文件和图片将上传已选择的文件和图片。</text>
<text class="color_blue">已同时选择PDF文件和图片将上传已选择的文件和图片。</text>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请说明</view>

View File

@ -69,4 +69,13 @@
background-color: #1e2336;
color:#8ca4ec ;
border-width: 0px 0;
}
.van-steps{
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container{
background-color: transparent !important;
}
.van-steps--horizontal{
padding: 10px 20px !important;
}