提交代码

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:'', userProjectId:'',
appId: "wx9997d071b4996f23", appId: "wx9997d071b4996f23",
// 智慧工地后台接口访问域名 // 智慧工地后台接口访问域名
reqUrl:'https://szgcwx.jhncidg.com', //reqUrl:'https://szgcwx.jhncidg.com',
//reqUrl:'http://127.0.0.1:8091', reqUrl:'http://127.0.0.1:8091',
uploadUrl:"https://szgcwx.jhncidg.com/wechat", //uploadUrl:"https://szgcwx.jhncidg.com/wechat",
//uploadUrl:'http://127.0.0.1:8091/wechat', uploadUrl:'http://127.0.0.1:8091/wechat',
//御景路数字化集成管控平台接口访问域名 //御景路数字化集成管控平台接口访问域名
szhUrl:'https://szh.makalu.cc', szhUrl:'https://szh.makalu.cc',

View File

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

View File

@ -3,6 +3,6 @@ module.exports = {
timeout: 60000, timeout: 60000,
appId: "wx9997d071b4996f23", appId: "wx9997d071b4996f23",
baseUrl: 'https://szgcwx.jhncidg.com', baseUrl: 'https://szgcwx.jhncidg.com',
//baseUrl: 'http://127.0.0.1:8091', baseUrl: 'http://127.0.0.1:8091',
noSecuritys:['/wechat/captchaImage','/wxApi/login'] 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{ .login_logo{
width: 100%; width: 100%;
height:80rpx; height:100rpx;
margin-top: 100rpx;
text-align: center; text-align: center;
} }
.login_logo image{ .login_logo image{
height: 65rpx; height: 70rpx;
margin-top: 30rpx;
} }
.login_input .pass { .login_input .pass {

View File

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

View File

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

View File

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

View File

@ -14,11 +14,12 @@
</view> </view>
</view> </view>
<view class="max_content"> <view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info"> <view class="inspect_info">
<view class="module_title module_title_flex"> <view class="module_title module_title_flex">
<view>{{projectName}}</view> <view>{{projectName}}</view>
</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 value="{{activeName}}" bind:change="onChange">
<van-collapse-item title="申请流程" name="1"> <van-collapse-item title="申请流程" name="1">
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index"> <view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
@ -26,7 +27,7 @@
</view> </view>
</van-collapse-item> </van-collapse-item>
</van-collapse> </van-collapse>
</view> </view> -->
<view class="inspect_info_list"> <view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view> <view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
<view class="inspect_info_content"> <view class="inspect_info_content">
@ -66,8 +67,11 @@
<file-uploader-all id="myImage" bindfiles="fileUpload" limit="{{limit}}" fileUrlArray="{{filesData}}"></file-uploader-all> <file-uploader-all id="myImage" bindfiles="fileUpload" limit="{{limit}}" fileUrlArray="{{filesData}}"></file-uploader-all>
</view> </view>
</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}}"> <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>
<view class="inspect_info_list"> <view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请说明</view> <view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请说明</view>

View File

@ -70,3 +70,12 @@
color:#8ca4ec ; color:#8ca4ec ;
border-width: 0px 0; 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;
}