|
@@ -153,21 +153,13 @@
|
|
|
</view>
|
|
|
<!-- 上传回签附件 -->
|
|
|
<view class="fix-bottom-wrap btns-wrap flex" v-if="opt.UploadFile">
|
|
|
- <button class="pass-btn" style="width: 450rpx;" @click="handleUploadMethod('file')">{{detail.Status==='已审批'?'上传回签附件':'更新回签附件'}}</button>
|
|
|
+ <button class="pass-btn" style="width: 450rpx;" @click="handleUploadCheckFile">{{detail.Status==='已审批'?'上传回签附件':'更新回签附件'}}</button>
|
|
|
</view>
|
|
|
<!-- 作废合同 -->
|
|
|
<!-- <view class="fix-bottom-wrap btns-wrap flex" v-if="opt.Invalid">
|
|
|
<button class="refuse-btn" style="width: 450rpx;" >作废合同</button>
|
|
|
</view> -->
|
|
|
|
|
|
- <!-- 上传回签附件选择上传文件类型弹窗 -->
|
|
|
- <van-popup :show="show" @close="show=false" round>
|
|
|
- <view style="width: 50vw;text-align: center;font-size: 16px;padding: 32rpx;line-height: 80rpx;">
|
|
|
- <view @click="handleUploadMethod('img')">上传图片</view>
|
|
|
- <view @click="handleUploadMethod('file')">上传文件</view>
|
|
|
- </view>
|
|
|
- </van-popup>
|
|
|
-
|
|
|
<!-- 上传回签附件弹窗确认弹窗 -->
|
|
|
<van-popup :show="showUpload" @close="showUpload=false" position="bottom" round>
|
|
|
<view class="uploadfile-wrap">
|
|
@@ -178,7 +170,7 @@
|
|
|
<image class="contract-img" mode="aspectFill" :src="item.img"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <button style="width: 450rpx;" @click='handleConfirmSignBack'>确定</button>
|
|
|
+ <button style="width: 450rpx;" @click='handleConfirmCheckFile'>确定</button>
|
|
|
</view>
|
|
|
</van-popup>
|
|
|
|
|
@@ -312,9 +304,8 @@
|
|
|
detail:null,
|
|
|
flowNodeList:null,
|
|
|
opt:{},
|
|
|
- show:false,
|
|
|
showUpload:false,
|
|
|
- files:[],
|
|
|
+ files:[],//签回附件
|
|
|
varietyList:[],
|
|
|
}
|
|
|
},
|
|
@@ -342,13 +333,42 @@
|
|
|
},1000)
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 点击上传回签附件
|
|
|
+ handleUploadCheckFile(){
|
|
|
+ wx.chooseMessageFile({
|
|
|
+ count:1,
|
|
|
+ type:'file',
|
|
|
+ success:(res)=>{
|
|
|
+ const tempFile=res.tempFiles[0]
|
|
|
+ const reg = /\.(pdf)$/;
|
|
|
+ const reg2= /\.doc|\.docx$/
|
|
|
+ if(!reg.test(tempFile.path)&&!reg2.test(tempFile.path)){
|
|
|
+ uni.showToast({
|
|
|
+ title:'请上传pdf/word格式文件',
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // pdf
|
|
|
+ if(reg.test(tempFile.path)){
|
|
|
+ this.files=[{type:'pdf',url:tempFile.path,img: require("@/pages-approve/static/pdf.png")}]
|
|
|
+ }
|
|
|
+ if(reg2.test(tempFile.path)){
|
|
|
+ this.files=[{type:'word',url:tempFile.path,img: require("@/pages-approve/static/word.png")}]
|
|
|
+ }
|
|
|
+
|
|
|
+ this.showUpload=true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
//确认提交上传回签附件
|
|
|
- async handleConfirmSignBack(){
|
|
|
- let FileUrlarr=this.files.map(item=>item.url)
|
|
|
- const res=await apiContractSignBackFiles({
|
|
|
+ async handleConfirmCheckFile(){
|
|
|
+ const temres=await apiContractSignBackFiles({
|
|
|
+ tempPath:this.files[0].url,
|
|
|
ContractId:Number(this.detail.ContractId),
|
|
|
- FileUrl:FileUrlarr.join('#')
|
|
|
})
|
|
|
+ const res=JSON.parse(temres.data)
|
|
|
if(res.code===200){
|
|
|
uni.showToast({
|
|
|
title:'操作成功',
|
|
@@ -373,42 +393,73 @@
|
|
|
},1000)
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 签回修改 只允许上传一个pdf/word
|
|
|
+ // async handleConfirmSignBack(){
|
|
|
+ // let FileUrlarr=this.files.map(item=>item.url)
|
|
|
+ // const res=await apiContractSignBackFiles({
|
|
|
+ // ContractId:Number(this.detail.ContractId),
|
|
|
+ // FileUrl:FileUrlarr.join('#')
|
|
|
+ // })
|
|
|
+ // if(res.code===200){
|
|
|
+ // uni.showToast({
|
|
|
+ // title:'操作成功',
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // // 已审批上传签回附件更新列表
|
|
|
+ // if(this.detail.Status==='已审批'){
|
|
|
+ // uni.$emit('contractApproveListUpdate',{
|
|
|
+ // ContractApprovalId:this.ContractApprovalId,
|
|
|
+ // ContractApprovalRecordId:this.ContractApprovalRecordId,
|
|
|
+ // ContractId:this.ContractId
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // setTimeout(()=>{
|
|
|
+ // this.showUpload=false
|
|
|
+ // this.files=[]
|
|
|
+ // if(this.ContractId!=0){
|
|
|
+ // this.getContractDetail()
|
|
|
+ // }else{
|
|
|
+ // this.getApprovalDetail()
|
|
|
+ // }
|
|
|
+ // },1000)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
|
|
|
- // 上传回签附件文件
|
|
|
- async handleUploadMethod(type){
|
|
|
- let res=[]
|
|
|
- if(type==='img'){
|
|
|
- res=await uploadImg()
|
|
|
- }else if(type==='file'){
|
|
|
- res=await uploadFiles({type:'file'})
|
|
|
- }
|
|
|
- const reg = /\.(pdf)|\.doc|\.docx$/;
|
|
|
- if(!reg.test(res[0])){
|
|
|
- uni.showToast({
|
|
|
- title:'请上传pdf/word格式文件',
|
|
|
- icon:"none"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.files=[{type:'pdf',url:res[0],img: require("@/pages-approve/static/pdf.png")}]
|
|
|
- // this.files=res.map((item) => {
|
|
|
- // if (reg.test(item)) {
|
|
|
- // return {
|
|
|
- // type: "pdf",
|
|
|
- // url: item,
|
|
|
- // img: require("@/pages-approve/static/pdf.png"),
|
|
|
- // };
|
|
|
- // } else {
|
|
|
- // return {
|
|
|
- // type: "img",
|
|
|
- // url: item,
|
|
|
- // img: item,
|
|
|
- // };
|
|
|
- // }
|
|
|
- // });
|
|
|
- this.show=false
|
|
|
- this.showUpload=true
|
|
|
- },
|
|
|
+ // // 上传回签附件文件
|
|
|
+ // async handleUploadMethod(type){
|
|
|
+ // let res=[]
|
|
|
+ // if(type==='img'){
|
|
|
+ // res=await uploadImg()
|
|
|
+ // }else if(type==='file'){
|
|
|
+ // res=await uploadFiles({type:'file'})
|
|
|
+ // }
|
|
|
+ // const reg = /\.(pdf)|\.doc|\.docx$/;
|
|
|
+ // if(!reg.test(res[0])){
|
|
|
+ // uni.showToast({
|
|
|
+ // title:'请上传pdf/word格式文件',
|
|
|
+ // icon:"none"
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // this.files=[{type:'pdf',url:res[0],img: require("@/pages-approve/static/pdf.png")}]
|
|
|
+ // // this.files=res.map((item) => {
|
|
|
+ // // if (reg.test(item)) {
|
|
|
+ // // return {
|
|
|
+ // // type: "pdf",
|
|
|
+ // // url: item,
|
|
|
+ // // img: require("@/pages-approve/static/pdf.png"),
|
|
|
+ // // };
|
|
|
+ // // } else {
|
|
|
+ // // return {
|
|
|
+ // // type: "img",
|
|
|
+ // // url: item,
|
|
|
+ // // img: item,
|
|
|
+ // // };
|
|
|
+ // // }
|
|
|
+ // // });
|
|
|
+ // this.showUpload=true
|
|
|
+ // },
|
|
|
|
|
|
// 审批单详情
|
|
|
async getApprovalDetail() {
|
|
@@ -420,7 +471,7 @@
|
|
|
this.detail=res.data.ContractDetail
|
|
|
this.opt=res.data.OpButton
|
|
|
this.flowNodeList=res.data.FlowNodeList
|
|
|
- this.handleVariety(res.data.ContractDetail.Service)
|
|
|
+ this.handleVariety(res.data.ContractDetail.Service||[])
|
|
|
// 代付合同时
|
|
|
if(res.data.ContractDetail.ContractBusinessType==='代付合同'){
|
|
|
this.detail.Service=res.data.ContractDetail.RelationContractDetailList[0].Service
|
|
@@ -435,7 +486,7 @@
|
|
|
this.detail=res.data.ContractDetail
|
|
|
this.opt=res.data.OpButton
|
|
|
this.flowNodeList=res.data.FlowNodeList
|
|
|
- this.handleVariety(res.data.ContractDetail.PermissionLookList)
|
|
|
+ this.handleVariety(res.data.ContractDetail.PermissionLookList||[])
|
|
|
// 代付合同时
|
|
|
if(res.data.ContractDetail.ContractBusinessType==='代付合同'){
|
|
|
this.detail.Service=res.data.ContractDetail.RelationContractDetailList[0].Service
|