123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>新建计划</title>
- <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="https://unpkg.com/element-ui/lib/theme-chalk/index.css" />
- <link rel="stylesheet" type="text/css" href="../css/new_recover.css" />
- </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 w300 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 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">诊疗信息</h4>
- <ul class="c-333 m0 p0 pb20">
- <li class="pt10"><span class="c-999">诊疗医院:</span>男</li>
- <li class="pt10"><span class="c-999">入院科室:</span>男</li>
- <li class="pt10"><span class="c-999">主治医师:</span>男</li>
- <li class="pt10"><span class="c-999">入院诊断:</span>男</li>
- <li class="pt10"><span class="c-999">出院诊断:</span>男</li>
- </ul>
- <h4 class="h30 m0 c-f14 c-border-b">出院小结</h4>
- <p class="m0 pt10 c-333">依旧本次判断,对新消息进行出院诊断做出以下结论:忧郁啥啥事等等等问题</p>-->
- </div>
- </div>
- <div class="fl c-h100 w-100-300">
- <div class="c-h100 plr5" v-if="!isPlan">
- <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 w-100-300 c-h100">
- <div class="plr5 c-h100-79">
- <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="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 class="fl w-100-78 c-333">
- <p class="m0 p0 mb10 txt-ells cur-pit" @click="lookProject(detail)">{{detail.specialistServiceItemDO.title}}</p>
- <div class="clearfix">
- <p class="w300 m0 mb5 p0 fl"><span class="c-999">医  院:</span>{{detail.hospitalName}}</p>
- <div class="m0 mb5 p0 fl clearfix">
- <span class="fl c-999">执行人员:</span>
- <div class="fl c-position-r w100">
- <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">
- <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 class="m0 p0 lh18 clearfix">
- <div class="w300 fl clearfix">
- <span class="fl c-999">计划时间:</span>
- <div class="fl set-label clearfix">
- <span class="fl mr20 pl20 c-f14 cur-pit" :class="{'active': detail.selectDate == 1}" @click="changeSelectDate(index, 1)">日期</span>
- <span class="fl mr20 pl20 c-f14 cur-pit" :class="{'active': detail.selectDate == 2}" @click="changeSelectDate(index, 2)">周期</span>
- </div>
- </div>
- <p class="m0 p0 fl"><span class="c-999">费  用:</span>{{detail.expense}}{{detail.specialistServiceItemDO.unit}}</p>
- </div>
- <div class="pl56">
- <div class="maxw600 ptb10 bgc-f5f5fa" v-show="detail.selectDate == 1">
- <p class="fl pl10 lh24 mb5 mr20 clearfix" v-for="(time, ind) in detail.specialistServiceItemDO.executeTime" :key="ind" v-if="detail.specialistServiceItemDO.executeTime.length">
- <span class="fl pb10">{{time}}</span><span class="fl pb10 ml5 c-red cur-pit" @click="spliceTimeArr(index, ind)">删除</span>
- </p>
- <el-date-picker type="date" :picker-options="pickerOptions1" v-model="detail.value14" value-format="yyyy-MM-dd" @input="getSelectDate(index)" placeholder="选择日期"></el-date-picker>
- </div>
- <div class="maxw600 ptb10 bgc-f5f5fa" v-show="detail.selectDate == 2">
- <p class="lh24 pl10 mb5 mr20 clearfix" v-for="(time, ind) in detail.specialistServiceItemDO.selectDateRange" :key="ind" v-if="detail.specialistServiceItemDO.selectDateRange.length">
- <span class="pb10 mr10">{{time.startTime}}</span>至<span class="pb10 ml10">{{time.endTime}}</span><span class="pb10 ml5 c-red cur-pit" @click="spliceTimeRange(index, ind)">删除</span>
- </p>
- <el-date-picker v-model="detail.value14" type="daterange" :picker-options="pickerOptions1" value-format="yyyy-MM-dd" @input="getRandgeDate(index)" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
- </div>
- </div>
- </div>
- <div class='fr w60 c-t-right clearfix'>
- <p class="m0 p0 mb10">×{{detail.specialistServiceItemDO.executeTime.length}}</p>
- <div class="fr sub-tap cur-pit" @click="subTemplate(index, detail)"></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 class="fr lh30 cur-pit plr15 c-t-center bgc-green c-fff" @click="canclePlan()">取消</span>
- <span class="fr lh30 cur-pit plr15 c-t-center c-fff" :class="havePlan ? 'bgc-12b7f5' : 'bgc-d7dce6'" @click="createRehabilitationPlan()">生成计划</span>
- </div>
- </div>
- </div>
- <div class="fr w300 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;">
- <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" v-if="!project3.isSelect" @click="addProject(index, index2, index3, project3)">添加</span>
- <span class="fr h30 btn plr10 bgc-e1e1e1 c-fff b-r-3" 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/util.js" type="text/javascript" charset="utf-8"></script>
- <script src="https://unpkg.com/element-ui/lib/index.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">
- var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType,
- docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
- 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
- })
- }
- recoverVue = new Vue({
- el: "#app",
- data: {
- pickerOptions1: {
- disabledDate(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,
- labelIndex: 2,
- labelCode: 1,
- spanLabel: [{
- labelName: "(转)家庭病床",
- code: 3
- }, {
- labelName: "(转)社区医院",
- code: 2
- }, {
- labelName: "康复计划",
- code: 1
- }],
- jDlist: null,
- zDlist: null,
- selectProjectDetail: null,
- searchKey: null,
- havePlan: false
- },
- mounted: function() {
- if(httpData.patient) {
- this.isPlan = false
- this.allFee = 0
- this.templateDetail = []
- this.pati = {patient: httpData.patient}
- this.getPatientInfo()
- this.findTemplateList()
- }
- },
- methods: {
- // 获取居民信息
- getPatientInfo: function() {
- this.findPatientSignSpecialistInfo()
- 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
- vm.jDlist = [{
- name: vm.patiInfo.ssDoctorName || vm.patiInfo.jtDoctorName,
- code: vm.patiInfo.ssDoctor || vm.patiInfo.jtDoctor
- }, {
- name: vm.patiInfo.ssDoctorHealthName || vm.patiInfo.jtDoctorHealthName,
- code: vm.patiInfo.ssDoctorHealth || vm.patiInfo.jtDoctorHealth
- }]
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- 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
- vm.zDlist = [{
- name: res.data.doctorName,
- code: res.data.doctor
- }, {
- name: res.data.healthAssistantName,
- code: res.data.healthAssistant
- }]
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 模板列表
- findTemplateList: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- patient: this.pati.patient,
- doctor: docInfo.uid
- }
- 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 = []
- vm.templateResult = res.data
- vm.findServiceItemsByHospital()
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 服务项目列表
- findServiceItemsByHospital: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- doctor: docInfo.uid,
- patient: this.pati.patient,
- serviceItemName: this.searchKey
- }
- recoverAPI.findServiceItemsByHospital(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.projectList = $.each(res.data[0], function(index, o) {
- $.each(vm.templateResult, function(index1, o1) {
- if(o1.specialistServiceItemDO.itemType == o.itemType) {
- $.each(o.item, function(index2, o2) {
- if(o1.specialistServiceItemDO.diseaseItem == o2.itemName) {
- $.each(o2.hospitalServiceItems, function(index3, o3) {
- if(o3.serviceItemId == o1.serviceItemId) {
- o3.isSelect = true
- o3.selectDoc = false
- o3.selectDate = 1
- o3.value14 = null
- o3.specialistServiceItemDO.executeTime = []
- o3.specialistServiceItemDO.selectDateRange = []
- if(o3.flag == 2) {
- o3.executeDoctor = vm.zDlist[0].code
- o3.executeDoctorName = vm.zDlist[0].name
- o3.docList = vm.zDlist
- } else {
- o3.executeDoctor = vm.jDlist[0].code
- o3.executeDoctorName = vm.jDlist[0].name
- o3.docList = vm.jDlist
- }
- vm.templateDetail.push(o3)
- }
- });
- }
- });
- }
- });
- return o;
- });
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- searchProject: function() {
- this.findServiceItemsByHospital()
- },
- setPatImg: function(src) {
- if(!src) {
- return "../../../images/p-female.png"
- } else {
- var str = httpRequest.getImgUrl(src);
- return str
- }
- },
- changeSelectDoc: function(index, bool) {
- this.templateDetail[index].selectDoc = !bool
- this.isTest = !this.isTest
- },
- selectLi: function(index, list) {
- this.templateDetail[index].selectDoc = false
- this.templateDetail[index].executeDoctor = list.code
- this.templateDetail[index].executeDoctorName = list.name
- 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.specialistServiceItemDO.executeTime.length
- if(len) {
- this.allFee = vm.sub(vm.allFee, vm.mul(len, detail.expense))
- }
- $.each(vm.projectList, function(index, o) {
- if(detail.specialistServiceItemDO.itemType == o.itemType) {
- $.each(o.item, function(index2, o2) {
- if(detail.specialistServiceItemDO.diseaseItem == o2.itemName) {
- $.each(o2.hospitalServiceItems, function(index3, o3) {
- if(o3.serviceItemId == detail.serviceItemId) {
- o3.isSelect = false
- o3.specialistServiceItemDO.executeTime = []
- }
- });
- }
- });
- }
- });
- vm.judgeHavePlan()
- },
- // 选择项目
- selectProject: function(index, index2, index3, o) {
- this.selectProjectDetail = o
- 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, index2, index3, 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.value14 = null
- this.selectProjectDetail.specialistServiceItemDO.executeTime = []
- this.selectProjectDetail.specialistServiceItemDO.selectDateRange = []
- if(this.selectProjectDetail.flag == 2) {
- this.selectProjectDetail.executeDoctor = this.zDlist[0].code
- this.selectProjectDetail.executeDoctorName = this.zDlist[0].name
- this.selectProjectDetail.docList = this.zDlist
- } else {
- this.selectProjectDetail.executeDoctor = this.jDlist[0].code
- this.selectProjectDetail.executeDoctorName = this.jDlist[0].name
- this.selectProjectDetail.docList = this.jDlist
- }
- this.templateDetail.push(this.selectProjectDetail)
- this.projectList[index].item[index2].hospitalServiceItems[index3] = this.selectProjectDetail
- },
- // 查看项目
- lookProject: function(o) {
- selectPatientIndex = layer.open({
- type: 2,
- area: ['400px', '500px'],
- shade: 0.5,
- title: '查看项目',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "select-project.html?projectId=" + o.id
- });
- },
- // 选择居民
- selectPatient: function() {
- 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.getPatientInfo()
- this.findTemplateList()
- },
- // 添加模板
- addMuban: function(oId) {
- var vm = this
- selectDiseaseIndex = layer.open({
- type: 2,
- area: ['400px', '500px'],
- shade: 0.5,
- title: '选择疾病',
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: "select-disease.html?teamCode=" + vm.pati.teamCode +"&templateId=" + oId || ''
- });
- },
- // 取消计划
- 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 = []
- },
- newPlan: function(disease, templateId) {
- this.diseaseObj = disease
- this.isPlan = true
- if(templateId) {
- this.findTemplateDetail(templateId)
- } else {
- this.templateDetail = []
- 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].specialistServiceItemDO.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"
- });
- },
- // 选择日期
- getSelectDate: function(index) {
- var str = this.templateDetail[index].value14
- this.templateDetail[index].specialistServiceItemDO.executeTime.push(str)
- this.templateDetail[index].value14 = null
- this.isTest = !this.isTest
- this.allFee = this.add(this.allFee, this.templateDetail[index].expense)
- this.judgeHavePlan()
- },
- // 选择周期
- getRandgeDate: function(index) {
- 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].specialistServiceItemDO.executeTime.push(str)
- this.allFee = this.add(this.allFee, this.templateDetail[index].expense)
- }
- var obj = {
- startTime: arr[0],
- endTime: arr[1],
- length: i
- }
- this.templateDetail[index].specialistServiceItemDO.selectDateRange.push(obj)
- this.templateDetail[index].value14 = null
- this.isTest = !this.isTest
- this.judgeHavePlan()
- },
- spliceTimeArr: function(index, ind) {
- var vm = this
- this.templateDetail[index].specialistServiceItemDO.executeTime.splice(ind, 1)
- this.isTest = !this.isTest
- vm.allFee = vm.sub(vm.allFee, vm.templateDetail[index].expense)
- vm.judgeHavePlan()
- },
- spliceTimeRange: function(index, ind) {
- var startPos = 0,
- len = this.templateDetail[index].specialistServiceItemDO.selectDateRange[ind].length,
- vm = this
- for(var i = 0; i < ind; i++) {
- startPos += this.templateDetail[index].specialistServiceItemDO.selectDateRange[i].length
- }
- this.templateDetail[index].specialistServiceItemDO.selectDateRange.splice(ind, 1)
- this.templateDetail[index].specialistServiceItemDO.executeTime.splice(startPos, len)
- this.isTest = !this.isTest
- vm.allFee = vm.sub(vm.allFee, vm.mul(vm.templateDetail[index].expense, len))
- vm.judgeHavePlan()
- },
- judgeHavePlan: function() {
- for(var k = 0; k < this.templateDetail.length; k++) {
- for(var i = 0; i < this.templateDetail[k].specialistServiceItemDO.executeTime.length; i++) {
- if(this.templateDetail[k].specialistServiceItemDO.executeTime[i]) {
- this.havePlan = true;
- return false;
- }
- }
- }
- this.havePlan = false
- },
- createRehabilitationPlan: function() {
- if(!this.havePlan) {
- showWarningMessage("请选择计划时间!")
- return false;
- }
- for(var k = 0; k < this.templateDetail.length; k++) {
- for(var i = 0; i < this.templateDetail[k].specialistServiceItemDO.executeTime.length; i++) {
- for(var j = i + 1; j < this.templateDetail[k].specialistServiceItemDO.executeTime.length; j++) {
- if(this.templateDetail[k].specialistServiceItemDO.executeTime[i] == this.templateDetail[k].specialistServiceItemDO.executeTime[j]) {
- showWarningMessage("请核对项目“" + this.templateDetail[k].specialistServiceItemDO.title + "”的计划时间选择!");
- return false;
- }
- }
- }
- }
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- data = {
- patient: this.pati.patient,
- name: this.pati.patientName,
- title: this.pati.patientName + this.diseaseObj.diseaseName + "康复计划",
- disease: this.diseaseObj.diseaseCode,
- diseaseName: this.diseaseObj.diseaseName,
- planType: this.labelCode,
- payment: 2,
- totalExpense: this.allFee,
- detail: []
- },
- params = {};
- $.each(vm.templateDetail, function(index, o) {
- if(o.specialistServiceItemDO.executeTime.length) {
- var executeTime = []
- $.each(o.specialistServiceItemDO.executeTime, function(ind, v) {
- v += ' 00:00'
- executeTime.push(v)
- });
- var obj = {
- hospitalServiceItemId: o.id,
- type: o.flag == 2 ? 2 : 1,
- doctor: o.executeDoctor,
- doctorName: o.executeDoctorName,
- executeTime: executeTime.join(",")
- }
- data.detail.push(obj)
- }
- });
- params = {
- json: JSON.stringify(data)
- }
- recoverAPI.createRehabilitationPlan(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- showSuccessMessage("康复计划配置成功!")
- setTimeout(function() {
- window.location.href = "../../rehabilitation/html/health_control.html"
- }, 1000)
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 字符串方法计算加减乘除(精确度百分位)
- 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>
|