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