官方纰漏bug修复和安全能力提升
This commit is contained in:
1 parent
459339719d
commit
ce00640ea4
148 files changed
+9524
-1701
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
import{d as O,u as P,o as Z,c as s,p as B,q as H,b as e,x as m,y as x,M as q,t as d,e as i,F as K,v as Q,P as N,f as R,r,R as W,B as S,j as o,n as X,A as F,E as D,C as ee,J as te}from"./index-DU2fjqYh.js";import{_ as le,b as M,a as ae}from"./business-config-CDFDGnOE.js";const se={class:"page-content route-list-page prototype-config-page"},oe={class:"card fill-list-card primary-list-card prototype-config-card"},ne={class:"prototype-filter-bar"},ie={class:"prototype-result-count"},de={key:0,class:"prototype-loading"},re={key:1,class:"prototype-error"},ue={key:2,class:"table-wrap",tabindex:"0"},ce={class:"data-table prototype-table"},ve={key:0},pe={key:1},ye={key:2},me={key:3},ge={key:0,"data-label":"主体编码"},be={key:1,"data-label":"主体名称"},_e={key:2,"data-label":"统一社会信用代码"},fe={class:"mono"},Ce={key:3,"data-label":"状态"},ke={"data-label":"操作"},Ee={class:"prototype-row-actions"},he=["onClick"],Ae=["disabled","onClick"],Te={key:3,class:"prototype-empty"},Ve={class:"modal-head","data-dialog-drag-handle":""},Ie=["disabled"],Le={class:"modal-body"},$e={key:0,class:"prototype-form-error",role:"alert"},xe={class:"prototype-form-grid"},Ne={class:"field full"},Se=["disabled"],De={class:"field full"},Me=["disabled"],Ue={class:"modal-actions"},we=["disabled"],Be=["disabled"],qe={class:"app-dialog__panel"},Re={class:"modal-head","data-dialog-drag-handle":""},Fe={class:"modal-body"},je={key:0,class:"prototype-spec-grid"},ze={class:"modal-actions"},Oe=O({__name:"LegalEntities",setup(Ge){const f=P(),b=r([]),A=r(""),C=r("ALL"),k=r("code"),T=r(!1),E=r(""),c=r(!1),V=r(null),y=r(""),h=r(null),_=r(null),g=r(null),v=W({name:"",creditCode:""}),U=S(()=>f.canEdit("ui.legal-entities.create")&&["name","creditCode"].every(l=>f.canEdit(`dialog.legal-entities.create.${l}`))),j=S(()=>f.canEdit("ui.legal-entities.deactivate")),p=l=>f.canRead(`ui.legal-entities.column.${l}`),I=(l,t)=>l instanceof Error&&l.message?l.message:t,L=S(()=>{const l=A.value.toLocaleLowerCase();return b.value.filter(t=>(C.value==="ALL"||t.status===C.value)&&(!l||[t.code,t.name,t.creditCode].some(n=>String(n||"").toLocaleLowerCase().includes(l)))).sort((t,n)=>String(t[k.value]).localeCompare(String(n[k.value]),"zh-CN"))}),w=async()=>{T.value=!0,E.value="";try{b.value=await M.legalEntities()}catch(l){E.value=I(l,"法人主体加载失败")}finally{T.value=!1}},z=async()=>{var l;Object.assign(v,{name:"",creditCode:""}),y.value="",await F(),(l=h.value)==null||l.showModal()},$=()=>{var l;c.value||(l=h.value)==null||l.close()},G=async()=>{var t;y.value="";const l=v.creditCode.replace(/\s+/g,"").toUpperCase();if(!v.name)return void(y.value="请填写主体名称");if(!/^[0-9A-Z]{18}$/.test(l))return void(y.value="统一社会信用代码应为 18 位数字或大写字母");c.value=!0;try{const n=await M.create("legal-entities",{name:v.name,creditCode:l});b.value.push(n),(t=h.value)==null||t.close(),D.success("法人主体已创建")}catch(n){y.value=I(n,"保存失败,请稍后重试")}finally{c.value=!1}},Y=async l=>{var t;g.value=l,await F(),(t=_.value)==null||t.showModal()},J=async l=>{const t=l.status==="ACTIVE"?"INACTIVE":"ACTIVE";try{await ee.confirm(`确认${t==="ACTIVE"?"启用":"停用"}“${l.name}”?`,`${t==="ACTIVE"?"启用":"停用"}法人主体`,{type:"warning"})}catch{return}V.value=l.id;try{const n=await M.changeStatus("legal-entities",l.id,t);b.value.splice(b.value.findIndex(a=>a.id===l.id),1,n),D.success(`法人主体已${t==="ACTIVE"?"启用":"停用"}`)}catch(n){D.error(I(n,"状态更新失败"))}finally{V.value=null}};return Z(()=>{w()}),(l,t)=>{const n=te("dialog-drag");return o(),s("div",se,[B(le,{eyebrow:"FINANCIAL MASTER DATA",title:"法人主体",description:"统一维护可用于费用归属、预算控制和付款账户的公司主体。"},{default:H(()=>[U.value?(o(),s("button",{key:0,class:"btn primary",type:"button",onClick:z}," + 新增法人主体 ")):i("",!0)]),_:1}),t[22]||(t[22]=e("div",{class:"prototype-governance-note"},[e("strong",null,"主数据治理"),e("span",null,"主体编码由系统自动生成;已被成本中心引用的主体不能直接停用,历史业务数据始终保留。")],-1)),e("section",oe,[e("div",ne,[m(e("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>A.value=a),type:"search",placeholder:"搜索主体编码、名称或统一社会信用代码","aria-label":"搜索法人主体"},null,512),[[x,A.value,void 0,{trim:!0}]]),m(e("select",{"onUpdate:modelValue":t[1]||(t[1]=a=>C.value=a),"aria-label":"筛选状态"},[...t[8]||(t[8]=[e("option",{value:"ALL"},"全部状态",-1),e("option",{value:"ACTIVE"},"启用",-1),e("option",{value:"INACTIVE"},"停用",-1)])],512),[[q,C.value]]),m(e("select",{"onUpdate:modelValue":t[2]||(t[2]=a=>k.value=a),"aria-label":"排序方式"},[...t[9]||(t[9]=[e("option",{value:"code"},"按编码排序",-1),e("option",{value:"name"},"按名称排序",-1)])],512),[[q,k.value]]),t[10]||(t[10]=e("span",{class:"prototype-filter-spacer"},null,-1)),e("spanLine truncated
|
||||