【bug】合同号点击加入不是合同签订企业联系人的限制

This commit is contained in:
fengachen
2021-10-25 16:08:33 +08:00
parent 83a5a8bf7e
commit 7e3cdb8113
+34 -3
View File
@@ -17,7 +17,11 @@ Page({
showProjectData:true, // 项目资料的显示隐藏 showProjectData:true, // 项目资料的显示隐藏
projectFileList: [], // 项目资料文件 projectFileList: [], // 项目资料文件
notifyFileList: [], // 通知文件 notifyFileList: [], // 通知文件
meetingList: [] // 会议文件 meetingList: [], // 会议文件
// 合同签订联系人的id
signedContactsId:{},
// 当前登录人的id
currentId:''
}, },
// 预览 // 预览
preview(e) { preview(e) {
@@ -46,11 +50,38 @@ Page({
}, },
// 跳转合同详情 // 跳转合同详情
contractDetail(){ contractDetail(){
const that = this
console.log(this.data.form) console.log(this.data.form)
if(this.data.form.contractId) { // 关联了合同才能去合同详情 if(this.data.form.contractId) { // 关联了合同才能去合同详情
wx.navigateTo({ UserApi.contractDetail({id:this.data.form.contractId}).then(res=>{
url: `../contractDetail/contractDetail?id=${this.data.form.contractId}`, console.log(res)
if(res.success){
this.setData({
signedContactsId: res.result.signedContactsId
})
wx.getStorage({
key:'userInfo',
success(res){
that.setData({
currentId:res.data.id
})
// 判断当前登录人是否是合同企业签订联系人
console.log('that.data.currentId === that.data.signedContactsId',that.data.currentId === that.data.signedContactsId);
if(that.data.currentId === that.data.signedContactsId){
wx.navigateTo({
url: `../contractDetail/contractDetail?id=${that.data.form.contractId}`,
})
}else{
wx.showToast({
title: '当前登录人不是合同签订企业联系人',
icon: 'none'
})
}
}
})
}
}) })
//
}else{ }else{
wx.showToast({ wx.showToast({
title: '未关联合同', title: '未关联合同',