import{_ as q,o as m,c as b,e as a,f as n,j as r,k as u,h as i,t as w,g,d as T,a as V,F as z,r as A,E as c,T as I}from"./index-C1KISTGN.js";import{A as L,M as U}from"./AnnualProcurementPlanDialog-ChZoZHwC.js";const j={class:"my-application"},F={class:"card-header"},G={__name:"MyApplication",setup(H){const p=u(!1),f=u(!1),y=u(!1),k=u(!1),N=[{id:1,name:"年度招采计划申请",type:"annual"},{id:2,name:"非经营性商品录入",type:"material"},{id:3,name:"询比价流程",type:"inquiry"}],d=u([{id:1,processName:"年度招采计划-2026年IT设备采购",processType:"年度招采计划申请",status:"审批中",applicant:"管理员",applyTime:"2026-05-15 10:30:00",currentStep:"部门经理审批"},{id:2,processName:"非经营性商品-办公电脑",processType:"非经营性商品录入",status:"已完成",applicant:"管理员",applyTime:"2026-05-10 14:20:00",currentStep:"已完成"}]),x=t=>{switch(t){case"已完成":return"success";case"审批中":return"warning";case"待提交":return"info";case"已驳回":return"danger";default:return"info"}},C=()=>{p.value=!0},S=t=>{p.value=!1,t.type==="annual"?f.value=!0:t.type==="material"?y.value=!0:t.type==="inquiry"&&(k.value=!0)},v=t=>{c.success("提交成功");let e="";t.tabType==="apply"?t.planType?e="年度招采计划申请":t.materialName?e="非经营性商品录入":t.inquiryName&&(e="询比价流程"):e="年度招采计划申请";const s={id:Date.now(),processName:`${t.inquiryName||t.projectName||t.materialName||"新申请"}`,processType:e,status:"审批中",applicant:t.applicant,applyTime:new Date().toLocaleString("zh-CN"),currentStep:"部门经理审批"};d.value.unshift(s)},D=t=>{c.info(`查看流程:${t.processName}`)},$=t=>{c.info(`编辑流程:${t.processName}`)},B=t=>{I.confirm(`确定要删除流程"${t.processName}"吗?`,"确认删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const e=d.value.findIndex(s=>s.id===t.id);e>-1&&(d.value.splice(e,1),c.success("删除成功"))}).catch(()=>{c.info("已取消删除")})};return(t,e)=>{const s=r("el-button"),o=r("el-table-column"),h=r("el-tag"),E=r("el-table"),M=r("el-card"),P=r("el-dialog");return m(),b("div",j,[a(M,null,{header:n(()=>[V("div",F,[e[5]||(e[5]=V("span",null,"我的申请",-1)),a(s,{type:"primary",onClick:C},{default:n(()=>[...e[4]||(e[4]=[i("发起新流程",-1)])]),_:1})])]),default:n(()=>[a(E,{data:d.value,border:"",stripe:"",style:{width:"100%"}},{default:n(()=>[a(o,{prop:"processName",label:"流程名称",width:"200"}),a(o,{prop:"processType",label:"流程类型",width:"150"}),a(o,{prop:"status",label:"状态",width:"100"},{default:n(l=>[a(h,{type:x(l.row.status)},{default:n(()=>[i(w(l.row.status),1)]),_:2},1032,["type"])]),_:1}),a(o,{prop:"applicant",label:"申请人",width:"120"}),a(o,{prop:"applyTime",label:"申请时间",width:"180"}),a(o,{prop:"currentStep",label:"当前节点",width:"120"}),a(o,{label:"操作",width:"200"},{default:n(l=>[a(s,{type:"text",size:"small",onClick:_=>D(l.row)},{default:n(()=>[...e[6]||(e[6]=[i("查看",-1)])]),_:1},8,["onClick"]),l.row.status==="待提交"?(m(),g(s,{key:0,type:"text",size:"small",onClick:_=>$(l.row)},{default:n(()=>[...e[7]||(e[7]=[i("编辑",-1)])]),_:1},8,["onClick"])):T("",!0),l.row.status==="待提交"?(m(),g(s,{key:1,type:"text",size:"small",onClick:_=>B(l.row),style:{color:"#f56c6c"}},{default:n(()=>[...e[8]||(e[8]=[i("删除",-1)])]),_:1},8,["onClick"])):T("",!0)]),_:1})]),_:1},8,["data"])]),_:1}),a(P,{modelValue:p.value,"onUpdate:modelValue":e[1]||(e[1]=l=>p.value=l),title:"选择流程",width:"500px"},{footer:n(()=>[a(s,{onClick:e[0]||(e[0]=l=>p.value=!1)},{default:n(()=>[...e[9]||(e[9]=[i("取消",-1)])]),_:1})]),default:n(()=>[(m(),b(z,null,A(N,l=>a(s,{key:l.id,class:"process-template-btn",onClick:_=>S(l)},{default:n(()=>[i(w(l.name),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["modelValue"]),a(L,{modelValue:f.value,"onUpdate:modelValue":e[2]||(e[2]=l=>f.value=l),onSubmit:v},null,8,["modelValue"]),a(U,{modelValue:y.value,"onUpdate:modelValue":e[3]||(e[3]=l=>y.value=l),onSubmit:v},null,8,["modelValue"])])}}},O=q(G,[["__scopeId","data-v-fdb700dc"]]);export{O as default};