Files
wanghu 2e36d7a9c8
build / build (push) Successful in 9m55s
commit
2026-10-10 15:58:02 +08:00

2 lines
7.0 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{l as H,p as R,h as E,a,f as s,e as f,w as d,q as v,A as U,t as o,d as r,c as m,j as k,v as j,y as O,r as u,k as B,u as J,m as K,o as t,g as h,F as b,b as N,B as P,C as G,_ as Q}from"./index-CTJMns_f.js";import{l as z,a as W}from"./leave-o9zTf0m1.js";import{t as V}from"./leaveTime-ZdUoa0wT.js";const X={class:"page-wrapper"},Y={key:0,class:"main-container detail-container"},Z={class:"page-head fix"},ee={class:"fr"},se={key:0,class:"status-tip"},le={key:1,class:"status-tip"},te={key:2,class:"status-tip"},ae={key:3,class:"status-tip"},ne={key:4,class:"status-tip"},oe={class:"detail-body fix"},ie={class:"info-list"},re={class:"hours"},ue={key:0},de={key:1},ce={key:0},pe={key:1},ve={key:0,class:"file-list"},me=["href"],_e=["src","alt"],fe={key:0,class:"file-size"},ge={key:1,class:"empty-tip"},ye={class:"card-title fix"},ke={key:0,class:"opinion-box"},he={class:"step-row"},be={class:"step-node"},Ne={key:0,class:"step-action"},we={class:"step-sub"},Ie={key:0},Te={key:1,class:"ml-12"},Se={key:0,class:"step-opinion"},xe={key:2,class:"empty-tip"},Ce={key:3,class:"flow-meta"},Ue={key:0},je={key:1},Be={key:2},ze=["src"],Ve={key:1,class:"main-container loading-box"},$e={key:1,class:"empty-tip"},Le=H({__name:"LeaveDetail",setup(qe){const _=J(),$=K(),w=B(()=>{const i=Number(_.query.leaveId??_.query.serid??_.query.id);return Number.isFinite(i)&&i>0?i:null}),e=k(null),g=k(!1),y=k(!1);async function I(){if(!w.value){j.Message.error("缺少请假单参数(leaveId)");return}g.value=!0;try{e.value=await O.detail(w.value).send()}catch(i){j.Message.error(i.message||"加载请假详情失败")}finally{g.value=!1}}const T=B(()=>{var l;const i=(l=e.value)==null?void 0:l.snapshot;if(!i)return null;try{const c=JSON.parse(i),p=[];return c.opinion&&p.push(`审批意见:${c.opinion}`),c.nodeName&&p.push(`节点:${c.nodeName}`),p.length?p.join(" "):null}catch{return null}});function S(i){return["jpg","jpeg","png","gif","bmp","webp"].includes(String(i.fileType||"").toLowerCase())?P(i.fileId):G(i.fileId)}function L(i){return["jpg","jpeg","png","gif","bmp","webp"].includes(String(i||"").toLowerCase())}return R(I),E(()=>_.query.leaveId,I),(i,l)=>{const c=u("Button"),p=u("Tag"),q=u("Icon"),x=u("Card"),D=u("TimelineItem"),F=u("Timeline"),M=u("Modal"),A=u("Spin");return t(),a("div",X,[e.value?(t(),a("div",Y,[s("div",Z,[l[4]||(l[4]=s("h4",{class:"fl"},"请假详情",-1)),s("div",ee,[f(c,{size:"small",onClick:l[0]||(l[0]=n=>v($).back())},{default:d(()=>[...l[3]||(l[3]=[h("返回",-1)])]),_:1})])]),s("div",{class:"status-bar",style:U(`border-left: 4px solid ${v(z)(e.value.status)};`)},[s("span",{class:"status-name",style:U(`color:${v(z)(e.value.status)}`)},o(e.value.statusName||v(W)(e.value.status)),5),e.value.status===0?(t(),a("span",se,"流程审批中,请等待审核人处理")):e.value.status===1?(t(),a("span",le,"已通过并计入时长统计")):e.value.status===2?(t(),a("span",te,"本次申请未通过")):e.value.status===3?(t(),a("span",ae," 已销假"+o(e.value.cancelTime?`(${String(e.value.cancelTime).slice(0,16)})`:"")+", 已返还扣除时长 ",1)):e.value.status===4?(t(),a("span",ne,"已撤回,可修改后重新提交")):r("",!0)],4),s("div",oe,[f(x,{bordered:!1,"dis-hover":"",class:"info-card"},{default:d(()=>[l[14]||(l[14]=s("div",{class:"card-title"},"请假信息",-1)),s("ul",ie,[s("li",null,[l[5]||(l[5]=s("label",null,"申请人",-1)),s("span",null,o(e.value.userName||"-"),1)]),s("li",null,[l[6]||(l[6]=s("label",null,"请假类型",-1)),s("span",null,o(e.value.leaveTypeName||e.value.leaveType),1)]),s("li",null,[l[7]||(l[7]=s("label",null,"开始时间",-1)),s("span",null,o(String(e.value.startTime||"").slice(0,16)),1)]),s("li",null,[l[8]||(l[8]=s("label",null,"结束时间",-1)),s("span",null,o(String(e.value.endTime||"").slice(0,16)),1)]),s("li",null,[l[9]||(l[9]=s("label",null,"请假时长",-1)),s("span",re,o(v(V)(e.value.totalHours))+" 小时(约 "+o(v(V)((e.value.totalHours||0)/8))+" 天)",1)]),s("li",null,[l[10]||(l[10]=s("label",null,"请假事由",-1)),s("span",null,o(e.value.reason||"-"),1)]),e.value.courseArrangeName?(t(),a("li",ue,[l[11]||(l[11]=s("label",null,"课务安排",-1)),s("span",null,o(e.value.courseArrangeName),1)])):r("",!0),e.value.cancelReason?(t(),a("li",de,[l[12]||(l[12]=s("label",null,"销假事由",-1)),s("span",null,o(e.value.cancelReason),1)])):r("",!0),s("li",null,[l[13]||(l[13]=s("label",null,"抄送人",-1)),e.value.ccUsers&&e.value.ccUsers.length?(t(),a("span",ce,[(t(!0),a(b,null,N(e.value.ccUsers,n=>(t(),m(p,{key:n.userId,size:"small",class:"mr-6"},{default:d(()=>[h(o(n.userName||n.userId),1)]),_:2},1024))),128))])):(t(),a("span",pe,"-"))])]),l[15]||(l[15]=s("div",{class:"card-title mt-16"},"图片",-1)),e.value.files&&e.value.files.length?(t(),a("div",ve,[(t(!0),a(b,null,N(e.value.files,n=>(t(),a("div",{key:n.fileId,class:"file-item"},[s("a",{href:S(n),target:"_blank",class:"file-link"},[L(n.fileType)?(t(),a("img",{key:0,src:S(n),class:"file-thumb",alt:n.fileName},null,8,_e)):(t(),m(q,{key:1,type:"ios-attach"})),h(" "+o(n.fileName),1)],8,me),n.fileSize?(t(),a("span",fe,o((n.fileSize/1024).toFixed(1))+" KB",1)):r("",!0)]))),128))])):(t(),a("div",ge,"无图片"))]),_:1}),f(x,{bordered:!1,"dis-hover":"",class:"flow-card"},{default:d(()=>[s("div",ye,[l[16]||(l[16]=s("span",{class:"fl"},"审批流程",-1)),e.value.diagramUrl?(t(),a("a",{key:0,class:"fr diagram-link",href:"javascript:;",onClick:l[1]||(l[1]=n=>y.value=!0)},"查看流程图")):r("",!0)]),T.value?(t(),a("div",ke,o(T.value),1)):r("",!0),e.value.progress&&e.value.progress.steps&&e.value.progress.steps.length?(t(),m(F,{key:1,class:"flow-timeline"},{default:d(()=>[(t(!0),a(b,null,N(e.value.progress.steps,(n,C)=>(t(),m(D,{key:C,color:n.finished===!1?"gray":C===e.value.progress.steps.length-1?"blue":"green"},{default:d(()=>[s("div",he,[s("span",be,o(n.nodeName||"-"),1),n.action?(t(),a("span",Ne,o(n.action),1)):r("",!0)]),s("div",we,[n.assigneeName?(t(),a("span",Ie,o(n.assigneeName),1)):r("",!0),n.time?(t(),a("span",Te,o(String(n.time).slice(0,16)),1)):r("",!0)]),n.opinion?(t(),a("div",Se,"意见:"+o(n.opinion),1)):r("",!0)]),_:2},1032,["color"]))),128))]),_:1})):(t(),a("div",xe,"暂无流程进度(流程中心未返回或未发起)")),e.value.progress?(t(),a("div",Ce,[e.value.progress.submitterName?(t(),a("div",Ue,"发起人:"+o(e.value.progress.submitterName),1)):r("",!0),e.value.progress.startTime?(t(),a("div",je,"发起时间:"+o(String(e.value.progress.startTime).slice(0,16)),1)):r("",!0),e.value.progress.currentNodeName?(t(),a("div",Be,"当前节点:"+o(e.value.progress.currentNodeName),1)):r("",!0)])):r("",!0)]),_:1})]),f(M,{modelValue:y.value,"onUpdate:modelValue":l[2]||(l[2]=n=>y.value=n),title:"流程图",width:820,"footer-hide":""},{default:d(()=>[e.value.diagramUrl?(t(),a("img",{key:0,src:e.value.diagramUrl,style:{width:"100%"},alt:"流程图"},null,8,ze)):r("",!0)]),_:1},8,["modelValue"])])):(t(),a("div",Ve,[g.value?(t(),m(A,{key:0,fix:"",size:"large"})):(t(),a("div",$e,"未找到请假记录"))]))])}}}),Ae=Q(Le,[["__scopeId","data-v-bfde105a"]]);export{Ae as default};