123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553 |
- <!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" href="../../../plugins/element-ui/element-ui.css" />
- <link rel="stylesheet" type="text/css" href="../css/common.css" />
- </head>
- <body class="m0">
- <div id="app" class="p15 c-333" v-cloak>
- <div class="ui-row flex">
- <div class="ui-row-item flex mr50">
- <label class="c-999 w-80">专科团队:</label>
- <select v-model="curTeamId" class="form-control w-180 h30">
- <option :value="o.id" v-for="(o, i) in teamList">{{o.name}}</option>
- </select>
- </div>
- <div class="ui-row-item flex">
- <label class="c-999 w-80">患者身份证:</label>
- <div>
- <input type="text" v-model="searchKey" placeholder="请输入患者身份证查询" class="form-control w-220 h30">
- </div>
- </div>
- <div class="ui-row-item flex">
- <button class="btn btn-12B7F5 btn-size-s ml10" @click="onSearch">搜索</button>
- <button class="btn btn-12B7F5 btn-size-s ml10" @click="viewQrcodeBox">扫码下转</button>
- <button class="btn btn-12B7F5 btn-size-s ml10" @click="addPatient">+ 添加患者</button>
- </div>
- </div>
- <div v-if="patientInfo" >
- <h4 class="m0 h30 c-f14 c-border-b f-w500">家签信息</h4>
- <div class="flex mt20">
- <div class="flex1 flex c-f14">
- <label class="c-999 w-80">患者信息:</label>
- <div class="flex1 c-333">{{patientInfo.patientName}} {{patientInfo.sex=='1'?'男':'女'}} {{patientInfo.age}}岁</div>
- </div>
- <div class="flex1 flex c-f14">
- <label class="c-999 w-80">家签社区:</label>
- <div class="flex1 c-333">{{patientInfo.hospitalName}}</div>
- </div>
- <div class="flex1 flex c-f14">
- <label class="c-999 w-80">家签医生:</label>
- <div class="flex1 c-333">{{patientInfo.doctorName}}{{patientInfo.doctorHealthName?'、'+patientInfo.doctorHealthName:''}}</div>
- </div>
- </div>
- <h4 class="m0 h30 c-f14 c-border-b f-w500 mt30">患者分类</h4>
- <div class="mt20">
- <div class="flex vc">
- <label class="c-999 w-80">健康情况:</label>
- <select v-model="curHealthStatu" class="form-control w-180 h30">
- <option v-for="(o, i) in healthLabel" v-bind:value="o.labelCode">{{o.labelName}}</option>
- </select>
- </div>
- <div class="flex mt20">
- <label class="c-999 w-80">疾病类型:</label>
- <div class="flex1">
- <div v-for="(o, i) in diseaseLabel" class="row-line-item w-180">
- <label class="checkbox-inline">
- <input type="checkbox" v-model="o.flag"/>
- <span>{{o.diseaseName}}</span>
- </label>
- </div>
- </div>
- </div>
- <div class="flex mt20">
- <label class="c-999 w-80">自定义分组:</label>
- <div class="flex1">
- <div v-for="(o, i) in customLabel" class="row-line-item w-180">
- <label class="checkbox-inline">
- <input type="checkbox" v-model="o.flag"/>
- <span>{{o.labelName}}</span>
- </label>
- </div>
- </div>
- </div>
- </div>
- <div class="c-t-center mt50">
- <button type="button" class="btn btn-12B7F5 btn-size-m" @click="judgePatientInSpecia">保存</button>
- </div>
- </div>
- <div v-else class="c-t-center mt50"><img src="../images/wushuju_img.png" alt=""> <p class="c-999 mt10">{{emptyText}}</p></div>
- </div>
- <div id="addPatientPanel" style="display: none;" class="c-t-center">
- <div class="mt40">
- <input type="text" id="inputControl1" placeholder="请输入患者身份证相关信息检索" class="form-control w-300 h30">
- </div>
- <div class="mt20 c-FF0000 c-f15">
- 注:可根据患者身份证或社保卡号进行搜索
- </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="../../../plugins/element-ui/element-ui.js" type="text/javascript"></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="../../../api/http-request.js" type="text/javascript"></script>
- <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
- <script type="text/javascript" src="../../../api/sign_api.js"></script>
- <script type="text/javascript">
- var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType
- var httpData=GetRequest()
- var docInfo = JSON.parse(window.localStorage.getItem("wlyyAgent"));
- var qrcodeBoxIndex;
- console.log(httpData)
- 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.addRecoveryDownVue = new Vue({
- el: "#app",
- data: {
- pickerOptions1: {
- disabledDate: function(time) {
- return time.getTime() < Date.now() - 8.64e7;
- }
- },
- patientInfo: undefined,
- searchKey: '',
- allLabel: {},
- customLabel: [],
- diseaseLabel: [],
- healthLabel: [],
- teamList: [], // 专科团队列表
- curTeamId: '',
- curTeamInfo: {},
- teamListObj: {},
- curHealthStatu: '',
- emptyText: '暂无数据',
- is_sign_specialist: false,
- is_sign_my: false,
- signTeamInfo: {},
- selectPatientIndex: undefined,
- },
- mounted: function() {
- this.getSpecialistTeamList()
- },
- watch: {
- curTeamId: function(){
- var vm = this
- this.getSpecialistPatientLabel(this.curTeamId)
- this.curTeamInfo = this.teamListObj[this.curTeamId]
- vm.patientInfo = undefined
- }
- },
- methods: {
- addPatient: function(){
- var vm = this
- $('#inputControl1').val('')
- $("#addPatientPanel").css('display','block')
- this.selectPatientIndex = layer.open({
- type: 1,
- area: ['400px', '260px'],
- shade: 0.5,
- title: '添加患者',
- btn: ['确定', '关闭'], //只是为了演示
- shadeClose: false, //点击遮罩关闭层
- content: $("#addPatientPanel"),
- yes: function(){
- var str = $('#inputControl1').val()
- if(str.trim().length==0){
- showErrorMessage('请输入患者身份证相关信息检索!')
- return
- }
- vm.getPatientByIdcardOrSsc(str)
- },
- });
- },
- getPatientByIdcardOrSsc: function(inputValue){
- var vm = this
- var params = {
- patientInfo: inputValue, // 居民身份证或者社保卡
- type: 1, // 1患者家签列表 2康复下转列表
- }
- var loading = layer.load(0, {shade: false})
- rehaAPI.getPatientByIdcardOrSsc(params).then(function(res){
- layer.close(loading)
- if(res.status==200){
- if(res.data&&res.data.patient){
- this.getPatient(res.data.patient)
- layer.close(vm.selectPatientIndex)
- }
- } else {
- showErrorMessage(res.data)
- }
- })
- },
- signSpecialist: function(is_sign_specialist, is_sign_my, patientCode){
- this.is_sign_specialist = is_sign_specialist
- this.is_sign_my = is_sign_my
- if(patientCode){
- this.getPatient(patientCode)
- }
- layer.close(qrcodeBoxIndex)
- },
- // 显示二维码窗口
- viewQrcodeBox: function(){
- var vm=this
- qrcodeBoxIndex = layer.open({
- type: 2,
- // offset: ['100px'], //右下角弹出
- area: ['500px', '500px'],
- shade: 0.5,
- title: '康复下转',
- fixed: true, //不固定
- maxmin: true,
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content:'../../rehabilitation/html/signZkTeam.html?id=' + vm.curTeamInfo.id + '&name='+ vm.curTeamInfo.name+'&photo='+vm.curTeamInfo.photo,
- end: function() { // 未点击确定按钮,点击关闭按钮
-
- }
- });
- },
- // 获取下转居民列表
- onSearch: function(){
- if(this.searchKey.trim().length==0){
- showWarningMessage('请输入居民身份证进行查询!')
- return false;
- }
- this.getRehabilitationPatientList(this.searchKey)
- },
- // 根据身份证号码获取家签居民
- getRehabilitationPatientList: function(value){
- var vm = this,
- loading = layer.load(0, {shade: false})
- var params = {
- idcard: value
- }
- rehaAPI.getRehabilitationPatientList(params).then(function(res){
- layer.close(loading)
- if(res.status == 200) {
- if(res.data.length>0){
- vm.patientInfo = res.data[0]
- vm.getPatientLabelInfo()
- // 获取签约专科信息
- vm.findPatientTeamList()
- } else {
- vm.patientInfo = undefined
- vm.emptyText = '患者暂未家签,请先提醒患者完成家庭医生签约'
- }
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 根据居民code 查找居民
- getPatient: function(patient){
- var vm = this
- var params = {
- patient: patient
- }
- signAPI.getPatient(params).then(function(res){
- if(res.status==200){
- if(res.data){
- var result = res.data
- vm.patientInfo = {}
- vm.patientInfo['patient'] = result.code
- vm.patientInfo['patientName'] = result.name
- vm.patientInfo['sex'] = result.sex
- vm.patientInfo['age'] = result.age
- vm.patientInfo['hospitalName'] = result.jtHospitalName
- vm.patientInfo['doctorName'] = result.jtDoctorName
- vm.patientInfo['doctorHealthName'] = result.jtDoctorHealthName
- vm.$forceUpdate()
- vm.getPatientLabelInfo()
- // 获取签约专科信息
- vm.findPatientTeamList()
- }
- console.log('res', res)
- } else {
- showErrorMessage('获取居民信息失败!')
- }
- })
- },
- getSpecialistTeamList: function(){
- var vm = this,
- loading = layer.load(0, {shade: false})
- var params = {
- doctor: docInfo.uid
- }
- rehaAPI.getSpecialistTeamList(params).then(function(res){
- layer.close(loading)
- if(res.status == 200) {
- vm.teamList = res.data || []
- vm.curTeamId = vm.teamList[0].id
- vm.curTeamInfo = vm.teamList[0]
- vm.teamListObj = {}
- $.each(res.data, function(index, o){
- vm.teamListObj[o.id] = o
- })
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- // 获取居民标签(健康情况、疾病类型、自定义分组)
- getPatientLabelInfo: function(){
- var vm = this,
- loading = layer.load(0, {shade: false})
- var params = {
- patient: vm.patientInfo.patient // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
- }
- 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']||[];
- vm.patientInfo.healthLabel = healthLabel
- vm.patientInfo.diseaseLabel = diseaseLabel
- vm.patientInfo.customLabel = customLabel
- vm.initLabelData()
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- initLabelData: function(){
- var vm = this
- var dLabel = [], cLabel = [];
- $.each(vm.allLabel['diseaseLabel'], function(index, o){
- o.flag = false
- o.disease = o.code
- o.diseaseName = o.name
- $.each(vm.patientInfo.diseaseLabel, function(index1, o1){
- if(o1.disease == o.code){
- o.flag = true
- }
- })
- dLabel.push(o)
- })
- $.each(vm.allLabel['customLabel'], function(index, o){
- o.flag = false
- o.labelCode = o.labelCode
- o.labelName = o.labelName
- $.each(vm.patientInfo.customLabel, function(index1, o1){
- if(o1.label == o.labelCode){
- o.flag = true
- }else{
-
- }
- })
- if(o.isSystem!=1){
- cLabel.push(o)
- }
- })
- vm.healthLabel = vm.allLabel['healthLabel'] || []
- vm.curHealthStatu = vm.healthLabel[0].labelCode
- vm.diseaseLabel = dLabel
- vm.customLabel = cLabel
- vm.$forceUpdate()
- },
- // 获取居民标签字典(健康情况、疾病类型、自定义分组)
- getSpecialistPatientLabel: function(teamId){
- var vm = this,
- loading = layer.load(0, {shade: false})
- var params = {
- teamCode: teamId
- }
- rehaAPI.getSpecialistPatientLabel(params).then(function(res){
- layer.close(loading)
- if(res.status==200){
- vm.allLabel = res.data
- }else{
- showErrorMessage(res.msg);
- }
- })
- },
- // 获取居民签约的专科团队
- findPatientTeamList: function(){
- var vm = this,
- params = {
- patient: vm.patientInfo.patient
- }
- rehaAPI.findPatientTeamList(params).then(function(res){
- if(res.status == 200) {
- var num = 0
- $.each(res.data, function(index,item){
- if(item.teamCode==vm.curTeamInfo.id){ //签约团队与二维码团队一致
- num++
- vm.signTeamInfo = item
- }
- })
- if(num>0){
- if(vm.signTeamInfo&&vm.signTeamInfo.doctor == docInfo.uid){
- vm.is_sign_specialist = true
- vm.is_sign_my = true
- } else {
- var text = vm.patientInfo.patientName+"已签约该专科团队【"+vm.signTeamInfo.doctorName+"】医生,请通过原医生创建康复计划"
- layer.alert(text, {icon: 5, title: '提示'});
- vm.is_sign_specialist = true
- vm.is_sign_my = false
- }
- } else {
- vm.is_sign_specialist = false
- vm.is_sign_my = false
- }
- } else {
- showErrorMessage(res.msg)
- }
- })
- },
- //居民未与扫描的二维码团队对应
- createPatientInSpeciaRelation:function(data){
- return new Promise(function (resolve, reject) {
- var vm = this,
- params = {
- patient: data.patient_code,
- doctor: docInfo.uid,
- patientName: data.patient_name,
- doctorName: docInfo.name,
- teamCode:data.teamCode
- }
- rehaAPI.createPatientInSpeciaRelation({jsonData:JSON.stringify(params)}).then(function(res){
- resolve(res)
- })
- })
- },
- judgePatientInSpecia: function(){
- var vm = this
- if(!vm.patientInfo){return false}
- if(!vm.is_sign_specialist){
- var text = "请问您是否确认为"+vm.patientInfo.patientName+"患者进行康复下转?"
- var current=layer.confirm(text, {
- btn: ['确定', '取消'],
- title: "提示"
- }, function (index) {
- vm.createPatientInSpeciaRelation({
- patient_code: vm.patientInfo.patient,
- patient_name: vm.patientInfo.patientName,
- teamCode: vm.curTeamInfo.id
- }).then(function(res){
- vm.is_sign_specialist = true
- vm.is_sign_my = true
- setTimeout(function(){
- vm.saveBtn()
- }, 500)
- })
- })
- } else {
- if(vm.is_sign_my){
- vm.saveBtn()
- } else {
- var text = vm.patientInfo.patientName+"已签约该专科团队【"+vm.signTeamInfo.doctorName+"】医生,请通过原医生创建康复计划"
- layer.alert(text, {icon: 5, title: '签约失败'});
- return
- }
- }
- },
- saveBtn: function(){
- var vm = this, num1 = 0, num2 = 0,
- health = {}, disease = [], custom = []
- if(!vm.curHealthStatu){
- showWarningMessage('请选择健康情况!')
- return false
- }
- $.each(vm.healthLabel, function(index, o){
- if(o.labelCode == vm.curHealthStatu){
- health = {
- label: o.labelCode,
- labelName: o.labelName,
- labelType: o.labelType
- }
- }
- })
- for(var i=0; i<vm.diseaseLabel.length; i++){
- var o = vm.diseaseLabel[i]
- if(!o.flag){
- num1++
- } else {
- disease.push({
- disease: o.disease,
- diseaseName: o.diseaseName
- })
- }
- if(num1==vm.diseaseLabel.length){
- showWarningMessage('请选择疾病类型!')
- return false
- }
- }
- for(var i=0; i<vm.customLabel.length; i++){
- var o = vm.customLabel[i]
- if(!o.flag){
- num2++
- } else {
- custom.push({
- label: o.labelCode,
- labelName: o.labelName,
- labelType: o.labelType
- })
- }
- // if(num2==vm.customLabel.length){
- // showWarningMessage('请选择自定义分组!')
- // return false
- // }
- }
- var data = {
- health: health,
- disease: disease,
- custom: custom
- }
- var params = {
- patient: vm.patientInfo.patient, // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
- patientName: vm.patientInfo.patientName,
- json: JSON.stringify(data),
- teamCode: vm.curTeamInfo.id
- }
- var loading = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
- rehaAPI.updatePatientLabelInfo(params).then(function(res){
- layer.close(loading);
- if(res.status==200){
- layer.confirm('康复下转基本信息保存成功,请为患者创建康复计划', { btn: ['创建康复计划', '取消'], title: "康复下转" }, function (index) {
- window.location.href="../../recover/html/new_recover.html?patient="+vm.patientInfo.patient + '&teamCode='+vm.curTeamInfo.id
- })
- }else{
- showErrorMessage(res.msg)
- }
- })
- }
- }
- })
- </script>
- </body>
- </html>
|