import{_ as W,d as z,c9 as G,n as f,k as H,ab as J,cB as F,q as K,r as c,aw as Q,o as a,c as v,h as u,y as s,i as e,ak as X,a as l,A as n,ca as Y,F as b,f2 as Z,B as $}from"./index.js";import{u as ee}from"./useDetail.da468487.js";import{i as te,h as ae,d as ue,e as oe}from"./index.9c129b93.js";import{R as se}from"./index.6004c99e.js";import le from"./return-form.456d2b.js";import{D as w}from"./receipt.f599b785.js";import{c as ne}from"./ticketReturn.e53d6b17.js";import"./porder.827c74bc.js";import re from"./invoice-modal.c7add8.js";import"./orderRecord.92bbc10f.js";import"./choose-modal.31346c.js";import"./_details.7b315419.js";import"./_options.b664a184.js";import"./invoice-table.019754.js";import"./invoice-form.8c6b00.js";import"./global.9ad647c8.js";import"./index.c443965f.js";const ie={class:"padding__container"},ce={key:0},pe="ticketReturnDetail",me=z({__name:"detail",setup(de){const{hasPermissionWithCode:p,permissions:fe}=G(pe),B=f(null),{push:S}=H(),_=f(null),{isSuperUser:T}=J(),E=f(!0),{id:C,isDetail:h,title:R,collapses:k}=ee({baseName:"\u91C7\u8D2D\u56DE\u7968",collapseLen:14}),N=f(!1),{run:x,data:t}=F({initalData:{},success:async(r={})=>{var d;const{supplierName:i}=r,o=await te({name:i}),[m={}]=((d=o==null?void 0:o.data)==null?void 0:d.list)||[];N.value=m.has_account}}),{run:I}=F({success:()=>S("/purchase/ticketReturn")}),{run:V,loading:j}=F({success:()=>O()});function O(){y(),_.value&&_.value.refresh(),E.value=!1,K(()=>E.value=!0)}const y=()=>x(ae({hpNo:C.value})),P=r=>I(ue(r));function A(r){const i={...r,hpNo:C.value};V(oe(i))}return h.value&&y(),(r,i)=>{const o=c("ElCollapseItem"),m=c("OrderRelationApproval"),d=c("ElAlert"),M=c("ElCollapse"),U=c("ElTabPane"),q=c("ElTabs"),L=Q("loading");return a(),v("div",ie,[u(q,null,{default:s(()=>[u(U,{label:e(R)},{default:s(()=>[u(M,{modelValue:e(k),"onUpdate:modelValue":i[0]||(i[0]=D=>X(k)?k.value=D:null)},{default:s(()=>[u(o,{name:"1",title:e(R)},{default:s(()=>[l(" \u56DE\u7968\u8BE6\u60C5 "),e(h)?(a(),n(e(Y),{key:0,data:e(t),columns:e(ne)(D=>{var g;return(g=B.value)==null?void 0:g.onDisplay(D)})},null,8,["data","columns"])):(a(),v(b,{key:1},[l(" \u521B\u5EFA\u56DE\u7968 "),u(le,{onCreate:P})],2112))]),_:1},8,["title"]),e(h)?(a(),v("div",ce,[u(o,{name:"2",title:"\u5BF9\u8D26\u8BE6\u60C5"},{default:s(()=>[u(e(se),{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(re,{ref_key:"invoiceModalRef",ref:B},null,512),l(" \u5BA1\u6279\u8282\u70B9 "),e(T)?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(Z,{key:0,code:e(t).hpNo,payNo:e(t).payNo,onRefresh:y},null,8,["code","payNo"]))]),_:1})):l("v-if",!0),e(t).status=="12"&&e(p)("065")?$((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:A},null,8,["code"])]),_:1})),[[L,e(j)]]):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(w),{"approve-value":"3","reject-value":"6",onApproval:A})]),_: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(w),{"approve-value":"4","reject-value":"7",onApproval:A})]),_:1})):l("v-if",!0)],64))])):l("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1})])}}});var Te=W(me,[["__file","D:/work/jiesuan/settle-vue3/src/views/purchase/ticketReturn/detail.vue"]]);export{Te as default};
