import{a2 as e,g as a,a as t,n as i,$ as o,K as l,o as d,X as s,p as n,w as r,q as p,t as m,v as u,B as c,D as h,E as f,F as g,x as b,y,I as V}from"./index-P0fyQ2Em.js";import{_ as C}from"./index.CIb_-r5F.js";import{r as L}from"./uni-app.es.DOtS5Ldl.js";import{_ as F,a as k}from"./u-form.B1LWETT2.js";import{_ as v,a as j}from"./u-radio-group.CbnO1TOv.js";import{_ as I}from"./index.D2KRRdBj.js";import{_,a as T}from"./index.PS-rWSqI.js";import{_ as N}from"./u-input.Cp2bygnN.js";import{_ as U,a as S}from"./index.Du-JSu8j.js";import{_ as x}from"./index.DgjoBC2V.js";import{_ as R}from"./index.BLChm46K.js";import{_ as A}from"./u-button.Chh1-6a-.js";import{C as q}from"./index.BoqsLhBg.js";import{H as O}from"./HandleOpinion.CRuckXPV.js";import{g as w,C as W}from"./commonWords.DzmSpZBH.js";import{_ as J}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./index.C9raOSI0.js";import"./u-search.CSVnMmHg.js";import"./u-icon.wXcRZHbn.js";import"./u-checkbox.Cy_cnskM.js";import"./u-checkbox-group.zSC_g3m3.js";import"./emitter.DrjJCwnj.js";import"./index.BuZ8YmVY.js";import"./resources.DEPsJg7u.js";import"./u-popup.CXrq2y3n.js";import"./index.DsvBnwWf.js";import"./u-tag.BmeG4z_q.js";import"./ly-tree.DZ8MU_HY.js";import"./u-avatar.q3DpmfEb.js";import"./base.DOXur1tF.js";import"./u-action-sheet.C0QG6n24.js";import"./lsj-upload.CSOZr0lY.js";import"./uni-icons.RJ8Vh9KU.js";const $=J({components:{HandleOpinion:O,CustomButton:q},data:()=>({copyIds:[],selectList:[],candidateList:[],commonList:[],title:"",label:"",name:{reject:"拒绝",launchRecall:"撤回",auditRecall:"撤回",audit:"同意",back:"退回",freeApprover:"加签",transfer:"转审"},ratioList:[{fullName:"10%",id:10},{fullName:"20%",id:20},{fullName:"30%",id:30},{fullName:"40%",id:40},{fullName:"50%",id:50},{fullName:"60%",id:60},{fullName:"70%",id:70},{fullName:"80%",id:80},{fullName:"90%",id:90},{fullName:"100%",id:100}],typeList:[{fullName:"审批前",id:1},{fullName:"审批后",id:2}],options:[{fullName:"或签",id:0},{fullName:"会签",id:1},{fullName:"依次审批",id:2}],list:[{fullName:"重新审批",disabled:!1,name:1},{fullName:"直接提交给我",disabled:!1,name:2}],props:{label:"nodeName",value:"nodeCode"},showCommonWords:!1,dataForm:{auditRatio:100,counterSign:0,addSignType:1,handleIds:"",handleVal:[],addSignUserIdList:"",fileList:[],handleOpinion:"",signImg:"",copyIds:"",branchList:[],candidateList:{},backNodeCode:"",backType:1},config:{},show:!1,selectVal:{},isCandidates:!1,rules:{branchList:[{required:!0,message:"请选择分支",type:"array",trigger:"blur,change"}],backNodeCode:[{required:!0,message:"请选择退回节点",trigger:"blur,change"}],signImg:[{required:!0,message:"请签名",trigger:"blur,change"}],addSignUserIdList:[{required:!0,message:"请选择加签人员",type:"array",trigger:"blur,change"}],handleIds:[{required:!0,message:"请选择人员",trigger:"blur,change"}],handleVal:[{required:!0,message:"请选择协办人员",trigger:"blur,change",type:"array"}],handleOpinion:[{required:!0,message:"请输入意见",trigger:"blur,change"}]},isCandidate:!1,propertiesType:""}),computed:{isBranch(){let e=!1;return 3!==this.candidateType&&(e=!0),this.branchList=this.config.branchList||[],this.branchList.length||(e=!1),"freeApprover"===this.config.type&&1===this.dataForm.addSignType&&(e=!1),e},showApproval(){return["audit","reject","approvalButton"].includes(this.config.type)},showCustomCopy(){return this.config.isCustomCopy&&["audit","reject"].includes(this.config.type)},showCandidate(){return!["transfer","revoke","recall","back","assist"].includes(this.config.type)&&this.isCandidate},showOpinion(){return["transfer","assist","revoke","auditRecall","launchRecall","back","freeApprover"].includes(this.config.type)},opinionTitle(){const e={transfer:{label:"转办原因"},audit:{label:"办理意见"}},a=this.config.type;let t={transfer:"转审原因",revoke:"撤销原因",assist:"协办原因",back:"退回意见",freeApprover:"加签意见",launchRecall:"撤回原因",auditRecall:"撤回原因",audit:"审批意见",reject:"审批意见"}[a]||"";return e[a]&&"processing"===this.propertiesType&&(t=e[a].label),t},fileLabel(){const e=this.config.type;if("transfer"===e&&"processing"===this.propertiesType)return"转办附件";if("audit"===e&&"processing"===this.propertiesType)return"办理附件";return{auditRecall:"撤回附件",freeApprover:"加签附件",back:"退回附件",transfer:"转审附件",audit:"审批附件",reject:"审批附件"}[e]||""},signRule(){return this.config.hasSign&&["audit","reject"].includes(this.config.type)}},onLoad(a){try{this.config=JSON.parse(decodeURIComponent(a.config))}catch{this.config=JSON.parse(a.config)}e("confirm",((e,a)=>{this.selectConfirm(e,a)})),this.init()},onReady(){this.$refs.dataForm.setRules(this.rules)},methods:{init(){var e,t,i,o;if(this.candidateType=this.config.candidateType,this.candidateList=this.config.candidateList||[],this.propertiesType=null==(e=this.config)?void 0:e.propertiesType,this.getSelector(),this.handleLabel(),this.config.candidateList.map((e=>{this.isCandidates=e.isCandidates})),this.copyIds=(null==(t=this.config)?void 0:t.circulateUser)||"",this.dataForm.backNodeCode=(null==(o=null==(i=this.config)?void 0:i.backNodeList)?void 0:o.length)?this.config.backNodeList[0].nodeCode:"",3!=this.candidateType&&(this.isCandidate=!0),this.branchList=this.config.branchList||[],1==this.candidateType){let e=[];this.isCandidate=!1;const a=this.candidateList;for(let t=0;t({title:"processing"===e?"办理":"审批",label:"审批"}),auditRecall:{title:"撤回审核",label:"撤回"},freeApprover:{title:"加签",label:"加签"},back:{title:"退回",label:"退回"},submit:{title:"提交审核",label:"提交审核"}},{title:l,label:d}=((e,a)=>{const t=o[e];return"function"==typeof t?t(a):t||{title:"",label:""}})(a,i);this.title=l,this.label=d,t({title:this.title})},changeUserSelect(e){this.dataForm.handleIds=e.join()},branchChange(e,a){this.dataForm.branchList=e,this.candidateList=[],this.init()},openSelect(e){e.formData=this.config.formData,e.taskId=this.config.operatorId,e.selectList=e.selectList||[],e.candidateList=JSON.stringify(this.candidateList),e.delegateUser=this.config.delegateUser,i({url:"/pages/workFlow/candiDateUserSelect/index?data="+encodeURIComponent(JSON.stringify(e))})},selectConfirm(e,a){let t=[];const i=this.candidateList.filter((e=>e.nodeCode==a))[0]||{};i.value=e.map((e=>e.id))||[],i.fullName=(e.map((e=>e.fullName))||[]).join(",")||"",i.selectList=e||[];for(let o=0;o{this.commonList=e.data.list||[]}))},confirmCommonWord(e){this.dataForm.handleOpinion=e.commonWordsText},handlePress(e){this.$emit("handlePress")},addCommonWords(){let e={commonWordsText:this.dataForm.handleOpinion,commonWordsType:1};W(e).then((e=>{this.$u.toast(e.msg)}))},freeApproverChange(e){this.isCandidates=!1,this.config.hasFreeApprover&&2==e&&this.candidateList.length&&(this.isCandidates=!0)},confirm(){var e;"freeApprover"===this.config.type&&(this.dataForm.addSignParameter={addSignUserIdList:this.dataForm.addSignUserIdList,auditRatio:this.dataForm.auditRatio,counterSign:this.dataForm.counterSign,addSignType:this.dataForm.addSignType}),this.config.hasSign||delete this.dataForm.signImg,this.dataForm.copyIds=Array.isArray(this.copyIds)&&this.copyIds.length&&this.copyIds.join(),3!==this.config.backType&&(this.dataForm.backType=this.config.backType);let a={...this.dataForm,eventType:["auditRecall","launchRecall"].includes(this.config.type)?"recall":this.config.type,approvalField:this.config.approvalField};if(this.isCandidates||this.isCandidate){let t={};for(let a=0;a{e&&(o("operate",a),setTimeout((()=>{l()}),500))}))}}},[["render",function(e,a,t,i,o,l){const q=L(d("JnpfSelect"),C),O=L(d("u-form-item"),F),w=L(d("u-radio"),v),W=L(d("u-radio-group"),j),J=p,$=L(d("JnpfUserSelect"),I),B=L(d("JnpfRadio"),_),H=V,D=L(d("u-input"),N),K=s("HandleOpinion"),P=L(d("JnpfInput"),U),X=L(d("JnpfTextarea"),T),E=L(d("JnpfInputNumber"),S),G=L(d("JnpfSign"),x),M=L(d("JnpfUploadFile"),R),Y=L(d("u-form"),k),z=s("CustomButton"),Q=L(d("u-button"),A);return m(),n(J,{class:"flow-popup-content"},{default:r((()=>[u(Y,{ref:"dataForm",model:o.dataForm,"label-width":200,errorType:["toast"]},{default:r((()=>[u(J,{class:"content"},{default:r((()=>[l.isBranch?(m(),n(O,{key:0,label:"分支选择",prop:"branchList",required:""},{default:r((()=>[u(q,{modelValue:o.dataForm.branchList,"onUpdate:modelValue":a[0]||(a[0]=e=>o.dataForm.branchList=e),onChange:l.branchChange,placeholder:"请选择审批分支",options:e.branchList,multiple:"",props:o.props},null,8,["modelValue","onChange","options","props"])])),_:1})):c("",!0),"back"===o.config.type&&o.config.backType?(m(),n(O,{key:1,class:"back-item",label:"退回节点",prop:"backNodeCode",required:""},{default:r((()=>[u(J,{class:"u-flex-col back-item-inner"},{default:r((()=>[u(q,{modelValue:o.dataForm.backNodeCode,"onUpdate:modelValue":a[1]||(a[1]=e=>o.dataForm.backNodeCode=e),options:o.config.backNodeList,props:o.props,disabled:2!=o.config.backNodeCode},null,8,["modelValue","options","props","disabled"]),3==o.config.backType?(m(),n(J,{key:0,class:"u-m-t-20 selectNode u-flex"},{default:r((()=>[u(W,{modelValue:o.dataForm.backType,"onUpdate:modelValue":a[2]||(a[2]=e=>o.dataForm.backType=e)},{default:r((()=>[(m(!0),h(g,null,f(o.list,((a,t)=>(m(),n(w,{onChange:t=>e.radioChange(a),key:t,name:a.name,disabled:a.disabled},{default:r((()=>[b(y(a.fullName),1)])),_:2},1032,["onChange","name","disabled"])))),128))])),_:1},8,["modelValue"])])),_:1})):c("",!0)])),_:1})])),_:1})):c("",!0),["transfer"].includes(o.config.type)&&"processing"!==o.propertiesType?(m(),n(O,{key:2,label:"转审给谁",prop:"handleIds",required:""},{default:r((()=>[u($,{modelValue:o.dataForm.handleIds,"onUpdate:modelValue":a[3]||(a[3]=e=>o.dataForm.handleIds=e)},null,8,["modelValue"])])),_:1})):c("",!0),["transfer"].includes(o.config.type)&&"processing"===o.propertiesType?(m(),n(O,{key:3,label:"转办给谁",prop:"handleIds",required:""},{default:r((()=>[u($,{modelValue:o.dataForm.handleIds,"onUpdate:modelValue":a[4]||(a[4]=e=>o.dataForm.handleIds=e)},null,8,["modelValue"])])),_:1})):c("",!0),["assist"].includes(o.config.type)?(m(),n(O,{key:4,label:"协办给谁",prop:"handleVal",required:""},{default:r((()=>[u($,{modelValue:o.dataForm.handleVal,"onUpdate:modelValue":a[5]||(a[5]=e=>o.dataForm.handleVal=e),multiple:"",onChange:l.changeUserSelect},null,8,["modelValue","onChange"])])),_:1})):c("",!0),"freeApprover"===o.config.type?(m(),n(J,{key:5},{default:r((()=>[u(O,{label:"加签人员",prop:"addSignUserIdList",required:""},{default:r((()=>[u($,{modelValue:o.dataForm.addSignUserIdList,"onUpdate:modelValue":a[6]||(a[6]=e=>o.dataForm.addSignUserIdList=e),multiple:""},null,8,["modelValue"])])),_:1}),u(O,{label:"加签类型"},{default:r((()=>[u(q,{options:o.typeList,modelValue:o.dataForm.addSignType,"onUpdate:modelValue":a[7]||(a[7]=e=>o.dataForm.addSignType=e),onChange:l.freeApproverChange},null,8,["options","modelValue","onChange"])])),_:1}),u(O,{label:"审批方式"},{default:r((()=>[u(B,{modelValue:o.dataForm.counterSign,"onUpdate:modelValue":a[8]||(a[8]=e=>o.dataForm.counterSign=e),options:o.options},null,8,["modelValue","options"])])),_:1}),1==o.dataForm.counterSign?(m(),n(O,{key:0,label:"会签比例"},{default:r((()=>[u(J,{class:"u-flex-col free-box"},{default:r((()=>[u(q,{options:o.ratioList,modelValue:o.dataForm.auditRatio,"onUpdate:modelValue":a[9]||(a[9]=e=>o.dataForm.auditRatio=e)},null,8,["options","modelValue"]),u(H,{class:"u-m-l-10 free-box-txt"},{default:r((()=>[b("达到会签比例则通过")])),_:1})])),_:1})])),_:1})):c("",!0)])),_:1})):c("",!0),l.showCandidate?(m(!0),h(g,{key:6},f(o.candidateList,((e,a)=>(m(),h(g,{key:a},[u(O,{label:e.nodeName+"审批人",required:!e.selected,"border-bottom":!1},{default:r((()=>[u(D,{type:"select",modelValue:e.fullName,"onUpdate:modelValue":a=>e.fullName=a,placeholder:"请选择审批候选人","input-align":"right",onClick:a=>l.openSelect(e)},null,8,["modelValue","onUpdate:modelValue","onClick"])])),_:2},1032,["label","required"]),e.selected?(m(),n(O,{key:0,label:"已选审批人"},{default:r((()=>[u(D,{type:"textarea",modelValue:e.selected,"onUpdate:modelValue":a=>e.selected=a,class:"textarea",border:"",disabled:"",placeholder:""},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024)):c("",!0)],64)))),128)):c("",!0),l.showOpinion?(m(),n(O,{key:7,label:l.opinionTitle},{default:r((()=>[u(K,{commonList:o.commonList,modelValue:o.dataForm.handleOpinion,"onUpdate:modelValue":a[10]||(a[10]=e=>o.dataForm.handleOpinion=e),onAddCommonWords:l.addCommonWords,showCommon:!1},null,8,["commonList","modelValue","onAddCommonWords"])])),_:1},8,["label"])):c("",!0),l.showApproval?(m(),n(O,{key:8,prop:"handleOpinion",required:"","label-position":"top",label:l.opinionTitle},{default:r((()=>[u(K,{commonList:o.commonList,modelValue:o.dataForm.handleOpinion,"onUpdate:modelValue":a[11]||(a[11]=e=>o.dataForm.handleOpinion=e),onAddCommonWords:l.addCommonWords},null,8,["commonList","modelValue","onAddCommonWords"])])),_:1},8,["label"])):c("",!0),o.config.approvalField.length?(m(!0),h(g,{key:9},f(o.config.approvalField,((e,a)=>(m(),n(O,{"label-position":"left",label:e.fieldName,key:a},{default:r((()=>["input"==e.jnpfKey?(m(),n(P,{key:0,modelValue:e.value,"onUpdate:modelValue":a=>e.value=a},null,8,["modelValue","onUpdate:modelValue"])):c("",!0),"textarea"==e.jnpfKey?(m(),n(X,{key:1,modelValue:e.value,"onUpdate:modelValue":a=>e.value=a},null,8,["modelValue","onUpdate:modelValue"])):c("",!0),"inputNumber"==e.jnpfKey?(m(),n(E,{key:2,modelValue:e.value,"onUpdate:modelValue":a=>e.value=a},null,8,["modelValue","onUpdate:modelValue"])):c("",!0)])),_:2},1032,["label"])))),128)):c("",!0),o.config.hasSign?(m(),n(O,{key:10,prop:l.signRule?"signImg":"",required:l.signRule},{default:r((()=>[u(G,{modelValue:o.dataForm.signImg,"onUpdate:modelValue":a[12]||(a[12]=e=>o.dataForm.signImg=e),signType:"ApprovalSign"},null,8,["modelValue"])])),_:1},8,["prop","required"])):c("",!0),o.config.hasFile?(m(),n(O,{key:11},{default:r((()=>[u(J,{class:"uploadFile"},{default:r((()=>[u(M,{modelValue:o.dataForm.fileList,"onUpdate:modelValue":a[13]||(a[13]=e=>o.dataForm.fileList=e),limit:3,align:"left"},null,8,["modelValue"])])),_:1})])),_:1})):c("",!0),l.showCustomCopy?(m(),n(O,{key:12,label:"抄送人员"},{default:r((()=>[u($,{modelValue:o.copyIds,"onUpdate:modelValue":a[14]||(a[14]=e=>o.copyIds=e),multiple:""},null,8,["modelValue"])])),_:1})):c("",!0)])),_:1})])),_:1},8,["model"]),u(J,{class:"flowBefore-actions"},{default:r((()=>[u(z,{class:"u-flex buttom-btn-left-inner",btnText:e.$t("common.cancelText"),btnIcon:"icon-ym icon-ym-add-cancel",customIcon:""},null,8,["btnText"]),u(Q,{class:"buttom-btn",type:"primary",onClick:a[15]||(a[15]=e=>l.confirm("confirm"))},{default:r((()=>[b(y(e.$t("common.okText")),1)])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-6ca69fbc"]]);export{$ as default};