import{_ as G,d as H,p as W,x as v,ai as J,aM as K,bc as N,z as Q,r as c,aD as X,o as t,c as f,l as u,D as l,m as e,ar as Y,a as s,G as n,aN as Z,F as g,dF as $,H as ee}from"./index.js";import{u as ae}from"./useDetail.748c7288.js";import{h as te,a as oe,b as ue,c as se}from"./index.ae4dabde.js";import le from"./return-form.863e11.js";import{D as S}from"./default.5cadb723.js";/* empty css                                                */import{c as ne}from"./ticketReturn.8c918810.js";import"./porder.cb2a60e8.js";import re from"./invoice-modal.e18f69.js";import"./index.101538.js";import"./index.8d1ab27f.js";import"./global.9ad647c8.js";import"./index.47e512cd.js";const ie={class:"padding__container"},ce={key:0},pe=H({__name:"detail",setup(me){const w="invoiceRelationDetail",{push:T}=W(),_=v(!0),{isSuperUser:x}=J(),{hasPermissionWithCode:p,permissions:de}=K(w),C=v(null),D=v(null),{id:k,isDetail:E,title:B,collapses:h}=ae({baseName:"\u4E70\u5165\u53D1\u7968\u5173\u8054",collapseLen:14}),R=v(!1),{run:I,data:a}=N({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)||[];R.value=m.has_account}}),{run:P}=N({success:()=>T("/purchaseNew/invoiceRelation")}),{run:V,loading:j}=N({success:()=>M()});function M(){y(),D.value&&D.value.refresh(),_.value=!1,Q(()=>_.value=!0)}const y=()=>I(oe({hpNo:k.value})),U=r=>P(ue(r));function A(r){const i={...r,hpNo:k.value};V(se(i))}return E.value&&y(),(r,i)=>{const o=c("ElCollapseItem"),m=c("OrderRelationApproval"),d=c("ElAlert"),O=c("ElCollapse"),L=c("ElTabPane"),q=c("ElTabs"),z=X("loading");return t(),f("div",ie,[u(q,null,{default:l(()=>[u(L,{label:e(B)},{default:l(()=>[u(O,{modelValue:e(h),"onUpdate:modelValue":i[0]||(i[0]=F=>Y(h)?h.value=F:null)},{default:l(()=>[u(o,{name:"1",title:e(B)},{default:l(()=>[s(" \u56DE\u7968\u8BE6\u60C5 "),e(E)?(t(),n(e(Z),{key:0,data:e(a),columns:e(ne)(F=>{var b;return(b=C.value)==null?void 0:b.onDisplay(F)})},null,8,["data","columns"])):(t(),f(g,{key:1},[s(" \u521B\u5EFA\u56DE\u7968 "),u(le,{onCreate:U})],2112))]),_:1},8,["title"]),e(E)?(t(),f("div",ce,[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(re,{ref_key:"invoiceModalRef",ref:C},null,512),s(" \u5BA1\u6279\u8282\u70B9 "),e(x)?s("v-if",!0):(t(),f(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($,{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")?ee((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})),[[z,e(j)]]):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(S),{"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(S),{"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 Re=G(pe,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/purchase/invoiceRelation/detail.vue"]]);export{Re as default};
