import{_ as G,d as H,aM as W,x as f,p as J,ai as K,bc as y,z as Q,r as c,aD as X,o as a,c as v,l as u,D as s,m as e,ar as Y,a as l,G as n,aN as Z,F as b,dF as $,H as ee}from"./index.js";import{u as te}from"./useDetail.748c7288.js";import{i as ae,h as ue,d as oe,e as se}from"./index.80104a95.js";import{R as le}from"./index.79a52a46.js";import ne from"./return-form.5b9726.js";import{D as S}from"./default.5cadb723.js";/* empty css                                                */import{c as re}from"./ticketReturn.8c918810.js";import"./porder.cb2a60e8.js";import ie from"./invoice-modal.da9520.js";import"./orderRecord.bd0f73d4.js";import"./choose-modal.c35b78.js";import"./_details.7b315419.js";import"./date-range.019e953f.js";import"./_options.b664a184.js";import"./invoice-table.7e7b22.js";import"./invoice-form.9ac8e9.js";import"./global.9ad647c8.js";import"./index.47e512cd.js";const ce={class:"padding__container"},pe={key:0},me=H({__name:"detail",setup(de){const T="ticketReturnDetail",{hasPermissionWithCode:p,permissions:fe}=W(T),A=f(null),{push:w}=J(),_=f(null),{isSuperUser:x}=K(),E=f(!0),{id:B,isDetail:D,title:R,collapses:h}=te({baseName:"\u91C7\u8D2D\u56DE\u7968",collapseLen:14}),N=f(!1),{run:I,data:t}=y({initalData:{},success:async(r={})=>{var d;const{supplierName:i}=r,o=await ae({name:i}),[m={}]=((d=o==null?void 0:o.data)==null?void 0:d.list)||[];N.value=m.has_account}}),{run:V}=y({success:()=>w("/purchase/ticketReturn")}),{run:j,loading:M}=y({success:()=>O()});function O(){F(),_.value&&_.value.refresh(),E.value=!1,Q(()=>E.value=!0)}const F=()=>I(ue({hpNo:B.value})),P=r=>V(oe(r));function C(r){const i={...r,hpNo:B.value};j(se(i))}return D.value&&F(),(r,i)=>{const o=c("ElCollapseItem"),m=c("OrderRelationApproval"),d=c("ElAlert"),U=c("ElCollapse"),L=c("ElTabPane"),q=c("ElTabs"),z=X("loading");return a(),v("div",ce,[u(q,null,{default:s(()=>[u(L,{label:e(R)},{default:s(()=>[u(U,{modelValue:e(h),"onUpdate:modelValue":i[0]||(i[0]=k=>Y(h)?h.value=k:null)},{default:s(()=>[u(o,{name:"1",title:e(R)},{default:s(()=>[l(" \u56DE\u7968\u8BE6\u60C5 "),e(D)?(a(),n(e(Z),{key:0,data:e(t),columns:e(re)(k=>{var g;return(g=A.value)==null?void 0:g.onDisplay(k)})},null,8,["data","columns"])):(a(),v(b,{key:1},[l(" \u521B\u5EFA\u56DE\u7968 "),u(ne,{onCreate:P})],2112))]),_:1},8,["title"]),e(D)?(a(),v("div",pe,[u(o,{name:"2",title:"\u5BF9\u8D26\u8BE6\u60C5"},{default:s(()=>[u(e(le),{ref_key:"formRef",ref:_,readonly:"",id:e(t).payNo},null,8,["id"])]),_:1}),e(t)&&["2","3","4","6","12"].includes(String(e(t).status))&&E.value?(a(),n(o,{key:0,title:"\u5173\u8054\u4FE1\u606F",name:"10"},{default:s(()=>[u(m,{readonly:"",code:e(t).hpNo},null,8,["code"])]),_:1})):l("v-if",!0),u(ie,{ref_key:"invoiceModalRef",ref:A},null,512),l(" \u5BA1\u6279\u8282\u70B9 "),e(x)?l("v-if",!0):(a(),v(b,{key:1},[e(t)&&e(t).status=="11"&&e(p)("063")?(a(),n(o,{key:0,title:"\u5F85\u53D1\u7968\u4E0E\u8BA2\u5355\u5173\u8054",name:"8"},{default:s(()=>[N.value?(a(),n(d,{key:1,closable:!1,type:"warning",title:"\u5F53\u524D\u4F9B\u5E94\u5546\u5DF2\u5F00\u901A\u4F9B\u5E94\u5546\u7AEF,\u8BF7\u5230\u4F9B\u5E94\u5546\u7AEF\u64CD\u4F5C"})):(a(),n($,{key:0,code:e(t).hpNo,payNo:e(t).payNo,onRefresh:F},null,8,["code","payNo"]))]),_:1})):l("v-if",!0),e(t).status=="12"&&e(p)("065")?ee((a(),n(o,{key:1,title:"\u5F85\u8D22\u52A1\u5BA1\u6838\u5173\u8054\u4FE1\u606F",name:"9"},{default:s(()=>[u(m,{rejectCode:13,successCode:3,isOld:!0,code:e(t).hpNo,onSubmit:C},null,8,["code"])]),_:1})),[[z,e(M)]]):l("v-if",!0),String(e(t).status)==="2"&&e(p)("020")?(a(),n(o,{key:2,title:"\u4E70\u65B9\u516C\u53F8\u4E1A\u52A1\u5BA1\u6838",name:"4"},{default:s(()=>[u(e(S),{"approve-value":"3","reject-value":"6",onApproval:C})]),_:1})):l("v-if",!0),String(e(t).status)==="3"&&e(p)("021")?(a(),n(o,{key:3,title:"\u4E70\u65B9\u516C\u53F8\u8BA4\u8BC1",name:"5"},{default:s(()=>[u(e(S),{"approve-value":"4","reject-value":"7",onApproval:C})]),_:1})):l("v-if",!0)],64))])):l("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1})])}}});var Ie=G(me,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/purchase/ticketReturn/detail.vue"]]);export{Ie as default};
