import{_ as $,d as ee,n as te,aO as oe,ai as ae,aP as h,ah as n,aM as ne,x as se,p as ie,bG as k,y as ue,r as c,aD as le,H as V,m as e,o as s,c as F,l as i,D as u,G as l,ar as I,a as d,F as re,I as ce,cy as pe,cz as me,cA as ve,cB as de,cC as _e}from"./index.js";import{I as fe}from"./index.47e512cd.js";import ye from"./upload-invoice.a6a0b6.js";import Ae from"./financial-review.016255.js";import De from"./index.dfc773.js";import Be from"./add-edit-form.53a3b5.js";import be from"./add-edit-form.e2a448.js";import he from"./add-edit-form.545511.js";import"./status.4c13d767.js";import"./configs.485df979.js";import"./inv-open.90cd9d14.js";import"./index.b1e722e8.js";import"./order-dialog.6bddc3.js";import"./search-check.146e22.js";import"./columns.17ba95.js";import"./search-batch.8d1810.js";import"./search-batch-main.447a41.js";import"./edit-order.eb4628.js";import"./invoice-title.001bf0.js";import"./order-dialog.729139.js";import"./search-check.7fc4c9.js";import"./columns.88d730.js";import"./search-batch.e603de.js";import"./search-batch-main.ca505f.js";import"./edit-order.08ed23.js";import"./invoice-title.2e64c3.js";import"./columns.d95d09.js";import"./choose-form.5ef709.js";import"./index.79a52a46.js";import"./orderRecord.bd0f73d4.js";import"./porder.cb2a60e8.js";import"./choose-modal.c9a6fa.js";import"./date-range.019e953f.js";import"./invoice-title.5ab0f3.js";const ke={1:{component:Ae,title:"\u5F85\u8D22\u52A1\u5BA1\u6838"},2:{component:ye,title:"\u5F85\u4E0A\u4F20\u53D1\u7968"}};const Ce={class:"main bg-white"},ge=ee({__name:"detail",setup(Ee){const{query:w}=te(),N=oe(),{isSuperUser:P}=ae(),p=h("\u9500\u552E\u8BA2\u5355"),U=n(()=>p.value==="\u9500\u552E\u8BA2\u5355"),x=n(()=>p.value==="\u901A\u7528\u8BA2\u5355"),G="invoiceApplyDetail",{hasPermissionWithCode:C}=ne(G),g=h(!1);h("");const y=n(()=>_.value?"0":"1"),E=se(["0","1","2","3","4"]),m=n(()=>w.id),_=n(()=>!m.value),{push:L}=ie(),{loading:S,data:o,run:O}=k({initalData:{},success:()=>o.value&&W(pe({companyNo:o.value.inv_out}))}),{data:A,run:q}=k({isList:!0,initalData:[]}),{data:H,run:W}=k({isList:!0,initalData:[],success:()=>{const[t]=H.value||[];if(!t)return;const{input_ticket:a}=t;g.value=a==="1"}}),j=n(()=>String(o.value.status)==="1"&&C("025")||String(o.value.status)==="2"&&C("058")),M=n(()=>{const{status:t}=o.value;return["4","6"].includes(String(t))}),z=n(()=>{const{inv_type:t}=o.value;return t==="3"||t==="4"}),T=n(()=>{const{inv_type:t}=o.value;return t==="4"}),J=n(()=>{const{inv_type:t}=o.value;return t==="2"||t==="3"}),D=n(()=>{const{status:t}=o.value;return ke[String(t)]||{}});async function K({status:t,...a}){let r;t?r=await ve({invNo:m.value,status:t,...a}):r=await me({invNo:m.value,...a});const{code:B,message:f}=r;N({code:B,message:f,handler:()=>L("/InvoiceSales/invoiceApply")})}const Q=()=>{q(de({invNo:m.value}))},X=()=>{O(_e({invNo:m.value}))};return ue(()=>{_.value||(X(),Q())}),(t,a)=>{const r=c("ElRadio"),B=c("ElRadioGroup"),f=c("el-tab-pane"),b=c("el-collapse-item"),Y=c("el-collapse"),Z=c("el-tabs"),R=le("loading");return V((s(),F("div",Ce,[i(Z,{modelValue:e(y),"onUpdate:modelValue":a[2]||(a[2]=v=>I(y)?y.value=v:null),type:"border-card"},{default:u(()=>[e(_)?(s(),l(f,{key:0,label:"\u65B0\u5EFA\u53D1\u7968\u7533\u8BF7",name:"0"},{default:u(()=>[i(B,{modelValue:e(p),"onUpdate:modelValue":a[0]||(a[0]=v=>I(p)?p.value=v:null)},{default:u(()=>[i(r,{label:"\u9500\u552E\u8BA2\u5355"}),i(r,{label:"\u901A\u7528\u8BA2\u5355(\u5143\u9686\u5B9A\u5236)"}),i(r,{label:"\u901A\u7528\u8BA2\u5355"})]),_:1},8,["modelValue"]),e(U)?(s(),l(Be,{key:0})):e(x)?(s(),l(he,{key:1})):(s(),l(be,{key:2}))]),_:1})):d("v-if",!0),e(_)?d("v-if",!0):(s(),l(f,{key:1,label:"\u4E1A\u52A1\u8BE6\u60C5",name:"1"},{default:u(()=>[i(Y,{modelValue:E.value,"onUpdate:modelValue":a[1]||(a[1]=v=>E.value=v)},{default:u(()=>[i(b,{title:"\u53D1\u7968\u7533\u8BF7\u8BE6\u60C5",name:"2"},{default:u(()=>[V(i(De,{detail:e(o)},null,8,["detail"]),[[R,e(S)]])]),_:1}),e(A).length>0&&e(A)[0].inv_number&&e(M)?(s(),l(b,{key:0,name:"3",title:"\u53D1\u7968\u8BE6\u60C5"},{default:u(()=>[i(e(fe),{"inv-number":e(A)[0].inv_number,type:"sale"},null,8,["inv-number"])]),_:1})):d("v-if",!0),e(P)?d("v-if",!0):(s(),F(re,{key:1},[Object.keys(e(D)).length&&e(j)?(s(),l(b,{key:0,name:"4",title:e(D).title},{default:u(()=>[(s(),l(ce(e(D).component),{"is-electronic":e(z),"is-support":e(g),"is-special-ticket":e(T),"is-plain":e(J),"inv-type":e(o).inv_type,onChangeStatus:K},null,40,["is-electronic","is-support","is-special-ticket","is-plain","inv-type"]))]),_:1},8,["title"])):d("v-if",!0)],64))]),_:1},8,["modelValue"])]),_:1}))]),_:1},8,["modelValue"])])),[[R,e(S)]])}}});var ut=$(ge,[["__scopeId","data-v-471f3669"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/invoiceApply/detail.vue"]]);export{ut as default};
