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