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