提交代码
parent
20ea41c983
commit
3f0641164d
|
|
@ -1,187 +0,0 @@
|
||||||
// pages/components/curve-echarts/index.js
|
|
||||||
import * as echarts from '../../../ec-canvas/echarts'
|
|
||||||
Component({
|
|
||||||
/**
|
|
||||||
* 组件的属性列表
|
|
||||||
*/
|
|
||||||
properties: {
|
|
||||||
chartId:{
|
|
||||||
type: String
|
|
||||||
},
|
|
||||||
chartData:{
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
height:{
|
|
||||||
type:String
|
|
||||||
}
|
|
||||||
},
|
|
||||||
observers: {
|
|
||||||
chartData: function (val) {
|
|
||||||
this.initChart()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
ec: {
|
|
||||||
lazyLoad: true
|
|
||||||
},
|
|
||||||
chart:undefined,
|
|
||||||
},
|
|
||||||
lifetimes: {
|
|
||||||
created: function(){
|
|
||||||
//在组件实例刚刚被创建时执行,注意此时不能调用 setData
|
|
||||||
},
|
|
||||||
attached: function () {
|
|
||||||
//在组件实例进入页面节点树时执行
|
|
||||||
|
|
||||||
},
|
|
||||||
ready: function () {
|
|
||||||
// 在组件在视图层布局完成后执行
|
|
||||||
|
|
||||||
this.initChart();
|
|
||||||
},
|
|
||||||
detached: function () {
|
|
||||||
// 在组件实例被从页面节点树移除时执行
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的方法列表
|
|
||||||
*/
|
|
||||||
methods: {
|
|
||||||
initChart(){
|
|
||||||
var id ='#' + this.data.chartId;
|
|
||||||
this.component = this.selectComponent(id);
|
|
||||||
this.component.init((canvas, width, height, dpr) => {
|
|
||||||
let chart = echarts.init(canvas, null, {
|
|
||||||
width: width,
|
|
||||||
height: height,
|
|
||||||
devicePixelRatio: dpr
|
|
||||||
})
|
|
||||||
chart.setOption(this.getData());
|
|
||||||
return chart;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getData() {
|
|
||||||
let that=this
|
|
||||||
var data = this.data.chartData
|
|
||||||
var legend={}
|
|
||||||
var xAxis={}
|
|
||||||
var series=[]
|
|
||||||
if(data.lineData != undefined) {
|
|
||||||
for(let i=0;i<data.lineData.length;i++) {
|
|
||||||
series.push({
|
|
||||||
name: data.legend[i] ,
|
|
||||||
type: 'line',
|
|
||||||
smooth: true ,// 将折线图变为波浪线图展示
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 5,
|
|
||||||
showSymbol: false,
|
|
||||||
lineStyle: {
|
|
||||||
normal: {
|
|
||||||
width: 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
color: data.color[i],
|
|
||||||
borderWidth: 5,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data: data.lineData[i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var unit = ''
|
|
||||||
if(data.unit){
|
|
||||||
unit = '单位:'+data.unit
|
|
||||||
}
|
|
||||||
var option = {
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: {
|
|
||||||
lineStyle: {
|
|
||||||
color: "#ccc",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
// type: 'plain', // 设置为plain
|
|
||||||
icon:'rect',
|
|
||||||
itemWidth: 10,
|
|
||||||
itemHeight: 10,
|
|
||||||
itemGap: 6,
|
|
||||||
data: data.legend,
|
|
||||||
top: -5,
|
|
||||||
textStyle: {
|
|
||||||
fontSize: 10,
|
|
||||||
color: "#6d82bd",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
// top: '10%', // 可以设置为百分比或像素值
|
|
||||||
bottom: '40%',
|
|
||||||
left: '18%',
|
|
||||||
// right: '10%'
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: data.date,
|
|
||||||
axisTick: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
axisLine: {
|
|
||||||
//坐标轴轴线相关设置。数学上的x轴
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
color: "#23283e",
|
|
||||||
type: "dashed",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
color: '#6d82bd',
|
|
||||||
rotate: 60, // 旋转角度
|
|
||||||
margin: 5 // 偏移量
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
name: unit, // 设置y轴的单位
|
|
||||||
type: "value",
|
|
||||||
axisLine: {
|
|
||||||
//坐标轴轴线相关设置。数学上的x轴
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
color: "#23283e",
|
|
||||||
type: "dashed",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisTick: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
color: '#008ffd', // y轴文字颜色为蓝色
|
|
||||||
},
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 10, // 设置单位文字的大小
|
|
||||||
fontWeight: 'bold', // 设置单位文字的粗细
|
|
||||||
color:'#fff'
|
|
||||||
},
|
|
||||||
splitLine: {
|
|
||||||
show: true,
|
|
||||||
lineStyle: {
|
|
||||||
color: "#3d414e",
|
|
||||||
type: "solid",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
series,
|
|
||||||
};
|
|
||||||
return option;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<!--pages/components/curve-echarts/index.wxml-->
|
|
||||||
<!-- curve-echarts数据图 -->
|
|
||||||
<view style="width: 100%;height: 600rpx;">
|
|
||||||
<ec-canvas id="{{ chartId }}" ec="{{ ec }} " ></ec-canvas>
|
|
||||||
</view>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
/* pages/components/curve-echarts/index.wxss */
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.in-delete{
|
.in-delete{
|
||||||
position: absolute;
|
float: right;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
background: rgba(0,0,0,0.7);
|
background: rgba(0,0,0,0.7);
|
||||||
|
|
@ -65,8 +65,8 @@
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 50rpx;
|
line-height: 50rpx;
|
||||||
right: -15rpx;
|
margin-right: -15rpx;
|
||||||
top: -20rpx;
|
margin-top: 0rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -115,6 +115,11 @@
|
||||||
background: #ff0000;
|
background: #ff0000;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
.files{
|
||||||
|
word-break: break-all;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,34 +35,18 @@
|
||||||
</view>
|
</view>
|
||||||
</van-col>
|
</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
<!--<view class="left_manage_max">
|
|
||||||
<view class="left_manage_min">
|
|
||||||
<view class="left_manage">
|
|
||||||
<image src="/images/set.png" class="left_icon"></image>
|
|
||||||
<text class="left_pro">账号管理</text>
|
|
||||||
<image src="/images/right.png" class="left_flaot"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="left_manage_min">
|
|
||||||
<view class="left_manage">
|
|
||||||
<image src="/images/set.png" class="left_icon"></image>
|
|
||||||
<text class="left_pro">账号管理</text>
|
|
||||||
<image src="/images/right.png" class="left_flaot"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>-->
|
|
||||||
<view class="left_manage_min">
|
<view class="left_manage_min">
|
||||||
<view class="left_manage" bindtap="XGMM">
|
<view class="left_manage" bindtap="XGMM">
|
||||||
<view class="left_password">
|
<image src="/images/set.png" class="left_icon"></image>
|
||||||
修改密码
|
<text class="left_password">修改密码</text>
|
||||||
</view>
|
<image src="/images/right.png" class="left_flaot"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="left_manage_min">
|
<view class="left_manage_min">
|
||||||
<view class="left_manage" bindtap="TCDL">
|
<view class="left_manage" bindtap="TCDL">
|
||||||
<view class="left_sign">
|
<image src="/images/set.png" class="left_icon"></image>
|
||||||
退出登录
|
<text class="left_sign">退出登录</text>
|
||||||
</view>
|
<image src="/images/right.png" class="left_flaot"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,556 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
procInsId:"",
|
||||||
|
infoData:{},
|
||||||
|
procDefName:"",
|
||||||
|
deployId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[],
|
||||||
|
comment:"",
|
||||||
|
taskId:"",
|
||||||
|
procInsId:"",
|
||||||
|
backShow:false,
|
||||||
|
targetKey:"",
|
||||||
|
targetKeyList:[],
|
||||||
|
taskName:"",
|
||||||
|
passState:true,
|
||||||
|
backName:"",
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let {deployId,procInsId,procDefName,deptName,nickName,taskId,taskName,projectName} = options
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
projectName,
|
||||||
|
procInsId,
|
||||||
|
procDefName,
|
||||||
|
deployId,
|
||||||
|
deptName,
|
||||||
|
nickName,
|
||||||
|
taskId,
|
||||||
|
taskName,
|
||||||
|
userId:res.data.userId,
|
||||||
|
loginName:res.data.loginName,
|
||||||
|
})
|
||||||
|
this.initTargetKeyList();
|
||||||
|
this.getFlowNodes();
|
||||||
|
this.getFlowRecordList();
|
||||||
|
this.getFormDatasList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
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'});
|
||||||
|
this.setData({
|
||||||
|
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:'none'});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批日志
|
||||||
|
getFlowRecordList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:res.data
|
||||||
|
})
|
||||||
|
let list=[];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
if(item.deleteReason){
|
||||||
|
item.deleteReason=that.getDeleteReason(item.deleteReason);
|
||||||
|
}
|
||||||
|
if(item.duration){
|
||||||
|
item.duration=that.getDurationDate(item.duration);
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批表单参数
|
||||||
|
getFormDatasList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
infoData:res.data
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//初始化退回节点
|
||||||
|
initTargetKeyList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/returnList',
|
||||||
|
method:"post",
|
||||||
|
data:{
|
||||||
|
taskId:that.data.taskId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
let list = [{id:'',text:''}];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
list.push({id:item.id,text:item.name})
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
targetKeyList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//退回
|
||||||
|
onBack(){
|
||||||
|
if(!this.data.backShow){
|
||||||
|
this.setData({
|
||||||
|
backShow:true
|
||||||
|
})
|
||||||
|
app.toast("请选择退回节点!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,userId,loginName,comment,targetKey} = that.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||taskId==""||userId==""||procInsId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(comment==""){
|
||||||
|
app.toast("请填写审批意见!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(targetKey==""){
|
||||||
|
app.toast("请选择退回节点!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
targetKey,
|
||||||
|
comment,
|
||||||
|
userId
|
||||||
|
}
|
||||||
|
//弹出确认
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认审批退回至'+that.data.backName+'?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/return',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("退回申请成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//通过
|
||||||
|
onPass(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,userId,loginName,comment} = that.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||taskId==""||userId==""||procInsId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(comment==""){
|
||||||
|
app.toast("请填写审批意见!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
instanceId:procInsId,
|
||||||
|
comment,
|
||||||
|
userId
|
||||||
|
}
|
||||||
|
//弹出确认
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认审批通过?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/complete',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("审批通过成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//通过
|
||||||
|
onReject(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,userId,loginName,comment} = that.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||taskId==""||userId==""||procInsId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(comment==""){
|
||||||
|
app.toast("请填写审批意见!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
instanceId:procInsId,
|
||||||
|
comment,
|
||||||
|
userId
|
||||||
|
}
|
||||||
|
//弹出确认
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认审批驳回?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/reject',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("驳回申请成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//申请说明
|
||||||
|
commentInput: function (options) {
|
||||||
|
this.data.comment = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
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){
|
||||||
|
this.setData({
|
||||||
|
targetKey:e.detail.id,
|
||||||
|
backName:e.detail.text
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,167 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number {{item.state}}">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
<van-collapse-item title="审批日志" name="2">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{flowRecordList}}" wx:key="index">
|
||||||
|
<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">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
|
||||||
|
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
|
||||||
|
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
|
||||||
|
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info gk_open_con">
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text></view>
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text></view>
|
||||||
|
<view wx:if="{{item.candidate}}"><image src="/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text></view>
|
||||||
|
<view wx:if="{{item.deleteReason}}"><image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text></view>
|
||||||
|
<view><image src="/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text></view>
|
||||||
|
<view wx:if="{{item.endTime}}"><image src="/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text></view>
|
||||||
|
<view wx:if="{{item.duration}}"><image src="/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text></view>
|
||||||
|
<view wx:if="{{item.message}}"><image src="/images/s_7.png"></image>处理意见:<text>{{item.message}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content color_blue">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起用户</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{procDefName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请日期</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{infoData.date}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假时间</view>
|
||||||
|
<view class="problem_list_info_con color_blue">
|
||||||
|
{{infoData.beginDate}}<text style="padding: 0 20rpx;">至</text>{{infoData.endDate}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假事由</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{infoData.remark}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="safety_inspect_title module_title_flex">
|
||||||
|
<text class="color_orange">共请假{{' '+infoData.day+' '}}天</text>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批意见</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写审批意见(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" maxlength="500" bindinput="commentInput"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" wx:if="{{backShow}}">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">退回节点</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<voucher-select columns="{{targetKeyList}}" placeholder="请选择退回节点" bindchange="onSelectTargetKey"></voucher-select>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_warning" bindtap="onBack">审批退回</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_delete" bindtap="onReject">审批驳回</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onPass">审批通过</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.gk_open_con view{
|
||||||
|
padding: 10rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.gk_open_con image{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 5rpx;
|
||||||
|
}
|
||||||
|
.pass{
|
||||||
|
background-color: #388a38;
|
||||||
|
}
|
||||||
|
.transact{
|
||||||
|
background-color: #8e6424;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,572 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
procInsId:"",
|
||||||
|
infoData:{},
|
||||||
|
procDefName:"",
|
||||||
|
deployId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[],
|
||||||
|
fileNames:[],
|
||||||
|
fileUrls:[],
|
||||||
|
comment:"",
|
||||||
|
taskId:"",
|
||||||
|
procInsId:"",
|
||||||
|
backShow:false,
|
||||||
|
targetKey:"",
|
||||||
|
targetKeyList:[],
|
||||||
|
taskName:"",
|
||||||
|
passState:true,
|
||||||
|
backName:"",
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let {deployId,procInsId,procDefName,deptName,nickName,taskId,taskName,projectName} = options
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
projectName,
|
||||||
|
procInsId,
|
||||||
|
procDefName,
|
||||||
|
deployId,
|
||||||
|
deptName,
|
||||||
|
nickName,
|
||||||
|
taskId,
|
||||||
|
taskName,
|
||||||
|
userId:res.data.userId,
|
||||||
|
loginName:res.data.loginName,
|
||||||
|
})
|
||||||
|
this.initTargetKeyList();
|
||||||
|
this.getFlowNodes();
|
||||||
|
this.getFlowRecordList();
|
||||||
|
this.getFormDatasList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
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'});
|
||||||
|
this.setData({
|
||||||
|
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:'none'});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批日志
|
||||||
|
getFlowRecordList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:res.data
|
||||||
|
})
|
||||||
|
let list=[];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
if(item.deleteReason){
|
||||||
|
item.deleteReason=that.getDeleteReason(item.deleteReason);
|
||||||
|
}
|
||||||
|
if(item.duration){
|
||||||
|
item.duration=that.getDurationDate(item.duration);
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批表单参数
|
||||||
|
getFormDatasList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
infoData:res.data
|
||||||
|
})
|
||||||
|
let fileNames = [];
|
||||||
|
let fileUrls = [];
|
||||||
|
//判断附件
|
||||||
|
if(res.data.files){
|
||||||
|
res.data.files.split(',').forEach(element => {
|
||||||
|
let it = element.split('/');
|
||||||
|
fileNames.push(it[it.length-1]);
|
||||||
|
fileUrls.push(element);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
fileNames,
|
||||||
|
fileUrls
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//初始化退回节点
|
||||||
|
initTargetKeyList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/returnList',
|
||||||
|
method:"post",
|
||||||
|
data:{
|
||||||
|
taskId:that.data.taskId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
let list = [{id:'',text:''}];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
list.push({id:item.id,text:item.name})
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
targetKeyList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//退回
|
||||||
|
onBack(){
|
||||||
|
if(!this.data.backShow){
|
||||||
|
this.setData({
|
||||||
|
backShow:true
|
||||||
|
})
|
||||||
|
app.toast("请选择退回节点!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,userId,loginName,comment,targetKey} = that.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||taskId==""||userId==""||procInsId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(comment==""){
|
||||||
|
app.toast("请填写审批意见!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(targetKey==""){
|
||||||
|
app.toast("请选择退回节点!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
targetKey,
|
||||||
|
comment,
|
||||||
|
userId
|
||||||
|
}
|
||||||
|
//弹出确认
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认审批退回至'+that.data.backName+'?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/return',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("退回申请成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//通过
|
||||||
|
onPass(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,userId,loginName,comment} = that.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||taskId==""||userId==""||procInsId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(comment==""){
|
||||||
|
app.toast("请填写审批意见!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
instanceId:procInsId,
|
||||||
|
comment,
|
||||||
|
userId
|
||||||
|
}
|
||||||
|
//弹出确认
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认审批通过?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/complete',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("审批通过成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//通过
|
||||||
|
onReject(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,userId,loginName,comment} = that.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||taskId==""||userId==""||procInsId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(comment==""){
|
||||||
|
app.toast("请填写审批意见!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
instanceId:procInsId,
|
||||||
|
comment,
|
||||||
|
userId
|
||||||
|
}
|
||||||
|
//弹出确认
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确认审批驳回?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/reject',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("驳回申请成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//申请说明
|
||||||
|
commentInput: function (options) {
|
||||||
|
this.data.comment = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
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){
|
||||||
|
this.setData({
|
||||||
|
targetKey:e.detail.id,
|
||||||
|
backName:e.detail.text
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number {{item.state}}">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
<van-collapse-item title="审批日志" name="2">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{flowRecordList}}" wx:key="index">
|
||||||
|
<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">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
|
||||||
|
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
|
||||||
|
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
|
||||||
|
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info gk_open_con">
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text></view>
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text></view>
|
||||||
|
<view wx:if="{{item.candidate}}"><image src="/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text></view>
|
||||||
|
<view wx:if="{{item.deleteReason}}"><image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text></view>
|
||||||
|
<view><image src="/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text></view>
|
||||||
|
<view wx:if="{{item.endTime}}"><image src="/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text></view>
|
||||||
|
<view wx:if="{{item.duration}}"><image src="/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text></view>
|
||||||
|
<view wx:if="{{item.message}}"><image src="/images/s_7.png"></image>处理意见:<text>{{item.message}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content color_blue">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起用户</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{procDefName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批内容</view>
|
||||||
|
<view class="problem_list_info_con color_blue">
|
||||||
|
<view class="files" wx:for="{{fileNames}}" wx:key="index">
|
||||||
|
<text data-index="{{index}}" style="word-wrap: break-word;">{{item}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请说明</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{infoData.remark}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批意见</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写审批意见(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" maxlength="500" bindinput="commentInput"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" wx:if="{{backShow}}">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">退回节点</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<voucher-select columns="{{targetKeyList}}" placeholder="请选择退回节点" bindchange="onSelectTargetKey"></voucher-select>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_warning" bindtap="onBack">审批退回</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_delete" bindtap="onReject">审批驳回</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onPass">审批通过</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.gk_open_con view{
|
||||||
|
padding: 10rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.gk_open_con image{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 5rpx;
|
||||||
|
}
|
||||||
|
.pass{
|
||||||
|
background-color: #388a38;
|
||||||
|
}
|
||||||
|
.transact{
|
||||||
|
background-color: #8e6424;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,180 @@
|
||||||
|
// pageage/safetyManagement/securityCheckGR/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
deptId:"",
|
||||||
|
userId:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
minRoleId:"",
|
||||||
|
projectData:{},
|
||||||
|
initData: {},
|
||||||
|
show:false,
|
||||||
|
listData:[],
|
||||||
|
request:app.globalData.reqUrl
|
||||||
|
},
|
||||||
|
|
||||||
|
getInfo(e){
|
||||||
|
let {deployId,procInsId,taskId,taskName,procDefKey,startDeptName,startUserName,procDefName,businessKeyName} = e.currentTarget.dataset.set
|
||||||
|
if(taskName=="提交申请"){
|
||||||
|
if(procDefKey=="flow_xmglzdl_qjspb"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../editLeaveTask/index?deployId=${deployId}&procInsId=${procInsId}&nickName=${startUserName}&deptName=${startDeptName}&procDefName=${procDefName}&taskId=${taskId}&taskName=${taskName}&projectName=${businessKeyName}&ret=await`,
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../editTask/index?deployId=${deployId}&procInsId=${procInsId}&nickName=${startUserName}&deptName=${startDeptName}&procDefName=${procDefName}&taskId=${taskId}&taskName=${taskName}&projectName=${businessKeyName}&ret=await`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//根据不同业务跳转不同表单
|
||||||
|
if(procDefKey=="flow_xmglzdl_qjspb"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../approveLeaveTask/index?deployId=${deployId}&procInsId=${procInsId}&nickName=${startUserName}&deptName=${startDeptName}&procDefName=${procDefName}&taskId=${taskId}&taskName=${taskName}&projectName=${businessKeyName}`,
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../approveTask/index?deployId=${deployId}&procInsId=${procInsId}&nickName=${startUserName}&deptName=${startDeptName}&procDefName=${procDefName}&taskId=${taskId}&taskName=${taskName}&projectName=${businessKeyName}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
loginName:res.data.loginName,
|
||||||
|
userId:res.data.userId,
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
minRoleId:res.data.minRoleId,
|
||||||
|
deptId:res.data.deptId,
|
||||||
|
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
|
||||||
|
})
|
||||||
|
this.getListData(res.data.loginName,res.data.userId,res.data.deptId,res.data.minRoleId);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目举牌验收数据
|
||||||
|
*/
|
||||||
|
getListData(loginName,userId,deptId,minRoleId) {
|
||||||
|
var that = this;
|
||||||
|
//businessKey注解掉可以跨项目审批
|
||||||
|
let param = {
|
||||||
|
//"businessKey":this.data.projectId,
|
||||||
|
"nowRole":minRoleId,
|
||||||
|
"nowDept":deptId,
|
||||||
|
"nowUserName":loginName,
|
||||||
|
"nowUser":userId
|
||||||
|
}
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/myAwaitFlowTaskList',
|
||||||
|
data:param,
|
||||||
|
method: "post",
|
||||||
|
success: function (res) {
|
||||||
|
res = res.data;
|
||||||
|
if(res.code=="200"){
|
||||||
|
that.setData({
|
||||||
|
listData:res.rows
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../../gengduogongneng/gengduogongneng',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
goFQLC:function(){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
goWDLC:function(){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myProcessIns/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
goBLWC:function(){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../finished/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//项目切换 返回值
|
||||||
|
onProjectSelect(e){
|
||||||
|
let projectId = e.detail.id;
|
||||||
|
let projectName = e.detail.text;
|
||||||
|
app.globalData.projectId = projectId;
|
||||||
|
app.globalData.projectName = projectName;
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index" ,
|
||||||
|
"van-popup": "@vant/weapp/popup/index"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
|
||||||
|
<view class="gd_max" style="margin-top: 20rpx;">
|
||||||
|
<van-row class="demo clearfix">
|
||||||
|
<van-col span="8">
|
||||||
|
<view class="gd_min" bindtap="goFQLC">
|
||||||
|
<image src="http://fileimg.makalu.cc/7e859556435e41ecb48664347c4b9c86.png"></image>
|
||||||
|
<view>发起流程</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="8">
|
||||||
|
<view class="gd_min" bindtap="goWDSQ">
|
||||||
|
<image src="http://fileimg.makalu.cc/1b250521a8a848dcb9a6fdd511ac908d.png"></image>
|
||||||
|
<view>我发起的</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="8">
|
||||||
|
<view class="gd_min" bindtap="goBLWC">
|
||||||
|
<image src="http://fileimg.makalu.cc/9ffe8962c0e24693b337bc0bdf0ab71c.png"></image>
|
||||||
|
<view>办理完成</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_max">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" bindtap="getInfo">
|
||||||
|
<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"><text class="color_orange">{{item.taskName}}</text>
|
||||||
|
<text wx:if="{{item.taskName!='提交申请'}}" class="timeline_for_state_1 color_green" style="font-weight: 800;">待审批</text>
|
||||||
|
<text wx:if="{{item.taskName=='提交申请'}}" class="timeline_for_state_2">审批驳回</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info">
|
||||||
|
<view class="inspect_list_info_data_prop color_blue">审批事项:{{item.procDefName}}</view>
|
||||||
|
<view class="inspect_list_info_data_prop color_purple">接收时间:{{item.createTime}}</view>
|
||||||
|
<view class="inspect_list_info_data_prop">申请用户:{{item.startUserName}}</view>
|
||||||
|
<view class="inspect_list_info_data_prop">申请单位:{{item.startDeptName}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{listData.length==0}}">
|
||||||
|
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||||
|
<image src="../../../images/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||||
|
<view style="color: #a5abbb;">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
/* pageage/project_checking_list/project_checking_list.wxss */
|
||||||
|
.gd_max{
|
||||||
|
padding:10rpx 50rpx 0;
|
||||||
|
}
|
||||||
|
.gd_min{
|
||||||
|
padding: 30rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.gd_min image{
|
||||||
|
width: 150rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
}
|
||||||
|
.gd_min view{
|
||||||
|
padding: 10rpx;
|
||||||
|
color: #89a4eb;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,514 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
myUserId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
procInsId:"",
|
||||||
|
infoData:{},
|
||||||
|
procDefName:"",
|
||||||
|
deployId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[],
|
||||||
|
taskId:"",
|
||||||
|
procInsId:"",
|
||||||
|
taskName:"",
|
||||||
|
passState:true,
|
||||||
|
backName:"",
|
||||||
|
stopShow:false,
|
||||||
|
deleteShow:false,
|
||||||
|
revocationShow:false,
|
||||||
|
finishTime:"",
|
||||||
|
ret:"",
|
||||||
|
comment:"",
|
||||||
|
stopBtnShow:false
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(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();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
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'});
|
||||||
|
this.setData({
|
||||||
|
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:'none'});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批日志
|
||||||
|
getFlowRecordList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:res.data
|
||||||
|
})
|
||||||
|
let list=[];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
if(item.deleteReason){
|
||||||
|
item.deleteReason=that.getDeleteReason(item.deleteReason);
|
||||||
|
}
|
||||||
|
if(item.duration){
|
||||||
|
item.duration=that.getDurationDate(item.duration);
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批表单参数
|
||||||
|
getFormDatasList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
infoData:res.data,
|
||||||
|
stopShow:!that.data.finishTime && that.data.userId==that.myUserId,
|
||||||
|
deleteShow:!that.data.finishTime && that.data.userId==that.myUserId,
|
||||||
|
revocationShow:!that.data.finishTime
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//退回
|
||||||
|
onStop(){
|
||||||
|
if(!this.data.stopBtnShow){
|
||||||
|
app.toast("请填写终止原因!")
|
||||||
|
this.setData({
|
||||||
|
stopBtnShow:true
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}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)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//撤回
|
||||||
|
onRevocation(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let params = {
|
||||||
|
procInsId: this.data.procInsId,
|
||||||
|
instanceId: this.data.procInsId,
|
||||||
|
taskId:this.data.taskId,
|
||||||
|
userId:this.data.startUserId,
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//终止原因
|
||||||
|
commentblur: function (options) {
|
||||||
|
this.data.comment = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
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){
|
||||||
|
this.setData({
|
||||||
|
targetKey:e.detail.id,
|
||||||
|
backName:e.detail.name
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
if(this.data.ret=="finished"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../finished/index',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myProcessIns/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,161 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number {{item.state}}">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
<van-collapse-item title="审批日志" name="2">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{flowRecordList}}" wx:key="index">
|
||||||
|
<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">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
|
||||||
|
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
|
||||||
|
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
|
||||||
|
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info gk_open_con">
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text></view>
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text></view>
|
||||||
|
<view wx:if="{{item.candidate}}"><image src="/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text></view>
|
||||||
|
<view wx:if="{{item.deleteReason}}"><image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text></view>
|
||||||
|
<view><image src="/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text></view>
|
||||||
|
<view wx:if="{{item.endTime}}"><image src="/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text></view>
|
||||||
|
<view wx:if="{{item.duration}}"><image src="/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text></view>
|
||||||
|
<view wx:if="{{item.message}}"><image src="/images/s_7.png"></image>处理意见:<text>{{item.message}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content color_blue">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起用户</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{procDefName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请日期</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{infoData.date}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假时间</view>
|
||||||
|
<view class="problem_list_info_con color_blue">
|
||||||
|
{{infoData.beginDate}}<text style="padding: 0 20rpx;">至</text>{{infoData.endDate}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假事由</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{infoData.remark}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="safety_inspect_title module_title_flex">
|
||||||
|
<text class="color_orange">共请假{{' '+infoData.day+' '}}天</text>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" wx:if="{{stopBtnShow}}">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">终止原因</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写终止原因(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" maxlength="500" bindinput="commentblur"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view wx:if="{{stopShow}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="onStop">终止</view>
|
||||||
|
<view wx:if="{{false}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="onDelete">删除</view>
|
||||||
|
<view wx:if="{{revocationShow}}" class="problem_submit_to_btn problem_submit_to_save" bindtap="onRevocation">撤回</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.gk_open_con view{
|
||||||
|
padding: 10rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.gk_open_con image{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 5rpx;
|
||||||
|
}
|
||||||
|
.pass{
|
||||||
|
background-color: #388a38;
|
||||||
|
}
|
||||||
|
.transact{
|
||||||
|
background-color: #8e6424;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,530 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
myUserId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
procInsId:"",
|
||||||
|
infoData:{},
|
||||||
|
procDefName:"",
|
||||||
|
deployId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[],
|
||||||
|
fileNames:[],
|
||||||
|
fileUrls:[],
|
||||||
|
taskId:"",
|
||||||
|
procInsId:"",
|
||||||
|
taskName:"",
|
||||||
|
passState:true,
|
||||||
|
backName:"",
|
||||||
|
stopShow:false,
|
||||||
|
deleteShow:false,
|
||||||
|
revocationShow:false,
|
||||||
|
finishTime:"",
|
||||||
|
ret:"",
|
||||||
|
comment:"",
|
||||||
|
stopBtnShow:false
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(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();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
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'});
|
||||||
|
this.setData({
|
||||||
|
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:'none'});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批日志
|
||||||
|
getFlowRecordList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:res.data
|
||||||
|
})
|
||||||
|
let list=[];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
if(item.deleteReason){
|
||||||
|
item.deleteReason=that.getDeleteReason(item.deleteReason);
|
||||||
|
}
|
||||||
|
if(item.duration){
|
||||||
|
item.duration=that.getDurationDate(item.duration);
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批表单参数
|
||||||
|
getFormDatasList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
infoData:res.data
|
||||||
|
})
|
||||||
|
let fileNames = [];
|
||||||
|
let fileUrls = [];
|
||||||
|
//判断附件
|
||||||
|
if(res.data.files){
|
||||||
|
res.data.files.split(',').forEach(element => {
|
||||||
|
let it = element.split('/');
|
||||||
|
fileNames.push(it[it.length-1]);
|
||||||
|
fileUrls.push(element);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
fileNames,
|
||||||
|
fileUrls,
|
||||||
|
stopShow:!that.data.finishTime && that.data.userId==that.myUserId,
|
||||||
|
deleteShow:!that.data.finishTime && that.data.userId==that.myUserId,
|
||||||
|
revocationShow:!that.data.finishTime
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//退回
|
||||||
|
onStop(){
|
||||||
|
if(!this.data.stopBtnShow){
|
||||||
|
app.toast("请填写终止原因!")
|
||||||
|
this.setData({
|
||||||
|
stopBtnShow:true
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}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)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//撤回
|
||||||
|
onRevocation(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let params = {
|
||||||
|
procInsId: this.data.procInsId,
|
||||||
|
instanceId: this.data.procInsId,
|
||||||
|
taskId:this.data.taskId,
|
||||||
|
userId:this.data.startUserId,
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
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){
|
||||||
|
this.setData({
|
||||||
|
targetKey:e.detail.id,
|
||||||
|
backName:e.detail.name
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
if(this.data.ret=="finished"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../finished/index',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myProcessIns/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//终止原因
|
||||||
|
commentblur: function (options) {
|
||||||
|
this.data.comment = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,154 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number {{item.state}}">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
<van-collapse-item title="审批日志" name="2">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{flowRecordList}}" wx:key="index">
|
||||||
|
<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">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
|
||||||
|
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
|
||||||
|
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
|
||||||
|
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info gk_open_con">
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text></view>
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text></view>
|
||||||
|
<view wx:if="{{item.candidate}}"><image src="/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text></view>
|
||||||
|
<view wx:if="{{item.deleteReason}}"><image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text></view>
|
||||||
|
<view><image src="/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text></view>
|
||||||
|
<view wx:if="{{item.endTime}}"><image src="/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text></view>
|
||||||
|
<view wx:if="{{item.duration}}"><image src="/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text></view>
|
||||||
|
<view wx:if="{{item.message}}"><image src="/images/s_7.png"></image>处理意见:<text>{{item.message}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content color_blue">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起用户</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{procDefName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批内容</view>
|
||||||
|
<view class="problem_list_info_con color_blue">
|
||||||
|
<view class="files" wx:for="{{fileNames}}" wx:key="index">
|
||||||
|
<text data-index="{{index}}" style="word-wrap: break-word;">{{item}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请说明</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{infoData.remark}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" wx:if="{{stopBtnShow}}">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">终止原因</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写终止原因(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" maxlength="500" bindinput="commentblur"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view wx:if="{{stopShow}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="onStop">终止</view>
|
||||||
|
<view wx:if="{{false}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="onDelete">删除</view>
|
||||||
|
<view wx:if="{{revocationShow}}" class="problem_submit_to_btn problem_submit_to_save" bindtap="onRevocation">撤回</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.gk_open_con view{
|
||||||
|
padding: 10rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.gk_open_con image{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 5rpx;
|
||||||
|
}
|
||||||
|
.pass{
|
||||||
|
background-color: #388a38;
|
||||||
|
}
|
||||||
|
.transact{
|
||||||
|
background-color: #8e6424;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,530 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
procInsId:"",
|
||||||
|
infoData:{},
|
||||||
|
procDefName:"",
|
||||||
|
deployId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[],
|
||||||
|
comment:"",
|
||||||
|
taskId:"",
|
||||||
|
procInsId:"",
|
||||||
|
backShow:false,
|
||||||
|
targetKey:"",
|
||||||
|
targetKeyList:[],
|
||||||
|
taskName:"",
|
||||||
|
passState:true,
|
||||||
|
backName:"",
|
||||||
|
ret:"",
|
||||||
|
remark:"",
|
||||||
|
beginDate:"",
|
||||||
|
endDate:"",
|
||||||
|
day:0,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let {deployId,procInsId,procDefName,deptName,nickName,taskId,taskName,projectName,ret} = options
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
projectName,
|
||||||
|
procInsId,
|
||||||
|
procDefName,
|
||||||
|
deployId,
|
||||||
|
deptName,
|
||||||
|
nickName,
|
||||||
|
taskId,
|
||||||
|
taskName,
|
||||||
|
ret,
|
||||||
|
userId:res.data.userId,
|
||||||
|
loginName:res.data.loginName,
|
||||||
|
})
|
||||||
|
this.initTargetKeyList();
|
||||||
|
this.getFlowNodes();
|
||||||
|
this.getFlowRecordList();
|
||||||
|
this.getFormDatasList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
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'});
|
||||||
|
this.setData({
|
||||||
|
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:'none'});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批日志
|
||||||
|
getFlowRecordList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:res.data
|
||||||
|
})
|
||||||
|
let list=[];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
if(item.deleteReason){
|
||||||
|
item.deleteReason=that.getDeleteReason(item.deleteReason);
|
||||||
|
}
|
||||||
|
if(item.duration){
|
||||||
|
item.duration=that.getDurationDate(item.duration);
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批表单参数
|
||||||
|
getFormDatasList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
infoData:res.data,
|
||||||
|
beginDate:res.data.beginDate,
|
||||||
|
endDate:res.data.endDate,
|
||||||
|
day:res.data.day
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//初始化退回节点
|
||||||
|
initTargetKeyList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/returnList',
|
||||||
|
method:"post",
|
||||||
|
data:{
|
||||||
|
taskId:that.data.taskId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
let list = [{id:'',text:''}];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
list.push({id:item.id,text:item.name})
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
targetKeyList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//保存
|
||||||
|
onSave(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let {procDefId,projectId,userId,loginName,remark,beginDate,endDate} = this.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||userId==""||procDefId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(beginDate==""){
|
||||||
|
app.toast("请选择请假开始时间!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(endDate==""){
|
||||||
|
app.toast("请选择请假结束时间!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(remark==""){
|
||||||
|
app.toast("请填写请假事由!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确定提交'+this.data.procDefName+'?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
// 用户点击了确定 可以调用了
|
||||||
|
that.submit()
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
submit(){
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,projectName,userId,loginName,nickName,remark,beginDate,endDate,day} = that.data;
|
||||||
|
let date = new Date();
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
instanceId:procInsId,
|
||||||
|
userId,
|
||||||
|
assignee:nickName,
|
||||||
|
variables:{
|
||||||
|
businessKey:projectId,
|
||||||
|
projectName,
|
||||||
|
date:that.dateFormat("yyyy-MM-dd HH:ss",date),
|
||||||
|
beginDate,
|
||||||
|
endDate,
|
||||||
|
day,
|
||||||
|
remark,
|
||||||
|
INITIATOR:that.data.infoData.INITIATOR
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/complete',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("提交申请成功!")
|
||||||
|
if(that.data.ret=="await"){
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//申请说明
|
||||||
|
remarkblur: function (options) {
|
||||||
|
this.data.remark = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
//开始时间
|
||||||
|
onbeginDate(e){
|
||||||
|
this.setData({
|
||||||
|
beginDate:e.detail
|
||||||
|
})
|
||||||
|
if(this.data.endDate==""){
|
||||||
|
this.setData({
|
||||||
|
endDate:e.detail
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.setDay();
|
||||||
|
},
|
||||||
|
//结束时间
|
||||||
|
onendDate(e){
|
||||||
|
this.setData({
|
||||||
|
endDate:e.detail
|
||||||
|
})
|
||||||
|
this.setDay();
|
||||||
|
},
|
||||||
|
|
||||||
|
setDay(){
|
||||||
|
if(this.data.beginDate && this.data.endDate){
|
||||||
|
let time = (new Date(this.data.endDate).getTime())-(new Date(this.data.beginDate).getTime());
|
||||||
|
if(time<0){
|
||||||
|
this.setData({
|
||||||
|
day:0
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
let hours = time/(3600000);
|
||||||
|
let day = (hours/24)+1;//这里默认加1天,PS:2023-09-10 2023-09-11实际请假应该为2天,而不是一天
|
||||||
|
if(hours%24>0) day++;
|
||||||
|
this.setData({
|
||||||
|
day
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
dateFormat(fmt, date) {
|
||||||
|
let ret;
|
||||||
|
const opt = {
|
||||||
|
'y+': date.getFullYear().toString(), // 年
|
||||||
|
'M+': (date.getMonth() + 1).toString(), // 月
|
||||||
|
'd+': date.getDate().toString(), // 日
|
||||||
|
'H+': date.getHours().toString(), // 时
|
||||||
|
'm+': date.getMinutes().toString(), // 分
|
||||||
|
's+': date.getSeconds().toString(), // 秒
|
||||||
|
// 有其他格式化字符需求可以继续添加,必须转化成字符串
|
||||||
|
};
|
||||||
|
for (let k in opt) {
|
||||||
|
ret = new RegExp('(' + k + ')').exec(fmt);
|
||||||
|
if (ret) {
|
||||||
|
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fmt;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
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){
|
||||||
|
this.setData({
|
||||||
|
targetKey:e.detail.id,
|
||||||
|
backName:e.detail.name
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
if(this.data.ret=="await"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//取消页面
|
||||||
|
cancelSaveView(){
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
if(this.data.ret=="await"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,158 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number {{item.state}}">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
<van-collapse-item title="审批日志" name="2">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{flowRecordList}}" wx:key="index">
|
||||||
|
<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">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
|
||||||
|
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
|
||||||
|
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
|
||||||
|
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info gk_open_con">
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text></view>
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text></view>
|
||||||
|
<view wx:if="{{item.candidate}}"><image src="/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text></view>
|
||||||
|
<view wx:if="{{item.deleteReason}}"><image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text></view>
|
||||||
|
<view><image src="/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text></view>
|
||||||
|
<view wx:if="{{item.endTime}}"><image src="/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text></view>
|
||||||
|
<view wx:if="{{item.duration}}"><image src="/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text></view>
|
||||||
|
<view wx:if="{{item.message}}"><image src="/images/s_7.png"></image>处理意见:<text>{{item.message}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content color_blue">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起用户</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{procDefName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假时间</view>
|
||||||
|
<view class="problem_list_info_con">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="10">
|
||||||
|
<voucher-date counts="5" maxDate="{{maxDate}}" placeholder="开始时间" bindchange="onbeginDate" time="{{beginDate}}"></voucher-date>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="4">
|
||||||
|
<view style="text-align: center;line-height: 90rpx;">至</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="10">
|
||||||
|
<voucher-date counts="5" maxDate="{{maxDate}}" placeholder="结束时间" bindchange="onendDate" time="{{endDate}}"></voucher-date>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假事由</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写请假事由(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" model:value="{{infoData.remark}}" maxlength="500" bindinput="remarkblur"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="safety_inspect_title module_title_flex" wx:if="{{day>0}}">
|
||||||
|
<text class="color_orange">共请假{{' '+day+' '}}天</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onSave">提交申请</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.gk_open_con view{
|
||||||
|
padding: 10rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.gk_open_con image{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 5rpx;
|
||||||
|
}
|
||||||
|
.pass{
|
||||||
|
background-color: #388a38;
|
||||||
|
}
|
||||||
|
.transact{
|
||||||
|
background-color: #8e6424;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,546 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
procInsId:"",
|
||||||
|
infoData:{},
|
||||||
|
procDefName:"",
|
||||||
|
deployId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[],
|
||||||
|
fileNames:[],
|
||||||
|
fileUrls:[],
|
||||||
|
comment:"",
|
||||||
|
taskId:"",
|
||||||
|
procInsId:"",
|
||||||
|
backShow:false,
|
||||||
|
targetKey:"",
|
||||||
|
targetKeyList:[],
|
||||||
|
taskName:"",
|
||||||
|
passState:true,
|
||||||
|
backName:"",
|
||||||
|
fileUrlArray:[],
|
||||||
|
ret:"",
|
||||||
|
remark:"",
|
||||||
|
filesData:[],
|
||||||
|
limit:9,
|
||||||
|
fileType:["doc","docx","xls","xlsx","ppt","pptx","txt","pdf","png","jpg","jpeg","mp4"],
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let {deployId,procInsId,procDefName,deptName,nickName,taskId,taskName,projectName,ret} = options
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
projectName,
|
||||||
|
procInsId,
|
||||||
|
procDefName,
|
||||||
|
deployId,
|
||||||
|
deptName,
|
||||||
|
nickName,
|
||||||
|
taskId,
|
||||||
|
taskName,
|
||||||
|
ret,
|
||||||
|
userId:res.data.userId,
|
||||||
|
loginName:res.data.loginName,
|
||||||
|
})
|
||||||
|
this.initTargetKeyList();
|
||||||
|
this.getFlowNodes();
|
||||||
|
this.getFlowRecordList();
|
||||||
|
this.getFormDatasList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
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'});
|
||||||
|
this.setData({
|
||||||
|
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:'none'});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批日志
|
||||||
|
getFlowRecordList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:res.data
|
||||||
|
})
|
||||||
|
let list=[];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
if(item.deleteReason){
|
||||||
|
item.deleteReason=that.getDeleteReason(item.deleteReason);
|
||||||
|
}
|
||||||
|
if(item.duration){
|
||||||
|
item.duration=that.getDurationDate(item.duration);
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
flowRecordList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询审批表单参数
|
||||||
|
getFormDatasList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
|
||||||
|
method:"get",
|
||||||
|
data:{
|
||||||
|
procInsId:this.data.procInsId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
infoData:res.data
|
||||||
|
})
|
||||||
|
let fileNames = [];
|
||||||
|
let fileUrls = [];
|
||||||
|
let fileUrlArray = [];
|
||||||
|
//判断附件
|
||||||
|
if(res.data.files){
|
||||||
|
res.data.files.split(',').forEach(element => {
|
||||||
|
let it = element.split('/');
|
||||||
|
fileNames.push(it[it.length-1]);
|
||||||
|
fileUrls.push(element);
|
||||||
|
fileUrlArray.push({name:it[it.length-1],path:element});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
fileNames,
|
||||||
|
fileUrls,
|
||||||
|
fileUrlArray
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//初始化退回节点
|
||||||
|
initTargetKeyList(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/returnList',
|
||||||
|
method:"post",
|
||||||
|
data:{
|
||||||
|
taskId:that.data.taskId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
let list = [{id:'',text:''}];
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
list.push({id:item.id,text:item.name})
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
targetKeyList:list
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//保存
|
||||||
|
onSave(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let {procDefId,projectId,userId,loginName,remark,filesData} = this.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||userId==""||procDefId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(remark==""){
|
||||||
|
app.toast("请填写申请说明!")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(filesData.length==0){
|
||||||
|
app.toast("请上传审批内容!")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for(let i=0;i<filesData.length;i++){
|
||||||
|
let _fileType = filesData[0].path.split('.');
|
||||||
|
_fileType = _fileType[_fileType.length-1].toLowerCase();
|
||||||
|
//判断附件类型,如果是图片直接展示,非图片则显示附件
|
||||||
|
if(this.data.fileType.indexOf(_fileType)==-1){
|
||||||
|
app.toast("申批内容不支持 [ "+_fileType+" ] 格式!请检查第"+(i+1)+"个附件")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确定提交'+this.data.procDefName+'?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
// 用户点击了确定 可以调用了
|
||||||
|
that.submit()
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
submit(){
|
||||||
|
let that = this
|
||||||
|
let {taskId,procInsId,projectId,projectName,userId,loginName,nickName,remark,filesData} = that.data;
|
||||||
|
let fileUrls = [];
|
||||||
|
filesData.forEach(async (item)=>{
|
||||||
|
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
|
||||||
|
let name = "file"
|
||||||
|
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
||||||
|
if(item.path.indexOf("/profile/")>-1){
|
||||||
|
fileUrls.push(item.path);
|
||||||
|
}else{
|
||||||
|
let obj = await that.syncUploadImage(uploadUrl,item.path,name);
|
||||||
|
fileUrls.push(obj.data.fileName);
|
||||||
|
}
|
||||||
|
//验证图片上传完毕
|
||||||
|
if(fileUrls.length == filesData.length){
|
||||||
|
let params = {
|
||||||
|
taskId,
|
||||||
|
instanceId:procInsId,
|
||||||
|
userId,
|
||||||
|
assignee:nickName,
|
||||||
|
variables:{
|
||||||
|
businessKey:projectId,
|
||||||
|
projectName,
|
||||||
|
files:fileUrls.toString(),
|
||||||
|
remark,
|
||||||
|
INITIATOR:that.data.infoData.INITIATOR
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/complete',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("提交申请成功!")
|
||||||
|
if(that.data.ret=="await"){
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这里考虑上传图片异步问题,封装为同步
|
||||||
|
*/
|
||||||
|
syncUploadImage(url,uploadFile,name) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
wx.uploadFile({
|
||||||
|
url, // 上传的服务器接口地址
|
||||||
|
filePath: uploadFile,
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
||||||
|
},
|
||||||
|
name, //上传的所需字段,后端提供
|
||||||
|
formData: { user: 'test' },
|
||||||
|
success: (res) => {
|
||||||
|
// 上传完成操作
|
||||||
|
const data = JSON.parse(res.data)
|
||||||
|
resolve({
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
//上传失败:修改pedding为reject
|
||||||
|
console.log("访问接口失败", err);
|
||||||
|
wx.showToast({
|
||||||
|
title: "网络出错,上传失败",
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//申请说明
|
||||||
|
remarkblur: function (options) {
|
||||||
|
this.data.remark = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
fileUpload(options){
|
||||||
|
let file=options.detail;
|
||||||
|
this.setData({
|
||||||
|
filesData: file
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
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){
|
||||||
|
this.setData({
|
||||||
|
targetKey:e.detail.id,
|
||||||
|
backName:e.detail.name
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
if(this.data.ret=="await"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//取消页面
|
||||||
|
cancelSaveView(){
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
if(this.data.ret=="await"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,149 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number {{item.state}}">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
<van-collapse-item title="审批日志" name="2">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{flowRecordList}}" wx:key="index">
|
||||||
|
<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">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
|
||||||
|
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
|
||||||
|
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
|
||||||
|
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info gk_open_con">
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text></view>
|
||||||
|
<view wx:if="{{item.assigneeName}}"><image src="/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text></view>
|
||||||
|
<view wx:if="{{item.candidate}}"><image src="/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text></view>
|
||||||
|
<view wx:if="{{item.deleteReason}}"><image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text></view>
|
||||||
|
<view><image src="/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text></view>
|
||||||
|
<view wx:if="{{item.endTime}}"><image src="/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text></view>
|
||||||
|
<view wx:if="{{item.duration}}"><image src="/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text></view>
|
||||||
|
<view wx:if="{{item.message}}"><image src="/images/s_7.png"></image>处理意见:<text>{{item.message}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content color_blue">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起用户</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{procDefName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批内容
|
||||||
|
<text style="font-size: small;">[可上传PDF/图片/WORD/PPT/XLS格式]</text>
|
||||||
|
</view>
|
||||||
|
<view class="problem_list_info_con color_blue">
|
||||||
|
<view class="problem_list_info_con">
|
||||||
|
<file-uploader-all bindfiles="fileUpload" limit="{{limit}}" fileUrlArray="{{fileUrlArray}}"></file-uploader-all>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请说明</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写申请说明(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" model:value="{{infoData.remark}}" maxlength="500" bindinput="remarkblur"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onSave">提交申请</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.gk_open_con view{
|
||||||
|
padding: 10rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.gk_open_con image{
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 5rpx;
|
||||||
|
}
|
||||||
|
.pass{
|
||||||
|
background-color: #388a38;
|
||||||
|
}
|
||||||
|
.transact{
|
||||||
|
background-color: #8e6424;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,168 @@
|
||||||
|
// pageage/safetyManagement/securityCheckGR/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
userId:"",
|
||||||
|
projectId:"",
|
||||||
|
projectData:{},
|
||||||
|
initData: {},
|
||||||
|
show:false,
|
||||||
|
list:[],
|
||||||
|
listData:[],
|
||||||
|
pageNum:1,
|
||||||
|
pageSize:10,
|
||||||
|
lastDataSize:10,
|
||||||
|
},
|
||||||
|
|
||||||
|
getInfo(e){
|
||||||
|
let {deployId,procInsId,taskId,taskName,procDefKey,startDeptName,startUserName,procDefName,businessKeyName,finishTime} = e.currentTarget.dataset.set
|
||||||
|
if(!finishTime){
|
||||||
|
finishTime="";
|
||||||
|
}
|
||||||
|
//根据不同业务跳转不同表单
|
||||||
|
if(procDefKey=="flow_xmglzdl_qjspb"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../detailLeaveTask/index?deployId=${deployId}&procInsId=${procInsId}&nickName=${startUserName}&deptName=${startDeptName}&procDefName=${procDefName}&taskId=${taskId}&taskName=${taskName}&projectName=${businessKeyName}&finishTime=${finishTime}&ret=finished`,
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../detailTask/index?deployId=${deployId}&procInsId=${procInsId}&nickName=${startUserName}&deptName=${startDeptName}&procDefName=${procDefName}&taskId=${taskId}&taskName=${taskName}&projectName=${businessKeyName}&finishTime=${finishTime}&ret=finished`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
userId:res.data.userId,
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
|
||||||
|
})
|
||||||
|
this.getListData(res.data.userId);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目举牌验收数据
|
||||||
|
*/
|
||||||
|
getListData(userId) {
|
||||||
|
//进入这里说明数据加载完毕
|
||||||
|
if(this.data.lastDataSize<this.data.pageSize){
|
||||||
|
//app.toast("已经到底了,暂无可继续加载数据!")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var that = this;
|
||||||
|
//businessKey注解掉可以跨项目审批
|
||||||
|
let param = {
|
||||||
|
"nowUser":userId
|
||||||
|
}
|
||||||
|
param.pageNum=that.data.pageNum;
|
||||||
|
param.pageSize=that.data.pageSize;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/myFinishedFlowTaskList',
|
||||||
|
data:param,
|
||||||
|
method: "get",
|
||||||
|
success: function (res) {
|
||||||
|
res = res.data;
|
||||||
|
if(res.code=="200"){
|
||||||
|
//这里处理this.data.lastDataSize=this.data.pageSize
|
||||||
|
if(that.data.list.length>0 && that.data.list[0].taskId==res.rows[0].taskId){
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onScrollToLower(){
|
||||||
|
console.log("滚动条到底了,开始加载新数据");
|
||||||
|
this.getListData(this.data.userId);
|
||||||
|
},
|
||||||
|
|
||||||
|
//项目切换 返回值
|
||||||
|
onProjectSelect(e){
|
||||||
|
let projectId = e.detail.id;
|
||||||
|
let projectName = e.detail.text;
|
||||||
|
app.globalData.projectId = projectId;
|
||||||
|
app.globalData.projectName = projectName;
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index" ,
|
||||||
|
"van-popup": "@vant/weapp/popup/index"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
<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="inspect_max_scroll_1">
|
||||||
|
<view class="inspect_for_scroll" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" bindtap="getInfo">
|
||||||
|
<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"><text>{{item.endTime}}</text>
|
||||||
|
<text wx:if="{{item.finishTime==null}}" class="timeline_for_state_1 color_green" style="font-weight: 800;">进行中</text>
|
||||||
|
<text wx:if="{{item.finishTime != null && scope.row.ASSIGNEE_ != null}}" class="timeline_for_state_1">已完成</text>
|
||||||
|
<text wx:if="{{item.finishTime != null && scope.row.ASSIGNEE_ == null}}" class="timeline_for_state_2">已终止</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info">
|
||||||
|
<view class="inspect_list_info_data_prop color_orange">项目名称:{{item.businessKeyName}}</view>
|
||||||
|
<view class="inspect_list_info_data_prop color_blue">审批事项:{{item.procDefName}}</view>
|
||||||
|
<view class="inspect_list_info_data_prop">当前节点:<text wx:if="{{item.finishTime == null}}">{{item.taskName}}</text>
|
||||||
|
<text wx:if="{{item.finishTime != null}}">流程结束</text>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info_data_prop">接收时间:{{item.createTime}}</view>
|
||||||
|
<view class="inspect_list_info_data_prop">申请用户:{{item.startUserName}}</view>
|
||||||
|
<view class="inspect_list_info_data_prop">申请单位:{{item.startDeptName}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{listData.length==0}}">
|
||||||
|
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||||
|
<image src="../../../images/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||||
|
<view style="color: #a5abbb;">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
/* pageage/project_checking_list/project_checking_list.wxss */
|
||||||
|
.gd_max{
|
||||||
|
padding:10rpx 50rpx 0;
|
||||||
|
}
|
||||||
|
.gd_min{
|
||||||
|
padding: 30rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.gd_min image{
|
||||||
|
width: 150rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
}
|
||||||
|
.gd_min view{
|
||||||
|
padding: 10rpx;
|
||||||
|
color: #89a4eb;
|
||||||
|
}
|
||||||
|
.inspect_max_scroll_1 {
|
||||||
|
height: 82vh;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,328 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
currentDate:new Date().getTime(),
|
||||||
|
deptId:"",
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
remark:"",
|
||||||
|
procDefId:"",
|
||||||
|
approveTitle:"",
|
||||||
|
deploymentId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[],
|
||||||
|
beginDate:"",
|
||||||
|
endDate:"",
|
||||||
|
day:0,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let {procDefId,approveTitle,deploymentId} = options
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
projectName:app.globalData.projectName,
|
||||||
|
procDefId,
|
||||||
|
approveTitle,
|
||||||
|
deploymentId,
|
||||||
|
deptId:res.data.deptId,
|
||||||
|
deptName:res.data.deptName,
|
||||||
|
userId:res.data.userId,
|
||||||
|
nickName:res.data.nickName,
|
||||||
|
loginName:res.data.loginName
|
||||||
|
})
|
||||||
|
this.getFlowNodes();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//取消页面
|
||||||
|
cancelSaveView(){
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
dateFormat(fmt, date) {
|
||||||
|
let ret;
|
||||||
|
const opt = {
|
||||||
|
'y+': date.getFullYear().toString(), // 年
|
||||||
|
'M+': (date.getMonth() + 1).toString(), // 月
|
||||||
|
'd+': date.getDate().toString(), // 日
|
||||||
|
'H+': date.getHours().toString(), // 时
|
||||||
|
'm+': date.getMinutes().toString(), // 分
|
||||||
|
's+': date.getSeconds().toString(), // 秒
|
||||||
|
// 有其他格式化字符需求可以继续添加,必须转化成字符串
|
||||||
|
};
|
||||||
|
for (let k in opt) {
|
||||||
|
ret = new RegExp('(' + k + ')').exec(fmt);
|
||||||
|
if (ret) {
|
||||||
|
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fmt;
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
for(let i=0;i<flowNodeList.length;i++){
|
||||||
|
if(flowNodeList[i].id==val){
|
||||||
|
let list = this.data.flowNodes;
|
||||||
|
list.push({id:flowNodeList[i].id,name:flowNodeList[i].name});
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+this.data.deploymentId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//保存
|
||||||
|
onSave(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
let {procDefId,projectId,projectName,deptId,userId,loginName,nickName,beginDate,endDate,remark,day} = that.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||deptId==""||userId==""||procDefId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(beginDate==""){
|
||||||
|
app.toast("请选择请假开始时间!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(endDate==""){
|
||||||
|
app.toast("请选择请假结束时间!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(remark==""){
|
||||||
|
app.toast("请填写请假事由!")
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let date = new Date()
|
||||||
|
let params = {
|
||||||
|
procDefId,
|
||||||
|
userId,
|
||||||
|
userName:loginName,
|
||||||
|
nickName,
|
||||||
|
variables:{
|
||||||
|
businessKey:projectId,
|
||||||
|
projectName,
|
||||||
|
date:that.dateFormat("yyyy-MM-dd HH:ss",date),
|
||||||
|
beginDate,
|
||||||
|
endDate,
|
||||||
|
day,
|
||||||
|
remark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确定提交'+this.data.approveTitle+'?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/startProcessInstance',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("提交申请成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myProcessIns/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//申请说明
|
||||||
|
remarkblur: function (options) {
|
||||||
|
this.data.remark = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
//开始时间
|
||||||
|
onbeginDate(e){
|
||||||
|
this.setData({
|
||||||
|
beginDate:e.detail
|
||||||
|
})
|
||||||
|
if(this.data.endDate==""){
|
||||||
|
this.setData({
|
||||||
|
endDate:e.detail
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.setDay();
|
||||||
|
},
|
||||||
|
//结束时间
|
||||||
|
onendDate(e){
|
||||||
|
this.setData({
|
||||||
|
endDate:e.detail
|
||||||
|
})
|
||||||
|
this.setDay();
|
||||||
|
},
|
||||||
|
|
||||||
|
setDay(){
|
||||||
|
if(this.data.beginDate && this.data.endDate){
|
||||||
|
let time = (new Date(this.data.endDate).getTime())-(new Date(this.data.beginDate).getTime());
|
||||||
|
if(time<0){
|
||||||
|
this.setData({
|
||||||
|
day:0
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
let hours = time/(3600000);
|
||||||
|
let day = (hours/24)+1;//这里默认加1天,PS:2023-09-10 2023-09-11实际请假应该为2天,而不是一天
|
||||||
|
if(hours%24>0) day++;
|
||||||
|
this.setData({
|
||||||
|
day
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
onChange(event) {
|
||||||
|
this.setData({
|
||||||
|
activeName: event.detail,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,131 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起人</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{approveTitle}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假时间</view>
|
||||||
|
<view class="problem_list_info_con">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="10">
|
||||||
|
<voucher-date counts="5" maxDate="{{maxDate}}" placeholder="开始时间" bindchange="onbeginDate"></voucher-date>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="4">
|
||||||
|
<view style="text-align: center;line-height: 90rpx;">至</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="10">
|
||||||
|
<voucher-date counts="5" maxDate="{{maxDate}}" placeholder="结束时间" bindchange="onendDate" time="{{endDate}}"></voucher-date>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">请假事由</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写请假事由(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" maxlength="500" bindinput="remarkblur"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="safety_inspect_title module_title_flex" wx:if="{{day>0}}">
|
||||||
|
<text class="color_orange">共请假{{' '+day+' '}}天</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onSave">提交申请</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,330 @@
|
||||||
|
// pageage/safetyManagement/addSafetyInspect/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
maxDate:new Date(2088,1,1).getTime(),
|
||||||
|
deptId:"",
|
||||||
|
deptName:"",
|
||||||
|
userId:"",
|
||||||
|
nickName:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
projectName:"",
|
||||||
|
remark:"",
|
||||||
|
filesData:[],
|
||||||
|
limit:9,
|
||||||
|
fileType:["doc","docx","xls","xlsx","ppt","pptx","txt","pdf","png","jpg","jpeg","mp4"],
|
||||||
|
procDefId:"",
|
||||||
|
approveTitle:"",
|
||||||
|
deploymentId:"",
|
||||||
|
activeName:"",
|
||||||
|
flowNodeList:[],
|
||||||
|
flowNodes:[]
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let {procDefId,approveTitle,deploymentId} = options
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
projectName:app.globalData.projectName,
|
||||||
|
procDefId,
|
||||||
|
approveTitle,
|
||||||
|
deploymentId,
|
||||||
|
deptId:res.data.deptId,
|
||||||
|
deptName:res.data.deptName,
|
||||||
|
userId:res.data.userId,
|
||||||
|
nickName:res.data.nickName,
|
||||||
|
loginName:res.data.loginName
|
||||||
|
})
|
||||||
|
this.getFlowNodes();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//取消页面
|
||||||
|
cancelSaveView(){
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getFlowNode(val){
|
||||||
|
let flowNodeList = this.data.flowNodeList;
|
||||||
|
for(let i=0;i<flowNodeList.length;i++){
|
||||||
|
if(flowNodeList[i].id==val){
|
||||||
|
let list = this.data.flowNodes;
|
||||||
|
list.push({id:flowNodeList[i].id,name:flowNodeList[i].name});
|
||||||
|
this.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
if(flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length>0){
|
||||||
|
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//查询工作流节点
|
||||||
|
getFlowNodes(){
|
||||||
|
let that = this;
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+this.data.deploymentId,
|
||||||
|
method:"get",
|
||||||
|
data:{},
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
res = res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
that.setData({
|
||||||
|
flowNodeList:res.data
|
||||||
|
})
|
||||||
|
if(res.data.length>0){
|
||||||
|
let list = that.data.flowNodes;
|
||||||
|
list.push({id:res.data[0].id,name:res.data[0].name});
|
||||||
|
that.setData({
|
||||||
|
flowNodes:list
|
||||||
|
})
|
||||||
|
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//保存
|
||||||
|
onSave(){
|
||||||
|
this.setData({
|
||||||
|
loadShow:true
|
||||||
|
})
|
||||||
|
let {procDefId,projectId,userId,loginName,remark,filesData} = this.data;
|
||||||
|
//数据效验
|
||||||
|
if(projectId==""||loginName==""||userId==""||procDefId==""){
|
||||||
|
app.toast("数据异常,请刷新页面重试!")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(remark==""){
|
||||||
|
app.toast("请填写申请说明!")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(filesData.length==0){
|
||||||
|
app.toast("请上传审批内容!")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for(let i=0;i<filesData.length;i++){
|
||||||
|
let _fileType = filesData[0].path.split('.');
|
||||||
|
_fileType = _fileType[_fileType.length-1].toLowerCase();
|
||||||
|
//判断附件类型,如果是图片直接展示,非图片则显示附件
|
||||||
|
if(this.data.fileType.indexOf(_fileType)==-1){
|
||||||
|
app.toast("申批内容不支持 [ "+_fileType+" ] 格式!请检查第"+(i+1)+"个附件")
|
||||||
|
this.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确定提交'+this.data.approveTitle+'?',
|
||||||
|
success: function (sm) {
|
||||||
|
if (sm.confirm) {
|
||||||
|
// 用户点击了确定 可以调用了
|
||||||
|
that.submit()
|
||||||
|
} else if (sm.cancel) {
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
});
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
submit(){
|
||||||
|
let that = this
|
||||||
|
let {procDefId,projectId,projectName,userId,loginName,nickName,remark,filesData} = that.data;
|
||||||
|
let fileUrls = [];
|
||||||
|
filesData.forEach(async (item)=>{
|
||||||
|
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
|
||||||
|
let name = "file"
|
||||||
|
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
||||||
|
let obj = await that.syncUploadImage(uploadUrl,item.path,name);
|
||||||
|
fileUrls.push(obj.data.fileName);
|
||||||
|
//验证图片上传完毕
|
||||||
|
if(fileUrls.length == filesData.length){
|
||||||
|
let params = {
|
||||||
|
procDefId,
|
||||||
|
userId,
|
||||||
|
userName:loginName,
|
||||||
|
nickName,
|
||||||
|
variables:{
|
||||||
|
businessKey:projectId,
|
||||||
|
projectName,
|
||||||
|
files:fileUrls.toString(),
|
||||||
|
remark,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/startProcessInstance',
|
||||||
|
method:"POST",
|
||||||
|
data:params,
|
||||||
|
header: {
|
||||||
|
"Username": loginName,
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
that.setData({
|
||||||
|
loadShow:false
|
||||||
|
})
|
||||||
|
res =res.data
|
||||||
|
if(res.code == 200){
|
||||||
|
app.toast("提交申请成功!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myProcessIns/index',
|
||||||
|
})
|
||||||
|
},200)
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这里考虑上传图片异步问题,封装为同步
|
||||||
|
*/
|
||||||
|
syncUploadImage(url,uploadFile,name) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
wx.uploadFile({
|
||||||
|
url, // 上传的服务器接口地址
|
||||||
|
filePath: uploadFile,
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
||||||
|
},
|
||||||
|
name, //上传的所需字段,后端提供
|
||||||
|
formData: { user: 'test' },
|
||||||
|
success: (res) => {
|
||||||
|
// 上传完成操作
|
||||||
|
const data = JSON.parse(res.data)
|
||||||
|
resolve({
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
//上传失败:修改pedding为reject
|
||||||
|
console.log("访问接口失败", err);
|
||||||
|
wx.showToast({
|
||||||
|
title: "网络出错,上传失败",
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//申请说明
|
||||||
|
remarkblur: function (options) {
|
||||||
|
this.data.remark = options.detail.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
fileUpload(options){
|
||||||
|
let file=options.detail;
|
||||||
|
this.setData({
|
||||||
|
filesData: file
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 手风琴
|
||||||
|
onChange(event) {
|
||||||
|
this.setData({
|
||||||
|
activeName: event.detail,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../myFlowDefinition/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index",
|
||||||
|
"van-collapse": "@vant/weapp/collapse",
|
||||||
|
"van-collapse-item": "@vant/weapp/collapse-item"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
<!--pageage/safetyManagement/addSafetyInspect/index.wxml-->
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<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;">
|
||||||
|
<van-collapse value="{{activeName}}" bind:change="onChange">
|
||||||
|
<van-collapse-item title="申请流程" name="1">
|
||||||
|
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
|
||||||
|
<text class="safety_issue_number">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起单位</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{deptName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">发起人</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{nickName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批事项</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
{{approveTitle}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list" style="width: 100%;">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">审批内容
|
||||||
|
<text style="font-size: small;">[可上传PDF/图片/WORD/PPT/XLS格式]</text>
|
||||||
|
</view>
|
||||||
|
<view class="problem_list_info_con">
|
||||||
|
<file-uploader-all bindfiles="fileUpload" limit="{{limit}}"></file-uploader-all>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_info_list">
|
||||||
|
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">申请说明</view>
|
||||||
|
<view class="inspect_info_content">
|
||||||
|
<textarea class="add_textarea" placeholder="请填写申请说明(500字内)"
|
||||||
|
placeholder-style="color:#6777aa;" maxlength="500" bindinput="remarkblur"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="problem_submit_to">
|
||||||
|
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
|
||||||
|
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onSave">提交申请</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<van-overlay show="{{loadShow}}">
|
||||||
|
<view class="gif">
|
||||||
|
<image src="../../../images/loding2.gif"></image>
|
||||||
|
<view>数据加载中!请稍后...</view>
|
||||||
|
</view>
|
||||||
|
</van-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
/* pageage/safetyManagement/addSafetyInspect/index.wxss */
|
||||||
|
.van-popup{
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
.van-image__img{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.radio_custom_class{
|
||||||
|
padding: 10rpx 100rpx 10rpx 0;
|
||||||
|
}
|
||||||
|
.radio_label_class{
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
.max_tab_name{
|
||||||
|
padding: 0 40rpx;
|
||||||
|
font-size:30rpx;
|
||||||
|
height: 460rpx;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.van-popup.van-popup--bottom{
|
||||||
|
background: #232a44;
|
||||||
|
}
|
||||||
|
.van-popup {
|
||||||
|
background-color: var(--popup-background-color,#232a44) !important;
|
||||||
|
}
|
||||||
|
.font_color{
|
||||||
|
padding: 15rpx 0;
|
||||||
|
color: #157dd2;
|
||||||
|
}
|
||||||
|
.active{
|
||||||
|
font-size:30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #14feff
|
||||||
|
}
|
||||||
|
.van-collapse.van-hairline--top-bottom:after{
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless{
|
||||||
|
background-color: #2b345b;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--borderless:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__title.van-collapse-item__title--expanded:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item .van-cell:after{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.van-collapse-item.van-hairline--top:after{
|
||||||
|
border-top-width:0
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable{
|
||||||
|
background-color: #2b345b;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.van-cell.van-cell--clickable:active{
|
||||||
|
background-color: #2b345b;
|
||||||
|
}
|
||||||
|
.van-collapse-item__wrapper .van-collapse-item__content{
|
||||||
|
background-color: #1e2336;
|
||||||
|
color:#8ca4ec ;
|
||||||
|
border-width: 0px 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,140 @@
|
||||||
|
// pageage/safetyManagement/securityCheckGR/index.js
|
||||||
|
const app = getApp()
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
deptId:"",
|
||||||
|
loginName:"",
|
||||||
|
projectId:"",
|
||||||
|
minRoleId:"",
|
||||||
|
projectData:{},
|
||||||
|
initData: {},
|
||||||
|
show:false,
|
||||||
|
listData:[],
|
||||||
|
request:app.globalData.reqUrl
|
||||||
|
},
|
||||||
|
|
||||||
|
addInfo(e){
|
||||||
|
let {id,name,deploymentId,flowKey} = e.currentTarget.dataset.set
|
||||||
|
if(flowKey=="flow_xmglzdl_qjspb"){
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../initLeaveTask/index?procDefId=${id}&approveTitle=${name}&deploymentId=${deploymentId}`,
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.redirectTo({
|
||||||
|
url: `../initTask/index?procDefId=${id}&approveTitle=${name}&deploymentId=${deploymentId}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
//获取缓存数据
|
||||||
|
wx.getStorage({
|
||||||
|
key: 'userinfo',
|
||||||
|
success:res=>{
|
||||||
|
this.setData({
|
||||||
|
loginName:res.data.loginName,
|
||||||
|
projectId:app.globalData.projectId,
|
||||||
|
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
|
||||||
|
})
|
||||||
|
this.getListData(res.data.loginName);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目举牌验收数据
|
||||||
|
*/
|
||||||
|
getListData(loginName) {
|
||||||
|
var that = this;
|
||||||
|
let param = {
|
||||||
|
"username": loginName
|
||||||
|
}
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.reqUrl + '/wechat/flowTask/myFlowDefinitionList',
|
||||||
|
data:param,
|
||||||
|
method: "get",
|
||||||
|
success: function (res) {
|
||||||
|
res = res.data;
|
||||||
|
if(res.code=="200" && res.data.records){
|
||||||
|
that.setData({
|
||||||
|
listData:res.data.records
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
app.toast(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
returnToPage: function () {
|
||||||
|
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../await/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//项目切换 返回值
|
||||||
|
onProjectSelect(e){
|
||||||
|
let projectId = e.detail.id;
|
||||||
|
let projectName = e.detail.text;
|
||||||
|
app.globalData.projectId = projectId;
|
||||||
|
app.globalData.projectName = projectName;
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-overlay": "@vant/weapp/overlay/index" ,
|
||||||
|
"van-popup": "@vant/weapp/popup/index"
|
||||||
|
},
|
||||||
|
"navigationStyle":"custom"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
<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>
|
||||||
|
<view class="max_content">
|
||||||
|
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
|
||||||
|
<view class="inspect_max">
|
||||||
|
<view class="inspect_list">
|
||||||
|
<view class="inspect_for" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" bindtap="addInfo">
|
||||||
|
<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">{{item.categoryName}}<text class="timeline_for_state_1">{{' v '+item.version}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="inspect_list_info">
|
||||||
|
<view class="inspect_list_info_details">
|
||||||
|
<view class="safety_issue_number color_blue">{{item.name}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{listData.length==0}}">
|
||||||
|
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||||
|
<image src="../../../images/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||||
|
<view style="color: #a5abbb;">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
/* pageage/project_checking_list/project_checking_list.wxss */
|
||||||
|
|
@ -35,34 +35,18 @@
|
||||||
</view>
|
</view>
|
||||||
</van-col>
|
</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
<!--<view class="left_manage_max">
|
|
||||||
<view class="left_manage_min">
|
|
||||||
<view class="left_manage">
|
|
||||||
<image src="/images/set.png" class="left_icon"></image>
|
|
||||||
<text class="left_pro">账号管理</text>
|
|
||||||
<image src="/images/right.png" class="left_flaot"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="left_manage_min">
|
|
||||||
<view class="left_manage">
|
|
||||||
<image src="/images/set.png" class="left_icon"></image>
|
|
||||||
<text class="left_pro">账号管理</text>
|
|
||||||
<image src="/images/right.png" class="left_flaot"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>-->
|
|
||||||
<view class="left_manage_min">
|
<view class="left_manage_min">
|
||||||
<view class="left_manage" bindtap="XGMM">
|
<view class="left_manage" bindtap="XGMM">
|
||||||
<view class="left_password">
|
<image src="/images/set.png" class="left_icon"></image>
|
||||||
修改密码
|
<text class="left_password">修改密码</text>
|
||||||
</view>
|
<image src="/images/right.png" class="left_flaot"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="left_manage_min">
|
<view class="left_manage_min">
|
||||||
<view class="left_manage" bindtap="TCDL">
|
<view class="left_manage" bindtap="TCDL">
|
||||||
<view class="left_sign">
|
<image src="/images/set.png" class="left_icon"></image>
|
||||||
退出登录
|
<text class="left_sign">退出登录</text>
|
||||||
</view>
|
<image src="/images/right.png" class="left_flaot"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -163,26 +147,6 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="echarts_max">
|
|
||||||
<view class="echarts_min">
|
|
||||||
<view class="eharts_title">机械设备</view>
|
|
||||||
<van-row>
|
|
||||||
<van-col span="12">
|
|
||||||
<view class="eharts_head">接入数:<text>{{machineryNum}}</text></view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="12">
|
|
||||||
<view class="eharts_head">正常运行数:<text>{{machineryOnline}}</text></view>
|
|
||||||
</van-col>
|
|
||||||
</van-row>
|
|
||||||
<view class="eharts_con">
|
|
||||||
<ec-canvas ec="{{ ec_2 }}" id="mychart-two"></ec-canvas>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue