Files
financial_system_frontend/dist/assets/BudgetManagement-4zzydz8X.js
T

2 lines
24 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
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{d as pe,u as Te,R as ue,w as be,o as De,c as a,p as Y,q as Ue,b as e,n as N,F as y,x as i,y as S,M as I,t as n,s as de,v as C,e as v,f as k,P as J,a0 as x,r,B as m,j as o,a1 as xe,A as ye,E as K,C as he,J as Ye}from"./index-DU2fjqYh.js";import{_ as $e,b as $,a as Be}from"./business-config-CDFDGnOE.js";import{_ as Re}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Me={class:"page-content route-list-page prototype-config-page budget-page"},qe={class:"tabs budget-main-tabs",role:"tablist"},Fe={class:"card fill-list-card primary-list-card prototype-config-card"},Pe={class:"prototype-filter-bar"},Oe={class:"prototype-result-count"},Ge={key:0,class:"table-wrap"},we={class:"data-table prototype-table"},ze={class:"prototype-cell-stack"},Je=["disabled","onClick"],Ke={key:1},He={key:1,class:"prototype-empty"},Qe={class:"budget-summary"},We={class:"budget-summary-label"},Xe={class:"available"},Ze={key:0,class:"prototype-governance-note"},et={class:"tabs budget-ledger-tabs"},tt={key:0,class:"card fill-list-card primary-list-card prototype-config-card"},lt={class:"prototype-filter-bar"},st=["value"],nt=["value"],at={class:"prototype-result-count"},ot={key:0,class:"table-wrap"},ut={class:"data-table prototype-table budget-ledger-table"},dt={key:0},it={key:1,class:"amount"},rt={key:2,class:"amount"},ct={key:3,class:"amount"},vt={key:0},pt={class:"prototype-cell-stack"},bt={class:"prototype-cell-stack"},yt={key:1,class:"amount"},mt={key:2,class:"amount"},gt={key:3,class:"amount"},Ct={class:"budget-usage"},ft=["onClick"],Et={key:1},It={key:1,class:"prototype-empty"},At={key:1,class:"card fill-list-card primary-list-card prototype-config-card"},kt={class:"prototype-filter-bar"},_t=["value"],jt={class:"prototype-result-count"},Lt={key:0,class:"table-wrap"},Nt={class:"data-table prototype-table"},St={class:"prototype-cell-stack"},Vt={class:"prototype-cell-stack"},Tt={class:"prototype-cell-stack"},Dt={class:"amount"},Ut={class:"prototype-cell-stack"},xt={key:1,class:"prototype-empty"},ht={class:"modal-head","data-dialog-drag-handle":""},Yt=["disabled"],$t={class:"modal-body"},Bt={key:0,class:"prototype-form-error"},Rt={class:"prototype-form-grid"},Mt={class:"field full"},qt=["disabled"],Ft=["value"],Pt={class:"field full"},Ot=["disabled"],Gt={class:"field full"},wt=["disabled"],zt={class:"modal-actions"},Jt=["disabled"],Kt=["disabled"],Ht={class:"modal-head","data-dialog-drag-handle":""},Qt=["disabled"],Wt={class:"modal-body"},Xt={key:0,class:"prototype-form-error"},Zt={class:"budget-adjust-layout"},el={class:"prototype-form-grid"},tl={class:"field"},ll=["readonly","disabled"],sl={class:"field"},nl=["disabled"],al=["value"],ol={class:"field full"},ul=["disabled"],dl=["value"],il={class:"field"},rl=["disabled"],cl=["value"],vl={class:"field"},pl=["disabled"],bl=["value"],yl={class:"field full"},ml=["disabled"],gl=["value"],Cl={class:"field"},fl=["disabled"],El={class:"field"},Il=["disabled"],Al={class:"field full"},kl=["disabled"],_l={class:"budget-adjust-preview"},jl={class:"result"},Ll={class:"modal-actions"},Nl=["disabled"],Sl=["disabled"],Vl=pe({__name:"BudgetManagement",setup(Tl){const H=pe({props:{loading:Boolean,error:{type:String,default:""}},emits:["retry"],setup(s,{emit:t}){return()=>s.loading?x("div",{class:"prototype-loading"},[x("span",{class:"loader"}),x("span","正在加载预算配置…")]):s.error?x("div",{class:"prototype-error"},[x("span",s.error),x("button",{class:"btn small",onClick:()=>t("retry")},"重试")]):null}}),me=()=>({fiscalYear:new Date().getFullYear(),subjects:[],ledgers:[],adjustments:[],summary:[]}),T=Te(),p=ue(me()),ie=r([]),Q=r([]),B=r([]),j=r("subjects"),D=r("limits"),f=r(!1),A=r(""),d=r(!1),g=r(""),W=r(null),X=r(""),R=r("ALL"),Z=r(""),M=r("ALL"),q=r("ALL"),ee=r(""),F=r("ALL"),P=r("ALL"),O=r(null),G=r(null),_=r(!1),E=ue({parentId:null,name:"",description:""}),u=ue({fiscalYear:new Date().getFullYear(),legalEntityId:null,costCenterId:null,subjectId:null,currencyCode:"CNY",direction:"INCREASE",amount:0,reason:""}),U=r(null),re=m(()=>T.canEdit("ui.budgets.subject-create")&&["parentId","name","description"].every(s=>T.canEdit(`dialog.budgets.subject.${s}`))),ge=m(()=>T.canEdit("ui.budgets.subject-status")),te=m(()=>T.canEdit("ui.budgets.adjust")&&["fiscalYear","legalEntityId","costCenterId","subjectId","currencyCode","direction","amount","reason"].every(s=>T.canEdit(`dialog.budgets.adjust.${s}`))),L=s=>T.canRead(`ui.budgets.column.${s}`),Ce=m(()=>p.subjects.filter(s=>s.level===1)),ce=m(()=>Ce.value.filter(s=>s.status==="ACTIVE")),fe=m(()=>ie.value.filter(s=>s.status==="ACTIVE")),Ee=m(()=>B.value.filter(s=>s.status==="ACTIVE")),Ie=m(()=>Q.value.filter(s=>s.status==="ACTIVE"&&s.legalEntityId===u.legalEntityId)),Ae=m(()=>p.subjects.filter(s=>s.level===2&&s.status==="ACTIVE"&&s.parentId===U.value)),w=(s,t)=>s instanceof Error&&s.message?s.message:t,le=m(()=>{const s=X.value.toLocaleLowerCase();return p.subjects.filter(t=>(R.value==="ALL"||t.status===R.value)&&(!s||[t.code,t.name,t.parentName,t.description].some(c=>String(c||"").toLocaleLowerCase().includes(s))))}),se=m(()=>{const s=Z.value.toLocaleLowerCase();return p.ledgers.filter(t=>(M.value==="ALL"||String(t.costCenterId)===M.value)&&(q.value==="ALL"||t.currencyCode===q.value)&&(!s||[t.subjectCode,t.subjectName,t.categoryName,t.costCenterCode,t.costCenterName,t.legalEntityName].some(c=>String(c||"").toLocaleLowerCase().includes(s))))}),ne=m(()=>{const s=ee.value.toLocaleLowerCase();return p.adjustments.filter(t=>(F.value==="ALL"||t.direction===F.value)&&(P.value==="ALL"||t.currencyCode===P.value)&&(!s||[t.requestNo,t.subjectCode,t.subjectName,t.categoryName,t.reason,t.applicantName].some(c=>String(c||"").toLocaleLowerCase().includes(s))))}),ke=m(()=>p.ledgers.find(s=>s.fiscalYear===u.fiscalYear&&s.legalEntityId===u.legalEntityId&&s.costCenterId===u.costCenterId&&s.subjectId===u.subjectId&&s.currencyCode===u.currencyCode)),V=m(()=>{const s=ke.value,t=Number((s==null?void 0:s.limitAmount)||0),c=Number((s==null?void 0:s.occupiedAmount)||0)+Number((s==null?void 0:s.executedAmount)||0),l=Number(u.amount||0),z=t+(u.direction==="DECREASE"?-l:l);return{before:t,committed:c,after:z,available:z-c}}),b=(s,t="CNY")=>{try{return new Intl.NumberFormat("zh-CN",{style:"currency",currency:t,minimumFractionDigits:2}).format(Number(s||0))}catch{return`${t} ${Number(s||0).toFixed(2)}`}},_e=s=>s?new Date(s).toLocaleString("zh-CN",{hour12:!1}):"—",je=s=>({PENDING:"审批中",APPROVED:"已通过",REJECTED:"已拒绝",CANCELLED:"已撤回"})[s]||s,h=async()=>{f.value=!0,A.value="";try{const[s,t]=await Promise.all([$.budgetOverview(),$.references()]);Object.assign(p,s),ie.value=t.legalEntities||[],Q.value=t.costCenters||[],B.value=t.currencies||[]}catch(s){A.value=w(s,"预算配置加载失败")}finally{f.value=!1}},Le=async()=>{var s;Object.assign(E,{parentId:null,name:"",description:""}),g.value="",await ye(),(s=O.value)==null||s.showModal()},ae=()=>{var s;d.value||(s=O.value)==null||s.close()},Ne=async()=>{var s;if(!E.parentId||!E.name||!E.description)return void(g.value="请完整填写一级分类、科目名称和适用说明");d.value=!0,g.value="";try{const t=await $.createBudgetSubject({...E,parentId:E.parentId});p.subjects.push(t),(s=O.value)==null||s.close(),K.success("二级预算科目已新增")}catch(t){g.value=w(t,"预算科目保存失败")}finally{d.value=!1}},Se=async s=>{const t=s.status==="ACTIVE"?"INACTIVE":"ACTIVE";try{await he.confirm(`确认${t==="ACTIVE"?"启用":"停用"}“${s.name}”?`,"科目状态确认",{type:"warning"})}catch{return}W.value=s.id;try{const c=await $.changeBudgetSubjectStatus(s.id,t);p.subjects.splice(p.subjects.findIndex(l=>l.id===s.id),1,c),K.success(`预算科目已${t==="ACTIVE"?"启用":"停用"}`)}catch(c){K.error(w(c,"科目状态更新失败"))}finally{W.value=null}},ve=async s=>{var t,c;_.value=!!s,Object.assign(u,{fiscalYear:(s==null?void 0:s.fiscalYear)||p.fiscalYear||new Date().getFullYear(),legalEntityId:(s==null?void 0:s.legalEntityId)??null,costCenterId:(s==null?void 0:s.costCenterId)??null,subjectId:(s==null?void 0:s.subjectId)??null,currencyCode:(s==null?void 0:s.currencyCode)||"CNY",direction:"INCREASE",amount:0,reason:""}),U.value=s?((t=p.subjects.find(l=>l.id===s.subjectId))==null?void 0:t.parentId)??null:null,g.value="",await ye(),(c=G.value)==null||c.showModal()},oe=()=>{var s;d.value||(s=G.value)==null||s.close()},Ve=async()=>{var s;if(!u.legalEntityId||!u.costCenterId||!u.subjectId||!u.currencyCode||Number(u.amount)<=0||!u.reason)return void(g.value="请完整填写预算维度、正数调整额和调整依据");if(V.value.available<0)return void(g.value="审批生效后的预算额度不能低于已占用与已执行金额之和");d.value=!0,g.value="";try{await $.requestBudgetAdjustment({...u,legalEntityId:u.legalEntityId,costCenterId:u.costCenterId,subjectId:u.subjectId}),await h(),(s=G.value)==null||s.close(),j.value="ledger",D.value="adjustments",K.success("预算调整申请已提交,审批通过前不会改写当前额度")}catch(t){g.value=w(t,"预算调整申请提交失败")}finally{d.value=!1}};return be(()=>u.legalEntityId,()=>{_.value||(u.costCenterId=null)}),be(U,()=>{_.value||(u.subjectId=null)}),De(()=>{h()}),(s,t)=>{const c=Ye("dialog-drag");return o(),a("div",Me,[Y($e,{eyebrow:"BUDGET MANAGEMENT",title:"预算管理",description:"预算科目与预算台账分开维护;所有金额按原币展示,不跨币种合计。"},{default:Ue(()=>[j.value==="subjects"&&re.value?(o(),a("button",{key:0,class:"btn primary",onClick:Le}," + 新增二级科目 ")):v("",!0),j.value==="ledger"&&te.value?(o(),a("button",{key:1,class:"btn primary",onClick:t[0]||(t[0]=l=>ve())}," + 申请调整额度 ")):v("",!0)]),_:1}),e("div",qe,[e("button",{class:N(["tab",{active:j.value==="subjects"}]),onClick:t[1]||(t[1]=l=>j.value="subjects")}," 预算科目目录",2),e("button",{class:N(["tab",{active:j.value==="ledger"}]),onClick:t[2]||(t[2]=l=>j.value="ledger")}," 预算台账 ",2)]),j.value==="subjects"?(o(),a(y,{key:0},[t[28]||(t[28]=e("div",{class:"prototype-governance-note"},[e("strong",null,"两级科目"),e("span",null,"一级分类由系统预置,只能在启用的一级分类下新增二级科目;预算额度实际记录在二级科目。")],-1)),e("section",Fe,[e("div",Pe,[i(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>X.value=l),type:"search",placeholder:"搜索科目编码、名称或说明"},null,512),[[S,X.value,void 0,{trim:!0}]]),i(e("select",{"onUpdate:modelValue":t[4]||(t[4]=l=>R.value=l)},[...t[25]||(t[25]=[e("option",{value:"ALL"},"全部状态",-1),e("option",{value:"ACTIVE"},"启用",-1),e("option",{value:"INACTIVE"},"停用",-1)])],512),[[I,R.value]]),t[26]||(t[26]=e("span",{class:"prototype-filter-spacer"},null,-1)),e("span",Oe,n(le.value.length)+" 个科目",1)]),Y(de(H),{loading:f.value,error:A.value,onRetry:h},null,8,["loading","error"]),!f.value&&!A.value&&le.value.length?(o(),a("div",Ge,[e("table",we,[t[27]||(t[27]=e("thead",null,[e("tr",null,[e("th",null,"层级/编码"),e("th",null,"预算分类"),e("th",null,"科目名称"),e("th",null,"适用说明"),e("th",null,"状态"),e("th",null,"操作")])],-1)),e("tbody",null,[(o(!0),a(y,null,C(le.value,l=>(o(),a("tr",{key:l.id},[e("td",null,[e("div",ze,[e("strong",null,n(l.code),1),e("small",null,n(l.level===1?"一级分类":"二级科目"),1)])]),e("td",null,n(l.level===1?"—":l.parentName),1),e("td",null,[e("strong",null,n(l.name),1)]),e("td",null,n(l.description||"—"),1),e("td",null,[Y(Be,{active:l.status==="ACTIVE"},null,8,["active"])]),e("td",null,[l.level===2&&ge.value?(o(),a("button",{key:0,class:N(["prototype-table-action",{danger:l.status==="ACTIVE"}]),disabled:W.value===l.id,onClick:z=>Se(l)},n(l.status==="ACTIVE"?"停用":"启用"),11,Je)):(o(),a("span",Ke,"—"))])]))),128))])])])):!f.value&&!A.value?(o(),a("div",He," 没有符合当前筛选条件的预算科目。 ")):v("",!0)])],64)):(o(),a(y,{key:1},[e("div",Qe,[(o(!0),a(y,null,C(p.summary,l=>(o(),a("article",{key:l.currencyCode,class:"budget-summary-currency"},[e("div",We,[e("strong",null,n(l.currencyCode),1),t[29]||(t[29]=e("span",null,"不与其他币种合并",-1))]),e("div",null,[t[30]||(t[30]=e("span",null,"预算额度",-1)),e("strong",null,n(b(l.limitAmount,l.currencyCode)),1)]),e("div",null,[t[31]||(t[31]=e("span",null,"已占用",-1)),e("strong",null,n(b(l.occupiedAmount,l.currencyCode)),1)]),e("div",null,[t[32]||(t[32]=e("span",null,"已执行",-1)),e("strong",null,n(b(l.executedAmount,l.currencyCode)),1)]),e("div",Xe,[t[33]||(t[33]=e("span",null,"可用余额",-1)),e("strong",null,n(b(l.availableAmount,l.currencyCode)),1)])]))),128)),!p.summary.length&&!f.value?(o(),a("div",Ze,[...t[34]||(t[34]=[e("strong",null,"暂无额度",-1),e("span",null,"首次提交预算调整申请时,系统会为所选年度和维度创建零额度台账;审批通过后才更新额度。",-1)])])):v("",!0)]),e("div",et,[e("button",{class:N(["tab",{active:D.value==="limits"}]),onClick:t[5]||(t[5]=l=>D.value="limits")}," 额度与执行",2),e("button",{class:N(["tab",{active:D.value==="adjustments"}]),onClick:t[6]||(t[6]=l=>D.value="adjustments")},[t[35]||(t[35]=k(" 调整记录 ",-1)),e("span",null,n(p.adjustments.length),1)],2)]),D.value==="limits"?(o(),a("section",tt,[e("div",lt,[i(e("input",{"onUpdate:modelValue":t[7]||(t[7]=l=>Z.value=l),type:"search",placeholder:"搜索预算科目、成本中心或法人"},null,512),[[S,Z.value,void 0,{trim:!0}]]),i(e("select",{"onUpdate:modelValue":t[8]||(t[8]=l=>M.value=l)},[t[36]||(t[36]=e("option",{value:"ALL"},"全部成本中心",-1)),(o(!0),a(y,null,C(Q.value,l=>(o(),a("option",{key:l.id,value:String(l.id)},n(l.code)+" · "+n(l.name),9,st))),128))],512),[[I,M.value]]),i(e("select",{"onUpdate:modelValue":t[9]||(t[9]=l=>q.value=l)},[t[37]||(t[37]=e("option",{value:"ALL"},"全部币种",-1)),(o(!0),a(y,null,C(B.value,l=>(o(),a("option",{key:l.code,value:l.code},n(l.code),9,nt))),128))],512),[[I,q.value]]),t[38]||(t[38]=e("span",{class:"prototype-filter-spacer"},null,-1)),e("span",at,n(se.value.length)+" 条额度",1)]),Y(de(H),{loading:f.value,error:A.value,onRetry:h},null,8,["loading","error"]),!f.value&&!A.value&&se.value.length?(o(),a("div",ot,[e("table",ut,[e("thead",null,[e("tr",null,[L("name")?(o(),a("th",dt,"预算科目")):v("",!0),t[39]||(t[39]=e("th",null,"预算维度",-1)),L("totalAmount")?(o(),a("th",it," 预算额度 ")):v("",!0),L("occupiedAmount")?(o(),a("th",rt," 已占用 ")):v("",!0),L("usedAmount")?(o(),a("th",ct,"已执行")):v("",!0),t[40]||(t[40]=e("th",{class:"amount"},"可用余额",-1)),t[41]||(t[41]=e("th",null,"使用率",-1)),t[42]||(t[42]=e("th",null,"操作",-1))])]),e("tbody",null,[(o(!0),a(y,null,C(se.value,l=>(o(),a("tr",{key:l.id},[L("name")?(o(),a("td",vt,[e("div",pt,[e("strong",null,n(l.subjectName),1),e("small",null,n(l.subjectCode)+" · "+n(l.categoryName),1)])])):v("",!0),e("td",null,[e("div",bt,[e("strong",null,n(l.legalEntityName)+" · "+n(l.costCenterName),1),e("small",null,n(l.fiscalYear)+" · "+n(l.currencyCode),1)])]),L("totalAmount")?(o(),a("td",yt,n(b(l.limitAmount,l.currencyCode)),1)):v("",!0),L("occupiedAmount")?(o(),a("td",mt,n(b(l.occupiedAmount,l.currencyCode)),1)):v("",!0),L("usedAmount")?(o(),a("td",gt,n(b(l.executedAmount,l.currencyCode)),1)):v("",!0),e("td",{class:N(["amount",{"amount-danger":l.availableAmount<0}])},n(b(l.availableAmount,l.currencyCode)),3),e("td",null,[e("div",Ct,[e("span",{style:xe({width:`${Math.min(100,l.usagePercent)}%`})},null,4)]),e("small",null,n(l.usagePercent)+"%",1)]),e("td",null,[te.value?(o(),a("button",{key:0,class:"prototype-table-action",onClick:z=>ve(l)}," 申请调整",8,ft)):(o(),a("span",Et,"—"))])]))),128))])])])):!f.value&&!A.value?(o(),a("div",It," 没有符合当前条件的预算额度。 ")):v("",!0)])):(o(),a("section",At,[e("div",kt,[i(e("input",{"onUpdate:modelValue":t[10]||(t[10]=l=>ee.value=l),type:"search",placeholder:"搜索科目、调整依据、单号或申请人"},null,512),[[S,ee.value,void 0,{trim:!0}]]),i(e("select",{"onUpdate:modelValue":t[11]||(t[11]=l=>F.value=l)},[...t[43]||(t[43]=[e("option",{value:"ALL"},"全部方向",-1),e("option",{value:"INCREASE"},"增加",-1),e("option",{value:"DECREASE"},"减少",-1)])],512),[[I,F.value]]),i(e("select",{"onUpdate:modelValue":t[12]||(t[12]=l=>P.value=l)},[t[44]||(t[44]=e("option",{value:"ALL"},"全部币种",-1)),(o(!0),a(y,null,C(B.value,l=>(o(),a("option",{key:l.code,value:l.code},n(l.code),9,_t))),128))],512),[[I,P.value]]),t[45]||(t[45]=e("span",{class:"prototype-filter-spacer"},null,-1)),e("span",jt,n(ne.value.length)+" 条记录",1)]),t[47]||(t[47]=e("div",{class:"budget-record-note"},[e("span",null,"调整申请只追加、不覆盖"),e("p",null,"待审批时仅记录申请值;审批通过后才更新预算额度。")],-1)),Y(de(H),{loading:f.value,error:A.value,onRetry:h},null,8,["loading","error"]),!f.value&&!A.value&&ne.value.length?(o(),a("div",Lt,[e("table",Nt,[t[46]||(t[46]=e("thead",null,[e("tr",null,[e("th",null,"调整时间/单号"),e("th",null,"预算科目"),e("th",null,"预算维度"),e("th",null,"方向"),e("th",{class:"amount"},"调整额"),e("th",null,"额度变化"),e("th",null,"审批状态"),e("th",null,"调整依据/申请人")])],-1)),e("tbody",null,[(o(!0),a(y,null,C(ne.value,l=>(o(),a("tr",{key:l.id},[e("td",null,[e("div",St,[e("strong",null,n(_e(l.createdAt)),1),e("small",null,n(l.requestNo),1)])]),e("td",null,[e("div",Vt,[e("strong",null,n(l.subjectName),1),e("small",null,n(l.subjectCode)+" · "+n(l.categoryName),1)])]),e("td",null,[e("div",Tt,[e("strong",null,n(l.legalEntityName)+" · "+n(l.costCenterName),1),e("small",null,n(l.fiscalYear)+" · "+n(l.currencyCode),1)])]),e("td",null,[e("span",{class:N(["business-status",l.direction==="INCREASE"?"is-active":"is-inactive"])},n(l.direction==="INCREASE"?"增加":"减少"),3)]),e("td",Dt,n(b(l.amount,l.currencyCode)),1),e("td",null,n(b(l.beforeLimit,l.currencyCode))+" → "+n(b(l.afterLimit,l.currencyCode)),1),e("td",null,n(je(l.approvalStatus)),1),e("td",null,[e("div",Ut,[e("strong",null,n(l.reason),1),e("small",null,n(l.applicantName),1)])])]))),128))])])])):!f.value&&!A.value?(o(),a("div",xt," 暂无预算调整记录。 ")):v("",!0)]))],64)),re.value?i((o(),a("dialog",{key:2,ref_key:"subjectDialog",ref:O,class:"app-dialog prototype-dialog",onCancel:J(ae,["prevent"])},[e("form",{onSubmit:J(Ne,["prevent"])},[e("div",ht,[t[48]||(t[48]=e("div",null,[e("span",{class:"eyebrow"},"BUDGET SUBJECT"),e("h2",null,"新增二级预算科目"),e("p",null,"一级分类为系统目录,科目编码自动生成。")],-1)),e("button",{class:"modal-close",type:"button",disabled:d.value,onClick:ae}," × ",8,Yt)]),e("div",$t,[g.value?(o(),a("p",Bt,n(g.value),1)):v("",!0),e("div",Rt,[e("div",Mt,[t[50]||(t[50]=e("label",null,[k("一级预算分类 "),e("em",null,"*")],-1)),i(e("select",{"onUpdate:modelValue":t[13]||(t[13]=l=>E.parentId=l),required:"",disabled:d.value},[t[49]||(t[49]=e("option",{value:null,disabled:""},"请选择一级分类",-1)),(o(!0),a(y,null,C(ce.value,l=>(o(),a("option",{key:l.id,value:l.id},n(l.code)+" · "+n(l.name),9,Ft))),128))],8,qt),[[I,E.parentId,void 0,{number:!0}]])]),e("div",Pt,[t[51]||(t[51]=e("label",null,[k("二级科目名称 "),e("em",null,"*")],-1)),i(e("input",{"onUpdate:modelValue":t[14]||(t[14]=l=>E.name=l),required:"",maxlength:"120",disabled:d.value},null,8,Ot),[[S,E.name,void 0,{trim:!0}]])]),e("div",Gt,[t[52]||(t[52]=e("label",null,[k("适用说明 "),e("em",null,"*")],-1)),i(e("textarea",{"onUpdate:modelValue":t[15]||(t[15]=l=>E.description=l),required:"",maxlength:"500",disabled:d.value},null,8,wt),[[S,E.description,void 0,{trim:!0}]])])])]),e("div",zt,[e("button",{class:"btn",type:"button",disabled:d.value,onClick:ae}," 取消",8,Jt),e("button",{class:"btn primary",type:"submit",disabled:d.value},n(d.value?"保存中…":"保存科目"),9,Kt)])],32)],32)),[[c]]):v("",!0),te.value?i((o(),a("dialog",{key:3,ref_key:"adjustDialog",ref:G,class:"app-dialog prototype-dialog budget-adjust-dialog",onCancel:J(oe,["prevent"])},[e("form",{onSubmit:J(Ve,["prevent"])},[e("div",Ht,[e("div",null,[t[53]||(t[53]=e("span",{class:"eyebrow"},"BUDGET ADJUSTMENT",-1)),t[54]||(t[54]=e("h2",null,"申请调整预算额度",-1)),e("p",null,n(_.value?"已从额度行带入预算维度,避免调整错对象。":"先确定预算维度,再选择调整方向。"),1)]),e("button",{class:"modal-close",type:"button",disabled:d.value,onClick:oe}," × ",8,Qt)]),e("div",Wt,[g.value?(o(),a("p",Xt,n(g.value),1)):v("",!0),e("div",Zt,[e("div",el,[e("div",tl,[t[55]||(t[55]=e("label",null,"年度",-1)),i(e("input",{"onUpdate:modelValue":t[16]||(t[16]=l=>u.fiscalYear=l),type:"number",min:"2000",max:"2100",readonly:_.value,disabled:d.value},null,8,ll),[[S,u.fiscalYear,void 0,{number:!0}]])]),e("div",sl,[t[56]||(t[56]=e("label",null,"币种",-1)),i(e("select",{"onUpdate:modelValue":t[17]||(t[17]=l=>u.currencyCode=l),disabled:d.value||_.value},[(o(!0),a(y,null,C(Ee.value,l=>(o(),a("option",{key:l.code,value:l.code},n(l.code)+" · "+n(l.name),9,al))),128))],8,nl),[[I,u.currencyCode]])]),e("div",ol,[t[58]||(t[58]=e("label",null,[k("法人主体 "),e("em",null,"*")],-1)),i(e("select",{"onUpdate:modelValue":t[18]||(t[18]=l=>u.legalEntityId=l),disabled:d.value||_.value},[t[57]||(t[57]=e("option",{value:null,disabled:""},"请选择法人主体",-1)),(o(!0),a(y,null,C(fe.value,l=>(o(),a("option",{key:l.id,value:l.id},n(l.code)+" · "+n(l.name),9,dl))),128))],8,ul),[[I,u.legalEntityId,void 0,{number:!0}]])]),e("div",il,[t[60]||(t[60]=e("label",null,[k("成本中心 "),e("em",null,"*")],-1)),i(e("select",{"onUpdate:modelValue":t[19]||(t[19]=l=>u.costCenterId=l),disabled:d.value||_.value},[t[59]||(t[59]=e("option",{value:null,disabled:""},"请选择成本中心",-1)),(o(!0),a(y,null,C(Ie.value,l=>(o(),a("option",{key:l.id,value:l.id},n(l.code)+" · "+n(l.name),9,cl))),128))],8,rl),[[I,u.costCenterId,void 0,{number:!0}]])]),e("div",vl,[t[62]||(t[62]=e("label",null,[k("预算分类 "),e("em",null,"*")],-1)),i(e("select",{"onUpdate:modelValue":t[20]||(t[20]=l=>U.value=l),disabled:d.value||_.value},[t[61]||(t[61]=e("option",{value:null,disabled:""},"请选择一级分类",-1)),(o(!0),a(y,null,C(ce.value,l=>(o(),a("option",{key:l.id,value:l.id},n(l.code)+" · "+n(l.name),9,bl))),128))],8,pl),[[I,U.value,void 0,{number:!0}]])]),e("div",yl,[t[64]||(t[64]=e("label",null,[k("预算科目 "),e("em",null,"*")],-1)),i(e("select",{"onUpdate:modelValue":t[21]||(t[21]=l=>u.subjectId=l),disabled:d.value||_.value||!U.value},[t[63]||(t[63]=e("option",{value:null,disabled:""},"请选择二级科目",-1)),(o(!0),a(y,null,C(Ae.value,l=>(o(),a("option",{key:l.id,value:l.id},n(l.code)+" · "+n(l.name),9,gl))),128))],8,ml),[[I,u.subjectId,void 0,{number:!0}]])]),e("div",Cl,[t[66]||(t[66]=e("label",null,[k("调整方向 "),e("em",null,"*")],-1)),i(e("select",{"onUpdate:modelValue":t[22]||(t[22]=l=>u.direction=l),disabled:d.value},[...t[65]||(t[65]=[e("option",{value:"INCREASE"},"增加额度",-1),e("option",{value:"DECREASE"},"减少额度",-1)])],8,fl),[[I,u.direction]])]),e("div",El,[t[67]||(t[67]=e("label",null,[k("调整额 "),e("em",null,"*")],-1)),i(e("input",{"onUpdate:modelValue":t[23]||(t[23]=l=>u.amount=l),type:"number",min:"0.01",step:"0.01",disabled:d.value},null,8,Il),[[S,u.amount,void 0,{number:!0}]])]),e("div",Al,[t[68]||(t[68]=e("label",null,[k("调整依据 "),e("em",null,"*")],-1)),i(e("textarea",{"onUpdate:modelValue":t[24]||(t[24]=l=>u.reason=l),maxlength:"1000",placeholder:"说明调整原因、决策依据或对应文件",disabled:d.value},null,8,kl),[[S,u.reason,void 0,{trim:!0}]])])]),e("aside",_l,[t[73]||(t[73]=e("h3",null,"审批生效预览",-1)),e("div",null,[t[69]||(t[69]=e("span",null,"当前额度",-1)),e("strong",null,n(b(V.value.before,u.currencyCode)),1)]),e("div",null,[t[70]||(t[70]=e("span",null,"已占用+已执行",-1)),e("strong",null,n(b(V.value.committed,u.currencyCode)),1)]),e("div",jl,[t[71]||(t[71]=e("span",null,"审批后额度",-1)),e("strong",null,n(b(V.value.after,u.currencyCode)),1)]),e("div",null,[t[72]||(t[72]=e("span",null,"审批后可用",-1)),e("strong",{class:N({"amount-danger":V.value.available<0})},n(b(V.value.available,u.currencyCode)),3)]),t[74]||(t[74]=e("p",null,"提交后等待审批,当前额度不会立即改写。",-1))])])]),e("div",Ll,[e("button",{class:"btn",type:"button",disabled:d.value,onClick:oe}," 取消",8,Nl),e("button",{class:"btn primary",type:"submit",disabled:d.value||V.value.available<0},n(d.value?"提交中…":"提交审批申请"),9,Sl)])],32)],32)),[[c]]):v("",!0)])}}}),hl=Re(Vl,[["__scopeId","data-v-82ae16c7"]]);export{hl as default};