import{_ as z,d as G,A as H,bo as M,E as Q,ai as X,aZ as y,af as C,x as b,aA as Y,o as a,c as E,y as i,K as o,u as e,ao as ee,O as I,N as l,a as r,L as F}from"./index.743f0c80.js";import{u as te}from"./useDetail.50c7b89c.js";import ne from"./return-form.95c191f1.js";import{B as ae}from"./basic-descriptions.e56bd542.js";import oe from"./approval-pending.fcdc0b78.js";import{I as V}from"./index.5fbf2896.js";import{i as ie}from"./capital-modal.1d528897.js";import se from"./index.66075224.js";import{h as A,a as ue,b as le}from"./index.5ec0a88b.js";import{d as re}from"./index.8212cab4.js";import"./inv-open.a0819b58.js";import"./tootip.48acd346.js";import"./status.868e86c0.js";import"./invoice.7fa18a6d.js";const ce={class:"padding__container"},me=G({__name:"detail",setup(pe){const{push:S}=H(),T="returnTicketDetail",{hasPermissionWithCode:x}=M(T),B=Q(["0","1","2"]),{id:k,isDetail:m,collapses:h,title:g}=te({baseName:"\u9000\u7968\u7533\u8BF7",collapseLen:5}),{isSuperUser:P}=X(),{data:n,run:N,loading:R}=y({initalData:{},success:({invNo:t})=>{K(re({invNo:t}))}}),{run:w}=y({success:()=>S("/InvoiceSales/returnTicket")}),{run:U}=y({success:()=>{N(A({returnCode:k.value}))}}),j=C(()=>{const{inv_type:t}=n.value;return t==="2"||t==="3"}),L=C(()=>{const{open_type:t}=n.value;return String(t)==="1"}),O=C(()=>{const{is_out_month:t}=n.value;return t}),J=C(()=>{const{inv_type:t}=n.value;return t}),{data:p,run:K,loading:W}=y({initalData:{}});function Z(t,c=!1){const{invinfo:u}=p.value,{inv_number:v,inv_subtotal:d,inv_code:D,open_date:_,check_code:s}=u||{},f={checkCode:s,invCode:D,invNum:v,open_date:_,subtotal_fee:d},q={returnCode:k.value,...t,...c?f:{}};U(ue(q))}const $=t=>{w(le(t))};return m.value&&N(A({returnCode:k.value})),(t,c)=>{const u=b("ElCollapseItem"),v=b("ElCollapse"),d=b("ElTabPane"),D=b("ElTabs"),_=Y("loading");return a(),E("div",ce,[i(D,null,{default:o(()=>[i(d,{label:e(g)},{default:o(()=>[i(v,{modelValue:e(h),"onUpdate:modelValue":c[0]||(c[0]=s=>ee(h)?h.value=s:null)},{default:o(()=>[i(u,{name:"1",title:e(g)},{default:o(()=>[e(m)?I((a(),l(e(ae),{key:0,columns:e(ie),data:e(n)},null,8,["columns","data"])),[[_,e(R)]]):(a(),l(ne,{key:1,onCreate:$}))]),_:1},8,["title"]),e(n).inv_number?(a(),l(u,{key:0,name:"2",title:"\u9000\u7968\u7968\u9762\u8BE6\u60C5"},{default:o(()=>[i(e(V),{type:"sale","inv-number":e(n).inv_number},null,8,["inv-number"])]),_:1})):r("v-if",!0),e(m)?(a(),E(F,{key:1},[e(P)?r("v-if",!0):(a(),E(F,{key:0},[String(e(n).status)==="0"&&e(x)("025")?(a(),l(u,{key:0,name:"4",title:"\u5F85\u5BA1\u6838"},{default:o(()=>[i(oe,{isNormal:e(j),"is-js":e(L),"is-out-month":e(O),"inv-type":e(J),"company-no":e(n).companyNo,onApproval:Z},null,8,["isNormal","is-js","is-out-month","inv-type","company-no"])]),_:1})):r("v-if",!0)],64))],64)):r("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"]),e(m)?(a(),l(d,{key:0,label:"\u5F00\u7968\u7533\u8BF7\u8BE6\u60C5"},{default:o(()=>[i(v,{modelValue:B.value,"onUpdate:modelValue":c[1]||(c[1]=s=>B.value=s)},{default:o(()=>{var s;return[e(n).invNo?(a(),l(u,{key:0,name:"0",title:"\u5F00\u7968\u7533\u8BF7\u8BE6\u60C5"},{default:o(()=>[I(i(se,{detail:e(p)},null,8,["detail"]),[[_,e(W)]])]),_:1})):r("v-if",!0),(s=e(p).invinfo)!=null&&s.inv_number?(a(),l(u,{key:1,name:"1",title:"\u5F00\u7968\u7968\u9762\u8BE6\u60C5"},{default:o(()=>{var f;return[i(e(V),{type:"sale","inv-number":(f=e(p).invinfo)==null?void 0:f.inv_number},null,8,["inv-number"])]}),_:1})):r("v-if",!0)]}),_:1},8,["modelValue"])]),_:1})):r("v-if",!0)]),_:1})])}}});var Ie=z(me,[["__file","D:/work/accout-vue3-ui/src/views/InvoiceSales/returnTicket/detail.vue"]]);export{Ie as default};