import{_ as A,d as w,c9 as V,n as c,k as F,ab as R,cB as p,q as Y,r as i,o as m,c as h,h as s,y as u,i as o,ak as g,a as C,A as j,ca as q,F as M,a7 as O}from"./index.js";import{u as S}from"./useDetail.da468487.js";import{b as U,c as L,a as z}from"./index.5741d39c.js";import G from"./return-form.13bcba.js";import{i as H}from"./ticketReturn.e53d6b17.js";import"./porder.827c74bc.js";import"./invoice-table.fd980e.js";import"./invoice-form.f6042b.js";import"./_rules.bde94d19.js";import"./global.9ad647c8.js";const J={class:"padding__container"},K="inputInvoicePoolDetail",Q=w({__name:"detail",setup(W){V(K),c(null);const{push:D}=F(),_=c(null);R();const d=c(!0),{id:k,isDetail:f,title:v,collapses:r}=S({baseName:"\u53D1\u7968",collapseLen:14}),y=c(!1),{run:E,data:T}=p({initalData:{},success:async(n={})=>{var l;const{supplierName:t}=n,a=await U({name:t}),[e={}]=((l=a==null?void 0:a.data)==null?void 0:l.list)||[];y.value=e.has_account}}),{run:I}=p({success:()=>D("/purchase/inputInvoicePool")});p({success:()=>x()});function x(){b(),_.value&&_.value.refresh(),d.value=!1,Y(()=>d.value=!0)}const b=()=>E(L({InvCode:k.value})),B=n=>{const{invArr:t}=n,a=t.map(e=>({invoice_subtotal:e.invoiceType.indexOf("fully")!==-1?"0":e.subtotal_amount,invoice_total:e.invoiceType.indexOf("fully")!==-1?e.subtotal_amount:"0",invoice_type:e.invoiceType||"",invoice_number:e.invNumber||"",check_code:e.checkNumber||"",invoice_code:e.invCode||"",open_date:O(e.open_time).format("YYYY-MM-DD")}));I(z({list:a}))};return f.value&&b(),(n,t)=>{const a=i("ElCollapseItem"),e=i("ElCollapse"),l=i("ElTabPane"),N=i("ElTabs");return m(),h("div",J,[s(N,null,{default:u(()=>[s(l,{label:o(v)},{default:u(()=>[s(e,{modelValue:o(r),"onUpdate:modelValue":t[0]||(t[0]=P=>g(r)?r.value=P:null)},{default:u(()=>[s(a,{name:"1",title:o(v)},{default:u(()=>[C(" \u53D1\u7968\u8BE6\u60C5 "),o(f)?(m(),j(o(q),{key:0,data:o(T),columns:o(H)},null,8,["data","columns"])):(m(),h(M,{key:1},[C(" \u521B\u5EFA\u56DE\u7968 "),s(G,{onCreate:B})],2112))]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1})])}}});var ce=A(Q,[["__file","D:/work/jiesuan/settle-vue3/src/views/purchase/inputInvoicePool/detail.vue"]]);export{ce as default};
