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