| 1 |
- var H=Object.defineProperty,L=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var Y=(e,t,i)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,m=(e,t)=>{for(var i in t||(t={}))N.call(t,i)&&Y(e,i,t[i]);if(M)for(var i of M(t))O.call(t,i)&&Y(e,i,t[i]);return e},b=(e,t)=>L(e,q(t));var h=(e,t,i)=>new Promise((l,u)=>{var _=s=>{try{c(i.next(s))}catch(p){u(p)}},v=s=>{try{c(i.throw(s))}catch(p){u(p)}},c=s=>s.done?l(s.value):Promise.resolve(s.value).then(_,v);c((i=i.apply(e,t)).next())});import{a as j,B as A}from"./index-f805ce51.js";import{u as U,_ as $}from"./useForm-c7f42ee0.js";import"./FormItem.vue_vue_type_script_lang-39d09a3e.js";import{al as d,av as E,au as G,_ as Q}from"./index.js";import{l as W,u as Z}from"./index-a4e1ec38.js";import{l as C,S as J}from"./antd-f259b82a.js";import{m as K,d as X,c as ee,u as r,f,Y as g,a6 as ae,a7 as w,l as te,Z as y,_ as ie,$ as P,F as se,a8 as ne,a0 as I,aa as oe}from"./vue-aed314e3.js";import{a as le}from"./dialysisDeviceApi-2f7535cf.js";const Fe=[{title:"设备编号",dataIndex:"deviceUniqueCode"},{title:"设备厂家",dataIndex:"deviceManufacturer"},{title:"设备型号",dataIndex:"deviceModel"},{title:"保养时间",dataIndex:"maintainTime"},{title:"保养方",dataIndex:"maintainCompany"},{title:"保养内容",dataIndex:"content"},{title:"保养费用(元)",dataIndex:"costYuan"},{title:"保养照片",dataIndex:"picture"}],re=[{label:"保养设备",field:"devices",component:"PlainTitle",defaultValue:"保养设备",colProps:{span:24}},{field:"deviceInfos",component:"Input",slot:"deviceInfos"},{label:"保养记录",field:"recording",component:"PlainTitle",defaultValue:"保养记录"},{label:"保养时间",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:C().format("YYYY-MM-DD HH:mm:ss"),colProps:{span:12}},{label:"保养方",field:"maintainCompany",required:!0,itemProps:{validateTrigger:"blur"},component:"ApiSelect",componentProps:{api:W,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:Z,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:C().format("YYYY-MM-DD")},colProps:{span:12}},{field:"searchNames",component:"Input",renderComponentContent:()=>({prefix:()=>K(J)}),componentProps:{placeholder:"请输入设备编号"},colProps:{span:12}}];function ze(){return d.get({url:"/biz/device/dialysisMaintain/maintainCompany"})}const Be=e=>d.post({url:"/biz/device/dialysisMaintain/query/page",params:E(e)}),Re=e=>d.post({url:"/biz/device/dialysisMaintain/removeByIds/",params:e}),ce=e=>d.post({url:"/biz/device/dialysisMaintain/add",params:e}),de=e=>d.post({url:"/biz/device/dialysisMaintain/edit",params:e}),ue=e=>d.get({url:"/biz/device/dialysisMaintain/detail/"+e}),pe=()=>d.get({url:"/biz/device/dialysisMaintain/allMaintainDevice"}),me=()=>d.get({url:"/biz/device/dialysisMaintain/needMaintainDevice"}),fe={key:0,class:"device-info"},ve={class:I(["device-card","card-disable"])},ge={key:1,class:"device-info"},_e=["onClick"],ye="35%",De=X({__name:"formDrawer",emits:["success","register"],setup(e,{emit:t}){const i=ee(()=>r(l)?"编辑保养记录":"新增保养记录"),l=f(!1),u=f({uniqueCode:null,manufacturer:null,deviceType:null}),_=f(),v=f(),c=f([]),s=f([]),{createMessage:p}=G(),[k,{setFieldsValue:x,resetFields:S,validate:F}]=U({labelWidth:100,schemas:re,showActionButtonGroup:!1,actionColOptions:{span:23},baseColProps:{span:24},wrapperCol:{span:23}}),[T,{setDrawerProps:D,closeDrawer:z}]=j(a=>h(this,null,function*(){if(yield S(),D({confirmLoading:!1}),l.value=!!(a!=null&&a.isUpdate),r(l)){const n=yield ue(a.record.id);v.value=n.id,_.value=n,u.value=yield le(n.deviceId),n.files=n.files&&n.files.map(o=>(o.uid=o.id,o.url=o.absolutePath,o.filename=o.realName,o)),yield x(m({},n))}else a.isRecently?c.value=yield me():c.value=yield pe()}));function B(){return h(this,null,function*(){try{const a=yield F();let n={};if(D({confirmLoading:!0}),a.picture=a.files?a.files&&a.files.map(o=>o.id):[],l.value)n=m(m({},_.value),a);else if(s.value&&s.value.length>0)a.deviceIds=s.value;else return p.error("请选择需要保养的设备"),!1;r(l)?yield de(b(m({},n),{id:v.value})):yield ce(m({},a)),r(l)?p.success("编辑成功!"):p.success("新增成功!"),z(),t("success",{isUpdate:r(l),values:b(m({},a),{id:v.value})})}finally{s.value=[],D({confirmLoading:!1})}})}function R(a){a.isSel?s.value=s.value.filter(n=>n!=a.id):s.value.push(a.id),c.value.forEach(n=>{a.id===n.id&&(a.isSel=a.isSel?!a.isSel:!0)})}return(a,n)=>(g(),ae(r(A),oe(a.$attrs,{destroyOnClose:"",onRegister:r(T),title:i.value,width:ye,onOk:B,showFooter:!0}),{default:w(()=>[te(r($),{onRegister:r(k),layout:"vertical"},{deviceInfos:w(()=>[l.value?(g(),y("div",fe,[ie("div",ve,P(u.value.uniqueCode+" "+u.value.manufacturer+" "+u.value.deviceType),1)])):(g(),y("div",ge,[(g(!0),y(se,null,ne(c.value,(o,V)=>(g(),y("div",{key:V,class:I(["device-card",o.isSel?"card-select":""]),onClick:he=>R(o)},P(o.uniqueCode+" "+o.manufacturer+" "+o.adviceModel),11,_e))),128))]))]),_:1},8,["onRegister"])]),_:1},16,["onRegister","title"]))}});const be=Q(De,[["__scopeId","data-v-bec3c67b"]]),Ve=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{be as F,Re as a,ze as b,Fe as c,Ve as f,me as g,Te as s,Be as u};
|