import{_ as F,d as w,k as x,n as i,di as E,cm as g,r,aw as y,B as f,i as s,o as c,c as N,h as l,y as u,A as _,e as C,ca as R,a as V,H as T,cd as A}from"./index.js";import j from"./index.80a144.js";import{b as M,d as U}from"./index.41007914.js";import{i as q}from"./ticketReturn.e53d6b17.js";import"./porder.827c74bc.js";import"./index.5741d39c.js";const H={class:"ticket__content w-full"},P={class:"w-full flex flex-col"},S={class:"flex w-full justify-end mt-[10px]"},$=w({__name:"return-form",setup(z){const b=x(),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=E({success(){g.success("\u521B\u5EFA\u6210\u529F!"),b.push("/purchase/purchaseCollection?tab=invoiceRelation_collection")}});async function h(){try{await d.value.validate();const{InvCode:a}=t.value;v.run(M({InvCode:a}))}catch{}}async function k(a){const e=await U({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 B=r("ElInput"),m=r("ElFormItem"),D=r("ElButton"),p=y("loading");return f((c(),N("div",H,[l(s(A),{ref_key:"formRef",ref:d,rules:I,model:t.value,"label-width":"110px"},{default:u(()=>[f((c(),_(m,{label:"\u8FDB\u9879\u53D1\u7968\u53F7\u7801",prop:"InvCode"},{default:u(()=>[C("div",P,[l(B,{modelValue:t.value.invoiceNumber,"onUpdate:modelValue":e[0]||(e[0]=n=>t.value.invoiceNumber=n),onClick:e[1]||(e[1]=n=>o.value.visible=!0),placeholder:"\u8FDB\u9879\u53D1\u7968\u53F7\u7801"},null,8,["modelValue"]),o.value.data?(c(),_(s(R),{key:0,class:"mt-[10px]",data:o.value.data,columns:s(q)},null,8,["data","columns"])):V("v-if",!0)])]),_:1})),[[p,o.value.loading]]),l(m,null,{default:u(()=>[C("div",S,[l(D,{type:"primary",onClick:h},{default:u(()=>e[3]||(e[3]=[T(" \u4FDD\u5B58 ")])),_:1})])]),_:1})]),_:1},8,["model"]),l(j,{visible:o.value.visible,"onUpdate:visible":e[2]||(e[2]=n=>o.value.visible=n),onSubmit:k},null,8,["visible"])])),[[p,s(v).loading]])}}});var W=F($,[["__file","D:/work/jiesuan/settle-vue3/src/views/purchaseNew/invoiceRelation/components/return-form.vue"]]);export{W as default};
