import{_ as W,d as z,k as G,n as f,ab as H,c9 as J,cB as N,q as K,r as c,aw as Q,o as t,c as v,h as u,y as l,i as e,ak as X,a as s,A as n,ca as Y,F as g,f2 as Z,B as $}from"./index.js";import{u as ee}from"./useDetail.da468487.js";import{h as ae,a as te,b as oe,c as ue}from"./index.41007914.js";import se from"./return-form.84ce05.js";import{D as w}from"./receipt.f599b785.js";import{c as le}from"./ticketReturn.e53d6b17.js";import"./porder.827c74bc.js";import ne from"./invoice-modal.7d000f.js";import"./index.fcef8c.js";import"./index.5741d39c.js";import"./global.9ad647c8.js";import"./index.c443965f.js";const ie={class:"padding__container"},re={key:0},ce="invoiceRelationDetail",pe=z({__name:"detail",setup(me){const{push:S}=G(),_=f(!0),{isSuperUser:T}=H(),{hasPermissionWithCode:p,permissions:de}=J(ce),k=f(null),B=f(null),{id:C,isDetail:E,title:D,collapses:h}=ee({baseName:"\u4E70\u5165\u53D1\u7968\u5173\u8054",collapseLen:14}),R=f(!1),{run:I,data:a}=N({initalData:{},success:async(i={})=>{var d;const{supplierName:r}=i,o=await ae({name:r}),[m={}]=((d=o==null?void 0:o.data)==null?void 0:d.list)||[];R.value=m.has_account}}),{run:x}=N({success:()=>S("/purchaseNew/invoiceRelation")}),{run:P,loading:V}=N({success:()=>j()});function j(){y(),B.value&&B.value.refresh(),_.value=!1,K(()=>_.value=!0)}const y=()=>I(te({hpNo:C.value})),M=i=>x(oe(i));function A(i){const r={...i,hpNo:C.value};P(ue(r))}return E.value&&y(),(i,r)=>{const o=c("ElCollapseItem"),m=c("OrderRelationApproval"),d=c("ElAlert"),O=c("ElCollapse"),U=c("ElTabPane"),q=c("ElTabs"),L=Q("loading");return t(),v("div",ie,[u(q,null,{default:l(()=>[u(U,{label:e(D)},{default:l(()=>[u(O,{modelValue:e(h),"onUpdate:modelValue":r[0]||(r[0]=F=>X(h)?h.value=F:null)},{default:l(()=>[u(o,{name:"1",title:e(D)},{default:l(()=>[s(" \u56DE\u7968\u8BE6\u60C5 "),e(E)?(t(),n(e(Y),{key:0,data:e(a),columns:e(le)(F=>{var b;return(b=k.value)==null?void 0:b.onDisplay(F)})},null,8,["data","columns"])):(t(),v(g,{key:1},[s(" \u521B\u5EFA\u56DE\u7968 "),u(se,{onCreate:M})],2112))]),_:1},8,["title"]),e(E)?(t(),v("div",re,[e(a)&&["2","3","4","6","12"].includes(String(e(a).status))&&_.value?(t(),n(o,{key:0,title:"\u5173\u8054\u4FE1\u606F",name:"10"},{default:l(()=>[u(m,{readonly:"",code:e(a).hpNo},null,8,["code"])]),_:1})):s("v-if",!0),u(ne,{ref_key:"invoiceModalRef",ref:k},null,512),s(" \u5BA1\u6279\u8282\u70B9 "),e(T)?s("v-if",!0):(t(),v(g,{key:1},[e(a)&&e(a).status=="11"&&e(p)("063")?(t(),n(o,{key:0,title:"\u5F85\u53D1\u7968\u4E0E\u8BA2\u5355\u5173\u8054",name:"8"},{default:l(()=>[R.value?(t(),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"})):(t(),n(Z,{key:0,code:e(a).hpNo,payNo:e(a).payNo,onRefresh:y,companyNo:e(a).companyNo,supplierNo:e(a).supplierNo,multiplePayNos:!0},null,8,["code","payNo","companyNo","supplierNo"]))]),_:1})):s("v-if",!0),e(a).status=="12"&&e(p)("065")?$((t(),n(o,{key:1,title:"\u5F85\u8D22\u52A1\u5BA1\u6838\u5173\u8054\u4FE1\u606F",name:"9"},{default:l(()=>[u(m,{rejectCode:13,successCode:3,code:e(a).hpNo,onSubmit:A},null,8,["code"])]),_:1})),[[L,e(V)]]):s("v-if",!0),String(e(a).status)==="2"&&e(p)("020")?(t(),n(o,{key:2,title:"\u4E70\u65B9\u516C\u53F8\u4E1A\u52A1\u5BA1\u6838",name:"4"},{default:l(()=>[u(e(w),{"approve-value":"3","reject-value":"6",onApproval:A})]),_:1})):s("v-if",!0),String(e(a).status)==="3"&&e(p)("021")?(t(),n(o,{key:3,name:"5",title:"\u4E70\u65B9\u516C\u53F8\u8BA4\u8BC1"},{default:l(()=>[u(e(w),{"approve-value":"4","reject-value":"7",onApproval:A})]),_:1})):s("v-if",!0)],64))])):s("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1})])}}});var De=W(pe,[["__file","D:/work/jiesuan/settle-vue3/src/views/purchase/invoiceRelation/detail.vue"]]);export{De as default};
