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