1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>新建计划</title>
- <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
- <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
- <link rel="stylesheet" type="text/css" href="../../../css/element-ui.css" />
- <link rel="stylesheet" type="text/css" href="../css/new_recover.css" />
- <script src="../../../js/esModule.js" type="text/javascript"></script>
- <style>
- .c-row{
- width: 100%;
- }
- </style>
- </head>
- <body class="m0">
- <div id="app" v-cloak>
- <div class="c-position-a" style="top: -999px; left: -999px;" v-show="isTest"></div>
- <div class="c-h100 clearfix">
- <div class="fl c-h100 w400 person_info c-border-r" style="overflow: hidden;">
- <div v-if="!patiInfo" class="c-h100" style="overflow: auto;">
- <div class="c-border-b c-t-center pt20">
- <div class="set-photo imgw80">
- <img src="../../../images/p-female.png" alt="居民头像" />
- </div>
- <p class="ptb10">患者名</p>
- </div>
- <div>
- <div class="no-result c-t-center pt20">
- <img src="../images/wushuju01_img.png" alt="无数据" />
- <p class="c-999">暂无相关信息</p>
- <div class="pt30">
- <span class="c-fff btn cur-pit plr10 ptb5 bgc-12b7f5 b-r-3" @click="selectPatient()">同步信息</span>
- </div>
- </div>
- </div>
- </div>
- <div v-else class="c-h100 plr10" style="overflow: auto;">
- <div class="c-t-center pt20 c-position-r">
- <div class="set-photo imgw80">
- <img :src="setPatImg(patiInfo.photo)" alt="居民头像" />
- </div>
- <h3 class="ptb10 m0 c-f16">{{patiInfo.name}}</h3>
- <span v-if="!isEditConfig" class="c-position-a set-qiehuan cur-pit" @click="selectPatient()"></span>
- </div>
- <h4 class="h30 m0 c-f14 c-border-b f-w500">基本信息</h4>
- <ul class="c-333 m0 p0 pb20">
- <li class="pt10"><span class="c-999">性  别:</span>{{patiInfo.sex == 1 ? "男" : "女"}}</li>
- <li class="pt10"><span class="c-999">年  龄:</span>{{patiInfo.age}}岁</li>
- <li class="pt10"><span class="c-999">身份证号:</span>{{patiInfo.idcard}}</li>
- <li class="pt10"><span class="c-999">地  址:</span>{{patiInfo.address}}</li>
- </ul>
- <h4 class="h30 m0 c-f14 c-border-b f-w500">家庭医生</h4>
- <ul class="c-333 m0 p0 pb20">
- <li class="pt10"><span class="c-999">签约社区:</span>{{patiInfo.ssHospitalName || patiInfo.jtHospitalName}}</li>
- <li class="pt10"><span class="c-999">全科医生:</span>{{patiInfo.ssDoctorName || patiInfo.jtDoctorName}}</li>
- <li class="pt10"><span class="c-999">健 管 师:</span>{{patiInfo.ssDoctorHealthName || patiInfo.jtDoctorHealthName}}</li>
- </ul>
- <h4 class="h30 m0 c-f14 c-border-b f-w500" style="overflow: hidden;">
- 康复建议
- <span v-if="!isEditConfig" class="click-text" @click="editAdviceTextarea">
- {{isEdit == true? '编辑':'保存'}}
- </span>
- </h4>
- <textarea v-bind:disabled="isEdit||isEditConfig" v-model="adviceContent" class="m0 p10 c-333 mt10" :class="{'bg-f5f5fa':isEdit, 'bd-red':showAdviceContentTip}" style="width: 100%;height: 200px; width: 100%; border:1px solid #e1e1e1; resize:none;" placeholder="请输入您的康复建议..."></textarea>
- <h4 class="h30 m0 c-f14 c-border-b f-w500" style="overflow: hidden;">
- 住院病历
- </h4>
- <div v-if="medicalRecordsList.length>0" v-for="(o, i) in medicalRecordsList" class="mt10">
- <div class="flex vc c-f14 c-border plr10 ptb5 link-control" style="cursor: pointer;" @click="editMedicalRecords(o, i)" :class="{'bd-12b7f5': curMedicalRecordsIndex==i}">
- <span class="c-666 mr15">
- {{formatter(o.admissionTime||o.createTime)}}
- </span>
- <div class="flex1 c-12b7f5 ellipsis-1">
- {{o.hospitalName}}
- </div>
- </div>
- </div>
- <div v-if="!isEditConfig&&medicalRecordsList.length==0" class="ui-grid">
- <button type="button" class="ui-col-1 btn btn-default fr mr5" style="width: 100%; background: #12B7F5; border-radius: 0px ;border: 0px ;padding: 10px;margin-top: 15px;" @click="comMedicalRecords()">同步病历</button>
- <button type="button" class="ui-col-1 btn btn-default fr ml5" style="width: 100%; background: #12B7F5; border-radius: 0px ;border: 0px ;padding: 10px;margin-top: 15px;" @click="addMedicalRecords()">手动上传</button>
- </div>
- </div>
- </div>
- <div class="fl c-h100 w-100-400">
- <div class="c-h100 plr5" v-if="!isPlan&&!isEditConfig">
- <h4 class="m0 pl15 lh40 c-border-b f-w500 c-position-r"><span class="c-position-a set-blue-span"></span>配置康复计划</h4>
- <div style="overflow: hidden; height: calc(100% - 41px);">
- <div style="overflow: auto; height: 100%;">
- <div class="un-select c-t-center pt45" v-if="!patiInfo">
- <img src="../images/wushuju_img.png" alt="" />
- <p class="c-999">您还没有选择居民</p>
- </div>
- <ul class="muban_con lh40 c-t-center pt30" v-else>
- <li class="mb20" v-for="(muban, index) in mubanList" :key="index" @click="addMuban(muban.id)">{{muban.title}}</li>
- <li class="addmuban-btn c-fff" @click="addMuban()">新增模板</li>
- </ul>
- </div>
- </div>
- </div>
- <div class="clearfix c-h100" v-else>
- <div class="fl c-h100" :class="{'c-row':isEditConfig, 'w-100-400':!isEditConfig}">
- <div class="plr5 c-h100-79 mb40">
- <h4 class="m0 pl15 lh40 c-border-b set-label f-w500 c-position-r">
- <em class="c-position-a set-blue-span"></em>
- 配置康复计划
- <!-- <span v-for="(label, index) in spanLabel" :key="index" class="fr ml20 pl20 c-f14 c-999 cur-pit" :class="{'active': index == labelIndex}" @click="setLabelIndex(index, label)">{{label.labelName}}</span> -->
- </h4>
- <div class="ui-col-1 mt20 mr20 c-t-right">
- <img style="width: 24px;height: 24px;" @click="switchWay" src="../images/switch.png"></img><span @click="switchWay" class="ml5 c-f14">{{selectWay=='during'?'切换为时间点':'切换为时间段'}}</span>
- </div>
- <div class="c-h100-41" style="overflow: hidden;">
- <ul class="c-h100 p0 m0" style="overflow: auto;">
- <li class="mt10 plr10 ptb5 c-border b-r-3 clearfix" v-for="(detail, index) in templateDetail" :key="index">
- <div v-if="detail.code=='2'||detail.code=='3'">
- <div class="fl w-100-78 c-333">
- <p :class='detail.isTimeSame ? "m0 p0 mb10 txt-ells cur-pit c-red" : "m0 p0 mb10 txt-ells cur-pit"'>{{detail.name}}</p>
- <div class="clearfix">
- <p class="w400 m0 mb10 p0 fl"><span class="c-999">医  院:</span>{{docInfo.hospitalName}}</p>
- <p class="m0 p0 mb10 fl"><span class="c-999">费  用:</span>{{detail.expense}}</p>
- </div>
- <div class="m0 p0 clearfix">
- <div class="w400 m0 mb10 p0 fl clearfix">
- <span class="fl c-999">选择频次:</span>
- <div class="fl c-position-r w100">
- 不限频次
- </div>
- </div>
- </div>
- <div class="clearfix">
- <span class="fl c-999">备  注:</span>
- <div class="fl maxw600 plr15 ptb10 c-border set-textarea">
- <textarea placeholder="不补充说明特殊用法、方式" v-model="detail.remark" name="" rows="" cols=""></textarea>
- </div>
- </div>
- </div>
- <div class='fr w60 c-t-right clearfix'>
- <div class="clearfix mb10"><span class="fr sub-tap cur-pit" @click="subTemplate(index, detail)"></span></div>
- </div>
- </div>
- <div v-else>
- <div class="fl w-100-78 c-333">
- <p :class='detail.isTimeSame ? "m0 p0 mb10 txt-ells cur-pit c-red" : "m0 p0 mb10 txt-ells cur-pit"'>{{detail.name}}</p>
- <div class="clearfix">
- <p class="w400 m0 mb10 p0 fl"><span class="c-999">医  院:</span>{{detail.executeHospitalName}}</p>
- <p class="m0 p0 mb10 fl"><span class="c-999">费  用:</span>{{detail.expense}}</p>
- </div>
- <div class="m0 p0 clearfix">
- <!-- 选择频次 时间点multiple/ 默认时间段during -->
- <div class="w400 m0 mb10 p0 fl clearfix">
- <span class="fl c-999">选择频次:</span>
- <div class="fl c-position-r custom-dropdown">
- <p class="m0 p0 plr10 c-border cur-pit set-xia" :class="{'set-shang':detail.selectFre}" @click="changeSelectFre(index, detail.selectFre)">{{detail.frequencyName}}</p>
- <ul class="m0 p0 c-border-b c-border-l c-border-r c-position-a doc_list" v-if="detail.selectFre" style="overflow-y: auto; height: 100px;">
- <li class="plr10 c-border-t cur-pit" v-for="(list, indDoc) in detail.frequencyList" :key="indDoc" @click="selectFre(index, list)">{{list.name}}</li>
- </ul>
- </div>
- </div>
- <div v-if="detail.frequencyName!='不限频次'" class="m0 mb10 p0 fl clearfix">
- <span class="fl c-999">执行人员:</span>
- <div class="fl c-position-r custom-dropdown">
- <p class="m0 p0 plr10 c-border cur-pit set-xia" :class="{'set-shang':detail.selectDoc}" @click="changeSelectDoc(index, detail.selectDoc)">{{detail.executeDoctorName}}</p>
- <ul class="m0 p0 c-border-b c-border-l c-border-r c-position-a doc_list" v-if="detail.selectDoc" style="overflow-y: auto; max-height: 100px;">
- <li class="plr10 c-border-t cur-pit" v-for="(list, indDoc) in detail.docList" :key="indDoc" @click="selectLi(index, list)">{{list.name}}</li>
- </ul>
- </div>
- </div>
- </div>
- <!-- <div v-if="detail.frequencyName!='不限频次'" class="pl65 mb10 set-label" v-if="detail.frequency.unit == 'H'">
- <span :class="detail.timeType == 1 ? 'pl20 mr5 cur-pit active' : 'pl20 mr5 cur-pit'" @click="selectTimeType(index, 1)">白天</span>
- <span :class="detail.timeType == 2 ? 'pl20 mr5 cur-pit active' : 'pl20 mr5 cur-pit'" @click="selectTimeType(index, 2)">晚上</span>
- <span :class="detail.timeType == 0 ? 'pl20 cur-pit active' : 'pl20 cur-pit'" @click="selectTimeType(index, 0)">全天</span>
- </div> -->
- <div v-if="detail.frequencyName!='不限频次'">
- <div class="clearfix">
- <span class="fl c-999 lh24">起始时间:</span>
- <div v-if="detail.mode=='during'">
- <div class="fl maxw600 mb10">
- <el-date-picker v-model="detail.value14[0]" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions1" @input="getRandgeDate(index, 0)">
- </el-date-picker>
- <span>—</span>
- <el-date-picker v-model="detail.value14[1]" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions1" @input="getRandgeDate(index, 1)">
- </el-date-picker>
- </div>
- </el-date-picker>
- <span class="fl lh24 mlr10 c-999">或</span>
- <div class="fl maxw600 mb10">
- <el-date-picker type="dates" :picker-options="pickerOptions1" v-model="detail.value15" value-format="yyyy-MM-dd" @input="getSelectDate(index)" placeholder="选择一个或者多个日期"></el-date-picker>
- </div>
- </div>
- <!-- 设置周几 根据所选择频率获取对应数组 -->
- <div v-if="detail.mode=='multiple'" class="fl maxw600 mb10 setInput">
- <el-select v-model="detail.dateCode" placeholder="请选择" @focus="selectTime(detail.frequencyName)" @change="setExecuteTime(detail)">
- <el-option
- v-for="item in multipleTimeList[detail.timeMode]"
- size="mini"
- :key="item.code"
- :label="item.name"
- :value="item.code">
- </el-option>
- </el-select>
- </div>
- </div>
- </div>
- <div class="ui-grid ui-grid-middle">
- <div class="clearfix ui-col-2">
- <span class="fl c-999">备  注:</span>
- <div class="fl maxw600 plr15 ptb10 c-border set-textarea">
- <textarea placeholder="不补充说明特殊用法、方式" v-model="detail.remark" name="" rows="" cols=""></textarea>
- </div>
- </div>
- </div>
- </div>
- <div class='fr w60 c-t-right clearfix'>
- <p v-if="detail.frequencyCode" class="m0 p0 mb10">×{{mul(detail.executeTime.length, detail.frequency.count)}}</p>
- <div v-if="detail.frequencyCode" class="clearfix mb10"><span class="fr sub-tap cur-pit" @click="subTemplate(index, detail)"></span></div>
- <div v-if="detail.frequencyCode" class="clearfix"><span class="fr fuzhi-tap cur-pit" @click="copyTemplate(index, detail)"></span></div>
- </div>
- </div>
- </li>
- <li class="pt100 c-t-center" v-if="!templateDetail.length">
- <span class="set-right-arraw pr20">请在右侧“服务项”列表中选择</span>
- </li>
- </ul>
- </div>
- </div>
- <div>
- <p class="m0 p0 pl20 ptb10 c-border-b set-label">支付方式:<span class="ml10 pl20 active">按服务支付</span><em class="c-red ml20">(按选择支付方式完成收费)</em></p>
- <div class="pl20 lh40">总费用:
- <span class="c-red c-f16">¥{{allFee}}</span>
- <span v-if="!isEditConfig" class="fr lh30 cur-pit plr15 c-t-center c-fff" :class="havePlan ? 'bgc-12b7f5' : 'bgc-d7dce6'" @click="createRehabilitationPlan()">生成计划</span>
- <span v-else class="fr lh30 cur-pit plr15 c-t-center c-fff" :class="havePlan ? 'bgc-12b7f5' : 'bgc-d7dce6'" @click="updateRehabilitationPlan()">完成编辑</span>
- <span class="fr lh30 cur-pit plr15 c-t-center bgc-green c-fff" @click="canclePlan()">取消</span>
- </div>
- </div>
- </div>
- <div v-if="!isEditConfig" class="fr w400 c-h100 c-border-l">
- <div class="plr5 c-h100">
- <h4 class="m0 pl15 lh40 c-border-b c-position-r f-w500">
- <em class="c-position-a set-blue-span"></em>添加其他项目
- </h4>
- <div class="clearfix mtb10 c-border">
- <input class="fl search-input plr10" type="text" v-model="searchKey" placeholder="输入项目名称" />
- <span class="fr search-btn" @click="searchProject()"></span>
- </div>
- <div class="c-h100-99" style="overflow: hidden;">
- <div class="c-h100 p0 m0" style="overflow: auto;">
- <ul class="p0 m0 pr10">
- <li v-for="(o, i) in serviceItems" :key="i" class="clearfix ptb5">
- <!-- @click="selectProject(i, o)" -->
- <div class="fl c-border w-100-66 cur-pit border-c12b7f5 ptb5 plr5 b-r-3 clearfix" :class="o.isSelect ? 'bgc-12b7f5' : 'bgc-fff'">
- <p class="fl w-100-78 txt-ells lh18" :class="o.isSelect ? 'c-fff' : 'c-666'">{{o.name}}</p>
- </div>
- <span class="fr h30 btn cur-pit plr10 bgc-12b7f5 c-fff b-r-3" style="padding: 0 10px;" v-if="!o.isSelect" @click="addProject(i, o)">添加</span>
- <span class="fr h30 btn plr10 bgc-e1e1e1 c-fff b-r-3" style="padding: 0 10px;" v-else>添加</span>
- </li>
- </ul>
- </div>
- </div>
- <!-- <div class="c-h100-99" style="overflow: hidden;">
- <ul class="c-h100 p0 m0" style="overflow: auto;">
- <li v-for="(project1, index) in projectList" :key="index">
- <h4 class="set-arrow c-f14 h30 p0 m0 pl20 f-w500 cur-pit" :class="{'active': index == proIndex1}" @click="selectPro(1, index)">{{project1.itemType == 1 ? '诊疗服务' : '健康服务'}}</h4>
- <ul class="c-h100 p0 m0 pl10" v-if="index == proIndex1">
- <li v-for="(project2, index2) in project1.item" :key="index2">
- <p class="set-arrow h30 c-f14 pl20 m0 c-333 cur-pit" :class="{'active': index2 == proIndex2}" @click="selectPro(2, index2)">{{project2.itemName}}</p>
- <ul class="p0 m0 pr10" v-if="index2 == proIndex2">
- <li v-for="(project3, index3) in project2.hospitalServiceItems" :key="index3" class="clearfix ptb5">
- <div class="fl c-border w-100-66 cur-pit border-c12b7f5 ptb5 plr5 b-r-3 clearfix" :class="project3.isSelect ? 'bgc-12b7f5' : 'bgc-fff'" @click="selectProject(index, index2, index3, project3)">
- <p class="fl w-100-78 txt-ells lh18" :class="project3.isSelect ? 'c-fff' : 'c-666'">{{project3.specialistServiceItemDO.title}}</p>
- <span class="fr lh18 b-r-3 c-f12 ml5 bgc-4dcd70 plr5 c-fff" v-if="project3.flag == 1 || project3.flag == 3">社区</span>
- <span class="fr lh18 b-r-3 c-f12 ml5 bgc-55cefc plr5 c-fff" v-if="project3.flag == 2 || project3.flag == 3">医院</span>
- </div>
- <span class="fr h30 btn cur-pit plr10 bgc-12b7f5 c-fff b-r-3" style="padding: 0 10px;" v-if="!project3.isSelect" @click="addProject(index, index2, index3, project3)">添加</span>
- <span class="fr h30 btn plr10 bgc-e1e1e1 c-fff b-r-3" style="padding: 0 10px;" v-else>添加</span>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </div> -->
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/jquery-2.2.4.js"></script>
- <script src="../../../plugins/layer/layer.min.js"></script>
- <script src="../../../plugins/toastr/toastr.min.js"></script>
- <script src="../../../js/bootstrap.min.js"></script>
- <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/moment.js"></script>
- <script src="../../../js/getPlanDate.js"></script>
- <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/element-ui.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../api/http-request.js" type="text/javascript"></script>
- <script src="../../../api/recover_api.js" type="text/javascript"></script>
- <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
- <script type="text/javascript">
- var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType,
- docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
- console.log('docInfodocInfodocInfodocInfo', docInfo)
- var httpData=GetRequest()
- function showSuccessMessage(msg) {
- layer.msg(msg, {
- icon: 1
- })
- }
-
- function showErrorMessage(msg) {
- layer.msg(msg, {
- icon: 5
- })
- }
-
- function showWarningMessage(msg) {
- layer.msg(msg, {
- icon: 2
- })
- }
-
- function showInfoMessage(msg) {
- layer.msg(msg, {
- icon: 6
- })
- }
- top.recoverVue = new Vue({
- el: "#app",
- data: {
- pickerOptions1: {
- disabledDate: function(time) {
- return time.getTime() < Date.now() - 8.64e7;
- }
- },
- surefont: '添加',
- isTest: false,
- pati: null,
- isPlan: false,
- proIndex1: null,
- proIndex2: null,
- patiInfo: null,
- diseaseObj: null, // 疾病
- mubanList: [],
- templateDetail: [],
- templateResult: [],
- allFee: 0,
- projectList: null,
- serviceItems: null, // 服务项列表
- labelIndex: 2,
- labelCode: 1,
- selectWay:'during',
- spanLabel: [{
- labelName: "(转)家庭病床",
- code: 3
- }, {
- labelName: "(转)社区医院",
- code: 2
- }, {
- labelName: "康复计划",
- code: 1
- }],
- jDlist: [], //家签医生
- zDlist: [], //专科医生
- multipleTimeList:{},
- frequencysList1:[{'code':'','name':'不限频次'},{"code":"qd_10-week1","name":"1周/次","type":1,mode:"week",'count':1},
- {"code":"qd_10-week1","name":"2周/次","type":2,mode:"week",'count':1},
- {"code":"qd_10-month1","name":"1月/次","type":1,mode:"month",'count':1},
- {"code":"qd_10-month1","name":"2月/次","type":2,mode:"month",'count':1},
- {"code":"qd_10-month1","name":"3月/次","type":3,mode:"month",'count':1}], //频次列表-multiple
- weekValue:'',
- selectProjectDetail: null,
- searchKey: null,
- havePlan: false,
- frequencyList: [],
- frequencyListObj: {},
- diagnosisInfo:"",
- indexOrder:0,
- profileRes:[],
- nodata:false,
- subsidiaryInfo:{},
- edit:true,
- selectDiseaseIndex:'',
- isPlanId :'',
- selectPatientIndex: '',
- adviceContent: '', //康复建议
- isEdit: false,
- medicalRecordsList: [],
- docInfo: JSON.parse(window.localStorage.getItem('wlyyAgent')),
- showAdviceContentTip: false,
- curMedicalRecordsIndex: -1,
- healthCodeArr: [],
- diseaseCodeArr: [],
- diseaseNameArr: [],
- teamCode: httpData['teamCode'],
- isEditConfig: httpData['isEditConfig']||false,
- planId: httpData['planId'],
- planInfo: {},
- planDetailId: httpData['planDetailId'],
- service:{
- relationRecordImg:{},
- messageList:{},
- },
- patient: httpData.patient || undefined
- },
- mounted: function() {
- this.selectFrequencys()
- this.initTimeData()
- if(this.patient) {
- this.isPlan = false
- this.allFee = 0
- this.templateDetail = []
- this.pati = {patient: this.patient}
- this.getPatientInfo()
- }
- if(this.teamCode){
- this.findTemplateList()
- }
- if(this.planId){
- this.planSchedule()
- }
- },
- watch: {
- adviceContent: function(){
- var vm = this
- if(vm.adviceContent.trim().length>0){
- vm.showAdviceContentTip = false
- } else {
- vm.showAdviceContentTip = true
- }
- },
- templateDetail: function(){
- if(this.templateDetail.length==0){
- this.havePlan = false
- }else{
- this.havePlan = true
- }
- }
- },
- methods: {
- getServiceItem: function() {
- var vm = this;
- var loadding = top.layer.load(0, {
- shade: false
- }); //0代表加载的风格,支持0-2
- rehaAPI.serviceItem({
- planDetailId: vm.planDetailId
- }).then(function(res) {
- top.layer.close(loadding);
- if(res.status == 200) {
- vm.service = res.data;
- var o1 = {}
- o1.isSelect = true
- o1.selectDoc = false
- o1.selectDate = 1
- o1.value14 = []
- o1.value15 = null
- o1.executeTime = []
- o1.mode='during'
- // 默认频次
- o1.selectFre = false
- if(vm.service.frequencyCode!=''){
- o1.frequencyCode = vm.service.frequencyCode
- o1.frequencyName = vm.frequencyListObj[vm.service.frequencyCode]
- o1.frequency = vm.frequencyList[1]
- } else {
- o1.frequencyCode = ''
- o1.frequencyName = '不限频次'
- o1.frequency = vm.frequencyList[0]
- }
- o1.expense=vm.service.expense||0
- o1.frequencyList = vm.frequencyList
- o1.timeType = 0
- o1.remark = vm.service.remark
- o1.executeDoctor = vm.service.executeDoctorCode
- o1.executeDoctorName = vm.service.executeDoctorName
- o1.executeHospitalName = vm.service.hospitalName
- o1.docList = vm.jDlist
- o1.code = vm.service.type
- o1.name = vm.service.title
- vm.templateDetail.push(o1)
- vm.judgeHavePlan()
- } else {
- showErrorMessage(res.msg)
- }
- })
- },
- initTimeData:function(){
- var vm=this
- vm.multipleTimeList ={"week":[],"month":[]}
- for(var i=1;i<=28;i++){
- switch(i){
- case 1:vm.multipleTimeList.week.push({name:"周一",code:String(i)});break;
- case 2:vm.multipleTimeList.week.push({name:"周二",code:String(i)});break;
- case 3:vm.multipleTimeList.week.push({name:"周三",code:String(i)});break;
- case 4:vm.multipleTimeList.week.push({name:"周四",code:String(i)});break;
- case 5:vm.multipleTimeList.week.push({name:"周五",code:String(i)});break;
- case 6:vm.multipleTimeList.week.push({name:"周六",code:String(i)});break;
- case 7:vm.multipleTimeList.week.push({name:"周日",code:String(i)});break;
- default:break;
- }
- // if(i<=7){
- vm.multipleTimeList.month.push({name:i+"号",code:String(i)})
- // }
- }
- },
- selectTime:function(item){
- if(!item){
- showErrorMessage('请先选择频次')
- return false
- }
- },
- setExecuteTime:function(item){
- if(item.dateCode){
- item.executeTime=getFreDateArr(item.timeMode+item.frequencysList1Type, Number(item.dateCode)).map(function(o) {return o.format("YYYY-MM-DD")})
- this.judgeHavePlan()
- }
- this.$forceUpdate()
- },
- //获取计划表
- planSchedule:function(){
- var vm = this;
- var params = {
- planId: this.planId,
- patientCode: this.patient
- };
- rehaAPI.planSchedule(params).then(function(res){
- if(res.status == 200){
- vm.planInfo = res.data;
- vm.adviceContent = vm.planInfo.adviceContent
- vm.selectByMedicalCode(res.data.medicalRecordsCode)
- }else{
- showErrorMessage(res.msg)
- }
- })
- },
- // 获取住院病历列表
- selectByMedicalCode: function(medicalRecordsCode){
- var vm = this;
- var params = {
- medical: medicalRecordsCode
- };
- rehaAPI.selectByMedicalCode(params).then(function(res){
- if(res.status==200){
- vm.medicalRecordsList = res.data
- }else {
- showErrorMessage(res.msg);
- }
- })
- },
- comMedicalRecords:function(record,isEdit){
- var vm = this
- var loading = layer.load(0, {shade: false})
- var event=record&&record.event?record.event:""
- if(!isEdit){
- isEdit = ""
- }
- recoverAPI.getPatientAccetokenByIdcard({idcard:vm.pati.idcard}).then(function(res){
- layer.close(loading)
- if(res.status==200){
- this.selectPatientIndex = layer.open({
- type: 2,
- area: ['75%', '650px'],
- shade: 0.5,
- title: '住院病历',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: httpRequest.server+"profileweb/#/zhuyuan?patientCode="+res.data.patientCode+"&hospital="+docInfo.hospital+"&recoverDown="+isEdit+"&event="+event,
- end: function(){
- var comProfile = sessionStorage.getItem("comProfile")
- if(comProfile){
- sessionStorage.removeItem("comProfile")
- vm.comMedicalRecordsBack(JSON.parse(comProfile),event); //同步住院病历
- }
- }
- });
- }else{
- showErrorMessage(res.msg);
- }
- })
- },
- comMedicalRecordsBack:function(comProfile,event){
- var vm = this
- var jsonData = {
- admissionTime: comProfile.data['入院时间']||"",
- dischargeTime: comProfile.data['出院时间']||"",
- admittingDiagnosis: "", // 入院诊断
- admittingDiagnosisName: comProfile.data['入院诊断']||"", //入院诊断名称
- dischargeDiagnosis: "", // 出院诊断
- dischargeDiagnosisName: comProfile.data['出院诊断']||"", // 出院诊断名称,多个用逗号
- advice: comProfile.data['出院医嘱']||"出院继续观察",
- images: "",
- "event": comProfile.event.id,
- "dataFrom":comProfile.event.dataFrom,
- "hospital":comProfile.event.orgCode,
- "jwpatient":comProfile.event.patient,
- }
- var params = {
- doctorCode: docInfo.uid,
- patient: vm.pati.patient,
- patientName: vm.pati.patientName,
- jsonData: JSON.stringify(jsonData)
- }
- var loading = layer.load(0, {shade: false})
- rehaAPI.createMedicalRecords(params).then(function(res){
- layer.close(loading)
- if(res.status==200){
- if(!event){
- vm.medicalRecordsList.unshift(res.data)
- }else{
- vm.$set(vm.medicalRecordsList, vm.curMedicalRecordsIndex, res.data)
- }
- if(!vm.adviceContent){
- vm.adviceContent = res.data.advice
- }
- }else{
- showErrorMessage(res.msg);
- }
- })
- },
- // 添加住院病历
- addMedicalRecords: function(){
- var vm = this
- this.selectPatientIndex = layer.open({
- type: 2,
- area: ['480px', '650px'],
- shade: 0.5,
- title: '添加住院病历',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "medical-records.html?patient="+vm.pati.patient+'&patientName='+vm.pati.patientName
- });
- },
- // 编辑住院病历
- editMedicalRecords: function(o, i){
- var vm = this
- if(vm.isEditConfig){
- if(o.event){
- vm.comMedicalRecords(o)
- }else{
- window.localStorage.setItem('curMedicalRecords', JSON.stringify(o))
- this.selectPatientIndex = layer.open({
- type: 2,
- area: ['480px', '650px'],
- shade: 0.5,
- title: '添加住院病历',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "../../rehabilitation/html/medical-records-detail.html?medicalRecordsCode="+o.code
- });
- }
- }else{
- vm.curMedicalRecordsIndex = i
- if(o.event){
- vm.comMedicalRecords(o,true)
- }else{
- window.localStorage.setItem('curMedicalRecords', JSON.stringify(o))
- this.selectPatientIndex = layer.open({
- type: 2,
- area: ['480px', '650px'],
- shade: 0.5,
- title: '添加住院病历',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "medical-records.html?patient="+vm.pati.patient+'&patientName='+vm.pati.patientName+'&medicalRecordsId='+o.id
- });
- }
- }
- },
- //关闭添加住院病历弹框
- closeMedicalRecords: function(){
- layer.close(this.selectPatientIndex)
- },
- completeMedicalRecords: function(type, data){
- var vm = this;
- if(type=='edit'){
- this.$set(this.medicalRecordsList, this.curMedicalRecordsIndex, data)
- } else {
- this.medicalRecordsList.unshift(data)
- }
- if(!vm.adviceContent){
- vm.adviceContent = data.advice
- }
- layer.close(this.selectPatientIndex)
- },
- //获取诊疗信息
- diagnosisQuery:function(){
- var vm = this;
- loadding = layer.load(0, {shade: false});
- params = {
- patient: this.pati.patient,
- // patient:"3b26a7905e034c36a5ba8e65bdc0dc7f",
- type: '2',
- page: 1,
- pageSize: 50,
- lastTime: ''
- }
- recoverAPI.diagnosisQuery(params).then(function(res){
- layer.close(loadding)
- if (res.status == 200) {
- if(res.data.length == 0){
- vm.diagnosisInfo = [{orgName:'无'}]
- console.log(vm.diagnosisInfo)
- vm.nodata = true
- }else{
- vm.diagnosisInfo = res.data;
- }
- vm.orderHospital(0)
- }else{
- vm.diagnosisInfo = [{orgName:'无'}]
- vm.orderHospital(0)
- showErrorMessage(res.msg);
- }
- })
- },
- //按照医院查询诊疗信息
- orderHospital:function(index){
- var vm = this;
- vm.indexOrder = index
- loadding = layer.load(0, {shade: false});
- var sec_params = {
- patient: vm.pati.patient,
- event:vm.diagnosisInfo[index].id || "",
- catalog:'0213',
- serial:"1"
- }
- recoverAPI.diagnosisSubsidiary(sec_params).then(function(res){
- layer.close(loadding)
- vm.subsidiaryInfo = vm.selectXmlDom(res,'0213')
- console.log(vm.subsidiaryInfo)
- })
- },
- //获取xml数据
- selectXmlDom: function (profileRes,tempalteCode) {
- var vm = this;
- if(profileRes.status == 200){
- var $dom = $(profileRes.data.replace(/<\?xml .*\?>/,'')),
- version = $dom.find(">version").length?$dom.find(">version").attr("code"):$dom.attr('version');
- $.trim(version) || (function () {
- version = $dom.find(">ClinicalDocument").length? '2.0.0.1' : '';
- })();
- if($.trim(version)) {
- var verNum = version.split('.')[0];
- var jsonData = {}
- // xml 转 json
- if((typeof profileRes.data=='string')&&profileRes.data.constructor==String) {
- // 去除携带的脚本内容
- profileRes.data = profileRes.data.replace(/<script[^>]*?>[\s\S]*?<\/script>/ig,'');
- // console.log(profileRes.data.replace(/<\?xml .*\?>/,''))
- jsonData = vm.handleData(profileRes.data.replace(/<\?xml .*\?>/,''));
- }
- }
- }else{
- showErrorMessage(profileRes.msg)
- jsonData = {data:{}}
- }
- return jsonData;
- },
- handleData :function (xmlStr) {
- var $xmlDom = $(xmlStr),
- $nodes = {
-
- } ;
- var resultData = [];
- return {
- data:{
- "department": $xmlDom.find('component section entry inDept').text(),//科室
- "dednumber": $xmlDom.find('component section entry bed').text(),//床号
- "HospitalizationNumber": "",//住院号
- "name": $xmlDom.find('recordTarget patient name').text(),//姓名
- "sex": $xmlDom.find('recordTarget patient sex').text(),//性别
- "nation": $xmlDom.find('recordTarget nation').text(),//民族
- "marriage": $xmlDom.find('recordTarget marriage').text(),//婚姻
- "admissionTime": $xmlDom.find('component section entry inTime').attr('value'),//入院时间
- "dischargeTime": $xmlDom.find('component section entry outTime').attr('value'),//出院时间
- "lengthStay": $xmlDom.find('component section entry inHospitalDay').text(),//住院天数
- "admissionStatus": $xmlDom.find('component section entry inCondition').text(),//入院情况
- "admissionDiagnosis": $xmlDom.find('component section entry inDiagnosis').text(),//入院诊断
- "dischargeDiagnosis": $xmlDom.find('component section entry outDiagnosis').text(),//出院诊断
- "DiagnosisProcess": $xmlDom.find('component section entry remedialCourse').text(),//诊疗经过
- "dischargeStatus": $xmlDom.find('component section entry outCondition').text(),//出院情况
- "dischargeOrder": $xmlDom.find('component section entry outOrder').text(),//出院医嘱
- "treatmentOutcome": $xmlDom.find('component section entry remedialResult').text(),//治疗结果
- "residentPhysician": $xmlDom.find('residentDoctor name').text(),//住院医师
- "attendingDoctor": $xmlDom.find('inChargeDoctor name').text(),//主治医师
- "time": $xmlDom.find('inChargeDoctor time').attr('value')//时间
- }
- }
- },
- //编辑诊疗
- editdiagnosis:function(){
- var vm = this;
- vm.edit = !vm.edit;
- vm.nodata = false
- vm.subsidiaryInfo.data.department = $('#department').find('input').val()
- vm.subsidiaryInfo.data.attendingDoctor = $('#attendingDoctor').find('input').val()
- vm.subsidiaryInfo.data.admissionDiagnosis = $('#department').find('input').val()
- vm.subsidiaryInfo.data.dischargeDiagnosis = $('#dischargeDiagnosis').find('input').val()
- },
- // 获取居民标签(健康情况、疾病类型、自定义分组)
- getPatientLabelInfo: function(){
- var vm = this,
- loading = layer.load(0, {shade: false})
- var params = {
- patient: this.pati.patient
- }
- rehaAPI.getPatientLabelInfo(params).then(function(res){
- layer.close(loading)
- if(res.status == 200) {
- var healthLabel = res.data['healthLabel']||[],
- diseaseLabel = res.data['diseaseServer']||[],
- customLabel = res.data['customLabel']||[];
- $.each(diseaseLabel, function(index, item){
- vm.diseaseCodeArr.push(item.disease)
- vm.diseaseNameArr.push(item.diseaseName)
- })
- $.each(healthLabel, function(index, item){
- vm.healthCodeArr.push(item.label)
- })
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 编辑康复建议
- editAdviceTextarea: function(){
- this.isEdit = !this.isEdit
- },
- // 获取频次列表
- selectFrequencys: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false});
- recoverAPI.selectFrequencys().then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.frequencyList = [{code:'', name: '不限频次'}].concat(res.data)
- console.log('vm.frequencyList', vm.frequencyList)
- $.each(res.data, function(index, item){
- vm.frequencyListObj[item.code]=item.name
- })
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 获取居民信息
- getPatientInfo: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- patient: this.pati.patient
- }
- recoverAPI.getPatientInfo(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.patiInfo = res.data
- vm.pati.patientName = res.data.name
- if(vm.planId){ // 编辑服务项时获取服务医生列表
- vm.selectPlanServerDoctor(vm.planId)
- } else {
- vm.jDlist.push({
- name: vm.patiInfo.ssDoctorName || vm.patiInfo.jtDoctorName,
- code: vm.patiInfo.ssDoctor || vm.patiInfo.jtDoctor,
- hospitalName: vm.patiInfo.jtHospitalName,
- type: 1, //1家医2专医
- })
- vm.jDlist.push({
- name: vm.patiInfo.ssDoctorHealthName || vm.patiInfo.jtDoctorHealthName,
- code: vm.patiInfo.ssDoctorHealth || vm.patiInfo.jtDoctorHealth,
- hospitalName: vm.patiInfo.jtHospitalName,
- type: 1, //1家医2专医
- })
- vm.jDlist.push({
- name: docInfo.name,
- code: docInfo.uid,
- hospitalName: docInfo.hospitalName,
- type: 2, //1家医2专医
- })
- }
- // 获取居民标签
- vm.getPatientLabelInfo()
- if(vm.docInfo.doctorType==1){
- vm.findPatientSignSpecialistInfo()
- }
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 获取服务医生列表
- selectPlanServerDoctor: function(id){
- var vm = this,
- params = {
- planId: id
- }
- rehaAPI.selectPlanServerDoctor(params).then(function(res){
- var jtList = [], zkList = []
- if(res.status==200){
- $.each(res.data, function(index, item){
- if(item.level==1){
- zkList.push({
- name: item.name,
- code: item.code,
- hospitalName: item.hospitalName
- })
- } else {
- jtList.push({
- name: item.name,
- code: item.code,
- hospitalName: item.hospitalName
- })
- }
- })
- vm.jDlist = jtList.concat(zkList)
- vm.getServiceItem()
- }else{
- layer.msg(res.msg,{icon:5});
- }
- })
- },
- // 签约专科信息
- findPatientSignSpecialistInfo: function() {
- var vm = this,
- params = {
- patient: this.pati.patient,
- doctor: docInfo.uid
- }
- recoverAPI.findPatientSignSpecialistInfo(params).then(function(res) {
- if(res.status == 200) {
- vm.pati.teamCode = res.data.teamCode
- if(!vm.teamCode){
- vm.teamCode = res.data.teamCode
- }
- vm.specialistTeam(vm.teamCode)
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 获取专科团队
- specialistTeam: function(teamCode) {
- var vm = this,
- params = {
- teamId: teamCode
- }
- recoverAPI.specialistTeam(params).then(function(res) {
- if(res.status == 200) {
- vm.zDlist = res.data.members
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 模板列表
- findTemplateList: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- patient: this.pati.patient,
- doctor: docInfo.uid,
- adminTeamCode: vm.teamCode
- }
- recoverAPI.findTemplateList(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.mubanList = res.data
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 模板详细
- findTemplateDetail: function(templateId) {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- templateId: templateId
- }
- recoverAPI.findTemplateDetail(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.templateDetail = []
- res.data.planArr=[]
- vm.templateResult = $.map(res.data,function(item){
- $.map(item.list,function(it){
- it.code=item.code
- it.name=item.name
- res.data.planArr.push(it)
- })
- return res.data.planArr
- })
- vm.templateResult=_.uniq(vm.templateResult,function(item){
- return item.id
- })
- vm.getServiceItemList().then(function(){
- var arr = []
- $.each(vm.serviceItems, function(index,o) {
- $.each(vm.templateResult, function(index1, o1) {
- if(o1.code == o.code) {
- if(o1.executeTimes){
- o.isSelect = true
- o1.selectFre = true
- o1.isSelect = true
- o1.selectDoc = false
- o1.selectDate = 1
- o1.value14 = []
- o1.value15 = null
- o1.executeTimes?o1.executeTime = o1.executeTimes.split(','):o1.executeTime=[]
- o1.executeTime=_.map(o1.executeTime,function(item){
- return item.substring(0,item.length-6)
- })
- // 默认频次
- o1.selectFre = false
- o1.mode='multiple'
- o1.timeMode=_.find(vm.frequencysList1,{'name':o1.frequencyName}).mode
- o1.frequencysList1Type=_.find(vm.frequencysList1,{'name':o1.frequencyName}).type
- o1.frequency = vm.frequencysList1[1]
- o1.frequencyList = vm.frequencysList1
- o1.timeType = 0
- o1.docList = vm.jDlist
- if(o1.type==1){
- o1.executeDoctorName=vm.jDlist[0].name
- o1.executeDoctor=vm.jDlist[0].code
- o1.executeHospitalName = vm.jDlist[0].hospitalName
- }else{
- o1.executeDoctorName=docInfo.name
- o1.executeDoctor=docInfo.uid
- o1.executeHospitalName = docInfo.hospitalName
- }
- }else{
- o.isSelect = true
- o1.selectFre = true
- o1.isSelect = true
- o1.selectDoc = false
- o1.selectDate = 1
- o1.value14 = []
- o1.value15 = null
- o1.executeTime = []
- // 默认频次
- o1.selectFre = false
- o1.frequencyCode = ''
- o1.frequencyName = '不限频次'
- o1.mode='during'
- o1.frequency = vm.frequencyList[0]
- o1.frequencyList = vm.frequencyList
- o1.timeType = 0
- o1.remark = null
- o1.executeDoctor = vm.jDlist[0].code
- o1.executeDoctorName = vm.jDlist[0].name
- o1.executeHospitalName = vm.jDlist[0].hospitalName
- o1.docList = vm.jDlist
- }
- arr.push(o1)
- }
- })
- })
- vm.templateDetail = arr
- // 赋值模板所带的默认服务项费用
- _.each(vm.templateDetail,function(item){
- _.map(vm.serviceItems,function(it){
- if(item.code==it.code){
- it.expense=item.expense
- return it
- }
- })
- })
- vm.checkAllMoney()
- vm.$forceUpdate()
- })
- // vm.findServiceItemsByHospital()
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 服务项目列表 2020-03-03 新增接口
- getServiceItemList: function(isSearch){
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- name: vm.searchKey
- }
- return rehaAPI.getServiceItemList(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- var serviceItems = res.data
- vm.serviceItems = $.each(serviceItems, function(index,o) {
- o.isSelect = false
- return o;
- })
- }else {
- showErrorMessage(res.msg);
- }
- })
- },
- searchProject: function() {
- this.getServiceItemList(true)
- },
- setPatImg: function(src) {
- if(!src) {
- return "../../../images/p-female.png"
- } else {
- var str = httpRequest.getImgUrl(src);
- return str
- }
- },
- changeSelectFre: function(index, bool) {
- this.templateDetail[index].selectFre = !bool
- this.isTest = !this.isTest
- },
- changeSelectDoc: function(index, bool) {
- this.templateDetail[index].selectDoc = !bool
- this.isTest = !this.isTest
- },
- // 选择频次
- selectFre: function(index, list) {
- this.templateDetail[index].selectFre = false
- this.templateDetail[index].frequencyCode = list.code
- this.templateDetail[index].frequencyName = list.name
- this.templateDetail[index].timeMode=list.mode
- this.templateDetail[index].frequencysList1Type=list.type
- this.templateDetail[index].dateCode=''
- this.templateDetail[index].frequency = list
- this.templateDetail[index] = this.templateDetail[index]
- this.isTest = !this.isTest
- // if(this.templateDetail[index].frequencyCode==''&&this.isEditConfig){
- // var obj = this.templateDetail[index]
- // this.templateDetail = [].push(obj)
- // }
- this.judgeHavePlan()
- },
- // 选择时间段
- selectTimeType: function(index, timetype) {
- this.templateDetail[index].timeType = timetype
- this.isTest = !this.isTest
- },
- // 选择执行医生
- selectLi: function(index, list) {
- this.templateDetail[index].selectDoc = false
- this.templateDetail[index].executeDoctor = list.code
- this.templateDetail[index].type = list.type
- this.templateDetail[index].executeDoctorName = list.name
- this.templateDetail[index].executeHospitalName = list.hospitalName
- this.templateDetail[index] = this.templateDetail[index]
- this.isTest = !this.isTest
- },
- // 删除配置计划
- subTemplate: function(index, detail) {
- var vm = this
- this.isTest = !this.isTest
- this.templateDetail.splice(index, 1)
- var len = detail.executeTime.length
- var deleteJudge = true
- $.each(vm.templateDetail, function(index, o) {
- if(o.code == detail.code) {
- deleteJudge = false
- }
- });
- if(deleteJudge) {
- $.each(vm.serviceItems, function(index, o) {
- if(detail.code == o.code) {
- o.isSelect = false
- o.executeTime = []
- vm.serviceItems[index] = o
- }
- });
- }
- this.checkAllMoney()
- this.judgeHavePlan()
- },
- // 复制计划
- copyTemplate: function(index, detail) {
- var vm = this,
- obj = JSON.parse(JSON.stringify(detail));
- this.isTest = !this.isTest
- obj.executeTime = []
- obj.mode=this.selectWay
- obj.selectFre=true
- obj.mode=='during'?obj.frequencyList=vm.frequencyList:obj.frequencyList=vm.frequencysList1
- obj.frequencyCode=''
- obj.frequencyName=''
- obj.dateCode=''
- obj.value14 = []
- obj.value15 = null
- this.templateDetail.push(obj)
- if(obj.code!='2'&&obj.code!='3'){
- this.havePlan = false
- }
- },
- switchWay:function(){
- this.selectWay=='during'?this.selectWay='multiple':this.selectWay='during'
- },
- // 选择项目
- selectProject: function(index, index2, index3, o) {
- this.selectProjectDetail = o
- this.selectPatientIndex = layer.open({
- type: 2,
- area: ['400px', '500px'],
- shade: 0.5,
- title: '选择项目',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "select-project.html?isLook=true&projectId=" + o.id + "&index=" + index + "&index3=" + index3 + "&index2=" + index2
- });
- },
- // 添加项目
- addProject: function(index, obj) {
- if(obj) {
- this.selectProjectDetail = obj
- }
- if(this.selectProjectDetail.isSelect) {
- showWarningMessage("已添加!")
- return false;
- }
- this.selectProjectDetail.isSelect = true
- this.selectProjectDetail.selectDoc = false
- this.selectProjectDetail.selectDate = 1
- this.selectProjectDetail.expense=obj.expense||0
- this.selectProjectDetail.value14 = []
- this.selectProjectDetail.value15 = null
- this.selectProjectDetail.executeTime = []
- // 频次选择
- this.selectProjectDetail.selectFre = true
- this.selectProjectDetail.frequencyCode = this.frequencyList[0].code
- this.selectProjectDetail.frequencyName = this.frequencyList[0].name
- this.selectProjectDetail.frequency = this.frequencyList[0]
- this.selectProjectDetail.mode = this.selectWay
- this.selectWay=='during'?this.selectProjectDetail.frequencyList=this.frequencyList:this.selectProjectDetail.frequencyList=this.frequencysList1
- this.selectProjectDetail.dateCode=''
- this.selectProjectDetail.timeType = 0
- this.selectProjectDetail.remark = null
- this.selectProjectDetail.executeDoctor = this.jDlist[0].code
- this.selectProjectDetail.executeDoctorName = this.jDlist[0].name
- this.selectProjectDetail.executeHospitalName = this.jDlist[0].hospitalName
- this.selectProjectDetail.docList = this.jDlist
- this.templateDetail.push(this.selectProjectDetail)
- this.serviceItems[index] = this.selectProjectDetail
- if(this.selectProjectDetail.code!='2'&&this.selectProjectDetail.code!='3'){
- this.havePlan = false
- }
- this.checkAllMoney()
- this.judgeHavePlan()
-
- },
- // 选择居民
- selectPatient: function() {
- this.selectPatientIndex = layer.open({
- type: 2,
- area: ['400px', '500px'],
- shade: 0.5,
- title: '同步患者',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "select-patient.html"
- });
- },
- // 选择居民回调
- selectPatientOk: function(pati) {
- this.isPlan = false
- this.allFee = 0
- this.templateDetail = []
- this.pati = pati
- this.isEdit = false
- this.showAdviceContentTip = false
- this.medicalRecordsList = []
- this.getPatientInfo()
- this.findTemplateList()
- // this.diagnosisQuery()
- layer.close(this.selectPatientIndex)
- },
- // 添加模板
- addMuban: function(oId) {
- var vm = this
- var templateId = oId||''
- vm.newPlan(templateId)
- },
- // 取消计划
- canclePlan: function(obj) {
- var vm = this
- cancleIndex = layer.open({
- type: 2,
- area: ['400px', '180px'],
- shade: 0.5,
- title: '取消确认',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "cancle_sure.html"
- });
- },
- cancleSure: function() {
- this.isPlan = false
- this.allFee = 0
- this.templateDetail = []
- },
- // (disease, templateId)
- newPlan: function(templateId) {
- // this.diseaseObj = disease
- // var templateId = this.templateId
- this.isPlan = true
- if(templateId) {
- this.findTemplateDetail(templateId)
- } else {
- this.templateDetail = []
- this.getServiceItemList()
- // this.findServiceItemsByHospital()
- }
- },
- selectPro: function(pro, index) {
- if(pro == 1) {
- this.proIndex2 = null;
- this.proIndex1 == index ? this.proIndex1 = null : this.proIndex1 = index
- } else {
- this.proIndex2 == index ? this.proIndex2 = null : this.proIndex2 = index
- }
- },
- setLabelIndex: function(index, label) {
- this.labelIndex = index
- this.labelCode = label.code
- },
- changeSelectDate: function(index, num) {
- if(this.templateDetail[index].executeTime.length) {
- showWarningMessage("请先清除此选项的计划时间!");
- return false;
- }
- this.isTest = !this.isTest
- this.templateDetail[index].selectDate = num
- },
- openSelectTime: function(index) {
- var vm = this
- selectTimeIndex = layer.open({
- type: 2,
- area: ['600px', '500px'],
- shade: 0.5,
- title: '服务时间选择',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "select_timer.html"
- });
- },
- formatter: function(time){
- return new Date(time).format('yyyy-MM-dd')
- },
- // 选择日期
- getSelectDate: function(index) {
- var vm = this,
- projectId = vm.templateDetail[index].code;
- if(!this.templateDetail[index].value15) {
- return false;
- }
- vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
- if(projectId == o.code) {
- o.isTimeSame = false
- }
- return o
- })
- this.templateDetail[index].executeTime = []
- var arr = this.templateDetail[index].value15
- this.templateDetail[index].executeTime = arr
- this.templateDetail[index].value14 = []
- this.isTest = !this.isTest
- this.judgeHavePlan()
- },
- // 选择周期
- getRandgeDate: function(index, i) {
- var vm = this
- var templateDetail=this.templateDetail[index]
- if(!templateDetail.value14[i]){
- this.templateDetail[index].executeTime = []
- this.havePlan = false
- return false
- }
- if(templateDetail.value14[0]>templateDetail.value14[1]){
- showWarningMessage("开始时间应小于结束时间!")
- return false;
- }
- var projectId = vm.templateDetail[index].code;
- vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
- if(projectId == o.code) {
- o.isTimeSame = false
- }
- return o
- })
- this.templateDetail[index].executeTime = []
- var arr = this.templateDetail[index].value14,
- startTime = new Date(arr[0]).getTime(),
- endTime = new Date(arr[1]).getTime(),
- absTime = endTime - startTime,
- oneday = 60 * 60 *24 * 1000,
- i = 0;
- for(i; i * oneday <= absTime; i++) {
- var num = i * oneday + startTime,
- str = new Date(num).format("yyyy-MM-dd")
- this.templateDetail[index].executeTime.push(str)
- }
- var obj = {
- startTime: arr[0],
- endTime: arr[1],
- length: i
- }
- this.templateDetail[index].value15 = null
- this.isTest = !this.isTest
- this.judgeHavePlan()
- },
- // 计算总费用
- checkAllMoney: function() {
- var vm = this
- this.allFee = 0
- var arr=JSON.parse(JSON.stringify(vm.templateDetail))
- arr=_.uniq(arr,'code')
- $.each(arr, function(index, o) {
- // var fee = vm.mul(vm.mul(o.expense, o.frequency.count), o.executeTime.length)
- vm.allFee = vm.add(vm.allFee, o.expense)
- });
- },
- judgeHavePlan: function() {
- var arr = []
- for(var k = 0; k < this.templateDetail.length; k++) {
- if(this.templateDetail[k].code=='2'||this.templateDetail[k].code=='3'){
- arr.push(true)
- } else if(this.templateDetail[k].frequencyCode){
- if(this.templateDetail[k].executeTime[0]) {
- arr.push(true)
- }else {
- arr.push(false)
- }
- } else {
- arr.push(true)
- }
- }
- var flag = _.every(arr, Boolean)
- if(flag){
- this.havePlan = true
- }else{
- this.havePlan = false
- }
- },
- // 编辑居民康复计划详情
- updateRehabilitationPlan: function(){
- var vm = this
- var ispass1=_.every(vm.templateDetail,function(item){
- if(item.code!='2'&&item.code!='3'){
- return _.every(vm.templateDetail,function(it,index){
- return _.every(vm.templateDetail,function(i,ind){
- if(index!=ind){
- var same=_.intersection(it.executeTime,i.executeTime)
- if(same.length>0){
- return false
- }else{
- return true
- }
- }else{
- return true
- }
- })
- })
- }else{
- return true
- }
- })
- if(!ispass1){ //时间重复
- showErrorMessage('存在重复时间')
- return false
- }
- var loadding = layer.load(0, {shade: false}),
- data = {
- planId: vm.planId,
- hospitalServiceItemId: vm.service.type,
- detail: [],
- };
- $.each(vm.templateDetail, function(index, o) {
- var obj;
- if(o.code=='2'||o.code=='3'||!o.frequencyCode){
- obj = {
- hospitalServiceItemId: o.code,
- type: 2,
- doctor: vm.jDlist[0].code,
- doctorName: vm.jDlist[0].name,
- executeTimes: '',
- frequencyCode: '',
- timeType: 0,
- remark: o.remark || '',
- expense:o.expense || 0
- }
- }else{
- if(o.executeTime.length) {
- var executeTime = []
- $.each(o.executeTime, function(ind, v) {
- v += ' 00:00'
- executeTime.push(v)
- });
- obj = {
- hospitalServiceItemId: o.code, // 服务项code
- type: o.type,
- doctor: o.executeDoctor,
- doctorName: o.executeDoctorName,
- executeTimes: executeTime.length>0?executeTime.join(","):'',
- frequencyCode: o.frequencyCode.split("-")[0],
- timeType: 0, //1白天2晚上0全天
- remark: o.remark || '',
- expense:o.expense||0
- }
- }
- }
- data.detail.push(obj)
- });
- var params = {
- json: JSON.stringify(data)
- }
- recoverAPI.updateRehabilitationPlan(params).then(function(res){
- layer.close(loadding)
- if(res.status ==200){
- showSuccessMessage('保存成功!')
- window.history.go(-1)
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- createRehabilitationPlan: function() {
- var vm = this
- if(!this.adviceContent){
- vm.showAdviceContentTip = true
- showWarningMessage("请输入康复建议!")
- return false;
- }
- if(vm.medicalRecordsList.length==0){
- showWarningMessage("请选择住院病历!")
- return false;
- }
- if(!this.havePlan) {
- showWarningMessage("请选择计划时间!")
- return false;
- }
- var codeArr=[];
- $.each(vm.medicalRecordsList,function(i, o){
- codeArr.push(o.code)
- })
- var loadding = layer.load(0, {shade: false}),
- data = {
- patient: this.pati.patient,
- name: this.pati.patientName,
- title: this.pati.patientName + "的康复计划",
- healthStatusCode:this.healthCodeArr.join(','),
- disease: this.diseaseCodeArr.join(','),
- diseaseName: this.diseaseNameArr.join(','),
- planType: this.labelCode || 1,
- payment: 2,
- totalExpense: this.allFee || 0,
- adviceContent: this.adviceContent,
- medicalRecordsCode: codeArr.join(','),
- teamCode: vm.teamCode,
- detail: [],
-
- };
- $.each(vm.templateDetail, function(index, o) {
- var obj;
- if(o.code=='2'||o.code=='3'||!o.frequencyCode){
- obj = {
- hospitalServiceItemId: o.code,
- type: 2,
- doctor: vm.jDlist[0].code,
- doctorName: vm.jDlist[0].name,
- executeTimes: '',
- frequencyCode: '',
- timeType: 0,
- remark: o.remark || '',
- expense:o.expense||0,
- }
- }else{
- if(o.executeTime.length) {
- var executeTime = []
- $.each(o.executeTime, function(ind, v) {
- v += ' 00:00'
- executeTime.push(v)
- });
- obj = {
- hospitalServiceItemId: o.code,
- type: o.type,
- doctor: o.executeDoctor,
- doctorName: o.executeDoctorName,
- executeTimes: executeTime.join(","),
- frequencyCode: o.frequencyCode.split("-")[0],
- timeType: 0,
- remark: o.remark || '',
- expense:o.expense||0,
- }
- }
- }
- data.detail.push(obj)
- });
- var params = {
- json: JSON.stringify(data)
- }
- // console.log('paramsparamsparamsparamsparams', data)
- // return
- recoverAPI.createRehabilitationPlan(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.isPlanId = res.data
- setTimeout(function() {
- window.location.href = "../../rehabilitation/html/health_control.html"
- }, 1000)
- showSuccessMessage("康复计划配置成功!")
- } else {
- showErrorMessage(res.msg || "同康复计划项目创建时间重复!");
- vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
- $.each(res.data, function(ind, v) {
- if(v == o.id) {
- o.isTimeSame = true
- }
- });
- return o
- })
- }
- })
- },
- // 字符串方法计算加减乘除(精确度百分位)
- add: function(num1,num2){
- var r1,r2,m,n;
- try{r1=num1.toString().split(".")[1].length}catch(e){r1=0}
- try{r2=num2.toString().split(".")[1].length}catch(e){r2=0}
- m = Math.pow(10,Math.max(r1,r2));
- n = (r1>=r2)?r1:r2;
- return ((num1*m + num2*m)/m).toFixed(n);
- },
- sub: function(num1,num2){
- var r1,r2,m,n;
- try{r1=num1.toString().split(".")[1].length}catch(e){r1=0}
- try{r2=num2.toString().split(".")[1].length}catch(e){r2=0}
- n = (r1>=r2)?r1:r2;
- m = Math.pow(10,Math.max(r1,r2));
- return ((num1*m - num2*m)/m).toFixed(n);
- },
- mul: function(num1,num2){
- var m = 0;
- try{m+=num1.toString().split(".")[1].length}catch(e){}
- try{m+=num2.toString().split(".")[1].length}catch(e){}
- return (Number(num1.toString().replace(".",""))*Number(num2.toString().replace(".","")))/Math.pow(10,m)
- },
- div: function(arg1,arg2){
- var t1=0,t2=0,r1,r2;
- try{t1=arg1.toString().split(".")[1].length}catch(e){}
- try{t2=arg2.toString().split(".")[1].length}catch(e){}
- r1=Number(arg1.toString().replace(".",""));
- r2=Number(arg2.toString().replace(".",""));
- return (r1/r2)*Math.pow(10,t2-t1);
- }
- }
- })
- </script>
- </body>
- </html>
|