| 1 |
- var N=Object.defineProperty,O=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var Y=(e,t,i)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,p=(e,t)=>{for(var i in t||(t={}))A.call(t,i)&&Y(e,i,t[i]);if(I)for(var i of I(t))U.call(t,i)&&Y(e,i,t[i]);return e},M=(e,t)=>O(e,j(t));var C=(e,t,i)=>new Promise((l,r)=>{var y=o=>{try{d(i.next(o))}catch(v){r(v)}},f=o=>{try{d(i.throw(o))}catch(v){r(v)}},d=o=>o.done?l(o.value):Promise.resolve(o.value).then(y,f);d((i=i.apply(e,t)).next())});import{a as E,B as $}from"./index-e473004f.js";import{u as G,_ as Q}from"./useForm-19fca69f.js";import"./FormItem.vue_vue_type_script_lang-35d3ca4d.js";import{ak as u,ap as W,ao as Z,_ as J}from"./index.js";import{a as S,u as K}from"./index-b614de6b.js";import{l as k,S as X}from"./antd-ecb53b14.js";import{m as ee,d as ae,c as te,u as c,f as m,Y as g,a6 as ie,a7 as _,l as oe,Z as D,_ as ne,$ as h,F as se,a8 as le,a0 as x,E as P,aa as re}from"./vue-8fccce23.js";import{a as ce}from"./dialysisDeviceApi-8d5a8df7.js";const ze=[{title:"设备编号",dataIndex:"deviceUniqueCode"},{title:"设备厂家",dataIndex:"deviceManufacturer"},{title:"设备型号",dataIndex:"deviceModel"},{title:"保养时间",dataIndex:"maintainTime"},{title:"保养方",dataIndex:"maintainCompany"},{title:"保养内容",dataIndex:"content"},{title:"保养费用(元)",dataIndex:"costYuan"},{title:"保养照片",dataIndex:"picture"}],de=[{field:"id",component:"Input",show:!1},{label:"保养设备",field:"devices",component:"PlainTitle",defaultValue:"保养设备",colProps:{span:24}},{field:"deviceInfos",component:"Input",slot:"deviceInfos",ifShow:({values:e})=>!e.id},{label:"设备编号",field:"uniqueCode",component:"Input",slot:"uniqueCode",colProps:{span:12},ifShow:({values:e})=>e.id},{label:"设备厂家",field:"manufacturer",component:"Input",slot:"manufacturer",colProps:{span:12},ifShow:({values:e})=>e.id},{label:"设备型号",field:"model",component:"Input",slot:"model",colProps:{span:12},ifShow:({values:e})=>e.id},{label:"保养记录",field:"recording",component:"PlainTitle",defaultValue:"保养记录"},{label:"保养时间",required:!0,field:"maintainTime",component:"DatePicker",componentProps:{placeholder:"请输入上传日期",getPopupContainer:()=>document.body,valueFormat:"YYYY-MM-DD HH:mm:ss",format:"YYYY-MM-DD HH:mm:ss",showTime:!0},defaultValue:k().format("YYYY-MM-DD HH:mm:ss"),colProps:{span:12}},{label:"保养方",field:"maintainCompany",required:!0,itemProps:{validateTrigger:"blur"},component:"ApiSelect",componentProps:{api:S,params:{dictCode:"dmc"}},colProps:{span:12}},{label:"保养内容",field:"content",component:"InputTextArea",componentProps:{placeholder:"请输入保养内容"}},{label:"保养费用(元)",field:"costYuan",component:"InputNumber",componentProps:{placeholder:"请输入保养费用"}},{label:"保养图片",field:"files",component:"ImageUpload",componentProps:({formModel:e})=>({api:K,maxSize:2,maxNumber:1,helpText:"仅支持上传jpg/png/pdf文件,文件大小不超过2M",accept:[".pdf","jpg","png"],onChange:t=>{console.log("🚀 ~ file: data.ts:57 ~ data:",t),e.files=t}})}],Te=[{field:"shiftDate",component:"RangePicker",componentProps:{width:240,format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD",getPopupContainer:()=>document.body,defaultValue:k().format("YYYY-MM-DD")},colProps:{span:12}},{field:"searchNames",component:"Input",renderComponentContent:()=>({prefix:()=>ee(X)}),componentProps:{placeholder:"请输入设备编号"},colProps:{span:12}}];function Ve(){return u.get({url:"/biz/device/dialysisMaintain/maintainCompany"})}const Be=e=>u.post({url:"/biz/device/dialysisMaintain/query/page",params:W(e)}),Re=e=>u.post({url:"/biz/device/dialysisMaintain/removeByIds/",params:e}),ue=e=>u.post({url:"/biz/device/dialysisMaintain/add",params:e}),pe=e=>u.post({url:"/biz/device/dialysisMaintain/edit",params:e}),me=e=>u.get({url:"/biz/device/dialysisMaintain/detail/"+e}),fe=()=>u.get({url:"/biz/device/dialysisMaintain/allMaintainDevice"}),ve=()=>u.get({url:"/biz/device/dialysisMaintain/needMaintainDevice"}),ge={key:0,class:"device-info"},_e={class:x(["device-card","card-disable"])},he={key:1,class:"device-info"},ye=["onClick"],De="35%",be=ae({__name:"formDrawer",emits:["success","register"],setup(e,{emit:t}){const i=te(()=>c(l)?"编辑保养记录":"新增保养记录"),l=m(!1),r=m({uniqueCode:null,manufacturer:null,model:null}),y=m(),f=m(),d=m([]),o=m([]),v=m(),{createMessage:b}=Z(),[F,{setFieldsValue:q,resetFields:z,validate:T}]=G({labelWidth:100,schemas:de,showActionButtonGroup:!1,actionColOptions:{span:23},baseColProps:{span:24},wrapperCol:{span:23}}),[V,{setDrawerProps:w,closeDrawer:B}]=E(a=>C(this,null,function*(){if(yield z(),w({confirmLoading:!1}),v.value=yield S({dictCode:"dmc"}),l.value=!!(a!=null&&a.isUpdate),c(l)){const n=yield me(a.record.id);f.value=n.id,y.value=n,r.value=yield ce(n.deviceId),n.files=n.files&&n.files.map(s=>(s.uid=s.id,s.url=s.absolutePath,s.filename=s.realName,s)),yield q(p({},n))}else a.isRecently?d.value=yield ve():d.value=yield fe()}));function R(){return C(this,null,function*(){try{const a=yield T();let n={};if(w({confirmLoading:!0}),a.picture=a.files?a.files&&a.files.map(s=>s.id):[],l.value)n=p(p({},y.value),a);else if(o.value&&o.value.length>0)a.deviceIds=o.value;else return b.error("请选择需要保养的设备"),!1;c(l)?yield pe(M(p({},n),{id:f.value})):yield ue(p({},a)),c(l)?b.success("编辑成功!"):b.success("新增成功!"),o.value=[],B(),t("success",{isUpdate:c(l),values:M(p({},a),{id:f.value})})}finally{w({confirmLoading:!1})}})}function H(a){a.isSel?o.value=o.value.filter(n=>n!=a.id):o.value.push(a.id),d.value.forEach(n=>{a.id===n.id&&(a.isSel=a.isSel?!a.isSel:!0)})}return(a,n)=>(g(),ie(c($),re(a.$attrs,{destroyOnClose:"",onRegister:c(V),title:i.value,width:De,onOk:R,showFooter:!0}),{default:_(()=>[oe(c(Q),{onRegister:c(F),layout:"vertical"},{deviceInfos:_(()=>[l.value?(g(),D("div",ge,[ne("div",_e,h(r.value.uniqueCode+" "+r.value.manufacturer+" "+r.value.adviceModel),1)])):(g(),D("div",he,[(g(!0),D(se,null,le(d.value,(s,L)=>(g(),D("div",{key:L,class:x(["device-card",s.isSel?"card-select":""]),onClick:Me=>H(s)},h(s.uniqueCode+" "+s.manufacturer+" "+s.adviceModel),11,ye))),128))]))]),uniqueCode:_(()=>[P(h(r.value.uniqueCode),1)]),manufacturer:_(()=>[P(h(r.value.manufacturer),1)]),model:_(()=>[P(h(r.value.model),1)]),_:1},8,["onRegister"])]),_:1},16,["onRegister","title"]))}});const we=J(be,[["__scopeId","data-v-6456759e"]]),He=Object.freeze(Object.defineProperty({__proto__:null,default:we},Symbol.toStringTag,{value:"Module"}));export{we as F,Re as a,Ve as b,ze as c,He as f,ve as g,Te as s,Be as u};
|