import{_ as K,d as Q,j as X,cb as ee,ab as te,cc as B,aa as o,c9 as ae,n as oe,k as ue,d3 as D,p as ne,r as c,aw as ie,B as w,i as n,o as u,c as F,h as i,y as s,A as l,a as v,F as se,C as le,dY as re,dZ as ce,d_ as pe,d$ as me,e0 as ve}from"./index.js";import{I as de}from"./index.c443965f.js";import _e from"./upload-invoice.606028.js";import fe from"./financial-review.828c4d.js";import ye from"./index.5405ac.js";import Ae from"./add-edit-form.b06a63.js";import be from"./add-edit-form.674e09.js";import ke from"./add-edit-form.27a2a4.js";import"./status.4c13d767.js";import"./configs.523ebe54.js";import"./inv-open.b2ee78c0.js";import"./index.9e6aefa2.js";import"./order-dialog.d36a86.js";import"./search-check.5c02f4.js";import"./columns.17ba95.js";import"./search-batch.8da474.js";import"./search-batch-main.ecb5c6.js";import"./edit-order.8c965b.js";import"./invoice-title.a62d39.js";import"./order-dialog.44f01b.js";import"./search-check.9a3661.js";import"./columns.88d730.js";import"./search-batch.86618f.js";import"./search-batch-main.5b340b.js";import"./edit-order.1cbc21.js";import"./invoice-title.630fcf.js";import"./columns.d95d09.js";import"./choose-form.3c99d5.js";import"./index.6004c99e.js";import"./orderRecord.92bbc10f.js";import"./porder.827c74bc.js";import"./choose-modal.98a16f.js";import"./invoice-title.0b9930.js";const Be={1:{component:fe,title:"\u5F85\u8D22\u52A1\u5BA1\u6838"},2:{component:_e,title:"\u5F85\u4E0A\u4F20\u53D1\u7968"}};const De={class:"main bg-white"},he="invoiceApplyDetail",ge=Q({__name:"detail",setup(Ce){const{query:R}=X(),I=ee(),{isSuperUser:N}=te(),d=B("\u9500\u552E\u8BA2\u5355"),P=o(()=>d.value==="\u9500\u552E\u8BA2\u5355"),U=o(()=>d.value==="\u901A\u7528\u8BA2\u5355"),{hasPermissionWithCode:h}=ae(he),g=B(!1);B("");const C=o(()=>_.value?"0":"1"),E=oe(["0","1","2","3","4"]),p=o(()=>R.id),_=o(()=>!p.value),{push:x}=ue(),{loading:S,data:t,run:L}=D({initalData:{},success:()=>t.value&&O(re({companyNo:t.value.inv_out}))}),{data:y,run:j}=D({isList:!0,initalData:[]}),{data:q,run:O}=D({isList:!0,initalData:[],success:()=>{const[e]=q.value||[];if(!e)return;const{input_ticket:a}=e;g.value=a==="1"}}),W=o(()=>String(t.value.status)==="1"&&h("025")||String(t.value.status)==="2"&&h("058")),G=o(()=>{const{status:e}=t.value;return["4","6"].includes(String(e))}),H=o(()=>{const{inv_type:e}=t.value;return e==="3"||e==="4"}),M=o(()=>{const{inv_type:e}=t.value;return e==="4"}),T=o(()=>{const{inv_type:e}=t.value;return e==="2"||e==="3"}),A=o(()=>{const{status:e}=t.value;return Be[String(e)]||{}});async function Y({status:e,...a}){let r;e?r=await pe({invNo:p.value,status:e,...a}):r=await ce({invNo:p.value,...a});const{code:b,message:f}=r;I({code:b,message:f,handler:()=>x("/InvoiceSales/invoiceApply")})}const Z=()=>{j(me({invNo:p.value}))},$=()=>{L(ve({invNo:p.value}))};return ne(()=>{_.value||($(),Z())}),(e,a)=>{const r=c("ElRadio"),b=c("ElRadioGroup"),f=c("el-tab-pane"),k=c("el-collapse-item"),z=c("el-collapse"),J=c("el-tabs"),V=ie("loading");return w((u(),F("div",De,[i(J,{modelValue:C.value,"onUpdate:modelValue":a[2]||(a[2]=m=>C.value=m),type:"border-card"},{default:s(()=>[_.value?(u(),l(f,{key:0,label:"\u65B0\u5EFA\u53D1\u7968\u7533\u8BF7",name:"0"},{default:s(()=>[i(b,{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=m=>d.value=m)},{default:s(()=>[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"]),P.value?(u(),l(Ae,{key:0})):U.value?(u(),l(ke,{key:1})):(u(),l(be,{key:2}))]),_:1})):v("v-if",!0),_.value?v("v-if",!0):(u(),l(f,{key:1,label:"\u4E1A\u52A1\u8BE6\u60C5",name:"1"},{default:s(()=>[i(z,{modelValue:E.value,"onUpdate:modelValue":a[1]||(a[1]=m=>E.value=m)},{default:s(()=>[i(k,{title:"\u53D1\u7968\u7533\u8BF7\u8BE6\u60C5",name:"2"},{default:s(()=>[w(i(ye,{detail:n(t)},null,8,["detail"]),[[V,n(S)]])]),_:1}),n(y).length>0&&n(y)[0].inv_number&&G.value?(u(),l(k,{key:0,name:"3",title:"\u53D1\u7968\u8BE6\u60C5"},{default:s(()=>[i(n(de),{"inv-number":n(y)[0].inv_number,type:"sale"},null,8,["inv-number"])]),_:1})):v("v-if",!0),n(N)?v("v-if",!0):(u(),F(se,{key:1},[Object.keys(A.value).length&&W.value?(u(),l(k,{key:0,name:"4",title:A.value.title},{default:s(()=>[(u(),l(le(A.value.component),{"is-electronic":H.value,"is-support":g.value,"is-special-ticket":M.value,"is-plain":T.value,"inv-type":n(t).inv_type,onChangeStatus:Y},null,40,["is-electronic","is-support","is-special-ticket","is-plain","inv-type"]))]),_:1},8,["title"])):v("v-if",!0)],64))]),_:1},8,["modelValue"])]),_:1}))]),_:1},8,["modelValue"])])),[[V,n(S)]])}}});var nt=K(ge,[["__scopeId","data-v-471f3669"],["__file","D:/work/jiesuan/settle-vue3/src/views/InvoiceSales/invoiceApply/detail.vue"]]);export{nt as default};
