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