"use strict";const s=require("../../common/vendor.js"),l=require("../../api/projectProcess/projectProcess.js"),u=()=>"../../components/BottomTabBar.js",h={name:"ProcessDetail",components:{BottomTabBar:u},data(){return{detailData:{},taskList:[],total:0,selectTabId:2,tableLoading:!1,queryParams:{taskName:"",taskType:"todo",pageSize:10,currentPage:1,projectId:null,processDefId:null,processInsId:null,deployId:null,processName:""},tabs:[{id:1,label:"全部",type:"all",colorClass:"all-color"},{id:2,label:"待办",type:"todo",colorClass:"todo-color"},{id:4,label:"剩余",type:"remaining",colorClass:"remaining-color"},{id:5,label:"按时",type:"timely",colorClass:"timely-color"},{id:6,label:"超时",type:"overtime",colorClass:"overtime-color"},{id:3,label:"容缺",type:"wait",colorClass:"wait-color"},{id:7,label:"跳过",type:"jump",colorClass:"jump-color"},{id:8,label:"督办",type:"urge",colorClass:"urge-color"}],superviseForm:{taskId:null,projectId:null,processInsId:null,receiverIds:null,receiverType:null,superviseType:"SUPERVISE",content:""},showSupervisePopup:!1}},onShow(){s.index.__f__("log","at subpackage/flowable/process-detail.vue:197","执行onshow"),this.getDetail(),this.getList()},onLoad(e){s.index.__f__("log","at subpackage/flowable/process-detail.vue:202","执行onload");const t=i=>{if(typeof i!="string"||i==="")return"";try{return decodeURIComponent(i)}catch(p){return s.index.__f__("error","at subpackage/flowable/process-detail.vue:208","参数解码失败:",p,"原始值:",i),i}};t(e.projectId)&&(this.queryParams.projectId=t(e.projectId),this.queryParams.processDefId=t(e.processDefId),this.queryParams.processInsId=t(e.processInsId),this.queryParams.deployId=t(e.deployId),this.queryParams.processName=t(e.processName),this.getDetail(),this.getList())},methods:{getTabCount(e){if(!this.detailData.statistics)return 0;const t={all:"totalTaskNum",todo:"todoTaskNum",remaining:"remainingTaskNum",timely:"timelyFinishedTaskNum",overtime:"overtimeTaskNum",wait:"waitTaskNum",jump:"jumpTaskNum",urge:"urgeTaskNum"};return this.detailData.statistics[t[e]]||0},formatUnitName(e){return e?Array.isArray(e)?e.filter(t=>t&&t.trim()).join(", ")||"未指定责任单位":e:"未指定责任单位"},getStatusClass(e){return{待办:"todo",已完成:"finished",进行中:"processing",未开始:"pending",容缺:"wait",挂起:"suspend"}[e]||""},getDetail(){const e=/^\d+(\.\d+)?$/.test(this.queryParams.projectId)?"PROJECT":"ENGINEERING";l.getProjectProcessDetail({projectId:this.queryParams.projectId,processDefId:this.queryParams.processDefId,projectType:e}).then(t=>{t.statusCode===200&&(this.detailData=t.data.data,s.index.__f__("log","at subpackage/flowable/process-detail.vue:266",this.detailData))})},getList(){this.tableLoading=!0,l.getProjectProcessDetailTaskList(this.queryParams).then(e=>{this.taskList=e.data.data||[],this.total=e.data.total||0,this.tableLoading=!1}).catch(()=>{this.tableLoading=!1})},changeTab(e,t){this.selectTabId=e,this.queryParams.taskType=t,this.queryParams.currentPage=1,this.getList()},handleSearch(){this.queryParams.currentPage=1,this.getList()},showHandle(e){const t=s.index.getStorageSync("userInfo")||{};if(["待办","挂起","容缺"].includes(e.taskStatus)){if(e.handlerType==="USER")return(e.handlerId||[]).indexOf(t.user.userId)!==-1;if(e.handlerType==="DEPT")return(e.handlerUnitId||[]).indexOf(t.user.deptId)!==-1||(e.handlerUnitId||[]).some(i=>(t.childDeptList||[]).indexOf(i)!==-1);if(e.handlerType==="ROLE")return(e.handlerUnitId||[]).some(i=>(t.user.roleIds||[]).indexOf(i)!==-1)}return!1},goToDo(e){const t={deployId:e.deployId,procDefId:e.processDefId,procInsId:e.processInsId,processName:e.taskName,flowName:this.queryParams.processName,projectName:this.detailData.projectName,taskId:e.taskId,projectId:this.queryParams.projectId,isWait:e.taskStatus==="容缺"};e.taskStatus==="容缺"?this.navigateToTask(t,!1):l.checkTaskAuditStatus({processDefId:e.processDefId,taskId:e.taskId}).then(i=>{this.navigateToTask(t,i.data)})},navigateToTask(e,t){e.showAuditing=t,s.index.navigateTo({url:`/subpackage/flowable/task-process?${this.buildQuery(e)}`})},goToProcessDetail(e){const t={projectName:this.detailData.projectName,flowName:this.queryParams.processName,procInsId:e.processInsId,deployId:e.deployId,taskId:e.taskId,projectId:this.queryParams.projectId};s.index.navigateTo({url:`/subpackage/flowable/task-process?${this.buildQuery(t)}&isView=true`})},buildQuery(e){return Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&")},openSupervise(e){this.superviseForm.content="",this.superviseForm.taskId=e.taskId,this.superviseForm.projectId=this.queryParams.projectId,this.superviseForm.processInsId=e.processInsId,this.superviseForm.receiverType=e.handlerType,e.handlerType==="USER"?this.superviseForm.receiverIds=e.handlerId:this.superviseForm.receiverIds=e.handlerUnitId,this.showSupervisePopup=!0},submitSupervise(){if(!this.superviseForm.content){s.index.showToast({title:"请输入督办内容",icon:"none"});return}l.taskSupervise(this.superviseForm).then(()=>{this.showSupervisePopup=!1,s.index.showToast({title:"督办成功"})})},openProcessImg(){s.index.showToast({title:"请在电脑端查看流程图",icon:"none"})},openRecord(){s.index.showToast({title:"日志功能开发中",icon:"none"})}}};if(!Array){const e=s.resolveComponent("uni-icons"),t=s.resolveComponent("BottomTabBar");(e+t)()}const m=()=>"../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";Math||m();function I(e,t,i,p,r,o){return s.e({a:s.p({type:"paperplane-filled",size:"24",color:"#fff"}),b:s.t(r.detailData.projectName||"-"),c:s.t(r.detailData.projectCode||"-"),d:s.t(r.queryParams.processName||"-"),e:s.t(r.detailData.status||"进行中"),f:s.f(r.tabs,(a,n,d)=>s.e({a:s.t(a.label)},r.detailData.statistics?{b:s.t(o.getTabCount(a.type))}:{},{c:a.id,d:s.n({active:a.id===r.selectTabId}),e:s.o(c=>o.changeTab(a.id,a.type),a.id)})),g:r.detailData.statistics,h:s.p({type:"search",size:"18",color:"#999"}),i:s.o((...a)=>o.handleSearch&&o.handleSearch(...a)),j:r.queryParams.taskName,k:s.o(a=>r.queryParams.taskName=a.detail.value),l:r.tableLoading&&(!r.taskList||r.taskList.length===0)},r.tableLoading&&(!r.taskList||r.taskList.length===0)?{m:s.p({type:"spinner-cycle",size:"28",color:"#1E88E5"})}:!r.taskList||r.taskList.length===0?{}:{},{n:!r.taskList||r.taskList.length===0,p:s.f(r.taskList,(a,n,d)=>s.e({a:s.t(a.taskName),b:s.t(a.taskStatus),c:s.n(o.getStatusClass(a.taskStatus)),d:"ddb9bfb8-3-"+d,e:s.t(o.formatUnitName(a.promoterUnitName)),f:a.taskStatus!=="未开始"},a.taskStatus!=="未开始"?{g:s.o(c=>o.goToProcessDetail(a),n)}:{},{h:o.showHandle(a)},o.showHandle(a)?{i:s.o(c=>o.goToDo(a),n)}:{},{j:a.taskStatus==="待办"},a.taskStatus==="待办"?{k:s.o(c=>o.openSupervise(a),n)}:{},{l:n,m:s.n(o.getStatusClass(a.taskStatus))})),q:s.p({type:"staff",size:"14",color:"#999"}),r:r.showSupervisePopup},r.showSupervisePopup?{s:s.p({type:"closeempty",size:"20",color:"#999"}),t:s.o(a=>r.showSupervisePopup=!1),v:r.superviseForm.content,w:s.o(a=>r.superviseForm.content=a.detail.value),x:s.t((r.superviseForm.content||"").length),y:s.o(a=>r.showSupervisePopup=!1),z:s.o((...a)=>o.submitSupervise&&o.submitSupervise(...a)),A:s.o(()=>{}),B:s.o(a=>r.showSupervisePopup=!1)}:{},{C:s.p({active:"progress"})})}const g=s._export_sfc(h,[["render",I],["__scopeId","data-v-ddb9bfb8"]]);wx.createPage(g);
|