import{h as F,y as N,r as z,p as i,M as n,N as r,a6 as u,l as B,W as f,V as c,k as e,o as g,q as m,m as v,$ as D,a0 as I,a4 as W,a2 as $,an as T,t as s,a7 as d}from"./vue-a39e6937.js";import{f as U}from"./index-ba596ae9.js";import{F as b}from"./index-f0d8af94.js";import{b as y}from"./validate-4ecec794.js";const K={class:"title"},A=F({__name:"popupForm",setup(M){const p=N(),a=T("baTable"),{t:l}=U(),k=z({create_time:[y({name:"date",title:l("supplierPayment.create_time")})],update_time:[y({name:"date",title:l("supplierPayment.update_time")})]});return(R,o)=>{const V=s("el-form"),h=s("el-scrollbar"),_=s("el-button"),P=s("el-dialog"),C=d("drag"),w=d("zoom"),x=d("loading"),S=d("blur");return i(),n(P,{class:"ba-operate-dialog","close-on-click-modal":!1,"model-value":["add","edit"].includes(e(a).form.operate),onClose:e(a).toggleForm,width:"50%"},{header:r(()=>[u((i(),B("div",K,[f(c(e(a).form.operate?e(l)(e(a).form.operate):""),1)])),[[C,[".ba-operate-dialog",".el-dialog__header"]],[w,".ba-operate-dialog"]])]),footer:r(()=>[g("div",{style:v("width: calc(100% - "+e(a).form.labelWidth/1.8+"px)")},[m(_,{onClick:o[5]||(o[5]=t=>e(a).toggleForm(""))},{default:r(()=>[f(c(e(l)("Cancel")),1)]),_:1}),u((i(),n(_,{loading:e(a).form.submitLoading,onClick:o[6]||(o[6]=t=>e(a).onSubmit(p.value)),type:"primary"},{default:r(()=>[f(c(e(a).form.operateIds&&e(a).form.operateIds.length>1?e(l)("Save and edit next item"):e(l)("Save")),1)]),_:1},8,["loading"])),[[S]])],4)]),default:r(()=>[u((i(),n(h,{class:"ba-table-form-scrollbar"},{default:r(()=>[g("div",{class:$(["ba-operate-form","ba-"+e(a).form.operate+"-form"]),style:v("width: calc(100% - "+e(a).form.labelWidth/2+"px)")},[e(a).form.loading?W("",!0):(i(),n(V,{key:0,ref_key:"formRef",ref:p,onSubmit:o[3]||(o[3]=D(()=>{},["prevent"])),onKeyup:o[4]||(o[4]=I(t=>e(a).onSubmit(p.value),["enter"])),model:e(a).form.items,"label-position":"right","label-width":e(a).form.labelWidth+"px",rules:k},{default:r(()=>[m(b,{label:e(l)("supplierPayment.supplier_id"),type:"remoteSelect",modelValue:e(a).form.items.supplier_id,"onUpdate:modelValue":o[0]||(o[0]=t=>e(a).form.items.supplier_id=t),prop:"supplier_id","input-attr":{pk:"supplier.id",field:"name","remote-url":"/admin/Supplier/index"},placeholder:e(l)("Please select field",{field:e(l)("supplierPayment.supplier_id")})},null,8,["label","modelValue","input-attr","placeholder"]),m(b,{label:e(l)("supplierPayment.bank_name"),type:"string",modelValue:e(a).form.items.bank_name,"onUpdate:modelValue":o[1]||(o[1]=t=>e(a).form.items.bank_name=t),prop:"bank_name",placeholder:e(l)("Please input field",{field:e(l)("supplierPayment.bank_name")})},null,8,["label","modelValue","placeholder"]),m(b,{label:e(l)("supplierPayment.bank_account"),type:"string",modelValue:e(a).form.items.bank_account,"onUpdate:modelValue":o[2]||(o[2]=t=>e(a).form.items.bank_account=t),prop:"bank_account",placeholder:e(l)("Please input field",{field:e(l)("supplierPayment.bank_account")})},null,8,["label","modelValue","placeholder"])]),_:1},8,["model","label-width","rules"]))],6)]),_:1})),[[x,e(a).form.loading]])]),_:1},8,["model-value","onClose"])}}});export{A as _};
