| 1 |
- import{L as A,R as x,O,b as R,I as z,A as B,m as j,k as F,l as K,n as M,p as Z,_ as $}from"./index-CKIhG1T4.js";import{E as G}from"./el-drawer-CG4e3nfG.js";import{a as H,c as J,u as P}from"./index-DhdUglfm.js";import{C as Q,f as W,a as f,v as X,D as p,T as n,U as d,F as y,_ as Y,$ as a,Z as L,u as o,E as V,K as b,ad as g}from"./spreadSheetsDesignerVue-MRUT1X_l.js";import"./spreadSheetsDesignerResourcesCn-afJmEehS.js";import"./spreadSheetsDesigner-vOnK2KEP.js";import"./spreadSheetsBarcode-0B8Cksr7.js";import"./spreadSheetsCharts-DpwtlVVO.js";import"./spreadExcelio-BZ-mA4Op.js";const ee={class:"create-modal-header"},le=$(Q({__name:"CreateOrEditEquipment",props:{isShow:{type:Boolean,default:!1},pageType:{type:String,default:"add"},id:{type:String,default:""},deptList:{type:Array,default:()=>[]},keeperList:{type:Array,default:()=>[]}},emits:["update:isShow","updateList"],setup(_,{emit:k}){const U=A(),w=W(()=>U.getDictMap.system_instrument_equipment_type),u=_,v=k,t=f({name:"",type:"",equipmentNo:"",specification:"",resolution:"",storageLocation:"",calibrationValidityDate:"",custodianId:"",custodianName:"",deptId:""}),D=f({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:"blur"}],type:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:"change"}],equipmentNo:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:"blur"}],deptId:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:"change"}]}),h=f(),q=()=>{v("update:isShow",!1)},T=()=>{h.value.validate(async s=>{if(!s)return;const l={...t.value};u.id&&u.pageType==="edit"&&(l.id=u.id),(u.pageType==="add"?await J(l):await P(l))&&(O.success((u.pageType==="add"?"\u65B0\u589E":"\u4FEE\u6539")+"\u6210\u529F"),v("updateList"),q())})};return X(()=>{u.pageType==="edit"&&H({id:u.id}).then(s=>{console.log(s),t.value={...s,calibrationValidityDate:x(s.calibrationValidityDate)}})}),(s,l)=>{const I=R,C=z,r=B,i=j,m=F,c=K,N=M,S=Z,E=G;return p(),n(E,{size:600,"model-value":u.isShow,direction:"rtl","show-close":!1,"close-on-click-modal":!1},{header:d(()=>[y("div",ee,[y("h4",null,Y(_.pageType==="add"?"\u65B0\u5EFA\u4EEA\u5668\u8BBE\u5907\u4FE1\u606F":"\u7F16\u8F91\u4EEA\u5668\u8BBE\u5907\u4FE1\u606F"),1),y("div",null,[a(I,{type:"default",onClick:q},{default:d(()=>l[9]||(l[9]=[L("\u53D6\u6D88")])),_:1}),a(I,{type:"primary",onClick:T},{default:d(()=>l[10]||(l[10]=[L("\u786E\u5B9A")])),_:1})]),a(C,{style:{position:"absolute",bottom:"-14px",right:"0",left:"0",margin:"0"}})])]),default:d(()=>[a(S,{model:o(t),ref_key:"formRef",ref:h,rules:o(D),"label-width":"160"},{default:d(()=>[a(i,{label:"\u8BBE\u5907\u540D\u79F0",prop:"name"},{default:d(()=>[a(r,{modelValue:o(t).name,"onUpdate:modelValue":l[0]||(l[0]=e=>o(t).name=e)},null,8,["modelValue"])]),_:1}),a(i,{label:"\u8BBE\u5907\u5206\u7C7B",prop:"type"},{default:d(()=>[a(c,{modelValue:o(t).type,"onUpdate:modelValue":l[1]||(l[1]=e=>o(t).type=e)},{default:d(()=>[(p(!0),V(b,null,g(o(w),e=>(p(),n(m,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(i,{label:"\u8BBE\u5907\u7F16\u53F7",prop:"equipmentNo"},{default:d(()=>[a(r,{modelValue:o(t).equipmentNo,"onUpdate:modelValue":l[2]||(l[2]=e=>o(t).equipmentNo=e)},null,8,["modelValue"])]),_:1}),a(i,{label:"\u578B\u53F7\u89C4\u683C",prop:"specification"},{default:d(()=>[a(r,{modelValue:o(t).specification,"onUpdate:modelValue":l[3]||(l[3]=e=>o(t).specification=e)},null,8,["modelValue"])]),_:1}),a(i,{label:"\u5206\u8FA8\u7387",prop:"resolution"},{default:d(()=>[a(r,{modelValue:o(t).resolution,"onUpdate:modelValue":l[4]||(l[4]=e=>o(t).resolution=e)},null,8,["modelValue"])]),_:1}),a(i,{label:"\u90E8\u95E8",prop:"deptId"},{default:d(()=>[a(c,{modelValue:o(t).deptId,"onUpdate:modelValue":l[5]||(l[5]=e=>o(t).deptId=e)},{default:d(()=>[(p(!0),V(b,null,g(u.deptList,e=>(p(),n(m,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(i,{label:"\u4FDD\u7BA1\u4EBA",prop:"custodianId"},{default:d(()=>[a(c,{modelValue:o(t).custodianId,"onUpdate:modelValue":l[6]||(l[6]=e=>o(t).custodianId=e)},{default:d(()=>[(p(!0),V(b,null,g(u.keeperList,e=>(p(),n(m,{key:e.value,label:e.label,value:e.value,filterable:""},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(i,{label:"\u5B58\u653E\u4F4D\u7F6E",prop:"storageLocation"},{default:d(()=>[a(r,{modelValue:o(t).storageLocation,"onUpdate:modelValue":l[7]||(l[7]=e=>o(t).storageLocation=e)},null,8,["modelValue"])]),_:1}),a(i,{label:"\u6821\u51C6\u6709\u6548\u671F",prop:"calibrationValidityDate"},{default:d(()=>[a(N,{modelValue:o(t).calibrationValidityDate,"onUpdate:modelValue":l[8]||(l[8]=e=>o(t).calibrationValidityDate=e),type:"date",placeholder:"\u8BF7\u9009\u62E9"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["model-value"])}}}),[["__scopeId","data-v-21442a4e"]]);export{le as default};
|