From 34ef6dd8f986cdab45b18ae43c29e16bbdb78da1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?=
<7507756+jiang_yuqi@user.noreply.gitee.com>
Date: Mon, 25 Mar 2024 01:40:33 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
miniprogram/api/projectFiles.js | 19 +
miniprogram/app.js | 8 +-
miniprogram/app.json | 3 +-
miniprogram/config.js | 2 +-
miniprogram/pageage/project_files/index.js | 222 +++++
miniprogram/pageage/project_files/index.json | 7 +
miniprogram/pageage/project_files/index.wxml | 65 ++
miniprogram/pageage/project_files/index.wxss | 6 +
miniprogram/pages/login/index.wxss | 6 +-
.../project_flowable/detailTask/index.js | 762 +++++++++---------
.../pages/project_flowable/initTask/index.js | 19 +-
.../project_flowable/initTask/index.json | 1 +
.../project_flowable/initTask/index.wxml | 10 +-
.../project_flowable/initTask/index.wxss | 9 +
14 files changed, 757 insertions(+), 382 deletions(-)
create mode 100644 miniprogram/api/projectFiles.js
create mode 100644 miniprogram/pageage/project_files/index.js
create mode 100644 miniprogram/pageage/project_files/index.json
create mode 100644 miniprogram/pageage/project_files/index.wxml
create mode 100644 miniprogram/pageage/project_files/index.wxss
diff --git a/miniprogram/api/projectFiles.js b/miniprogram/api/projectFiles.js
new file mode 100644
index 0000000..f140c10
--- /dev/null
+++ b/miniprogram/api/projectFiles.js
@@ -0,0 +1,19 @@
+import {request} from '../utils/request'
+
+// 项目文件传达列表
+export function fileList(data){
+ return request({
+ url: '/wechat/projectFiles/list',
+ method: 'get',
+ data: data
+ })
+}
+
+// 根据条件统计项目文件传达
+export function findCountByType(data){
+ return request({
+ url: '/wechat/projectFiles/findCountByType',
+ method: 'get',
+ data: data
+ })
+}
\ No newline at end of file
diff --git a/miniprogram/app.js b/miniprogram/app.js
index c803550..67d968f 100644
--- a/miniprogram/app.js
+++ b/miniprogram/app.js
@@ -29,10 +29,10 @@ App({
userProjectId:'',
appId: "wx9997d071b4996f23",
// 智慧工地后台接口访问域名
- reqUrl:'https://szgcwx.jhncidg.com',
- //reqUrl:'http://127.0.0.1:8091',
- uploadUrl:"https://szgcwx.jhncidg.com/wechat",
- //uploadUrl:'http://127.0.0.1:8091/wechat',
+ //reqUrl:'https://szgcwx.jhncidg.com',
+ reqUrl:'http://127.0.0.1:8091',
+ //uploadUrl:"https://szgcwx.jhncidg.com/wechat",
+ uploadUrl:'http://127.0.0.1:8091/wechat',
//御景路数字化集成管控平台接口访问域名
szhUrl:'https://szh.makalu.cc',
diff --git a/miniprogram/app.json b/miniprogram/app.json
index a4c9154..8e7c1fa 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -107,7 +107,8 @@
"project_deptWorks/list/index",
"project_standard/list/index",
"project_standard/add/index",
- "project_standard/info/index"
+ "project_standard/info/index",
+ "project_files/index"
],
"independent": false
}
diff --git a/miniprogram/config.js b/miniprogram/config.js
index 371fe15..a5cb815 100644
--- a/miniprogram/config.js
+++ b/miniprogram/config.js
@@ -3,6 +3,6 @@ module.exports = {
timeout: 60000,
appId: "wx9997d071b4996f23",
baseUrl: 'https://szgcwx.jhncidg.com',
- //baseUrl: 'http://127.0.0.1:8091',
+ baseUrl: 'http://127.0.0.1:8091',
noSecuritys:['/wechat/captchaImage','/wxApi/login']
};
\ No newline at end of file
diff --git a/miniprogram/pageage/project_files/index.js b/miniprogram/pageage/project_files/index.js
new file mode 100644
index 0000000..a3263b2
--- /dev/null
+++ b/miniprogram/pageage/project_files/index.js
@@ -0,0 +1,222 @@
+import {
+ fileList,
+ findCountByType,
+} from '../../api/projectFiles'
+
+const app = getApp();
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ initData: {},
+ listData: [],
+ qbCount: 0,
+ sjbmCount: 0,
+ jtgsCount: 0,
+ zgsCount: 0,
+ activeState: "1",
+ pageNum: 1,
+ pageSize: 10,
+ lastDataSize: 10,
+ list: [],
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.setData({
+ initData: {
+ text: app.globalData.projectName,
+ id: app.globalData.projectId
+ },
+ pageNum: 1,
+ pageSize: 10,
+ lastDataSize: 10,
+ listData: []
+ })
+ this.getListData();
+ },
+
+ /**
+ * 查询文件列表
+ */
+ getListData() {
+ //进入这里说明数据加载完毕
+ if (this.data.lastDataSize < this.data.pageSize) {
+ //app.toast("已经到底了,暂无可继续加载数据!")
+ return;
+ }
+ let that = this;
+ this.queryCount();
+ fileList({
+ fileBelong: this.data.activeState,
+ pageNum: this.data.pageNum,
+ pageSize: this.data.pageSize
+ }).then(res => {
+ //这里处理this.data.lastDataSize=this.data.pageSize
+ if (that.data.list.length > 0 && res.rows.length > 0 && that.data.list[0].id == res.rows[0].id) {
+ that.setData({
+ lastDataSize: 0,
+ })
+ } else {
+ that.setData({
+ pageNum: that.data.pageNum + 1,
+ lastDataSize: res.rows.length,
+ list: res.rows,
+ listData: that.data.listData.concat(res.rows)
+ })
+ }
+ });
+ },
+
+ /**
+ * 统计文件传达
+ */
+ queryCount() {
+ let that = this;
+ findCountByType({}).then(res => {
+ if (res.data.length > 0) {
+ let sjbm = 0,
+ jtgs = 0,
+ zgs = 0;
+ res.data.forEach(item => {
+ if (item.fileBelong == "1") {
+ sjbm += item.total;
+ } else if (item.fileBelong == "2") {
+ jtgs += item.total;
+ } else {
+ zgs += item.total;
+ }
+ });
+ that.setData({
+ sjbmCount: sjbm,
+ jtgsCount: jtgs,
+ zgsCount: zgs
+ })
+ }
+ });
+ },
+
+ /**
+ * 加载新数据
+ */
+ onScrollToLower() {
+ console.log("滚动条到底了,开始加载新数据");
+ this.getListData();
+ },
+
+ /**
+ * 下载并打开文档
+ * @param {*} e
+ */
+ openFile: function (e) {
+ let {
+ filePath
+ } = e.currentTarget.dataset.set
+ wx.downloadFile({
+ // 示例 url,并非真实存在
+ url: app.globalData.uploadUrl + '/common/download/resource?resource=' + filePath,
+ success: function (res) {
+ const _path = res.tempFilePath
+ let fpt = _path.split(".");
+ wx.openDocument({
+ filePath: _path,
+ fileType: fpt[fpt.length - 1],
+ success: function (res) {
+ console.log('打开文档成功')
+ },
+ fail: function (res) {
+ console.log(res)
+ }
+ })
+ }
+ })
+ //app.toast("暂不支持下载!如需下载请前往后台管理系统!!")
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ },
+ /**
+ * 标签切换
+ */
+ trainingTypeJump(e) {
+ let index = e.currentTarget.dataset.index;
+ this.setData({
+ activeState: index + '',
+ pageNum: 1,
+ pageSize: 10,
+ lastDataSize: 10,
+ list: [],
+ listData: [],
+ });
+
+ this.getListData();
+ },
+
+ /**
+ * 项目切换
+ * @param {*} e
+ */
+ onProjectSelect(e) {
+ let projectId = e.detail.id;
+ let projectName = e.detail.text;
+ app.globalData.projectId = projectId;
+ app.globalData.projectName = projectName;
+ this.onLoad();
+ },
+
+ returnToPage: function () {
+ wx.redirectTo({
+ url: '../../pages/safety_manage/index',
+ })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/pageage/project_files/index.json b/miniprogram/pageage/project_files/index.json
new file mode 100644
index 0000000..e01f582
--- /dev/null
+++ b/miniprogram/pageage/project_files/index.json
@@ -0,0 +1,7 @@
+{
+ "usingComponents": {
+ "van-row": "@vant/weapp/row",
+ "van-col": "@vant/weapp/col"
+ },
+ "navigationStyle":"custom"
+}
\ No newline at end of file
diff --git a/miniprogram/pageage/project_files/index.wxml b/miniprogram/pageage/project_files/index.wxml
new file mode 100644
index 0000000..04d342e
--- /dev/null
+++ b/miniprogram/pageage/project_files/index.wxml
@@ -0,0 +1,65 @@
+
+
+
+
+ 上级部门({{sjbmCount}})
+ 集团公司({{jtgsCount}})
+ 子公司({{zgsCount}})
+
+
+
+
+
+
+
+ {{index < 9 ?'0'+(index+1):(index+1)}}
+ 上级部门
+ 集团公司
+ 子公司
+
+
+
+
+
+
+
+
+
+
+ {{item.fileName}}
+
+
+
+ {{item.createTime}}
+
+
+ {{item.readNum}}
+
+
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pageage/project_files/index.wxss b/miniprogram/pageage/project_files/index.wxss
new file mode 100644
index 0000000..62fb9a2
--- /dev/null
+++ b/miniprogram/pageage/project_files/index.wxss
@@ -0,0 +1,6 @@
+.module_see_info_ear {
+ color: #00a3ff;
+ }
+.ss{
+ top: 1rpx;
+}
\ No newline at end of file
diff --git a/miniprogram/pages/login/index.wxss b/miniprogram/pages/login/index.wxss
index 48cb214..be748d3 100644
--- a/miniprogram/pages/login/index.wxss
+++ b/miniprogram/pages/login/index.wxss
@@ -56,12 +56,12 @@ page{
}
.login_logo{
width: 100%;
- height:80rpx;
- margin-top: 100rpx;
+ height:100rpx;
text-align: center;
}
.login_logo image{
- height: 65rpx;
+ height: 70rpx;
+ margin-top: 30rpx;
}
.login_input .pass {
diff --git a/miniprogram/pages/project_flowable/detailTask/index.js b/miniprogram/pages/project_flowable/detailTask/index.js
index 14ace72..7d949be 100644
--- a/miniprogram/pages/project_flowable/detailTask/index.js
+++ b/miniprogram/pages/project_flowable/detailTask/index.js
@@ -6,92 +6,116 @@ Page({
* 页面的初始数据
*/
data: {
- maxDate:new Date(2088,1,1).getTime(),
- deptName:"",
- userId:"",
- myUserId:"",
- nickName:"",
- loginName:"",
- projectId:"",
- projectName:"",
- procInsId:"",
- infoData:{},
- procDefName:"",
- deployId:"",
- activeName:"",
- flowNodeList:[],
- flowNodes:[],
- imageList:[],
- filesData:[],
- taskId:"",
- procInsId:"",
- taskName:"",
- passState:true,
- backName:"",
- stopShow:false,
- deleteShow:false,
- revocationShow:false,
- finishTime:"",
- ret:"",
- comment:"",
- stopBtnShow:false,
- imageType:["png","jpg","jpeg"],
- fileType:["pdf"],
+ maxDate: new Date(2088, 1, 1).getTime(),
+ deptName: "",
+ userId: "",
+ myUserId: "",
+ nickName: "",
+ loginName: "",
+ projectId: "",
+ projectName: "",
+ procInsId: "",
+ infoData: {},
+ procDefName: "",
+ deployId: "",
+ activeName: "",
+ flowNodeList: [],
+ flowNodes: [],
+ imageList: [],
+ filesData: [],
+ taskId: "",
+ procInsId: "",
+ taskName: "",
+ passState: true,
+ backName: "",
+ stopShow: false,
+ deleteShow: false,
+ revocationShow: false,
+ finishTime: "",
+ ret: "",
+ comment: "",
+ stopBtnShow: false,
+ imageType: ["png", "jpg", "jpeg"],
+ fileType: ["pdf"],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
- let {deployId,procInsId,procDefName,deptName,nickName,taskId,taskName,projectName,userId,finishTime,ret} = options
+ let {
+ deployId,
+ procInsId,
+ procDefName,
+ deptName,
+ nickName,
+ taskId,
+ taskName,
+ projectName,
+ userId,
+ finishTime,
+ ret
+ } = options
//获取缓存数据
wx.getStorage({
- key: 'userinfo',
- success:res=>{
- this.setData({
- projectId:app.globalData.projectId,
- projectName,
- procInsId,
- procDefName,
- deployId,
- deptName,
- nickName,
- taskId,
- taskName,
- userId,
- finishTime,
- ret,
- myUserId:res.data.userId,
- loginName:res.data.loginName,
- })
- this.getFlowNodes();
- this.getFlowRecordList();
- this.getFormDatasList();
- }
- })
+ key: 'userinfo',
+ success: res => {
+ this.setData({
+ projectId: app.globalData.projectId,
+ projectName,
+ procInsId,
+ procDefName,
+ deployId,
+ deptName,
+ nickName,
+ taskId,
+ taskName,
+ userId,
+ finishTime,
+ ret,
+ myUserId: res.data.userId,
+ loginName: res.data.loginName,
+ })
+ this.getFlowNodes();
+ this.getFlowRecordList();
+ this.getFormDatasList();
+ }
+ })
},
- getFlowNode(val){
+ getFlowNode(val) {
let flowNodeList = this.data.flowNodeList;
- for(let i=0;i0){
+ if (flowNodeList[i].outgoingFlows && flowNodeList[i].outgoingFlows.length > 0) {
return this.getFlowNode(flowNodeList[i].outgoingFlows[0].targetRef);
}
}
@@ -99,30 +123,34 @@ Page({
},
//查询工作流节点
- getFlowNodes(){
+ getFlowNodes() {
let that = this;
wx.request({
- url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/'+that.data.deployId,
- method:"get",
- data:{},
+ url: app.globalData.reqUrl + '/wechat/flowTask/readNotes/' + that.data.deployId,
+ method: "get",
+ data: {},
header: {
"Content-Type": "application/json"
},
- success(res){
+ success(res) {
res = res.data
- if(res.code == 200){
+ if (res.code == 200) {
that.setData({
- flowNodeList:res.data
+ flowNodeList: res.data
})
- if(res.data.length>0){
+ if (res.data.length > 0) {
let list = that.data.flowNodes;
- list.push({id:res.data[0].id,name:res.data[0].name,state:'pass'});
+ list.push({
+ id: res.data[0].id,
+ name: res.data[0].name,
+ state: 'pass'
+ });
that.setData({
- flowNodes:list
+ flowNodes: list
})
return that.getFlowNode(res.data[0].outgoingFlows[0].targetRef);
}
- }else{
+ } else {
app.toast(res.msg);
}
}
@@ -130,37 +158,37 @@ Page({
},
//查询审批日志
- getFlowRecordList(){
+ getFlowRecordList() {
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/findCommentByProcInsId',
- method:"get",
- data:{
- procInsId:this.data.procInsId
+ method: "get",
+ data: {
+ procInsId: this.data.procInsId
},
header: {
"Content-Type": "application/json"
},
- success(res){
+ success(res) {
res = res.data
- if(res.code == 200){
+ if (res.code == 200) {
that.setData({
- flowRecordList:res.data
+ flowRecordList: res.data
})
- let list=[];
- res.data.forEach(item=>{
- if(item.deleteReason){
- item.deleteReason=that.getDeleteReason(item.deleteReason);
+ let list = [];
+ res.data.forEach(item => {
+ if (item.deleteReason) {
+ item.deleteReason = that.getDeleteReason(item.deleteReason);
}
- if(item.duration){
- item.duration=that.getDurationDate(item.duration);
+ if (item.duration) {
+ item.duration = that.getDurationDate(item.duration);
}
list.push(item);
})
that.setData({
- flowRecordList:list
+ flowRecordList: list
})
- }else{
+ } else {
app.toast(res.msg);
}
}
@@ -168,353 +196,363 @@ Page({
},
//查询审批表单参数
- getFormDatasList(){
+ getFormDatasList() {
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/findFormDatasByProcInsId',
- method:"get",
- data:{
- procInsId:this.data.procInsId
+ method: "get",
+ data: {
+ procInsId: this.data.procInsId
},
header: {
"Content-Type": "application/json"
},
- success(res){
+ success(res) {
res = res.data
- if(res.code == 200){
+ if (res.code == 200) {
that.setData({
- infoData:res.data
+ infoData: res.data
})
let filesData = [];
let imageList = [];
//判断附件
- if(res.data.files){
- res.data.files.split(',').forEach(element => {
- let ft = element.split('.');
- if(that.data.imageType.indexOf(ft[ft.length-1].toLowerCase())>-1){
- imageList.push({minPath:config.baseUrl+element,path:element});
- }else{
- let it = element.split('/');
- filesData.push({name:it[it.length-1],path:element});
- }
- });
+ if (res.data.files) {
+ res.data.files.split(',').forEach(element => {
+ let ft = element.split('.');
+ if (that.data.imageType.indexOf(ft[ft.length - 1].toLowerCase()) > -1) {
+ imageList.push({
+ minPath: config.baseUrl + element,
+ path: element
+ });
+ } else {
+ let it = element.split('/');
+ filesData.push({
+ name: it[it.length - 1],
+ path: element
+ });
+ }
+ });
}
that.setData({
filesData,
imageList,
- stopShow:!that.data.finishTime && that.data.userId==that.myUserId,
- deleteShow:!that.data.finishTime && that.data.userId==that.myUserId,
- revocationShow:!that.data.finishTime
+ stopShow: !that.data.finishTime && that.data.userId == that.myUserId,
+ deleteShow: !that.data.finishTime && that.data.userId == that.myUserId,
+ revocationShow: !that.data.finishTime
})
- }else{
+ } else {
app.toast(res.msg);
}
}
})
},
- //退回
- onStop(){
- if(!this.data.stopBtnShow){
- app.toast("请填写终止原因!")
- this.setData({
- stopBtnShow:true
- })
- return;
- }else{
- if(this.data.comment==""){
+ //退回
+ onStop() {
+ if (!this.data.stopBtnShow) {
app.toast("请填写终止原因!")
this.setData({
- stopBtnShow:true
+ stopBtnShow: true
})
return;
- }
- }
- this.setData({
- loadShow:true
- })
- let that = this
- let params = {
- instanceId:this.data.procInsId,
- comment:this.data.comment,
- userId:this.data.myUserId,
- taskId:this.data.taskId
- }
- //弹出确认
- wx.showModal({
- title: '提示',
- content: '是否终止当前流程申请?',
- success: function (sm) {
- if (sm.confirm) {
- wx.request({
- url: app.globalData.reqUrl + '/wechat/flowTask/stopProcess',
- method:"POST",
- data:params,
- header: {
- "Username": that.data.loginName,
- "Content-Type": "application/json"
- },
- success(res){
- that.setData({
- loadShow:false
- })
- res = res.data
- if(res.code == 200){
- app.toast("终止流程申请成功!")
- if(that.data.ret=="finished"){
- setTimeout(()=>{
- wx.redirectTo({
- url: '../finished/index',
- })
- },200)
- }else{
- setTimeout(()=>{
- wx.redirectTo({
- url: '../myProcessIns/index',
- })
- },200)
- }
- }else{
- app.toast(res.msg);
- }
- }
- })
- } else if (sm.cancel) {
- that.setData({
- loadShow:false
- })
- console.log('用户点击取消');
+ } else {
+ if (this.data.comment == "") {
+ app.toast("请填写终止原因!")
+ this.setData({
+ stopBtnShow: true
+ })
+ return;
}
}
- })
+ this.setData({
+ loadShow: true
+ })
+ let that = this
+ let params = {
+ instanceId: this.data.procInsId,
+ comment: this.data.comment,
+ userId: this.data.myUserId,
+ taskId: this.data.taskId
+ }
+ //弹出确认
+ wx.showModal({
+ title: '提示',
+ content: '是否终止当前流程申请?',
+ success: function (sm) {
+ if (sm.confirm) {
+ wx.request({
+ url: app.globalData.reqUrl + '/wechat/flowTask/stopProcess',
+ method: "POST",
+ data: params,
+ header: {
+ "Username": that.data.loginName,
+ "Content-Type": "application/json"
+ },
+ success(res) {
+ that.setData({
+ loadShow: false
+ })
+ res = res.data
+ if (res.code == 200) {
+ app.toast("终止流程申请成功!")
+ if (that.data.ret == "finished") {
+ setTimeout(() => {
+ wx.redirectTo({
+ url: '../finished/index',
+ })
+ }, 200)
+ } else {
+ setTimeout(() => {
+ wx.redirectTo({
+ url: '../myProcessIns/index',
+ })
+ }, 200)
+ }
+ } else {
+ app.toast(res.msg);
+ }
+ }
+ })
+ } else if (sm.cancel) {
+ that.setData({
+ loadShow: false
+ })
+ console.log('用户点击取消');
+ }
+ }
+ })
},
//通过
- onDelete(){
- this.setData({
- loadShow:true
- })
- let that = this
- //弹出确认
- wx.showModal({
- title: '提示',
- content: '是否确认删除流程申请?',
- success: function (sm) {
- if (sm.confirm) {
- wx.request({
- url: app.globalData.reqUrl + '/wechat/flowTask/delete/'+that.data.procInsId,
- method:"delete",
- data:{},
- header: {
- "Username": that.data.loginName,
- "Content-Type": "application/json"
- },
- success(res){
- that.setData({
- loadShow:false
- })
- res = res.data
- if(res.code == 200){
- app.toast("删除流程申请成功!")
- if(that.data.ret=="finished"){
- setTimeout(()=>{
- wx.redirectTo({
- url: '../finished/index',
- })
- },200)
- }else{
- setTimeout(()=>{
- wx.redirectTo({
- url: '../myProcessIns/index',
- })
- },200)
+ onDelete() {
+ this.setData({
+ loadShow: true
+ })
+ let that = this
+ //弹出确认
+ wx.showModal({
+ title: '提示',
+ content: '是否确认删除流程申请?',
+ success: function (sm) {
+ if (sm.confirm) {
+ wx.request({
+ url: app.globalData.reqUrl + '/wechat/flowTask/delete/' + that.data.procInsId,
+ method: "delete",
+ data: {},
+ header: {
+ "Username": that.data.loginName,
+ "Content-Type": "application/json"
+ },
+ success(res) {
+ that.setData({
+ loadShow: false
+ })
+ res = res.data
+ if (res.code == 200) {
+ app.toast("删除流程申请成功!")
+ if (that.data.ret == "finished") {
+ setTimeout(() => {
+ wx.redirectTo({
+ url: '../finished/index',
+ })
+ }, 200)
+ } else {
+ setTimeout(() => {
+ wx.redirectTo({
+ url: '../myProcessIns/index',
+ })
+ }, 200)
+ }
+ } else {
+ app.toast(res.msg);
+ }
}
- }else{
- app.toast(res.msg);
- }
+ })
+ } else if (sm.cancel) {
+ that.setData({
+ loadShow: false
+ })
+ console.log('用户点击取消');
}
- })
- } else if (sm.cancel) {
- that.setData({
- loadShow:false
- })
- console.log('用户点击取消');
}
- }
- })
+ })
},
//撤回
- onRevocation(){
+ onRevocation() {
this.setData({
- loadShow:true
+ loadShow: true
})
let that = this
let params = {
procInsId: this.data.procInsId,
instanceId: this.data.procInsId,
- taskId:this.data.taskId,
- userId:this.data.myUserId,
- assignee:this.data.nickName
+ taskId: this.data.taskId,
+ userId: this.data.myUserId,
+ assignee: this.data.nickName
}
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认撤回当前任务流程?',
success: function (sm) {
- if (sm.confirm) {
- wx.request({
- url: app.globalData.reqUrl + '/wechat/flowTask/revokeProcess',
- method:"POST",
- data:params,
- header: {
- "Username": that.data.loginName,
- "Content-Type": "application/json"
- },
- success(res){
- that.setData({
- loadShow:false
- })
- res =res.data
- if(res.code == 200){
- app.toast("撤回流程申请成功!")
- if(that.data.ret=="finished"){
- setTimeout(()=>{
- wx.redirectTo({
- url: '../finished/index',
- })
- },200)
- }else{
- setTimeout(()=>{
- wx.redirectTo({
- url: '../myProcessIns/index',
- })
- },200)
+ if (sm.confirm) {
+ wx.request({
+ url: app.globalData.reqUrl + '/wechat/flowTask/revokeProcess',
+ method: "POST",
+ data: params,
+ header: {
+ "Username": that.data.loginName,
+ "Content-Type": "application/json"
+ },
+ success(res) {
+ that.setData({
+ loadShow: false
+ })
+ res = res.data
+ if (res.code == 200) {
+ app.toast("撤回流程申请成功!")
+ if (that.data.ret == "finished") {
+ setTimeout(() => {
+ wx.redirectTo({
+ url: '../finished/index',
+ })
+ }, 200)
+ } else {
+ setTimeout(() => {
+ wx.redirectTo({
+ url: '../myProcessIns/index',
+ })
+ }, 200)
+ }
+ } else {
+ app.toast(res.msg);
}
- }else{
- app.toast(res.msg);
}
- }
- })
+ })
} else if (sm.cancel) {
that.setData({
- loadShow:false
- })
- console.log('用户点击取消');
+ loadShow: false
+ })
+ console.log('用户点击取消');
}
}
})
- },
+ },
- // 手风琴
- onChange(event) {
- this.setData({
- activeName: event.detail,
- });
- },
+ // 手风琴
+ onChange(event) {
+ this.setData({
+ activeName: event.detail,
+ });
+ },
- getDeleteReason(val){
- val = val.replace("Change activity to ","");
- let flowRecordList = this.data.flowRecordList;
- for(let i=0;i0){
- if(days<10) days = "0"+days;
- if(hours<10) hours = "0"+hours;
- if(minutes<10) minutes = "0"+minutes;
- if(seconds<10) seconds = "0"+seconds;
- return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒';
- }
- if(hours>0){
- if(hours<10) hours = "0"+hours;
- if(minutes<10) minutes = "0"+minutes;
- if(seconds<10) seconds = "0"+seconds;
- return hours + '小时' + minutes + '分钟' + seconds + '秒';
- }
- if(minutes>0){
- if(minutes<10) minutes = "0"+minutes;
- if(seconds<10) seconds = "0"+seconds;
- return minutes + '分钟' + seconds + '秒';
- }
- if(seconds>0){
- if(seconds<10) seconds = "0"+seconds;
- return seconds + '秒';
- }
- },
+ getDurationDate(val) {
+ // 计算出相差天数
+ let days = Math.floor(val / (24 * 3600 * 1000))
+ // 计算出小时数
+ let leave1 = val % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数
+ let hours = Math.floor(leave1 / (3600 * 1000))
+ // 计算相差分钟数
+ let leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数
+ let minutes = Math.floor(leave2 / (60 * 1000))
+ // 计算相差秒数
+ let leave3 = leave2 % (60 * 1000) // 计算分钟数后剩余的毫秒数
+ let seconds = Math.round(leave3 / 1000)
+ if (days > 0) {
+ if (days < 10) days = "0" + days;
+ if (hours < 10) hours = "0" + hours;
+ if (minutes < 10) minutes = "0" + minutes;
+ if (seconds < 10) seconds = "0" + seconds;
+ return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒';
+ }
+ if (hours > 0) {
+ if (hours < 10) hours = "0" + hours;
+ if (minutes < 10) minutes = "0" + minutes;
+ if (seconds < 10) seconds = "0" + seconds;
+ return hours + '小时' + minutes + '分钟' + seconds + '秒';
+ }
+ if (minutes > 0) {
+ if (minutes < 10) minutes = "0" + minutes;
+ if (seconds < 10) seconds = "0" + seconds;
+ return minutes + '分钟' + seconds + '秒';
+ }
+ if (seconds > 0) {
+ if (seconds < 10) seconds = "0" + seconds;
+ return seconds + '秒';
+ }
+ },
//选择退回节点
- onSelectTargetKey(e){
+ onSelectTargetKey(e) {
this.setData({
- targetKey:e.detail.id,
- backName:e.detail.name
+ targetKey: e.detail.id,
+ backName: e.detail.name
})
},
-
+
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
- if(this.data.ret=="finished"){
+ if (this.data.ret == "finished") {
wx.redirectTo({
url: '../finished/index',
})
- }else{
+ } else {
wx.redirectTo({
url: '../myProcessIns/index',
})
}
},
- //展示图片详细
- showImg:function(e){
- let {path} = e.currentTarget.dataset.set
- wx.previewImage({
- urls: this.data.imageList,
- current: path
- })
- },
+ //展示图片详细
+ showImg: function (e) {
+ let {
+ path
+ } = e.currentTarget.dataset.set
+ wx.previewImage({
+ urls: this.data.imageList,
+ current: path
+ })
+ },
- /**
- * 下载并打开文档
- * @param {*} e
- */
- downFile:function(e){
- let {path} = e.currentTarget.dataset.set
+ /**
+ * 下载并打开文档
+ * @param {*} e
+ */
+ downFile: function (e) {
+ let {
+ path
+ } = e.currentTarget.dataset.set
wx.downloadFile({
- // 示例 url,并非真实存在
- url: app.globalData.uploadUrl+'/common/download/resource?resource='+path,
- success: function (res) {
- const filePath = res.tempFilePath
- let fpt = filePath.split(".");
- wx.openDocument({
- filePath: filePath,
- fileType: fpt[fpt.length-1],
- success: function (res) {
- console.log('打开文档成功')
- },
- fail:function(res) {
- console.log(res)
- }
- })
- }
- })
- //app.toast("暂不支持下载!如需下载请前往后台管理系统!!")
- },
+ // 示例 url,并非真实存在
+ url: app.globalData.uploadUrl + '/common/download/resource?resource=' + path,
+ success: function (res) {
+ const filePath = res.tempFilePath
+ let fpt = filePath.split(".");
+ wx.openDocument({
+ filePath: filePath,
+ fileType: fpt[fpt.length - 1],
+ success: function (res) {
+ console.log('打开文档成功')
+ },
+ fail: function (res) {
+ console.log(res)
+ }
+ })
+ }
+ })
+ //app.toast("暂不支持下载!如需下载请前往后台管理系统!!")
+ },
//终止原因
commentblur: function (options) {
diff --git a/miniprogram/pages/project_flowable/initTask/index.js b/miniprogram/pages/project_flowable/initTask/index.js
index 6838bf4..473208c 100644
--- a/miniprogram/pages/project_flowable/initTask/index.js
+++ b/miniprogram/pages/project_flowable/initTask/index.js
@@ -25,7 +25,8 @@ Page({
flowNodeList: [],
flowNodes: [],
isFiles: false,
- imageInfoData:[],
+ imageInfoData: [],
+ active: "",
},
/**
@@ -73,7 +74,8 @@ Page({
let list = this.data.flowNodes;
list.push({
id: flowNodeList[i].id,
- name: flowNodeList[i].name
+ name: flowNodeList[i].name,
+ text: flowNodeList[i].name.length > 4 ? flowNodeList[i].name.substring(0, 4) : flowNodeList[i].name
});
this.setData({
flowNodes: list
@@ -105,7 +107,8 @@ Page({
let list = that.data.flowNodes;
list.push({
id: res.data[0].id,
- name: res.data[0].name
+ name: res.data[0].name,
+ text: res.data[0].name
});
that.setData({
flowNodes: list
@@ -199,7 +202,7 @@ Page({
imageInfoData
} = that.data;
let fileUrls = [];
- filesData.forEach( f =>{
+ filesData.forEach(f => {
imageInfoData.push(f.path);
});
imageInfoData.forEach(async (item) => {
@@ -327,13 +330,13 @@ Page({
this.setData({
isFiles: !this.data.isFiles,
});
- if(this.data.isFiles){
- if(this.data.filesData.length==0){
+ if (this.data.isFiles) {
+ if (this.data.filesData.length == 0) {
let myImages = this.selectComponent("#myImage");
myImages.upload();
}
- }else{
- if(this.data.imageInfoData.length==0){
+ } else {
+ if (this.data.imageInfoData.length == 0) {
let myFiles = this.selectComponent("#myFiles");
myFiles.upload();
}
diff --git a/miniprogram/pages/project_flowable/initTask/index.json b/miniprogram/pages/project_flowable/initTask/index.json
index 5c42e53..804b5fd 100644
--- a/miniprogram/pages/project_flowable/initTask/index.json
+++ b/miniprogram/pages/project_flowable/initTask/index.json
@@ -2,6 +2,7 @@
"usingComponents": {
"van-overlay": "@vant/weapp/overlay/index",
"van-collapse": "@vant/weapp/collapse",
+ "van-steps": "@vant/weapp/steps/index",
"van-collapse-item": "@vant/weapp/collapse-item"
},
"navigationStyle":"custom"
diff --git a/miniprogram/pages/project_flowable/initTask/index.wxml b/miniprogram/pages/project_flowable/initTask/index.wxml
index 2cb157f..50f525b 100644
--- a/miniprogram/pages/project_flowable/initTask/index.wxml
+++ b/miniprogram/pages/project_flowable/initTask/index.wxml
@@ -14,11 +14,12 @@
+
{{projectName}}
-
+
发起单位
@@ -66,8 +67,11 @@
+
+ 新版本默认上传图片,PDF文件从上方右侧切换上传。
+
- 已同时选择PDF文件和图片,将上传已选择的文件和图片。
+ 已同时选择PDF文件和图片,将上传已选择的文件和图片。
申请说明
diff --git a/miniprogram/pages/project_flowable/initTask/index.wxss b/miniprogram/pages/project_flowable/initTask/index.wxss
index 7ac05d2..42b488b 100644
--- a/miniprogram/pages/project_flowable/initTask/index.wxss
+++ b/miniprogram/pages/project_flowable/initTask/index.wxss
@@ -69,4 +69,13 @@
background-color: #1e2336;
color:#8ca4ec ;
border-width: 0px 0;
+ }
+ .van-steps{
+ background-color: transparent !important;
+ }
+ .van-step--horizontal .van-step__circle-container{
+ background-color: transparent !important;
+ }
+ .van-steps--horizontal{
+ padding: 10px 20px !important;
}
\ No newline at end of file