import{_ as A,d as V,aM as g,x as c,p as w,ai as F,bc as p,z as R,r as i,o as m,c as b,l as s,D as u,m as o,ar as Y,a as h,G as M,aN as U,F as j,ae as O}from"./index.js";import{u as S}from"./useDetail.748c7288.js";import{b as q,c as z,a as G}from"./index.8d1ab27f.js";import L from"./return-form.0e4f51.js";import{i as H}from"./ticketReturn.8c918810.js";import"./porder.cb2a60e8.js";import"./invoice-table.d05740.js";import"./invoice-form.ce6266.js";import"./_rules.bde94d19.js";import"./global.9ad647c8.js";const J={class:"padding__container"},K=V({__name:"detail",setup(Q){g("inputInvoicePoolDetail"),c(null);const{push:D}=w(),_=c(null);F();const d=c(!0),{id:E,isDetail:f,title:v,collapses:r}=S({baseName:"\u53D1\u7968",collapseLen:14}),y=c(!1),{run:k,data:N}=p({initalData:{},success:async(n={})=>{var l;const{supplierName:t}=n,a=await q({name:t}),[e={}]=((l=a==null?void 0:a.data)==null?void 0:l.list)||[];y.value=e.has_account}}),{run:T}=p({success:()=>D("/purchase/inputInvoicePool")});p({success:()=>x()});function x(){C(),_.value&&_.value.refresh(),d.value=!1,R(()=>d.value=!0)}const C=()=>k(z({InvCode:E.value})),I=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")}));T(G({list:a}))};return f.value&&C(),(n,t)=>{const a=i("ElCollapseItem"),e=i("ElCollapse"),l=i("ElTabPane"),P=i("ElTabs");return m(),b("div",J,[s(P,null,{default:u(()=>[s(l,{label:o(v)},{default:u(()=>[s(e,{modelValue:o(r),"onUpdate:modelValue":t[0]||(t[0]=B=>Y(r)?r.value=B:null)},{default:u(()=>[s(a,{name:"1",title:o(v)},{default:u(()=>[h(" \u53D1\u7968\u8BE6\u60C5 "),o(f)?(m(),M(o(U),{key:0,data:o(N),columns:o(H)},null,8,["data","columns"])):(m(),b(j,{key:1},[h(" \u521B\u5EFA\u56DE\u7968 "),s(L,{onCreate:I})],2112))]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1})])}}});var ce=A(K,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/purchase/inputInvoicePool/detail.vue"]]);export{ce as default};
