jhwxapp/miniprogram/pageage/flow_labour/info/index.js

168 lines
3.5 KiB
JavaScript

import config from '../../../config'
import {
getInfo,
findMyFlowLabourNodes
} from "../../../api/flowLabour"
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id: "",
infoData: {
files: ""
},
activeName: "",
flowRecordList: [],
request: app.globalData.reqUrl,
flowNodes: [{
text: '提交投诉'
}, {
text: '项目经理'
}, {
text: '甲方代表'
}, {
text: '集团公司'
}],
active: 100,
rejectNode:0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {
id
} = options
this.setData({
id
})
this.getInfo();
this.getAuditinfo();
},
/**
* 获取劳资投诉详情信息
*
*/
getInfo() {
getInfo(this.data.id).then(res => {
if (res.code == 200) {
let active = this.data.active;
let rejectNode = this.data.rejectNode;
if(res.data.approveStatus=="10" || res.data.approveStatus=="21"){
active = 1;
if(res.data.approveStatus=="21"){
rejectNode = active+1;
}
}else if(res.data.approveStatus=="20" || res.data.approveStatus=="31"){
active = 2;
if(res.data.approveStatus=="31"){
rejectNode = active+1;
}
}else if(res.data.approveStatus=="30"){
active = 3;
}
this.setData({
active,
rejectNode,
infoData: res.data
})
}
});
},
/**
* 查询流程日志
*/
getAuditinfo() {
findMyFlowLabourNodes(this.data.id).then(res => {
if (res.code == 200) {
this.setData({
flowRecordList: res.data
})
}
});
},
// 手风琴
onChange(event) {
this.setData({
activeName: event.detail,
});
},
//展示图片
showImg: function (e) {
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(config.baseUrl+url);
});
console.log(paths,"xx1");
console.log(path);
wx.previewImage({
urls: path,
current: path[e.currentTarget.dataset.index]
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})