import{_ as h,d as R,w as r,X as V,Z as b,r as _,aC as I,o as g,c as M,l as a,C as o,b as C,M as F,H as q,G as D,u as l,a as E,aR as U,F as j}from"./index.1d1a5ecb.js";import{B as H}from"./basic-descriptions.1879b0f8.js";import{d as O}from"./index.5fa131c7.js";import{O as z}from"./inv-open.21fa1eb1.js";import{C as S}from"./capital-modal.bbd60b51.js";import{I as T}from"./index.b5c3b679.js";import"./tootip.76f6bcc3.js";import"./status.d6b2a53d.js";import"./invoice.be540bfd.js";const G={invNo:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E00\u5F20\u53D1\u7968"}],return_reason:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u9000\u8D27\u539F\u56E0"}],remark:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u5907\u6CE8"}]},L={class:"flex justify-end w-full mb-2"},X=C("div",{"mt-5":""},null,-1),Z={flex:"","w-full":"","justify-end":""},A=R({__name:"return-form",emits:["create"],setup(J,{emit:k}){const p=r(""),x=r(""),w=r(null),c=r(null),f=r(null),y=V(),v=r(!1),t=b({invNo:"",return_reason:"",remark:""});async function B({invNo:s,inv_number:e,open_date:i}){v.value=!0,p.value=e,x.value=i;const{code:u,message:m,data:d}=await O({invNo:s});y({code:u,message:m,handler:function(){c.value=d,t.invNo=d.invNo,f.value.validateField("logNo")}}),v.value=!1}function N(){f.value.validate(async s=>{!s||k("create",l(t))})}return(s,e)=>{const i=_("ElButton"),u=_("ElFormItem"),m=_("ElInput"),d=I("loading");return g(),M(j,null,[a(l(U),{ref_key:"formRef",ref:f,model:t,rules:l(G),size:"small","label-width":"100px"},{default:o(()=>[a(u,{label:"\u53D1\u7968",prop:"invNo"},{default:o(()=>[C("div",L,[a(i,{size:"small",type:"primary",onClick:e[0]||(e[0]=()=>w.value.onDisplay())},{default:o(()=>[F("\u9009\u62E9")]),_:1})]),c.value?q((g(),D(l(H),{key:0,"w-full":"",data:c.value,columns:l(z)},null,8,["data","columns"])),[[d,v.value]]):E("v-if",!0)]),_:1}),p.value?(g(),D(l(T),{key:0,"inv-number":p.value,type:"sale"},null,8,["inv-number"])):E("v-if",!0),X,a(u,{label:"\u9000\u7968\u539F\u56E0",prop:"return_reason","w-480px":""},{default:o(()=>[a(m,{type:"textarea",rows:6,maxlength:"2000",max:"","w-300px":"",modelValue:t.return_reason,"onUpdate:modelValue":e[1]||(e[1]=n=>t.return_reason=n),"show-word-limit":""},null,8,["modelValue"])]),_:1}),a(u,{label:"\u5907\u6CE8",prop:"remark","w-480px":""},{default:o(()=>[a(m,{type:"textarea",rows:6,maxlength:"2000",modelValue:t.remark,"onUpdate:modelValue":e[2]||(e[2]=n=>t.remark=n),placeholder:"\u8BF7\u8F93\u5165\u53D1\u7968\u5907\u6CE8","show-word-limit":""},null,8,["modelValue"])]),_:1}),C("div",Z,[a(i,{type:"primary",onClick:N},{default:o(()=>[F("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model","rules"]),a(S,{ref_key:"capitalModalRef",ref:w,onChoose:e[3]||(e[3]=n=>B(n))},null,512)],64)}}});var re=h(A,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/returnTicket/components/return-form.vue"]]);export{re as default};
