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