import{_ as Z,d as $,m as ee,aO as te,ah as oe,aP as D,ag as n,aL as ae,w as ne,n as ie,bv as g,x as se,r as p,aC as ue,H as S,u as e,o as i,c as V,l as s,C as u,G as l,aq as F,a as c,F as le,I as re}from"./index.56c69f5a.js";import{I as pe}from"./index.211aa9d2.js";import ce from"./upload-invoice.9d519e0c.js";import me from"./financial-review.2342c6d8.js";import ve from"./index.89e6eb96.js";import de from"./add-edit-form.93cb4ed7.js";import _e from"./add-edit-form.e2276dbc.js";import{h as fe,a as ye,b as be,c as Ce,d as he}from"./index.126bf4a4.js";import"./invoice.3cbb6342.js";import"./status.2df4810d.js";import"./status.4c13d767.js";import"./configs.21fb2cbe.js";import"./inv-open.d02d7e88.js";import"./tootip.fe6ea468.js";import"./basic-descriptions.5f176484.js";import"./index.5f608d1a.js";import"./order-dialog.934c1f0c.js";import"./search-check.3fd2e710.js";import"./use-page-search.27df6d7f.js";import"./columns.f584afd8.js";import"./search-batch.4c4dcb02.js";import"./edit-order.bb15af73.js";import"./invoice-title.1a159ab0.js";import"./columns.9116a0cb.js";import"./choose-form.23665e0d.js";import"./index.e077b65d.js";import"./index.2e257471.js";import"./orderRecord.9d7001b8.js";import"./porder.30193b2b.js";import"./calc.850c7422.js";import"./choose-modal.09f969b2.js";import"./date-range.c3f1dbd6.js";import"./invoice-title.9f01c935.js";const Ae={1:{component:me,title:"\u5F85\u8D22\u52A1\u5BA1\u6838"},2:{component:ce,title:"\u5F85\u4E0A\u4F20\u53D1\u7968"}};const De={class:"main bg-white"},ge=$({__name:"detail",setup(Be){const{query:I}=ee(),w=te(),{isSuperUser:x}=oe(),d=D("\u9500\u552E\u8BA2\u5355"),N=n(()=>d.value==="\u9500\u552E\u8BA2\u5355"),P="invoiceApplyDetail",{hasPermissionWithCode:U}=ae(P),B=D(!1);D("");const y=n(()=>_.value?"0":"1"),k=ne(["0","1","2","3","4"]),m=n(()=>I.id),_=n(()=>!m.value),{push:L}=ie(),{loading:E,data:o,run:q}=g({initalData:{},success:()=>o.value&&H(fe({companyNo:o.value.inv_out}))}),{data:b,run:O}=g({isList:!0,initalData:[]}),{data:G,run:H}=g({isList:!0,initalData:[],success:()=>{const[t]=G.value||[];if(!t)return;const{input_ticket:a}=t;B.value=a==="1"}}),j=n(()=>String(o.value.status)==="1"&&U("025")||String(o.value.status)==="2"),M=n(()=>{const{status:t}=o.value;return["4","6"].includes(String(t))}),T=n(()=>{const{inv_type:t}=o.value;return t==="3"||t==="4"}),W=n(()=>{const{inv_type:t}=o.value;return t==="4"}),z=n(()=>{const{inv_type:t}=o.value;return t==="2"||t==="3"}),C=n(()=>{const{status:t}=o.value;return Ae[String(t)]||{}});async function J({status:t,...a}){let r;t?r=await be({invNo:m.value,status:t,...a}):r=await ye({invNo:m.value,...a});const{code:h,message:f}=r;w({code:h,message:f,handler:()=>L("/InvoiceSales/invoiceApply")})}const K=()=>{O(Ce({invNo:m.value}))},Q=()=>{q(he({invNo:m.value}))};return se(()=>{_.value||(Q(),K())}),(t,a)=>{const r=p("ElRadio"),h=p("ElRadioGroup"),f=p("el-tab-pane"),A=p("el-collapse-item"),X=p("el-collapse"),Y=p("el-tabs"),R=ue("loading");return S((i(),V("div",De,[s(Y,{modelValue:e(y),"onUpdate:modelValue":a[2]||(a[2]=v=>F(y)?y.value=v:null),type:"border-card"},{default:u(()=>[e(_)?(i(),l(f,{key:0,label:"\u65B0\u5EFA\u53D1\u7968\u7533\u8BF7",name:"0"},{default:u(()=>[s(h,{modelValue:e(d),"onUpdate:modelValue":a[0]||(a[0]=v=>F(d)?d.value=v:null)},{default:u(()=>[s(r,{label:"\u9500\u552E\u8BA2\u5355"}),s(r,{label:"\u901A\u7528\u8BA2\u5355"})]),_:1},8,["modelValue"]),e(N)?(i(),l(de,{key:0})):(i(),l(_e,{key:1}))]),_:1})):c("v-if",!0),e(_)?c("v-if",!0):(i(),l(f,{key:1,label:"\u4E1A\u52A1\u8BE6\u60C5",name:"1"},{default:u(()=>[s(X,{modelValue:k.value,"onUpdate:modelValue":a[1]||(a[1]=v=>k.value=v)},{default:u(()=>[s(A,{title:"\u53D1\u7968\u7533\u8BF7\u8BE6\u60C5",name:"2"},{default:u(()=>[S(s(ve,{detail:e(o)},null,8,["detail"]),[[R,e(E)]])]),_:1}),e(b).length>0&&e(b)[0].inv_number&&e(M)?(i(),l(A,{key:0,name:"3",title:"\u53D1\u7968\u8BE6\u60C5"},{default:u(()=>[s(e(pe),{"inv-number":e(b)[0].inv_number,type:"sale"},null,8,["inv-number"])]),_:1})):c("v-if",!0),e(x)?c("v-if",!0):(i(),V(le,{key:1},[Object.keys(e(C)).length&&e(j)?(i(),l(A,{key:0,title:e(C).title,name:"4"},{default:u(()=>[(i(),l(re(e(C).component),{"is-electronic":e(T),"is-support":e(B),"is-special-ticket":e(W),"is-plain":e(z),"inv-type":e(o).inv_type,onChangeStatus:J},null,40,["is-electronic","is-support","is-special-ticket","is-plain","inv-type"]))]),_:1},8,["title"])):c("v-if",!0)],64))]),_:1},8,["modelValue"])]),_:1})),c(` <el-tab-pane label="\u5BA1\u6279\u8BB0\u5F55" name="2" v-if="!isCreate">\r
        <examRecord :examCode="examCode" />\r
      </el-tab-pane> `)]),_:1},8,["modelValue"])])),[[R,e(E)]])}}});var nt=Z(ge,[["__scopeId","data-v-471f3669"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/detail.vue"]]);export{nt as default};
