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