import{_ as g,d as A,aV as k,bU as x,x as f,r as i,o as I,G as U,D as a,l,m as r,aQ as q,bI as w,cS as M,h as Q,M as R,ar as S,aZ as T}from"./index.js";import{h as j}from"./index.8d1ab27f.js";const G={class:"w-full flex justify-end"},P=A({__name:"choose-modal",props:{visible:{type:Boolean,required:!0},data:{type:null,required:!0}},emits:["refresh"],setup(v,{emit:_}){const d=v,t=k(d,"visible"),y=x({success(){T.success("\u7ED1\u5B9A\u6210\u529F!"),t.value=!1,_("refresh")}}),o=f({companyNo:"",supplierNo:""}),m=f(null),N={companyNo:[{required:!0,message:"\u4E70\u5165\u65B9\u516C\u53F8\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],supplierNo:[{required:!0,message:"\u5356\u51FA\u65B9\u516C\u53F8\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]};async function B(){var n;try{await((n=m.value)==null?void 0:n.validate());const{id:e,InvCode:s,invoice_code:p,invoice_type:c,invoice_total:u,invoice_number:E,invoice_subtotal:F,check_code:V,open_date:D,status:h}=d.data,b={id:e,InvCode:s,invoice_code:p,invoice_number:E,invoice_type:c,invoice_total:u,open_date:D,invoice_subtotal:F,check_code:V,status:h,companyNo:o.value.companyNo,supplierNo:o.value.supplierNo};y.run(j(b))}catch{}}const C=()=>o.value={companyNo:"",supplierNo:""};return(n,e)=>{const s=i("ElFormItem"),p=i("ElButton"),c=i("ElDialog");return I(),U(c,{modelValue:r(t),"onUpdate:modelValue":e[2]||(e[2]=u=>S(t)?t.value=u:null),center:"",title:"\u7ED1\u5B9A\u516C\u53F8",onClose:C,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:a(()=>[l(r(q),{rules:N,ref_key:"formRef",ref:m,model:o.value},{default:a(()=>[l(s,{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"companyNo"},{default:a(()=>[l(r(w),{modelValue:o.value.companyNo,"onUpdate:modelValue":e[0]||(e[0]=u=>o.value.companyNo=u),placeholder:"\u4E70\u5165\u65B9\u516C\u53F8"},null,8,["modelValue"])]),_:1}),l(s,{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"supplierNo"},{default:a(()=>[l(r(M),{modelValue:o.value.supplierNo,"onUpdate:modelValue":e[1]||(e[1]=u=>o.value.supplierNo=u),placeholder:"\u5356\u51FA\u65B9\u516C\u53F8"},null,8,["modelValue"])]),_:1}),l(s,null,{default:a(()=>[Q("div",G,[l(p,{type:"primary",onClick:B},{default:a(()=>[R("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});var H=g(P,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/supply/outputInvoicePool/choose-modal.vue"]]);export{H as default};
