import{a6 as e,g as t,a1 as a,T as i,U as o,e as s,n,J as l,$ as d,q as r,c,w as p,i as h,o as m,t as f,G as u,A as g,C as y,D as b,F as T,v as L,x as v,H as C,E as k,a5 as _,b3 as j,a0 as F,B as x}from"./index-q4e9g9yE.js";import{_ as V}from"./index.CSUS0XkT.js";import{r as I}from"./uni-app.es.xrkMgk95.js";import{_ as W,a as w}from"./u-form.CYIYSjYw.js";import{_ as S,a as U}from"./u-radio-group.CXgzmKAa.js";import{_ as A}from"./index.xmDOlOIj.js";import{_ as N}from"./u-input.DYf86bZO.js";import{_ as D}from"./u-button.C4-DWqAF.js";import{_ as O}from"./index.CqSQsNBF.js";import{_ as $}from"./index.oV8cgrFf.js";import{_ as B}from"./u-icon.-mUgdvoC.js";import{_ as J}from"./u-popup.DF0FfdDZ.js";import{r as q}from"./resources.DipqUmnN.js";import{_ as E}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./MultSelect.TVbPCNeO.js";import"./u-search.CaJ7gLmG.js";import"./u-checkbox.CgXB409k.js";import"./u-checkbox-group.Df9YeOSE.js";import"./emitter.DrjJCwnj.js";import"./u-avatar.zMXA-uuc.js";import"./ly-tree.CKcX-trg.js";import"./u-badge.CxYuT2nG.js";import"./ly-checkbox.DrDVjFAd.js";import"./u-action-sheet.BGFPFmXO.js";function z(t){return e({url:"/api/system/CommonWords",method:"post",data:t})}function P(t){return e({url:`/api/system/CommonWords/${t.id}`,method:"put",data:t})}const R=E({data:()=>({placeholder:"请输入",icon:q.message.nodata,customStyle:{color:"red",width:"100%",height:"100%",borderRadius:"0",border:"0"},commonWordsText:"",show2:!1,show:!1,btnTxt:"确认",typeList:[{fullName:"审批前",id:1},{fullName:"审批后",id:2}],props:{label:"nodeName",value:"nodeCode"},list:[{fullName:"重新审批",disabled:!1,name:1},{fullName:"直接提交给我",disabled:!1,name:2}],config:{},dataForm:{fileList:[],handleOpinion:"",signImg:"",copyIds:"",freeApproverUserId:"",branchList:[],candidateList:{},rejectStep:"",freeApproverType:1,rejectType:1},candidateValue:{},selectList:[],selectVal:{},isCandidate:!1,branchList:[],candidateList:[],candidateType:"",seletUserLabel:"选择人员",opinionName:"审批意见",isShow:!0,isBranch:!1,isSign:!1,rejectList:[],isLastAppro:!0,rejectType:1,commonWordsList:[],commonWordsData:{},key:+new Date}),onLoad(e){try{this.config=JSON.parse(decodeURIComponent(e.config))}catch{this.config=JSON.parse(e.config)}this.userInfo=t("userInfo")||{},this.dataForm.signImg=this.userInfo.signImg,this.rejectList=this.config.rejectList.list||[],this.rejectType=this.config.rejectType,this.isLastAppro=this.config.rejectList.isLastAppro,a({title:this.config.title}),this.btnTxt=this.btnTxt+this.config.title.replace(/\s+/g,""),this.isCandidate=!0,this.candidateType=this.config.candidateType,this.isSign="submit"!==this.config.eventType&&this.config.hasSign,this.config.hasFreeApprover?(this.opinionName="加签原因",this.seletUserLabel="加签人员",this.isBranch=!1):this.isBranch=1==this.candidateType&&"transfer"!==this.config.eventType&&"reject"!==this.config.eventType,3===this.candidateType&&(this.isCandidate=!1),this.candidateList=this.config.candidateList,this.branchList=this.config.branchList||[],this.branchList.length&&(this.branchList=this.branchList.filter((e=>e.isBranchFlow)),this.candidateList=this.config.branchList.filter((e=>!e.isBranchFlow&&e.isCandidates)),this.candidateList=this.candidateList.map((e=>({...e,label:e.nodeName+"审批人"})))),"reject"!==this.config.eventType&&"revoke"!==this.config.eventType&&"recall"!==this.config.eventType&&"submit"!==this.config.eventType&&"transfer"!==this.config.eventType||("transfer"===this.config.eventType&&(this.seletUserLabel="转给谁",this.opinionName="转审原因",this.placeholder="请输入"),"reject"===this.config.eventType&&(this.opinionName="退回意见",this.dataForm.rejectStep=this.rejectList[0][this.props.value],this.dataForm.rejectType=3!=this.rejectType?this.rejectType:1),"recall"===this.config.eventType&&(this.opinionName="撤回原因",this.placeholder="请输入"),"revoke"===this.config.eventType&&(this.opinionName="撤回原因",this.placeholder="请输入")),"approvalCancel"===this.config.eventType&&(this.opinionName="驳回原因",this.placeholder="请输入"),i("confirm",((e,t)=>{this.selectConfirm(e,t)})),this.init(),"submit"!==this.config.eventType&&this.config.hasOpinion&&this.getSelector()},onUnload(){o("confirm")},methods:{init(){if(1==this.candidateType){let e=[];this.isCandidate=!1;const t=this.candidateList;for(let a=0;a({...e,label:e.nodeName+"审批人"}))));this.key=+new Date},getSelector(){e({url:"/api/system/CommonWords/Selector?type=App",method:"get"}).then((e=>{this.commonWordsList=e.data.list||[],this.key=+new Date}))},confirm(e){if(this.commonWordsData.commonWordsText=this.commonWordsText,this.commonWordsData.commonWordsType=1,!this.commonWordsText)return this.$u.toast("审批常用语不能为空");(0===this.commonWordsData.id?z:P)(this.commonWordsData).then((e=>{this.show2=!1,this.commonWordsText="",s({title:e.msg,icon:"none",complete:()=>{this.getSelector()}})})).catch((e=>{this.show2=!1,this.getSelector()}))},cancel(){this.show2=!1,this.commonWordsText=""},commonWords(){this.show=!0,this.key=+new Date},selectCommonWord(e){this.dataForm.handleOpinion=this.dataForm.handleOpinion+e.commonWordsText,this.show=!1},delCommonWord(t){var a;(a=t.id,e({url:`/api/system/CommonWords/${a}`,method:"DELETE"})).then((e=>{this.$u.toast(e.msg),this.getSelector()}))},editCommonWord(e){this.show2=!0;let t={commonWordsText:"",enabledMark:1,id:0,sortCode:0,systemIds:[],systemNames:[]};e.id?(this.commonWordsText=e.commonWordsText,this.commonWordsData={...e,systemIds:[],systemNames:[]}):(this.commonWordsText="",this.commonWordsData=t)},radioChange(e){this.dataForm.rejectType=e.name},open(e){this.isShow=!e},change(e,t){if(!e.length)return this.dataForm.candidateList={};let a=[];for(let i=0;i0&&(this.isBranch=!0))},openSelect(e){this.selectList=[];for(let t in this.selectVal)t===e.nodeId&&(this.selectList=this.selectVal[t]);e.formData=this.config.formData,e.taskId=this.config.taskId,e.selectList=this.selectList,e.candidateList=JSON.stringify(this.candidateList),n({url:"/pages/workFlow/candiDateUserSelect/index?data="+encodeURIComponent(JSON.stringify(e))})},selectConfirm(e,t){let a=e,i=[],o=[],s=[];for(let n=0;n[f(d,{class:"jnpf-wrap"},{default:p((()=>[f(G,{model:o.dataForm,"label-position":"left","label-width":"150",ref:"dataForm"},{default:p((()=>[f(d,{class:"u-p-l-20 u-p-r-20 form-item-box"},{default:p((()=>["reject"===o.config.eventType&&o.isLastAppro?(m(),c(l,{key:0,label:"退回节点",class:u({"form-item":3==o.rejectType})},{default:p((()=>[f(n,{modelValue:o.dataForm.rejectStep,"onUpdate:modelValue":t[0]||(t[0]=e=>o.dataForm.rejectStep=e),options:o.config.rejectList.list,props:o.props,disabled:2!=o.config.rejectStep},null,8,["modelValue","options","props","disabled"])])),_:1},8,["class"])):g("",!0)])),_:1}),3==o.rejectType&&"reject"===o.config.eventType?(m(),c(d,{key:0,class:"reject"},{default:p((()=>[f(d,{class:""},{default:p((()=>[f(E,{modelValue:o.dataForm.rejectType,"onUpdate:modelValue":t[1]||(t[1]=e=>o.dataForm.rejectType=e)},{default:p((()=>[(m(!0),y(T,null,b(o.list,((e,t)=>(m(),c(q,{onChange:t=>s.radioChange(e),key:t,name:e.name,disabled:e.disabled},{default:p((()=>[L(v(e.fullName),1)])),_:2},1032,["onChange","name","disabled"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1})):g("",!0),f(d,{class:"u-p-l-20 u-p-r-20 form-item-box"},{default:p((()=>[o.isBranch?(m(),c(l,{key:0,label:"分支选择",prop:"branch",required:""},{default:p((()=>[f(n,{modelValue:o.dataForm.branchList,"onUpdate:modelValue":t[2]||(t[2]=e=>o.dataForm.branchList=e),onChange:s.branchChange,placeholder:"请选择审批分支",options:o.branchList,multiple:"",props:o.config.props},null,8,["modelValue","onChange","options","props"])])),_:1})):g("",!0),!o.config.hasFreeApprover&&"transfer"!==o.config.eventType||"revoke"===o.config.eventType||"recall"===o.config.eventType||"reject"===o.config.eventType?g("",!0):(m(),c(l,{key:1,label:o.seletUserLabel,prop:"freeApproverUserId",required:!("transfer"!==o.config.eventType&&!o.config.hasFreeApprover)},{default:p((()=>[f(z,{modelValue:o.dataForm.freeApproverUserId,"onUpdate:modelValue":t[3]||(t[3]=e=>o.dataForm.freeApproverUserId=e),onOpen:s.open},null,8,["modelValue","onOpen"])])),_:1},8,["label","required"])),o.config.hasFreeApprover?(m(),c(l,{key:2,label:"加签类型"},{default:p((()=>[f(n,{options:o.typeList,modelValue:o.dataForm.freeApproverType,"onUpdate:modelValue":t[4]||(t[4]=e=>o.dataForm.freeApproverType=e),onChange:s.freeApproverChange},null,8,["options","modelValue","onChange"])])),_:1})):g("",!0),"transfer"!==o.config.eventType&&"revoke"!==o.config.eventType&&"recall"!==o.config.eventType&&o.isCandidate?(m(!0),y(T,{key:3},b(o.candidateList,((e,t)=>(m(),c(l,{prop:"comInput",key:t,label:e.nodeName,required:""},{default:p((()=>[e.hasCandidates?(m(),c(P,{key:0,type:"select","select-open":e.selectShow,modelValue:o.candidateValue[e.nodeId],"onUpdate:modelValue":t=>o.candidateValue[e.nodeId]=t,onClick:t=>s.openSelect(e),placeholder:"请选择审批候选人","input-align":"right"},null,8,["select-open","modelValue","onUpdate:modelValue","onClick"])):(m(),c(z,{key:1,modelValue:o.candidateValue[e.nodeId],"onUpdate:modelValue":t=>o.candidateValue[e.nodeId]=t,multiple:"",onChange:t=>s.change(t,e.nodeId),onOpen:s.open},null,8,["modelValue","onUpdate:modelValue","onChange","onOpen"]))])),_:2},1032,["label"])))),128)):g("",!0),"submit"!==o.config.eventType&&o.config.hasOpinion?(m(),c(l,{key:4,label:o.opinionName,prop:"handleOpinion"},{default:p((()=>[f(d,{class:"words-contain"},{default:p((()=>[f(P,{style:{flex:"1"},modelValue:o.dataForm.handleOpinion,"onUpdate:modelValue":t[5]||(t[5]=e=>o.dataForm.handleOpinion=e),type:"textarea",placeholder:o.placeholder,"input-align":"right"},null,8,["modelValue","placeholder"]),"transfer"!=o.config.eventType&&"recall"!=o.config.eventType&&"revoke"!==o.config.eventType&&"approvalCancel"!==o.config.eventType?(m(),c(d,{key:0,class:"u-p-10"},{default:p((()=>[f(R,{size:"mini",onClick:s.commonWords},{default:p((()=>[L("常用语")])),_:1},8,["onClick"])])),_:1})):g("",!0)])),_:1})])),_:1},8,["label"])):g("",!0),"submit"!==o.config.eventType&&o.config.hasOpinion?(m(),c(l,{key:5,label:o.config.title+"附件",prop:"fileList"},{default:p((()=>[f(H,{modelValue:o.dataForm.fileList,"onUpdate:modelValue":t[6]||(t[6]=e=>o.dataForm.fileList=e),limit:3},null,8,["modelValue"])])),_:1},8,["label"])):g("",!0),o.config.isCustomCopy&&"transfer"!==o.config.eventType&&"revoke"!==o.config.eventType&&"recall"!==o.config.eventType?(m(),c(l,{key:6,label:"抄送人员",prop:"copyIds"},{default:p((()=>[f(z,{modelValue:o.dataForm.copyIds,"onUpdate:modelValue":t[7]||(t[7]=e=>o.dataForm.copyIds=e),multiple:"",onOpen:s.open},null,8,["modelValue","onOpen"])])),_:1})):g("",!0),o.isSign?(m(),c(l,{key:7,label:"签名",prop:"signImg",required:""},{default:p((()=>[f(M,{modelValue:o.dataForm.signImg,"onUpdate:modelValue":t[8]||(t[8]=e=>o.dataForm.signImg=e),isInvoke:!0},null,8,["modelValue"])])),_:1})):g("",!0)])),_:1})])),_:1},8,["model"])])),_:1}),o.isShow?(m(),c(d,{key:0},{default:p((()=>["submit"!==o.config.eventType?(m(),c(d,{key:0,class:"flowBefore-actions"},{default:p((()=>[f(R,{class:"buttom-btn",type:"primary",onClick:t[9]||(t[9]=e=>s.handleClick(o.config.eventType))},{default:p((()=>[L(v(o.btnTxt),1)])),_:1})])),_:1})):g("",!0)])),_:1})):g("",!0),o.isShow?(m(),c(d,{key:1},{default:p((()=>["submit"===o.config.eventType?(m(),c(d,{key:0,class:"flowBefore-actions"},{default:p((()=>[f(R,{class:"buttom-btn",onClick:t[10]||(t[10]=e=>s.handleClick("cancel"))},{default:p((()=>[L("取消")])),_:1}),f(R,{class:"buttom-btn",type:"primary",onClick:t[11]||(t[11]=e=>s.handleClick(o.config.eventType))},{default:p((()=>[L("确定 ")])),_:1})])),_:1})):g("",!0)])),_:1})):g("",!0),f(Y,{modelValue:o.show,"onUpdate:modelValue":t[12]||(t[12]=e=>o.show=e),mode:"bottom","border-radius":"14",height:"700rpx",closeable:"","mask-close-able":!1},{default:p((()=>[f(d,{class:"u-p-28 hd",style:{"text-align":"center"}},{default:p((()=>[L("常用审批语")])),_:1}),f(d,{class:"add"},{default:p((()=>[f(d,{class:"add-inner",onClick:s.editCommonWord},{default:p((()=>[f(Z,{name:"plus-circle-fill",color:"#81d3f8",size:"28"}),f(K,{class:"u-m-l-8"},{default:p((()=>[L("添加常用语")])),_:1})])),_:1},8,["onClick"])])),_:1}),f(d,{class:"content"},{default:p((()=>[f(X,{"scroll-y":"true",style:{height:"480rpx"}},{default:p((()=>[f(d,{class:"commonList u-flex-col"},{default:p((()=>[o.commonWordsList.length>0?(m(!0),y(T,{key:0},b(o.commonWordsList,((e,t)=>(m(),c(d,{class:"u-flex item",key:t},{default:p((()=>[f(d,{class:"txt",onClick:t=>s.selectCommonWord(e)},{default:p((()=>[L(v(e.commonWordsText),1)])),_:2},1032,["onClick"]),1==e.commonWordsType?(m(),c(d,{key:0,class:"icon",onClick:F((t=>s.editCommonWord(e)),["stop"])},{default:p((()=>[x("i",{class:"icon-ym icon-ym-btn-edit",style:{color:"#81d3f8","font-size":"36rpx"}})])),_:2},1032,["onClick"])):g("",!0),1==e.commonWordsType?(m(),c(d,{key:1,class:"icon",onClick:F((t=>s.delCommonWord(e)),["stop"])},{default:p((()=>[x("i",{class:"icon-ym icon-ym-extend-trash",style:{color:"#e35d4b","font-size":"36rpx"}})])),_:2},1032,["onClick"])):g("",!0)])),_:2},1024)))),128)):g("",!0),o.commonWordsList.length<=0?(m(),c(d,{key:1,class:""},{default:p((()=>[f(d,{class:"notData-box u-flex-col"},{default:p((()=>[f(d,{class:"u-flex-col notData-inner"},{default:p((()=>[f(Q,{src:o.icon,mode:"",class:"iconImg"},null,8,["src"]),f(K,{class:"notData-inner-text"},{default:p((()=>[L("暂无数据")])),_:1})])),_:1})])),_:1})])),_:1})):g("",!0)])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"]),(m(),c(Y,{modelValue:o.show2,"onUpdate:modelValue":t[14]||(t[14]=e=>o.show2=e),mode:"center",width:"500rpx","border-radius":"24",key:o.key},{default:p((()=>[f(d,{class:"u-flex-col innerPopup-box"},{default:p((()=>[f(d,{class:"innerPopup-hd"},{default:p((()=>[L(" 审批常用语 ")])),_:1}),f(d,{class:"innerPopup-content"},{default:p((()=>[f(P,{modelValue:o.commonWordsText,"onUpdate:modelValue":t[13]||(t[13]=e=>o.commonWordsText=e),type:"textarea",placeholder:"请输入内容","auto-height":!1,maxlength:"99999",height:"150","input-align":"right"},null,8,["modelValue"])])),_:1}),f(d,{class:"u-flex btn-box"},{default:p((()=>[f(ee,{class:"btn",onClick:s.cancel},{default:p((()=>[L("取消")])),_:1},8,["onClick"]),f(ee,{class:"btn btn2",onClick:s.confirm},{default:p((()=>[L("确定")])),_:1},8,["onClick"])])),_:1})])),_:1})])),_:1},8,["modelValue"]))])),_:1})}],["__scopeId","data-v-1db7c0b3"]]);export{R as default};