import{P as t,g as e,a2 as s,u as i,a4 as o,aW as a,s as n,a5 as r,$ as l,aJ as h,c as d,a as c,n as f,ab as p,K as u,X as g,o as m,p as v,w,q as L,t as y,C as I,Q as b,y as k,v as T,B,D as S,E as j,F as C,x}from"./index-P0fyQ2Em.js";import{_ as A}from"./u-select.B1D-PP_I.js";import{r as F}from"./uni-app.es.DOtS5Ldl.js";import{_ as U}from"./u-icon.wXcRZHbn.js";import{_ as R}from"./u-search.CSVnMmHg.js";import{_ as D}from"./u-avatar.q3DpmfEb.js";import{_ as N}from"./index.BuZ8YmVY.js";import{_ as $}from"./uni-popup.BLLVDysl.js";import{g as _}from"./entrust.D26hiAV_.js";import{U as O,C as E}from"./workFlowForm.Bxjvxts8.js";import{A as H,R as P,F as M,b as J,s as V,T as q,S as z,a as K,c as W,C as G,d as Q,e as X,l as Y,f as Z,g as tt,h as et,i as st,j as it}from"./flowBefore.-kiV42CS.js";import{g as ot,u as at,c as nt}from"./visualDev.B0fuvtpd.js";import{c as rt}from"./flowEngine.Ke7vpfzj.js";import{r as lt}from"./resources.DEPsJg7u.js";import{c as ht}from"./form.D2PjL320.js";import{f as dt}from"./flowBtn.BSp3ZwA5.js";import{R as ct}from"./index.9Bg6bWZE.js";import{E as ft}from"./ErrorForm.0zUEzmhG.js";import{M as pt}from"./index.C9raOSI0.js";import{_ as ut}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-popup.CXrq2y3n.js";import"./index.BEyjEu29.js";import"./index.D5H39cMc.js";import"./u-divider.BoeCb7vx.js";import"./u-line.D-FzmOwL.js";import"./u-upload.Btn0UtQx.js";import"./uni-icons.RJ8Vh9KU.js";import"./u-input.Cp2bygnN.js";import"./emitter.DrjJCwnj.js";import"./u-button.Chh1-6a-.js";import"./mp-html.DI6DI7Ml.js";import"./u-form.B1LWETT2.js";import"./u-tabs.DEel8MQB.js";import"./u-badge.CWPuZ-w1.js";import"./index.DsvBnwWf.js";import"./base.DOXur1tF.js";import"./index.Du-JSu8j.js";import"./index.PS-rWSqI.js";import"./u-radio-group.CbnO1TOv.js";import"./index.BMdHwtjY.js";import"./u-loading.D5Tc00lz.js";import"./u-checkbox.Cy_cnskM.js";import"./u-checkbox-group.zSC_g3m3.js";import"./index.CIb_-r5F.js";import"./u-tag.BmeG4z_q.js";import"./ly-tree.DZ8MU_HY.js";import"./index.vGVmWABQ.js";import"./index.BLChm46K.js";import"./lsj-upload.CSOZr0lY.js";import"./index.-5h2Pj7y.js";import"./index.D2KRRdBj.js";import"./index.lbbLqjbF.js";import"./index.DgjoBC2V.js";import"./u-action-sheet.C0QG6n24.js";import"./index.D-SsN0gl.js";import"./order.BZyuCWTy.js";import"./index.BoqsLhBg.js";import"./u-time-line.q7UXLQNV.js";import"./useDefineSetting.DqFEhsPu.js";import"./index.Dfxlsegv.js";import"./emoji.DwmieXKz.js";import"./u-subsection.B-kRzElF.js";import"./u-image.RNxpLaRU.js";import"./u-cell-group.C7i7cw4u.js";import"./document.CzYQ9UiF.js";function gt(e){return t({url:`/api/workflow/task/Press/${e}`,method:"post"})}const mt=e("sysConfigInfo");const vt=ut({components:{childForm:ht,ErrorForm:ft,flowBtn:dt,RecordTimeList:ct,MultSelect:pt},data:()=>({dataLogList:[],dataLog:!1,childFormKey:+new Date,todoBtnList:[],signUserIdList:[],keyword:"",formLoding:!1,loading:!1,taskInfo:{},backNodeList:[],btnInfo:[],nodeList:[],handleStatus:1,show:!1,config:{},formData:{},recordList:[],properties:{},flowStatus:"",btnLoading:!1,eventType:"",commentList:[],processId:"",candidateList:[],title:"",branchList:[],candidateType:3,selectflowUrgent:{extra:"0",label:"普通",value:1},showFlowUrgent:!1,defaultValue:[0],flowUrgent:1,flowUrgentList:[{label:"普通",color:"#409EFF",bgColor:"#e5f3fe",value:1,extra:"0"},{label:"重要",color:"#E6A23C",bgColor:"#fef6e5",value:2,extra:"1"},{label:"紧急",color:"#F56C6C",bgColor:"#fee5e5",value:3,extra:"2"}],actionList:[],rejectList:[],hasComment:!1,progressList:[],rightBtnList:[],approvalField:[],delegateUser:"",showSelectModal:!1,userList:[],auxiliaryInfo:[]}),computed:{baseURL(){return this.define.baseURL},getShowExtraPanel(){var t,e;return this.dataLog&&(null==(e=null==(t=this.config)?void 0:t.formData)?void 0:e.id)||"-1"!=this.config.opType&&!this.loading}},onLoad(t){if(!t.config)return this.jnpf.goBack();if(this.config=JSON.parse(this.jnpf.base64.decode(t.config)),s("operate",(t=>{this.btnLoading=!0,this[t.eventType+"Handle"](t)})),this.loading=!0,t.token){const e=i();e.setToken(""),e.setToken(t.token);let s={id:this.config.taskId,flowId:this.config.flowId,opType:this.config.opType,taskId:this.config.taskId,operatorId:this.config.operatorId,hideCancelBtn:!0};o(s.operatorId||s.taskId,s.opType).then((t=>{s.opType=t.data.opType,this.config=s,a().then((t=>{let e={...t.data,userId:t.data.id};n("userInfo",e),this.init()}))})).catch((t=>{}))}else this.init(),this.processId=this.config.id||""},onShow(){r("comment"),s("comment",(t=>{this.commentList=[],this.current=0,this.addComment(t)})),s("openRevokeFlow",(t=>{this.config=t,this.$nextTick((()=>{this.getBeforeInfo(this.config)}))})),l("initCollapse")},onUnload(){r("operate"),r("refresh"),r("comment"),r("openRevokeFlow")},methods:{handlePreviewImage(t){h({urls:[t],current:t,success:()=>{},fail:()=>{d({title:"预览图片失败",icon:"none"})}})},handleCodeGeneration(t){this.config=t,this.init(this.config),s("operate",(t=>{this[t.eventType+"Handle"](t)})),s("comment",(t=>{this.commentList=[],this.current=0,this.addComment(t)})),this.processId=this.config.id,c({title:this.config.fullName}),this.key=+new Date},handleBtn(t,e={}){const s=["submit","audit","reject","save","saveAudit","saveAssist","freeApprover","approvalButton","delegateSubmit"],i=["transfer","back","launchRecall","assist","auditRecall","cancelSign","revoke","approvalCancel","sign","startHandle"];switch(this.eventType=t,!0){case t.includes("initiationForm"):const o={previewType:"initiationForm",taskId:this.config.taskId,title:this.config.fullName};f({url:`/pages/workFlow/scanForm/index?config=${JSON.stringify(o)}`});break;case t.includes("press"):this.handlePress();break;case t.includes("reduceApprover"):this.getAddSignUserList();break;case t.includes("comment"):this.goWriteComment();break;case s.includes(t):this.eventLauncher(t);break;case i.includes(t):this.eventReceiver({},t);break;case"customBtns"===t:this.handleCustomBtns(e.value)}},handleCustomBtns(t){return this.actionList.length&&this.actionList.map((e=>{if(e.value===t){const t={flowInfo:this.flowInfo,formData:this.formData,taskInfo:this.taskInfo,onlineUtils:this.jnpf.onlineUtils},s=this.jnpf.getScriptFunc(e.jsJson);if(!s)return;s.call(this,{...t})}})),null},getDelegateUser(){_(this.config.flowId).then((t=>(this.userList=t.data.list||[],1==this.userList.length?this.selectUser([{id:this.userList[0].id}]):this.userList.length?this.openUserListModal():void 0)))},showSelectClose(){this.showSelectModal=!1},openUserListModal(){this.showSelectModal=!0},selectUser(t){this.delegateUser=t[0].id,this.getCandidates(this.config.operatorId)},delegateSubmitHandle(t){this.handleRequest(t)},handlePress(){p({title:"提示",content:"此操作将提示该节点尽快处理",success:t=>{t.confirm&>(this.config.id).then((t=>{this.$u.toast(t.msg)}))}})},hideReduceApprover(){this.keyword="",this.$refs.reduceApprover.close()},getAddSignUserList(){let t={currentPage:1,enabledMark:1,id:this.config.operatorId,keyword:this.keyword,organizeId:"",pageSize:1e4,sidx:"",sort:"desc"};H(t,this.config.operatorId).then((t=>{this.signUserIdList=t.data.list||[],this.$refs.reduceApprover.open("bottom")}))},deleteReduce(t){P({ids:[t]},this.config.operatorId).then((e=>{let s=this.signUserIdList.filter((e=>t!==e.id));this.signUserIdList=s}))},goWriteComment(t){let e={taskId:0==this.config.opType?this.config.id:this.config.taskId};t&&(e.replyId=t),e=encodeURIComponent(JSON.stringify(e)),f({url:"/pages/workFlow/comment/index?data="+e})},addComment(t){t.taskId=0==this.config.opType?this.config.id:this.config.taskId,rt(t).then((t=>{this.$nextTick((()=>{this.$refs.RecordTimeList.change(1)}))}))},init(){if(this.processId=this.config.id,this.config.id){let t={modelId:this.config.flowId,id:this.config.id,type:1,flowId:this.config.flowId,processId:this.config.id,taskId:this.config.taskId,opType:this.config.opType};n("dynamicModelExtra",t)}this.getBeforeInfo(this.config)},getBeforeInfo(){let t=this.config;this.formData.flowId=t.flowId,this.loading=!0;const e={flowId:t.flowId,opType:2==t.opType?3:t.opType};t.isFlow&&(e.isFlow=t.isFlow),"-1"!=t.opType&&"0"!=t.opType&&(e.operatorId=t.operatorId),M((null==t?void 0:t.taskId)||(null==t?void 0:t.id)||0,e).then((e=>{this.flowInfo=e.data.flowInfo||{},this.properties=e.data.nodeProperties||{},this.auxiliaryInfo=this.properties.auxiliaryInfo,this.$nextTick((()=>{this.initApprovalField()})),this.formInfo=e.data.formInfo||{},this.taskInfo=e.data.taskInfo||{},this.btnInfo=e.data.btnInfo||[],this.progressList=e.data.progressList||[],t.formOperates=e.data.formOperates||[],t.formType=this.formInfo.type;const s="-1"==t.opType?this.flowInfo.fullName:this.taskInfo.fullName;t.fullName=s,this.title=this.flowInfo.fullName,this.thisStep=this.taskInfo.thisStep||"",0!==t.status&&3!==t.status&&(this.title=this.thisStep?t.fullName+"/"+this.thisStep:t.fullName),t.type=this.flowInfo.type,t.draftData=e.data.draftData||null,t.formData=e.data.formData||{};let i=t.formData.id;t.formEnCode=this.formInfo.enCode,this.nodeList=e.data.nodeList||[],this.recordList=(e.data.recordList||[]).reverse(),t.formConf=this.formInfo.formData,t.formConf&&(this.dataLog=JSON.parse(t.formConf).dataLog,this.dataLog&&this.getOnlineLog(i)),this.hasComment=this.flowInfo.flowNodes.global.hasComment,this.loading=!1,this.formLoding=!0,c({title:"revoke"===this.config.formEnCode?`${this.flowInfo.fullName}撤销申请`:this.flowInfo.fullName}),t.formRecords&&t.title&&c({title:t.title}),this.flowUrgent=this.taskInfo.flowUrgent||1;this.selectflowUrgent=(()=>{var t={value:this.flowUrgent,extra:"0",label:"普通"};return this.flowUrgentList.forEach(((e,s)=>{e.value==this.flowUrgent&&(t.extra=s,t.label=e.label)})),t})(),this.initRightBtnList(),"-1"!=t.opType&&"3"!=t.opType&&(t.readonly=!0),t.formOperates=[],0==t.opType?this.properties&&this.properties&&this.properties.formOperates&&(t.formOperates=this.properties.formOperates||[]):t.formOperates=e.data.formOperates||[],this.getFlowStatus(),setTimeout((()=>{this.$nextTick((()=>{this.$refs.child&&this.$refs.child.$refs.form?this.$refs.child.$refs.form.init(t):d({title:"暂无此流程表单",icon:"none",complete:()=>{setTimeout((()=>{u()}),1500)}})}))}),100),this.config=t}))},getOnlineLog(t){let e=this.formInfo.id;ot(e,t).then((t=>{let e=t.data.list||[];this.dataLogList=e}))},initApprovalField(){var t,e,s;if(this.approvalField=[],3==this.config.opType&&this.properties.hasApprovalField){const i=(null==(s=null==(e=null==(t=this.flowInfo)?void 0:t.flowNodes)?void 0:e.global)?void 0:s.approvalFieldList)||[];this.properties.approvalField.map((t=>{const e=i.filter((e=>e.id==t));(null==e?void 0:e.length)&&this.approvalField.push({...e[0],value:null})}))}},getFlowStatus(){"0"==this.config.category&&(this.flowStatus=lt.status.signfor),"1"!=this.config.category&&"2"!=this.config.category||("1"==this.config.status&&(this.flowStatus=lt.status.circulation),"5"==this.config.status&&(this.flowStatus=lt.status.back)),this.config.category||("0"==this.config.status&&(this.flowStatus=lt.status.draft),"1"==this.config.status&&(this.flowStatus=lt.status.doing),"2"==this.config.status&&(this.flowStatus=lt.status.adopt)),"3"==this.config.category&&("7"==this.config.status&&(this.flowStatus=lt.status.transfer),"1"==this.config.status&&(this.flowStatus=lt.status.agree),"0"==this.config.status&&(this.flowStatus=lt.status.refuse),"4"==this.config.status&&(this.flowStatus=lt.status.addSign),"5"==this.config.status&&(this.flowStatus=lt.status.return)),"4"==this.config.category&&("1"==this.config.status&&(this.flowStatus=lt.status.doing),"8"==this.config.status&&(this.flowStatus=lt.status.back))},initRightBtnList(){var t,e,s,i,o,a,n,r,l,h,d,c,f;const p=[];6!=this.opType&&((null==(t=this.btnInfo)?void 0:t.hasDelegateSubmitBtn)&&p.push({id:"delegateSubmit",fullName:"委托发起",type:"primary"}),(null==(e=this.btnInfo)?void 0:e.hasSubmitBtn)&&p.push({id:"submit",fullName:this.properties.submitBtnText||"提交",type:"primary"}),1==mt.flowSign&&(null==(s=this.btnInfo)?void 0:s.hasSignBtn)&&p.push({id:"sign",fullName:(null==(i=this.btnInfo)?void 0:i.proxyMark)?"代签":"签收",type:"primary",width:"100%"}),2==this.config.opType&&(1==mt.flowSign&&(null==(n=null==(a=null==(o=this.flowInfo)?void 0:o.flowNodes)?void 0:a.global)?void 0:n.hasSignFor)&&this.todoBtnList.push({id:"cancelSign",fullName:"退签",type:"warning"}),this.todoBtnList.push({id:"startHandle",fullName:(null==(r=this.btnInfo)?void 0:r.proxyMark)?"代办":"开始办理",type:"primary",width:"100%"})),(null==(l=this.btnInfo)?void 0:l.hasRecallLaunchBtn)&&p.push({id:"launchRecall",fullName:"撤回",type:"warning",width:"100%"}),(null==(h=this.btnInfo)?void 0:h.hasRecallAuditBtn)&&p.push({id:"auditRecall",fullName:"撤回",type:"warning",width:"100%"}),(null==(d=this.btnInfo)?void 0:d.hasAssistSaveBtn)&&p.push({id:"saveAssist",fullName:"保存"}),(null==(c=this.btnInfo)?void 0:c.hasAuditBtn)&&p.push({id:"audit",fullName:this.properties.auditBtnText||"同意",type:"primary"}),(null==(f=this.btnInfo)?void 0:f.hasReduceApproverBtn)&&p.push({id:"reduceApprover",fullName:this.properties.reduceApproverBtnText||"减签",type:"primary",width:"100%"}),this.rightBtnList=p,this.initBtnList())},initBtnList(){var t;const e=[],s=this.properties,i=this.btnInfo;(null==(t=null==s?void 0:s.customBtns)?void 0:t.length)&&(null==s||s.customBtns.map((t=>{e.push({id:"customBtns",text:t.label,jsJson:t.jsJson,value:t.value})}))),this.hasComment&&"-1"!=this.config.opType&&this.rightBtnList.length&&e.push({id:"comment",text:"评论"}),(null==i?void 0:i.hasViewStartFormBtn)&&e.push({id:"initiationForm",text:"查看发起表单"}),2!=this.config.opType&&((null==i?void 0:i.hasPressBtn)&&e.push({id:"press",text:"催办"}),(null==i?void 0:i.hasSaveAuditBtn)&&e.push({id:"saveAudit",text:"暂存"}),(null==i?void 0:i.hasBackBtn)&&e.push({id:"back",text:s.backBtnText||"退回"}),(null==i?void 0:i.hasFreeApproverBtn)&&e.push({id:"freeApprover",text:s.freeApproverBtnText||"加签"}),(null==i?void 0:i.hasTransferBtn)&&e.push({id:"transfer",text:s.transferBtnText||"转审"}),(null==i?void 0:i.hasAssistBtn)&&e.push({id:"assist",text:s.assistBtnText||"协办"}),(null==i?void 0:i.hasRevokeBtn)&&e.push({id:"revoke",text:"撤销"})),this.actionList=e},handleAction(t){switch(this.actionList[t].id){case"assist":this.eventLauncher("assist");break;case"back":this.eventLauncher("back");break;case"save":this.eventLauncher("save");break;case"transfer":this.eventReceiver({},"transfer");break;case"reject":this.eventReceiver({},"reject");break;case"launchRecall":this.eventReceiver({},"launchRecall");break;case"auditRecall":this.eventReceiver({},"auditRecall");break;case"cancelSign":this.eventReceiver({},"cancelSign");break;case"saveAudit":this.eventLauncher("saveAudit");break;case"revoke":this.eventReceiver({},"revoke");break;case"freeApprover":this.eventLauncher("freeApprover");break;case"approvalCancel":this.eventReceiver({},"approvalCancel")}},eventLauncher(t){this.$refs.child&&this.$refs.child.$refs.form&&this.$refs.child.$refs.form.submit(t,this.selectflowUrgent.value)},eventReceiver(t,e){if(this.formData={...t,flowId:this.flowInfo.flowId},this.eventType=e,"sign"===e||"cancelSign"===e){let t={ids:[this.config.operatorId],type:"sign"===e?0:1},s="确定签收,签收后进入待办。";"cancelSign"===e&&(s="确定退签,确定后进入我的待签。"),p({title:"提示",content:s,success:e=>{e.confirm&&this.signFor(t)}})}if("startHandle"===e){let t={ids:[this.config.operatorId]};p({title:"提示",content:"确定开始办理流程。",success:e=>{e.confirm&&this.Transact(t)}})}if(["save","submit","delegateSubmit"].includes(e))return this.submitOrSave(e);if(["saveAudit","saveAssist"].includes(e))return this.saveAudit();if("reject"!==e&&"audit"!==e||("processing"===this.properties.type?p({title:"提示",content:"是否确认办理该审批单?",success:t=>{if(t.confirm)return this.getCandidates(this.config.operatorId)}}):this.getCandidates(this.config.operatorId)),"back"===e)return this.back();if("revoke"===e)return this.jumRevokePage();if("assist"===e)return this.operate();if("transfer"===e)return this.operate(this.properties.transferBtnText);if("freeApprover"===e)return this.getCandidates(this.config.operatorId);if("launchRecall"!==e&&"auditRecall"!==e||this.operate(),"approvalCancel"===e){let t={formData:this.formData,eventType:this.eventType};return this.properties.hasOpinion||this.properties.hasSign?this.operate(this.properties.cancelBtnText||"驳回"):p({title:"提示",content:"此操作将审批驳回终止流程,是否继续?",success:e=>{e.confirm&&this.approvalCancelHandle(t)}})}},jumRevokePage(){let t={type:this.eventType};f({url:"/pages/workFlow/operate/revoke?config="+encodeURIComponent(JSON.stringify(t))})},back(t){J(this.config.id).then((t=>{this.backNodeList=t.data.list||[],this.$nextTick((()=>{this.operate(this.properties.backBtnText)}))})).catch((()=>{this.btnLoading=!1}))},backHandle(t){delete t.addSignParameter;const e={...t,...this.formData};V(e,this.config.id).then((t=>{var s;const i=null==(s=t.data)?void 0:s.errorCodeList;if(i&&Array.isArray(i)&&i.length)return this.$refs.ErrorForm.init(i,e);this.toastAndBack(t.msg)})).catch((()=>{this.btnLoading=!1}))},Transact(t){this.btnLoading=!0,q(t).then((t=>{this.config.opType=3,this.btnLoading=!1,this.config.readonly&&this.$set(this.config,"readonly",!1),this.initRightBtnList(),this.initApprovalField(),this.childFormKey=+new Date,l("refresh")})).catch((t=>{this.btnLoading=!1}))},signFor(t){this.btnLoading=!0,z(t).then((t=>{this.toastAndBack(t.msg)})).catch((t=>{this.btnLoading=!1}))},saveAudit(){this.btnLoading=!0;const t="saveAssist"==this.eventType?K:W;this.formData.id=this.config.taskId;let e={...this.formData,id:this.config.taskId,flowId:this.flowInfo.flowId};t(this.config.operatorId,e).then((t=>{d({title:t.msg,icon:"none",complete:()=>{setTimeout((()=>{u()}),1500)}})})).catch((()=>{this.btnLoading=!1}))},submitErrorForm(t){let e={...this.formData,...t};"submit"===this.eventType?this.handleRequest(e):this.handleApproval(e)},getCandidates(t){this.formData.flowId=this.flowInfo.flowId,this.formData.f_id=this.config.taskId;let e={flowId:this.flowInfo.flowId,flowUrgent:this.flowUrgent,...this.formData,f_id:this.config.taskId};"delegateSubmit"===this.eventType&&(e.delegateUser=this.delegateUser),["audit","reject"].includes(this.eventType)&&(e.handleStatus="audit"===this.eventType?1:0),G(t||0,e).then((t=>{const e=t.data||{};return this.candidateType=e.type||3,this.candidateList=e.list.filter((t=>!t.isBranchFlow&&t.isCandidates)),this.branchList=e.list||[],["audit","reject"].includes(this.eventType)?this.operate():"freeApprover"===this.eventType?this.operate(this.properties.freeApproverBtnText):"save"===this.eventType?handleRequest():this.candidateList.length||1==this.candidateType?this.operate("submit"):void(this.candidateList.length||this.properties.isCustomCopy||3!=this.candidateType||(this.branchList=[],p({title:"提示",content:"您确定要提交当前流程吗?",success:t=>{t.confirm&&(this.btnLoading=!0,this.handleRequest())}})))})).catch((()=>{}))},submitOrSave(t){if(this.formData.status="submit"===t?0:1,"save"===t)return this.handleRequest();if("delegateSubmit"===t)return this.getDelegateUser();let e="-1"===this.config.opType?0:this.config.operatorId;this.getCandidates(e)},submitHandle(t){this.handleRequest(t)},selfHandleRequest(){(this.formData.id?at:nt)(this.flowInfo.flowId,this.formData).then((t=>{d({title:t.msg,icon:"none",complete:()=>{setTimeout((()=>{u()}),1500)}})})).catch((()=>{}))},handleRequest(t){this.formData={...this.formData,...t,flowId:this.flowInfo.flowId,candidateType:this.candidateType,status:"save"===this.eventType?0:1,delegateUser:this.config.delegateUser||"",id:this.config.id,isFlow:this.config.isFlow||1,flowUrgent:this.flowUrgent},"save"===this.eventType&&(this.btnLoading=!0),"delegateSubmit"===this.eventType&&(this.formData.delegateUser=this.delegateUser),(this.formData.id?O:E)(this.formData).then((t=>{var e;const s=null==(e=t.data)?void 0:e.errorCodeList;if(s&&Array.isArray(s)&&s.length)return this.$refs.ErrorForm.init(s);d({title:t.msg,icon:"none",complete:()=>{setTimeout((()=>{l("refresh"),u()}),1500)}})})).catch((()=>{this.btnLoading=!1}))},handlePress(){p({title:"提示",content:"此操作将提示该节点尽快处理",success:t=>{t.confirm&>(this.config.id).then((t=>{this.$u.toast(t.msg)}))}})},operate(){const t=this.candidateList.filter((t=>!t.isBranchFlow&&t.isCandidates)),e=this.branchList.filter((t=>t.isBranchFlow));let s=this.properties,i=this.eventType,o={type:i,operatorId:this.config.operatorId,formData:this.formData,candidateType:this.candidateType,branchList:e,candidateList:t,rejectList:this.rejectList,propertiesType:"processing"===s.type?s.type:"",taskId:"submit"===i?0:this.config.taskId,hasFreeApprover:"freeApprover"===i&&s.hasFreeApproverBtn,hasSign:s.hasSign,isCustomCopy:s.isCustomCopy,hasOpinion:s.hasOpinion,hasReduceApproverBtn:s.hasReduceApproverBtn,hasFile:s.hasFile,hasBackBtn:s.hasBackBtn,backNodeList:this.backNodeList,backNodeCode:s.backNodeCode,backMsgConfig:s.backMsgConfig,backType:s.backType,nodeName:s.nodeName,approvalField:this.approvalField,delegateUser:this.delegateUser,props:{label:"nodeName",value:"nodeId"}};f({url:"/pages/workFlow/operate/index?config="+encodeURIComponent(JSON.stringify(o))})},revokeHandle(e){(function(e,s){return t({url:`/api/workflow/task/Revoke/${e}`,method:"PUT",data:s})})(this.config.id,{handleOpinion:e.handleOpinion}).then((t=>{this.toastAndBack(t.msg,!0)})).catch((()=>{this.btnLoading=!1}))},assistHandle(t){Q(this.config.id,t).then((t=>{this.toastAndBack(t.msg,!0)})).catch((()=>{this.btnLoading=!1}))},recallHandle(t){let e="auditRecall"===this.eventType?this.config.operatorId:this.config.id;("auditRecall"===this.eventType?X:Y)(e,{handleOpinion:t.handleOpinion,signImg:t.signImg,fileList:t.fileList}).then((t=>{this.toastAndBack(t.msg)})).catch((()=>{this.btnLoading=!1}))},auditHandle(t){this.handleApproval(t)},freeApproverHandle(t){this.freeApprover(t)},transferHandle(t){Z(this.config.id,t).then((t=>{this.toastAndBack(t.msg,!0)})).catch((()=>{this.btnLoading=!1}))},approvalCancelHandle(t){tt(this.config.id,{handleOpinion:t.handleOpinion,signImg:t.signImg,fileList:t.fileList,eventType:"approvalCancel"}).then((t=>{this.toastAndBack(t.msg,!0)})).catch((t=>{this.btnLoading=!1}))},rejectHandle(t){this.handleApproval(t)},freeApprover(t){const e={...t,...this.formData,id:this.config.taskId};et(this.config.id,e).then((t=>{this.toastAndBack(t.msg,!0)})).catch((t=>{this.btnLoading=!1}))},setBtnLoad(t){this.btnLoading=!!t},handleApproval(t){delete t.addSignParameter,"audit"===t.eventType&&(this.handleStatus=1),"reject"===t.eventType&&(this.handleStatus=0);const e={...t,...this.formData,id:this.config.taskId,flowId:this.flowInfo.flowId,handleStatus:this.handleStatus};("audit"===this.eventType?st:it)(this.config.operatorId,e).then((t=>{var s;const i=null==(s=t.data)?void 0:s.errorCodeList;if(i&&Array.isArray(i)&&i.length)return this.$refs.ErrorForm.init(i,e);this.toastAndBack(t.msg,!0)})).catch((t=>{this.btnLoading=!1}))},toastAndBack(t,e){d({title:t,icon:"none",mask:!0,complete:()=>{setTimeout((()=>{l("refresh"),u()}),1500)}})},handleShowSelect(){"-1"==this.config.opType&&(this.showFlowUrgent=!0)},seltConfirm(t){this.flowUrgent=t[0].value,this.selectflowUrgent=t[0],this.defaultValue=[this.flowUrgentList.findIndex((e=>e.value===t[0].value))]}}},[["render",function(t,e,s,i,o,a){const n=g("childForm"),r=g("ErrorForm"),l=g("RecordTimeList"),h=L,d=g("flowBtn"),c=F(m("u-select"),A),f=F(m("u-icon"),U),p=F(m("u-search"),R),u=F(m("u-avatar"),D),_=F(m("JnpfEmpty"),N),O=F(m("uni-popup"),$),E=g("MultSelect");return y(),v(h,{class:"flowBefore-v"},{default:w((()=>{var s,i,g;return[I("div",{class:"flow-urgent-value",style:b({"background-color":o.flowUrgentList[o.selectflowUrgent.extra].bgColor}),onClick:e[0]||(e[0]=(...t)=>a.handleShowSelect&&a.handleShowSelect(...t))},[I("span",{style:b({color:o.flowUrgentList[o.selectflowUrgent.extra].color})},k(o.selectflowUrgent.label),5)],4),T(h,{class:"flowBefore-box"},{default:w((()=>[T(h,{class:"scroll-v","scroll-y":""},{default:w((()=>{var t,e;return[o.loading?B("",!0):(y(),v(n,{ref:"child",config:o.config,onEventReceiver:a.eventReceiver,onSetBtnLoad:a.setBtnLoad,key:o.childFormKey},null,8,["config","onEventReceiver","onSetBtnLoad"])),T(r,{onSubmitErrorForm:a.submitErrorForm,ref:"ErrorForm"},null,8,["onSubmitErrorForm"]),a.getShowExtraPanel?(y(),v(l,{key:1,progressList:o.progressList,taskInfo:o.taskInfo,commentList:o.commentList,taskId:0==o.config.opType?o.config.id:o.config.taskId,ref:"RecordTimeList",onHandleReply:a.goWriteComment,hasComment:o.hasComment,dataLog:o.dataLog,opType:o.config.opType,formID:null==(e=null==(t=o.config)?void 0:t.formData)?void 0:e.id,dataLogList:o.dataLogList,auxiliaryInfo:o.auxiliaryInfo,formData:o.config.formData},null,8,["progressList","taskInfo","commentList","taskId","onHandleReply","hasComment","dataLog","opType","formID","dataLogList","auxiliaryInfo","formData"])):B("",!0)]})),_:1})])),_:1}),o.formLoding?(y(),v(d,{key:0,actionList:o.actionList,btnInfo:o.btnInfo,opType:o.config.opType,hideSaveBtn:o.config.hideSaveBtn,onHandleBtn:a.handleBtn,onHandlePress:a.handlePress,btnLoading:o.btnLoading,rightBtnList:o.rightBtnList,saveBtnText:o.properties.saveBtnText,hasComment:o.hasComment,hasSignFor:null==(g=null==(i=null==(s=t.flowInfo)?void 0:s.flowNodes)?void 0:i.global)?void 0:g.hasSignFor,todoBtnList:o.todoBtnList,isProcessing:o.config.isProcessing},null,8,["actionList","btnInfo","opType","hideSaveBtn","onHandleBtn","onHandlePress","btnLoading","rightBtnList","saveBtnText","hasComment","hasSignFor","todoBtnList","isProcessing"])):B("",!0),T(c,{list:o.flowUrgentList,modelValue:o.showFlowUrgent,"onUpdate:modelValue":e[1]||(e[1]=t=>o.showFlowUrgent=t),onConfirm:a.seltConfirm,"default-value":o.defaultValue},null,8,["list","modelValue","onConfirm","default-value"]),T(O,{mode:"bottom",ref:"reduceApprover","background-color":"#fff"},{default:w((()=>[T(h,{class:"approverContent"},{default:w((()=>[T(h,{class:"notice-warp"},{default:w((()=>[T(h,{class:"u-flex close-icon"},{default:w((()=>[T(f,{name:"close",size:"32",onClick:a.hideReduceApprover,color:"#93969c"},null,8,["onClick"])])),_:1}),T(h,{class:"search-box"},{default:w((()=>[T(p,{placeholder:t.$t("app.apply.pleaseKeyword"),modelValue:o.keyword,"onUpdate:modelValue":e[2]||(e[2]=t=>o.keyword=t),height:"72","show-action":!1,onChange:a.getAddSignUserList,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1})])),_:1}),T(h,{class:"popup"},{default:w((()=>[o.signUserIdList.length?(y(!0),S(C,{key:0},j(o.signUserIdList,((e,s)=>(y(),v(h,{key:s,class:"list-box"},{default:w((()=>[T(h,{class:"u-flex item"},{default:w((()=>[T(h,{class:"u-flex",style:{flex:"1"}},{default:w((()=>[T(u,{src:t.define.baseURL+e.headIcon},null,8,["src"]),T(h,{class:"u-m-l-10"},{default:w((()=>[T(h,null,{default:w((()=>[x(k(e.fullName),1)])),_:2},1024),T(h,null,{default:w((()=>[x(k(e.organize),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),T(h,{class:"",onClick:t=>a.deleteReduce(e.id)},{default:w((()=>[T(f,{name:"trash",size:"32",color:"#93969c"})])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)))),128)):(y(),v(_,{key:1}))])),_:1})])),_:1})])),_:1},512),o.userList.length?(y(),v(E,{key:1,list:o.userList,show:o.showSelectModal,onConfirm:a.selectUser,onClose:a.showSelectClose},null,8,["list","show","onConfirm","onClose"])):B("",!0)]})),_:1})}],["__scopeId","data-v-16f41110"]]);export{vt as default};