import{_ as U,d as q,k as L,j as $,n as m,aa as H,cc as Q,c9 as G,ab as W,cB as P,q as X,r as n,o as a,c as B,h as r,y as u,i as t,ak as Y,a as o,A as i,F as z,H as A,dx as J,dX as K,f4 as M,f5 as Z}from"./index.js";import{u as ee}from"./useDetail.da468487.js";import{D as te}from"./receipt.f599b785.js";import{R as oe}from"./index.6004c99e.js";import{h as ae}from"./export.97c4d705.js";import{P as ue}from"./index.c5f474a0.js";import"./global.9ad647c8.js";import"./orderRecord.92bbc10f.js";import"./porder.827c74bc.js";import"./xlsx.ed122d16.js";import"./print-style.0cc9588c.js";const se={class:"padding__container"},re={key:0,style:{position:"absolute",top:"15px",right:"15px"}},le="orderRecordDetail",ne=q({__name:"detail",setup(ie){const{push:g}=L(),{query:x}=$(),D=m({}),v=m(null),b=H(()=>{var s;return((s=v.value)==null?void 0:s.detail.status)||""}),_=m(null),d=Q(!1),{hasPermissionWithCode:p}=G(le),{id:c,title:F,isDetail:y,collapses:E}=ee({baseName:"\u8BA2\u5355\u5BF9\u8D26",collapseLen:3}),{isSuperUser:N}=W(),C=m(!0),{run:V}=P({success:async()=>{v.value.refresh(),C.value=!1,X(()=>C.value=!0)}}),{run:S,loading:T}=P({success:()=>g(`/purchase/${x.isQuery?"orderRecordQuery":"orderRecord"}`)});function w(s){const e={...s,payNo:c.value},f=c.value.slice(3,9),R=Number(f)<Z;V(R?J(e):K(e))}function O({cids:s}){const e={cids:s.join(",")};S(M(e))}async function h(){await ae({url:"paycgdexport",name:"\u5BF9\u8D26\u5355\u660E\u7EC6\u8868",onStart:()=>d.value=!0,onSuccess:()=>d.value=!1,onFail:()=>d.value=!1,params:{payNo:c.value}})}return(s,e)=>{const f=n("ElCollapseItem"),R=n("ElCollapse"),j=n("ElTabPane"),I=n("ElTabs"),k=n("ElButton");return a(),B("div",se,[r(I,null,{default:u(()=>[r(j,{label:t(F)},{default:u(()=>[r(R,{modelValue:t(E),"onUpdate:modelValue":e[1]||(e[1]=l=>Y(E)?E.value=l:null)},{default:u(()=>[o(" \u8BE6\u60C5 or \u521B\u5EFA "),r(f,{name:"1",title:t(F)},{default:u(()=>[C.value?(a(),i(t(oe),{key:0,id:t(c),ref_key:"formRef",ref:v,loading:t(T),readonly:t(y),onCreate:O,onGetRecord:e[0]||(e[0]=l=>D.value=l),isPurch:""},null,8,["id","loading","readonly"])):o("v-if",!0)]),_:1},8,["title"]),o(" \u8BE6\u60C5 - \u5BA1\u6279\u8282\u70B9 "),t(y)&&!t(N)?(a(),B(z,{key:0},[String(b.value)==="1"&&t(p)("039")?(a(),i(f,{key:0,name:"2",title:"\u4E70\u65B9\u516C\u53F8\u4E1A\u52A1\u5BA1\u6838"},{default:u(()=>[r(t(te),{approveValue:"2",rejectValue:"3",onApproval:w})]),_:1})):o("v-if",!0)],64)):o("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),t(y)?(a(),B("div",re,[t(p)("047")?(a(),i(k,{key:0,onClick:e[2]||(e[2]=l=>_.value.print(!0))},{default:u(()=>e[5]||(e[5]=[A(" \u6253\u5370\u51FA\u5E93\u5355 ")])),_:1})):o("v-if",!0),t(p)("046")?(a(),i(k,{key:1,onClick:e[3]||(e[3]=l=>_.value.print())},{default:u(()=>e[6]||(e[6]=[A(" \u6253\u5370\u5BF9\u8D26\u5355 ")])),_:1})):o("v-if",!0),t(p)("038")?(a(),i(k,{key:2,loading:d.value,type:"primary",onClick:e[4]||(e[4]=()=>h())},{default:u(()=>e[7]||(e[7]=[A(" \u5BF9\u8D26\u5355\u660E\u7EC6\u5BFC\u51FA ")])),_:1},8,["loading"])):o("v-if",!0)])):o("v-if",!0),r(t(ue),{record:D.value,ref_key:"PrintOrderRecordRef",ref:_},null,8,["record"])])}}});var ke=U(ne,[["__file","D:/work/jiesuan/settle-vue3/src/views/purchase/orderRecord/detail.vue"]]);export{ke as default};
