import{_ as B,d as V,x as l,X as R,Z as b,r as _,aD as I,o as g,c as M,l as a,D as r,h as D,M as w,H as q,G as x,m as o,aN as U,a as C,aQ as j,F as H,cC as O}from"./index.js";import{O as z}from"./inv-open.90cd9d14.js";import S from"./index.eaa670.js";import{I as T}from"./index.47e512cd.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"},Q=D("div",{"mt-5":""},null,-1),X={flex:"","w-full":"","justify-end":""},Z=V({__name:"return-form",emits:["create"],setup(A,{emit:E}){const c=l(""),k=l(""),F=l(null),p=l(null),f=l(null),y=R(),v=l(!1),t=b({invNo:"",return_reason:"",remark:""});async function N({invNo:s,inv_number:e,open_date:i}){v.value=!0,c.value=e,k.value=i;const{code:u,message:m,data:d}=await O({invNo:s});y({code:u,message:m,handler:function(){p.value=d,t.invNo=d.invNo,f.value.validateField("logNo")}}),v.value=!1}function h(){f.value.validate(async s=>{!s||E("create",o(t))})}return(s,e)=>{const i=_("ElButton"),u=_("ElFormItem"),m=_("ElInput"),d=I("loading");return g(),M(H,null,[a(o(j),{ref_key:"formRef",ref:f,model:t,rules:o(G),size:"small","label-width":"100px"},{default:r(()=>[a(u,{label:"\u53D1\u7968",prop:"invNo"},{default:r(()=>[D("div",L,[a(i,{size:"small",type:"primary",onClick:e[0]||(e[0]=()=>F.value.onDisplay())},{default:r(()=>[w("\u9009\u62E9")]),_:1})]),p.value?q((g(),x(o(U),{key:0,"w-full":"",data:p.value,columns:o(z)},null,8,["data","columns"])),[[d,v.value]]):C("v-if",!0)]),_:1}),c.value?(g(),x(o(T),{key:0,"inv-number":c.value,type:"sale"},null,8,["inv-number"])):C("v-if",!0),Q,a(u,{label:"\u9000\u7968\u539F\u56E0",prop:"return_reason","w-480px":""},{default:r(()=>[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:r(()=>[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}),D("div",X,[a(i,{type:"primary",onClick:h},{default:r(()=>[w("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model","rules"]),a(S,{ref_key:"capitalModalRef",ref:F,onChoose:e[3]||(e[3]=n=>N(n))},null,512)],64)}}});var Y=B(Z,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/returnTicket/components/return-form.vue"]]);export{Y as default};
