import{_ as y,d as E,p as F,x as i,bU as g,r,aD as w,H as f,m as n,o as c,c as B,l,D as u,G as _,h as C,aN as N,a as V,M as R,aQ as T,aZ as U}from"./index.js";import M from"./index.1d1004.js";import{b as j,d as A}from"./index.ae4dabde.js";import{i as q}from"./ticketReturn.8c918810.js";import"./porder.cb2a60e8.js";import"./index.8d1ab27f.js";const G={class:"ticket__content w-full"},H={class:"w-full flex flex-col"},P={class:"flex w-full justify-end mt-[10px]"},Q=E({__name:"return-form",setup(S){const b=F(),d=i(null),o=i({visible:!1,loading:!1,data:null}),t=i({InvCode:"",invoiceNumber:""}),I={InvCode:[{required:!0,message:"\u8BF7\u9009\u62E9\u53D1\u7968\u53F7\u7801",trigger:"change"}]},v=g({success(){U.success("\u521B\u5EFA\u6210\u529F!"),b.push("/supply/supplyCollection")}});async function D(){try{await d.value.validate();const{InvCode:a}=t.value;v.run(j({InvCode:a}))}catch{}}async function h(a){const e=await A({InvCode:a.InvCode});t.value.invoiceNumber=e.data.invoice_number,t.value.InvCode=e.data.InvCode,o.value.data=e.data}return(a,e)=>{const k=r("ElInput"),m=r("ElFormItem"),x=r("ElButton"),p=w("loading");return f((c(),B("div",G,[l(n(T),{ref_key:"formRef",ref:d,rules:I,model:t.value,"label-width":"110px"},{default:u(()=>[f((c(),_(m,{label:"\u9500\u9879\u53D1\u7968\u53F7\u7801",prop:"InvCode"},{default:u(()=>[C("div",H,[l(k,{modelValue:t.value.invoiceNumber,"onUpdate:modelValue":e[0]||(e[0]=s=>t.value.invoiceNumber=s),onClick:e[1]||(e[1]=s=>o.value.visible=!0),placeholder:"\u9500\u9879\u53D1\u7968\u53F7\u7801"},null,8,["modelValue"]),o.value.data?(c(),_(n(N),{key:0,class:"mt-[10px]",data:o.value.data,columns:n(q)},null,8,["data","columns"])):V("v-if",!0)])]),_:1})),[[p,o.value.loading]]),l(m,null,{default:u(()=>[C("div",P,[l(x,{type:"primary",onClick:D},{default:u(()=>[R(" \u4FDD\u5B58 ")]),_:1})])]),_:1})]),_:1},8,["model"]),l(M,{visible:o.value.visible,"onUpdate:visible":e[2]||(e[2]=s=>o.value.visible=s),onSubmit:h},null,8,["visible"])])),[[p,n(v).loading]])}}});var O=y(Q,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/supplyNew/invoiceRelation/components/return-form.vue"]]);export{O as default};
