pages-workFlow-flowBefore-revokeForm.Qke5NTp6.js 8.0 KB

1
  1. import{g as t,Z as o,Y as e,n as i,ac as s,b as r,I as n,X as a,k as l,m as f,w as m,o as p,p as d,A as h,a1 as g,v as c,q as u,z as L}from"./index-C9TJPork.js";import{_ as j}from"./u-select._zRP6WN5.js";import{r as w}from"./uni-app.es.CUt9gedF.js";import{F as I}from"./flowBefore.ByZZauY_.js";import{g as v}from"./visualDev.BBHwDjmz.js";import{c as b}from"./flowEngine.DQGtFE3U.js";import{c as x}from"./form.DUFP5a_o.js";import{f as y}from"./flowBtn.Cn-oianJ.js";import{R as C}from"./index.C22M-S3z.js";import{_ as T}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-popup.7vl_vYde.js";import"./u-icon.BNGPST4x.js";import"./index.xne9cW2P.js";import"./index.JD_F80lD.js";import"./u-divider.OXt8wuKL.js";import"./u-line.DT3xflsc.js";import"./u-upload.C47NF8qM.js";import"./uni-icons.RLS1HIfd.js";import"./u-input.cq_N7lcW.js";import"./emitter.DrjJCwnj.js";import"./index.ChsH6p4P.js";import"./u-search.DOsDiA_z.js";import"./u-checkbox.DJ2PERbW.js";import"./u-checkbox-group.DHs1JB4s.js";import"./u-radio-group.BjzEj90s.js";import"./resources.DEPsJg7u.js";import"./u-button.C_4h_wUh.js";import"./mp-html.2sjiF9X0.js";import"./u-form.D7hQ6Wil.js";import"./u-tabs.CYgabJiD.js";import"./u-badge.BHkDpFBd.js";import"./index.CGKbu-GF.js";import"./base.2x6xVo4W.js";import"./index.DgFntJr-.js";import"./index.wn1wOnr0.js";import"./index.DcbbriKv.js";import"./u-loading.U11iGLth.js";import"./index.CdyKhOVe.js";import"./u-tag.Bh8Dlw6Z.js";import"./ly-tree.D703-q15.js";import"./index.D8pU8O9m.js";import"./index.Dsioj_0m.js";import"./lsj-upload.BbvSShYb.js";import"./index.0iW0RovP.js";import"./index.CBTp4-Gm.js";import"./u-avatar.B8J43dhc.js";import"./u-tabs-swiper.7mAQsu3f.js";import"./index.DnzbI5dt.js";import"./u-action-sheet.BBR1EfIr.js";import"./order.ByFS2HgB.js";import"./index.EdP8UdTp.js";import"./u-time-line.5hGOY-3W.js";import"./uni-popup.DMKcDE3C.js";import"./index.BeMkBjFo.js";import"./useDefineSetting.BfaIxVbd.js";import"./index.BibifGpc.js";import"./emoji.DwmieXKz.js";import"./u-subsection.D8Of0b4C.js";import"./u-image.rajv-jH8.js";import"./u-cell-group.BPfexNA1.js";import"./document.CBtG0N9y.js";t("sysConfigInfo");const U=T({components:{childForm:x,flowBtn:y,RecordTimeList:C},data:()=>({dataLogList:[],dataLog:!1,childFormKey:+new Date,formLoding:!1,loading:!1,taskInfo:{},btnInfo:[],show:!1,config:{},formData:{},properties:{},btnLoading:!1,commentList:[],tabsName:"表单信息",title:"",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"}],showAction:!1,actionList:[],hasComment:!1,progressList:[],rightBtnList:[]}),computed:{baseURL(){return this.define.baseURL},getShowExtraPanel(){var t,o;return this.dataLog&&(null==(o=null==(t=this.config)?void 0:t.formData)?void 0:o.id)||"-1"!=this.config.opType&&!this.loading}},onUnload(){o("comment")},onShow(){e("comment",(t=>{this.commentList=[],this.current=0,this.addComment(t)}))},onLoad(t){this.config=JSON.parse(this.jnpf.base64.decode(t.config)),this.$nextTick((()=>{this.getBeforeInfo(this.config)}))},methods:{addComment(t){t.taskId=this.config.id,b(t).then((t=>{this.$nextTick((()=>{this.$refs.RecordTimeList.change(1)}))}))},handleBtn(t,o={}){"comment".includes(t)&&this.goWriteComment()},goWriteComment(t){let o={taskId:this.config.id};t&&(o.replyId=t),o=encodeURIComponent(JSON.stringify(o)),i({url:"/pages/workFlow/comment/index?data="+o})},getBeforeInfo(){let t=this.config;this.formData.flowId=t.flowId,this.loading=!0;const o={flowId:t.flowId,opType:2==t.opType?3:t.opType};"-1"!=t.opType&&"0"!=t.opType&&(o.operatorId=t.operatorId),I((null==t?void 0:t.taskId)||(null==t?void 0:t.id)||0,o).then((o=>{this.flowInfo=o.data.flowInfo||{},this.properties=o.data.nodeProperties||{},this.formInfo=o.data.formInfo||{},this.taskInfo=o.data.taskInfo||{},this.btnInfo=o.data.btnInfo||[],this.progressList=o.data.progressList||[],t.formOperates=o.data.formOperates||[],t.formType=this.formInfo.type;const e="-1"==t.opType?this.flowInfo.fullName:this.taskInfo.fullName;t.fullName=e,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=o.data.draftData||null,t.formData=o.data.formData||{};let i=t.formData.id;t.formEnCode=this.formInfo.enCode,this.recordList=(o.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.formLoding=!0,s({title:"revoke"===this.config.formEnCode?`${this.flowInfo.fullName}撤销申请`:this.flowInfo.fullName}),t.formRecords&&t.title&&s({title:t.title}),this.flowUrgent=this.taskInfo.flowUrgent||1;this.selectflowUrgent=(()=>{var t={value:this.flowUrgent,extra:"0",label:"普通"};return this.flowUrgentList.forEach(((o,e)=>{o.value==this.flowUrgent&&(t.extra=e,t.label=o.label)})),t})(),"-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=o.data.formOperates||[],setTimeout((()=>{this.$nextTick((()=>{this.$refs.child&&this.$refs.child.$refs.form?this.$refs.child.$refs.form.init(t):r({title:"暂无此流程表单",icon:"none",complete:()=>{setTimeout((()=>{n()}),1500)}})}))}),100),this.loading=!1,this.config=t}))},getOnlineLog(t){let o=this.formInfo.id;v(o,t).then((t=>{let o=t.data.list||[];this.dataLogList=[...o].reverse()}))},initBtnList(){const t=[];this.properties,this.btnInfo,this.hasComment&&"-1"!=this.config.opType&&this.rightBtnList.length&&t.push({id:"comment",text:"评论"}),this.actionList=t},handleShowSelect(){"-1"==this.config.opType&&(this.showFlowUrgent=!0)},seltConfirm(t){this.flowUrgent=t[0].value,this.selectflowUrgent=t[0],this.defaultValue=[this.flowUrgentList.findIndex((o=>o.value===t[0].value))]}}},[["render",function(t,o,e,i,s,r){const n=a("childForm"),I=a("RecordTimeList"),v=p,b=a("flowBtn"),x=w(l("u-select"),j);return d(),f(v,{class:"flowBefore-v"},{default:m((()=>{var e,i,a;return[h("div",{class:"flow-urgent-value",style:g({"background-color":s.flowUrgentList[s.selectflowUrgent.extra].bgColor}),onClick:o[0]||(o[0]=(...t)=>r.handleShowSelect&&r.handleShowSelect(...t))},[h("span",{style:g({color:s.flowUrgentList[s.selectflowUrgent.extra].color})},c(s.selectflowUrgent.label),5)],4),u(v,{class:"flowBefore-box"},{default:m((()=>[u(v,{class:"scroll-v","scroll-y":""},{default:m((()=>{var t,o;return[s.loading?L("",!0):(d(),f(n,{ref:"child",config:s.config,key:s.childFormKey},null,8,["config"])),s.loading?L("",!0):(d(),f(I,{key:1,progressList:s.progressList,taskInfo:s.taskInfo,commentList:s.commentList,taskId:s.config.id,ref:"RecordTimeList",onHandleReply:r.goWriteComment,hasComment:s.hasComment,dataLog:s.dataLog,opType:s.config.opType,formID:null==(o=null==(t=s.config)?void 0:t.formData)?void 0:o.id,dataLogList:s.dataLogList},null,8,["progressList","taskInfo","commentList","taskId","onHandleReply","hasComment","dataLog","opType","formID","dataLogList"]))]})),_:1})])),_:1}),s.formLoding?(d(),f(b,{key:0,actionList:s.actionList,btnInfo:s.btnInfo,opType:s.config.opType,hideSaveBtn:s.config.hideSaveBtn,onHandleBtn:r.handleBtn,btnLoading:s.btnLoading,rightBtnList:s.rightBtnList,saveBtnText:s.properties.saveBtnText,hasComment:s.hasComment,hasSignFor:null==(a=null==(i=null==(e=t.flowInfo)?void 0:e.flowNodes)?void 0:i.global)?void 0:a.hasSignFor},null,8,["actionList","btnInfo","opType","hideSaveBtn","onHandleBtn","btnLoading","rightBtnList","saveBtnText","hasComment","hasSignFor"])):L("",!0),u(x,{list:s.flowUrgentList,modelValue:s.showFlowUrgent,"onUpdate:modelValue":o[1]||(o[1]=t=>s.showFlowUrgent=t),onConfirm:r.seltConfirm,"default-value":s.defaultValue},null,8,["list","modelValue","onConfirm","default-value"])]})),_:1})}],["__scopeId","data-v-facc9eba"]]);export{U as default};