import{d as P,a as F,az as R,a2 as O,o as J,r as Q,K as p,aq as g,e as i,y as f,L as n,u as e,t as u,m as c,f as S,am as w,n as q,j as r,i as C,G as X,ac as Y,C as I,F as Z,B as ee}from"./vue-A59npLRR.js";import{b}from"./validate-_EUdkMt3.js";import{F as _}from"./index-r6iTpmP6.js";import{c as oe,v as le,_ as ae}from"./index-EwE51S_X.js";import"./index-K8IR974I.js";import"./baTable-MdxYOkAk.js";import"./index-XALue448.js";import"./echarts-cxb9vJr1.js";function re(){return oe({url:"admin/borrow.BorrowApply/getAssetGroup",method:"get"})}const te={class:"title"},ne=P({__name:"popupForm",setup(se){const U=le(),V=F(),o=R("baTable"),{t}=O(),z=()=>{o.form.items.asset==null?o.form.items.asset=[{configuration_standard_id:"",model:"",num:""}]:o.form.items.asset.push({configuration_standard_id:"",model:"",num:""})},B=s=>{o.form.items.asset.splice(s,1)},v=F([]),D=(s,l)=>{const d=s?v.value.filter(L(s)):v.value;l(d)},L=s=>l=>l.value.toLowerCase().indexOf(s.toLowerCase())===0,N=async()=>{var l;const s=await re();return((l=s==null?void 0:s.data)==null?void 0:l.row)||[]};J(()=>{N().then(s=>{v.value=s})});const $=(s,l)=>{o.form.items.asset[l].group_id=s.group_id,o.form.items.asset[l].configuration_standard_id=s.configuration_standard_id},G=Q({encoding:[b({name:"required",message:"接单号不能为空,请联系管理员!!"})],username:[b({name:"required",message:"请输入使用人"})],purpose:[b({name:"required",message:"请选择申请类型"})],email:[b({name:"email"})],mobile:[b({name:"mobile"})],expected_end_time:[b({name:"required"})],borrow_reason:[b({name:"required",message:"借取用途不能为空"})],asset:[b({name:"required",message:"仪器类型不能为空"})]});return(s,l)=>{const d=p("el-col"),h=p("el-row"),K=p("el-autocomplete"),k=p("el-input"),y=p("el-button"),M=p("el-form"),T=p("el-scrollbar"),W=p("el-dialog"),j=g("drag"),E=g("zoom"),A=g("blur"),H=g("loading");return i(),f(W,{class:"ba-operate-dialog","close-on-click-modal":!1,"model-value":["Add","Edit"].includes(e(o).form.operate),onClose:e(o).toggleForm,"destroy-on-close":!0},{header:n(()=>[w((i(),S("div",te,[c(u(e(o).form.operate?e(t)(e(o).form.operate):""),1)])),[[j,[".ba-operate-dialog",".el-dialog__header"]],[E,".ba-operate-dialog"]])]),footer:n(()=>[C("div",{style:q("width: calc(100% - "+e(o).form.labelWidth/1.8+"px)")},[r(y,{onClick:l[8]||(l[8]=a=>e(o).toggleForm(""))},{default:n(()=>[c(u(e(t)("Cancel")),1)]),_:1}),w((i(),f(y,{loading:e(o).form.submitLoading,onClick:l[9]||(l[9]=a=>e(o).onSubmit(V.value)),type:"primary"},{default:n(()=>[c(u(e(o).form.operateIds&&e(o).form.operateIds.length>1?e(t)("Save and edit next item"):e(t)("Save")),1)]),_:1},8,["loading"])),[[A]])],4)]),default:n(()=>[w((i(),f(T,{class:"ba-table-form-scrollbar"},{default:n(()=>[C("div",{class:X(["ba-operate-form","ba-"+e(o).form.operate+"-form"]),style:q(e(U).layout.shrink?"":"width: calc(100% - "+e(o).form.labelWidth/2+"px)")},[e(o).form.loading?I("",!0):(i(),f(M,{key:0,ref_key:"formRef",ref:V,onKeyup:l[7]||(l[7]=Y(a=>e(o).onSubmit(V.value),["enter"])),model:e(o).form.items,"label-position":e(U).layout.shrink?"top":"right","label-width":e(o).form.labelWidth+"px",rules:G},{default:n(()=>[e(o).form.operate!=="Add"?(i(),f(_,{key:0,label:e(t)("borrow.borrowapply.encoding"),modelValue:e(o).form.items.encoding,"onUpdate:modelValue":l[0]||(l[0]=a=>e(o).form.items.encoding=a),type:"string",prop:"encoding",placeholder:e(t)("borrow.borrowapply.encoding"),readonly:"readonly"},null,8,["label","modelValue","placeholder"])):I("",!0),r(_,{label:e(t)("borrow.borrowapply.username"),modelValue:e(o).form.items.username,"onUpdate:modelValue":l[1]||(l[1]=a=>e(o).form.items.username=a),type:"string",prop:"username",placeholder:e(t)("borrow.borrowapply.username")},null,8,["label","modelValue","placeholder"]),r(_,{label:e(t)("borrow.borrowapply.mobile"),modelValue:e(o).form.items.mobile,"onUpdate:modelValue":l[2]||(l[2]=a=>e(o).form.items.mobile=a),type:"string",prop:"mobile",placeholder:e(t)("borrow.borrowapply.mobile")},null,8,["label","modelValue","placeholder"]),r(_,{label:e(t)("borrow.borrowapply.purpose"),modelValue:e(o).form.items.purpose,"onUpdate:modelValue":l[3]||(l[3]=a=>e(o).form.items.purpose=a),type:"radio",data:{content:{0:e(t)("borrow.borrowapply.purpose 0"),1:e(t)("borrow.borrowapply.purpose 1")},childrenAttr:{border:!0}}},null,8,["label","modelValue","data"]),r(_,{label:e(t)("borrow.borrowapply.expected end time"),prop:"expected_end_time",modelValue:e(o).form.items.expected_end_time,"onUpdate:modelValue":l[4]||(l[4]=a=>e(o).form.items.expected_end_time=a),type:"datetime",placeholder:e(t)("borrow.borrowapply.expected end time"),"value-format":"yyyy-MM-dd HH"},null,8,["label","modelValue","placeholder"]),r(_,{label:e(t)("borrow.borrowapply.borrow reason"),prop:"borrow_reason",type:"textarea",modelValue:e(o).form.items.borrow_reason,"onUpdate:modelValue":l[5]||(l[5]=a=>e(o).form.items.borrow_reason=a),"input-attr":{maxlength:10,clearable:!0,"show-password":!0}},null,8,["label","modelValue"]),r(_,{label:e(t)("borrow.borrowapply.reamrk"),prop:"remarks",type:"textarea",modelValue:e(o).form.items.remarks,"onUpdate:modelValue":l[6]||(l[6]=a=>e(o).form.items.remarks=a),"input-attr":{maxlength:10,clearable:!0,"show-password":!0}},null,8,["label","modelValue"]),C("div",null,[r(h,{gutter:10},{default:n(()=>[r(d,{span:5,offset:1,class:"ba-array-key"},{default:n(()=>[c(u(e(t)("borrow.borrowapply.choose")),1)]),_:1}),r(d,{span:5,class:"ba-array-value"},{default:n(()=>[c(u(e(t)("borrow.borrowapply.assetnumber")),1)]),_:1}),r(d,{span:5,class:"ba-array-value"},{default:n(()=>[c(u(e(t)("仪器分类号")),1)]),_:1}),r(d,{span:5,class:"ba-array-key"},{default:n(()=>[c(u(e(t)("borrow.borrowapply.configuration standard id")),1)]),_:1})]),_:1}),(i(!0),S(Z,null,ee(e(o).form.items.asset,(a,x)=>(i(),f(h,{class:"ba-array-item",gutter:10,key:x},{default:n(()=>[r(d,{span:4,offset:2},{default:n(()=>[r(K,{modelValue:a.model,"onUpdate:modelValue":m=>a.model=m,"fetch-suggestions":D,placeholder:"请输入仪器类型",onSelect:m=>{$(m,x)}},null,8,["modelValue","onUpdate:modelValue","onSelect"])]),_:2},1024),r(d,{span:4},{default:n(()=>[r(k,{modelValue:a.num,"onUpdate:modelValue":m=>a.num=m,class:"el-input",placeholder:"请填写数量"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),r(d,{span:5},{default:n(()=>[r(k,{modelValue:a.group_id,"onUpdate:modelValue":m=>a.group_id=m,class:"el-input",placeholder:"仪器分类号",readonly:""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),r(d,{span:5},{default:n(()=>[r(k,{modelValue:a.configuration_standard_id,"onUpdate:modelValue":m=>a.configuration_standard_id=m,class:"el-input",placeholder:"配置编号(非必填)",readonly:""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),r(d,{span:4},{default:n(()=>[r(y,{onClick:m=>B(x),size:"small",icon:"el-icon-Delete",circle:""},null,8,["onClick"])]),_:2},1024)]),_:2},1024))),128)),r(h,{gutter:10},{default:n(()=>[r(d,{span:10,offset:12},{default:n(()=>[w((i(),f(y,{class:"ba-add-array-item",onClick:z,icon:"el-icon-Plus"},{default:n(()=>[c(u(e(t)("Add")),1)]),_:1})),[[A]])]),_:1})]),_:1})])]),_:1},8,["model","label-position","label-width","rules"]))],6)]),_:1})),[[H,e(o).form.loading]])]),_:1},8,["model-value","onClose"])}}}),_e=ae(ne,[["__scopeId","data-v-be4401d0"]]);export{_e as default};