Browse Source

12月13 自动生成

yq1 2 weeks ago
parent
commit
fa239b850b
1 changed files with 269 additions and 27 deletions
  1. 269 27
      src/xt_pages/user/courseOfDisease_new.vue

+ 269 - 27
src/xt_pages/user/courseOfDisease_new.vue View File

@@ -85,7 +85,7 @@
85 85
                 病程内容
86 86
               </span>
87 87
               <div style="display:flex;">
88
-                <div>
88
+                <!-- <div>
89 89
                   取值时间:
90 90
                   <el-select v-model="quzhi_date" @change="datachange" placeholder="请选择" style="width: 120px;">
91 91
                     <el-option
@@ -114,7 +114,7 @@
114 114
                     placeholder="选择日期"
115 115
                     style="width: 150px;">
116 116
                   </el-date-picker>
117
-                </div>
117
+                </div> -->
118 118
                 <!-- <div>
119 119
                   <el-button type="primary" size="small" @click="autotext_click">
120 120
                     生成
@@ -205,8 +205,8 @@
205 205
         top="0"
206 206
         >
207 207
         <div>
208
-          <!-- <div style="display:flex;"> -->
209
-            <!-- <div>
208
+          <div style="display:flex;position: absolute;left: 20%;top: 20px;">
209
+            <div>
210 210
               取值时间:
211 211
               <el-select v-model="quzhi_date" @change="datachange" placeholder="请选择" style="width: 120px;">
212 212
                 <el-option
@@ -235,7 +235,7 @@
235 235
                 placeholder="选择日期"
236 236
                 style="width: 150px;">
237 237
               </el-date-picker>
238
-            </div> -->
238
+            </div>
239 239
             <div style="text-align: right;margin-bottom: 10px;">
240 240
               <el-button type="primary" size="small" @click="autotext_click">
241 241
                 生成
@@ -244,15 +244,16 @@
244 244
                 取消
245 245
               </el-button>
246 246
             </div>
247
-          <!-- </div> -->
247
+          </div>
248 248
           <div v-show="AuToShow">
249
-            <text_content @new_content="newcontent" :patient="patient" :prescription="prescription" :berforList="berforList"
249
+            <div v-html="textcontent" id="editer"></div>
250
+            <!-- <text_content @new_content="newcontent" :patient="patient" :prescription="prescription" :berforList="berforList"
250 251
             :monitorList="monitorList" :dryweightList="dryweightList" :inpectionList="inpectionList" :dialysisOrderList="dialysisOrderList"
251 252
             :start_date="start_date" :end_date="end_date" :patient_id="patient_id" :num="num" :longAdvice="longAdvice" :groupPrescriptionList="groupPrescriptionList" :afterList="afterList" :max_blood_flow_volume="max_blood_flow_volume"
252 253
             :max_befor_systolic_blood_pressure="max_befor_systolic_blood_pressure" :min_befor_systolic_blood_pressure="min_befor_systolic_blood_pressure" :max_befor_diastolic_blood_pressure="max_befor_diastolic_blood_pressure"  :min_befor_diastolic_blood_pressure="min_befor_diastolic_blood_pressure"
253 254
             :max_after_systolic_blood_pressure="max_after_systolic_blood_pressure" :min_after_systolic_blood_pressure="min_after_systolic_blood_pressure" :max_after_diastolic_blood_pressure="max_after_diastolic_blood_pressure" :min_after_diastolic_blood_pressure="min_after_diastolic_blood_pressure"
254 255
             :max_monitor_systolic_blood_pressure="max_monitor_systolic_blood_pressure" :min_monitor_systolic_blood_pressure="min_monitor_systolic_blood_pressure" :max_monitor_diastolic_blood_pressure="max_monitor_diastolic_blood_pressure" :min_monitor_diastolic_blood_pressure="min_monitor_diastolic_blood_pressure"
255
-            :lastDryWeight="lastDryWeight" :patientVascularAccess="patientVascularAccess" :lastBefor="lastBefor"></text_content>
256
+            :lastDryWeight="lastDryWeight" :patientVascularAccess="patientVascularAccess" :lastBefor="lastBefor"></text_content> -->
256 257
           </div>
257 258
         </div>
258 259
 
@@ -333,7 +334,7 @@
333 334
         quzhi_date:1,
334 335
         start_date:'',
335 336
         end_date:'',
336
-        quzhi_options:[{value:1,label:'本周'},{value:2,label:'上周'},{value:3,label:'本月'},{value:4,label:'上'},],
337
+        quzhi_options:[{value:1,label:'本周'},{value:2,label:'上周'},{value:3,label:'本月'},{value:4,label:'上'},],
337 338
         tableData:[],
338 339
         admin_user_id:"",
339 340
         record_date:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
@@ -377,6 +378,7 @@
377 378
             {id:2,name:'血常规',date:'2024-12-19',left:[{c_id:1,c_name:'血红蛋白',c_value:110},{c_id:2,c_name:'血红蛋白2',c_value:110}],
378 379
             right:[{c_id:1,c_name:'白细胞1',c_value:110},{c_id:2,c_name:'白细胞3',c_value:110}]}
379 380
         ],
381
+        textcontent:'',
380 382
       }
381 383
     },
382 384
     created() {
@@ -400,6 +402,8 @@
400 402
       // // const ceshi=`hellow word`
401 403
       // this.new_content = ceshi
402 404
       // this.$refs.editor.contents=ceshi
405
+      // this.start_date = this.getFirstDayOfWeek(new Date())
406
+      // this.end_date = this.getTime(new Date())
403 407
       this.fetchAllDoctorAndNurse()
404 408
       this.getlist()
405 409
     },
@@ -553,7 +557,7 @@
553 557
         if(this.admin_user_id == ""){
554 558
            this.admin_user_id = 0
555 559
         }
556
-       
560
+
557 561
         var params = {
558 562
           id:this.id,
559 563
           patient_id:this.patient_id,
@@ -601,7 +605,7 @@
601 605
         // this.auto_dialog = true
602 606
       },
603 607
       autotext_click(){
604
-
608
+       
605 609
           //  医嘱
606 610
           if(this.longAdvice!=null && this.longAdvice.length>0){
607 611
             for(let i=0;i<this.longAdvice.length;i++){
@@ -670,13 +674,247 @@
670 674
         this.Inspect = arr
671 675
         console.log("newarr----------------",arr)
672 676
        }
677
+       const contents = `<table border="1" class="table" style="border-collapse: collapse;width: 100%;">
678
+              <tr>
679
+                <th colspan="2" style="padding: 5px;">透析阶段小结(${this.start_date}~${this.end_date})</th>
680
+              </tr>
681
+              <tr>
682
+                <td width="130" style="padding: 5px;">基本信息</td>
683
+                <td style="padding: 5px;">
684
+                  <span>姓名:</span>  <span>性别:</span>  <span>年龄:</span>  <span>透析号:</span>
685
+                </td>
686
+              </tr>
687
+              <tr>
688
+                <td style="align-items: center;padding: 5px;">透析处方</td>
689
+                <td style='padding:5px'>
690
+                  <p style='font-weight: bold;'>总次数:次 ;</p>
691
+                  <p style='margin-bottom: 10px;' >其中;
692
+
693
+                  </p>
694
+                  <p style='font-weight: bold;'>透析器:</p>
695
+                  <p style='margin-bottom: 10px;'>
696
+
697
+                  </p>
698
+                  <p style='font-weight: bold;'>透析液处方:</p>
699
+                  <p style='margin-bottom: 10px;'>
700
+
701
+                  </p>
702
+                  <p style='font-weight: bold;'>抗凝方式:</p>
703
+                  <p ></p>
704
+                </td>
705
+              </tr>
706
+              <tr>
707
+                <td style="align-items: center;padding: 5px;">透析情况</td>
708
+                <td style='padding:5px'>
709
+                  <p>透析间期平均体重增加:kg;</p>
710
+                  <p>凝血:;</p>
711
+                  <p>平均血流量:mL/min;最大血流量:mL/min;</p>
712
+                  <p>平均超滤量:ml/次;平均超滤率:mL/h;</p>
713
+                  <p><span style='font-weight: bold;'>透前血压:</span>&nbsp;<span class="">收缩压:mmHg~mmHg;舒张压:mmHg~mmHg;</span></p>
714
+                  <p><span style='font-weight: bold;'>透后血压:</span>&nbsp;<span class="">收缩压:mmHg~mmHg;舒张压:mmHg;</span></p>
715
+                  <p><span style='font-weight: bold;'>透中最低血压:</span>&nbsp;<span class="">收缩压:mmHg~mmHg</span></p>
716
+                  <p><span style='font-weight: bold;'>透中最高血压:</span>&nbsp;<span class="">舒张压:mmHg~mmHg;</span></p>
717
+                </td>
718
+              </tr>
719
+              <tr>
720
+                <td style="align-items: center;padding: 5px;">干体重</td>
721
+                <td style='padding: 5px;'>
722
+                  <p>
723
+                    <span style='font-weight: bold;'>当前干体重:</span>&nbsp;<span class="">kg;</span>
724
+                  </p>
725
+                  <p>
726
+                    <span style='font-weight: bold;'>调整记录:</span>&nbsp;<span class=""></span>
727
+                  </p>
728
+                </td>
729
+              </tr>
730
+              <tr>
731
+                <td style="align-items: center;padding: 5px;">血管通路</td>
732
+                <td style='padding: 5px;'>
733
+                  <p>
734
+                    <span style='font-weight: bold;'>使用的血管通路:</span>&nbsp;<span class=""> &nbsp;&nbsp;建立时间:</span>
735
+                  </p>
736
+                </td>
737
+              </tr>
738
+              <tr>
739
+                <td style="align-items: center;padding: 5px;">合并症/并发症</td>
740
+                <td style='padding: 5px;'>
741
+                  <p>
742
+                    <span style='font-weight: bold;'>合并症:</span>&nbsp;<span class="">无</span>
743
+                  </p>
744
+                  <p>
745
+                    <span style='font-weight: bold;'>透析并发症:</span>&nbsp;<span class=""></span>
746
+                  </p>
747
+                </td>
748
+              </tr>
749
+              <tr>
750
+                <td style="align-items: center;padding: 5px;">检查结果</td>
751
+                <td style='padding: 5px;'>
752
+                  <span class="">无</span>
753
+                </td>
754
+              </tr>
755
+              <tr>
756
+                <td style="align-items: center;padding: 5px;">检验结果</td>
757
+                <td></td>
758
+              </tr>
759
+              <tr>
760
+                <td style="align-items: center;padding: 5px;">医嘱用药</td>
761
+                <td  class='' style="padding: 0;">
762
+                  <p style="display: flex;text-align: center;border-bottom: 1px solid black;">
763
+                    <span style="width: 30%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">药物名称</span><span style="width:20% ;display: inline-block;padding: 5px 0;border-right: 1px solid black;">医嘱类型</span><span style="width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">开始时间</span><span style="width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">单次用量</span><span style="width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;">执行频率</span><span style="width: 10%;padding: 5px 0;display: inline-block;">状态</span></p>
764
+                </td>
765
+              </tr>
766
+
767
+
768
+              <tr>
769
+                <td style="align-items: center;padding: 5px;">透析总评价和建议</td>
770
+                <td style='padding: 5px;'>
771
+                  <p class="">1、血压控制不良,随时监测血压,并加用口服降压药,将血压控制在正常范围;</p>
772
+                  <p class="">2、透析间期体重增加稳定,继续保持;</p>
773
+                  <p class="">3、血液透析时血流量达标,注意保护内瘘避免狭窄;</p>
774
+                </td>
775
+              </tr>
776
+              <tr>
777
+                <td style="align-items: center;padding: 5px;">医师签名</td>
778
+                <td style='padding: 5px;'>
779
+                  <p class=""></p>
780
+                </td>
781
+              </tr>
782
+            </table>`
783
+          console.log('1111111111textcontent',this.start_date);
784
+        this.textcontent = contents
785
+        this.$nextTick(()=>{
786
+          console.log('document.getElementById(editer)',document.getElementById('editer').getElementsByTagName('tbody')[0].children[9]);
787
+          const iframeDoc = document.getElementById('editer').getElementsByTagName('tbody')[0].children[9].children[1]
788
+          const jiancDoc = document.getElementById('editer').getElementsByTagName('tbody')[0].children[8].children[1]
789
+          console.log('document.getElementById(editer)1111',jiancDoc);
790
+          if(this.Inspect.length<1){
791
+            let newList = document.createElement('p');
792
+            newList.style.cssText = 'padding: 5px;'
793
+            newList.textContent = '无';
794
+            jiancDoc.appendChild(newList)
795
+          }else{
796
+            let newList = document.createElement('p');
797
+                newList.style.cssText='display: flex;text-align: center;border-bottom: 1px solid black;';
798
+                let newListItem1 = document.createElement('span');
799
+                newListItem1.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
800
+                let newListItem2 = document.createElement('span');
801
+                newListItem2.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
802
+                let newListItem3 = document.createElement('span');
803
+                newListItem3.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
804
+                let newListItem4 = document.createElement('span');
805
+                newListItem4.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
806
+                let newListItem5 = document.createElement('span');
807
+                newListItem5.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
808
+                let newListItem6 = document.createElement('span');
809
+                newListItem6.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;'
810
+                newListItem1.textContent = '检验项目';
811
+                newListItem2.textContent = '检验时间';
812
+                newListItem3.textContent = '检验内容';
813
+                newListItem4.textContent = '结果';
814
+                newListItem5.textContent = '检验内容';
815
+                newListItem6.textContent = '结果';
816
+                newList.appendChild(newListItem1);
817
+                newList.appendChild(newListItem2);
818
+                newList.appendChild(newListItem3);
819
+                newList.appendChild(newListItem4);
820
+                newList.appendChild(newListItem5);
821
+                newList.appendChild(newListItem6);
822
+                jiancDoc.appendChild(newList)
823
+            for(let i in this.Inspect){
824
+              let newList1 = document.createElement('p');
825
+              const child1 = document.createElement('p')
826
+              const child2 = document.createElement('p')
827
+              const child3 = document.createElement('p')
828
+              newList1.appendChild(child1);
829
+              newList1.appendChild(child2);
830
+              newList1.appendChild(child3);
831
+              newList1.style.cssText='display: flex;text-align: center;border-bottom: 1px solid black;';
832
+              child1.style.cssText= 'width: 40%;display: inline-block;border-right: 1px solid black;display: flex;'
833
+              child2.style.cssText= 'width: 40%;display: inline-block;border-right: 1px solid black;display: flex;flex-wrap: wrap;'
834
+              child3.style.cssText= 'width: 40%;display: inline-block;display: flex;flex-wrap: wrap;'
835
+
836
+              let newListItem1 = document.createElement('span');
837
+              newListItem1.style.cssText= 'flex:1;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
838
+              let newListItem2 = document.createElement('span');
839
+              newListItem2.style.cssText= 'flex:1;display: inline-block;padding: 5px 0;'
840
+              newListItem1.textContent = this.Inspect[i].name;
841
+              newListItem2.textContent = this.Inspect[i].date;
842
+              child1.appendChild(newListItem1);
843
+              child1.appendChild(newListItem2);
844
+              for(let j in this.Inspect[i].left){
845
+                let newListItem3 = document.createElement('span');
846
+                newListItem3.style.cssText= 'border-bottom: 1px solid black;width:50%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
847
+                let newListItem4 = document.createElement('span');
848
+                newListItem4.style.cssText= 'border-bottom: 1px solid black;width:50%;display: inline-block;padding: 5px 0;'
849
+                newListItem3.textContent = this.Inspect[i].left[j].item_name;
850
+                newListItem4.textContent = this.Inspect[i].left[j].inspect_value;
851
+                child2.appendChild(newListItem3);
852
+                child2.appendChild(newListItem4);
853
+              }
854
+              for(let x in this.Inspect[i].right){
855
+                let newListItem5 = document.createElement('span');
856
+                newListItem5.style.cssText= 'width: 50%;display: inline-block;padding: 5px 0;border-right: 1px solid black;border-bottom: 1px solid black;'
857
+                let newListItem6 = document.createElement('span');
858
+                newListItem6.style.cssText= 'width: 50%;display: inline-block;padding: 5px 0;border-bottom: 1px solid black;'
859
+                newListItem5.textContent = this.Inspect[i].right[x].item_name;
860
+                newListItem6.textContent = this.Inspect[i].right[x].inspect_value;
861
+                child3.appendChild(newListItem5);
862
+                child3.appendChild(newListItem6);
863
+              }
864
+              jiancDoc.appendChild(newList1)
865
+            }
866
+          }
867
+          var newListArr =[]
868
+          for(let j in this.longAdvice){
869
+            const obj={
870
+              id:this.longAdvice[j].id,
871
+              newlist:'newList'+j
872
+            }
873
+            newListArr.push(obj) 
874
+          }
875
+          for(let i in this.longAdvice){
876
+            for(let j in newListArr){
877
+              if(this.longAdvice[i].id==newListArr[j].id){
878
+                let newList = document.createElement('p');
879
+                newList.style.cssText='display: flex;text-align: center;border-bottom: 1px solid black;';
880
+                let newListItem1 = document.createElement('span');
881
+                newListItem1.style.cssText= 'width: 30%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
882
+                let newListItem2 = document.createElement('span');
883
+                newListItem2.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
884
+                let newListItem3 = document.createElement('span');
885
+                newListItem3.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
886
+                let newListItem4 = document.createElement('span');
887
+                newListItem4.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
888
+                let newListItem5 = document.createElement('span');
889
+                newListItem5.style.cssText= 'width: 20%;display: inline-block;padding: 5px 0;border-right: 1px solid black;'
890
+                let newListItem6 = document.createElement('span');
891
+                newListItem6.style.cssText= 'width: 10%;display: inline-block;padding: 5px 0;'
892
+                newListItem1.textContent = this.longAdvice[i].advice_name;
893
+                newListItem2.textContent = this.longAdvice[i].advice_type_name;
894
+                newListItem3.textContent = this.getTime(this.longAdvice[i].start_time)
895
+                newListItem4.textContent = this.longAdvice[i].single_dose +this.longAdvice[i].single_dose_unit ;
896
+                newListItem5.textContent = this.longAdvice[i].execution_frequency;
897
+                newListItem6.textContent = this.longAdvice[i].stop_state_name;
898
+                newList.appendChild(newListItem1);
899
+                newList.appendChild(newListItem2);
900
+                newList.appendChild(newListItem3);
901
+                newList.appendChild(newListItem4);
902
+                newList.appendChild(newListItem5);
903
+                newList.appendChild(newListItem6);
904
+                iframeDoc.appendChild(newList)
905
+              }
906
+            }
907
+          }
908
+        })
909
+        this.new_content = this.textcontent
910
+        this.$refs.editor.contents = this.new_content
673 911
 
674
-        // this.$nextTick(()=>{
675
-          const iframeDoc = document.getElementsByClassName('edui-editor-iframeholder')[0].getElementsByTagName('iframe')[0].contentDocument.getElementsByTagName('tbody')[0].children[9].children[1]
912
+        this.$nextTick(()=>{
913
+          const iframeDoc1 = document.getElementsByClassName('edui-editor-iframeholder')[0].getElementsByTagName('iframe')[0].contentDocument.getElementsByTagName('tbody')[0].children[9].children[1]
676 914
 
677
-          const jiancDoc = document.getElementsByClassName('edui-editor-iframeholder')[0].getElementsByTagName('iframe')[0].contentDocument.getElementsByTagName('tbody')[0].children[8].children[1]
678
-          jiancDoc.getElementsByTagName('br')[0].remove()
679
-          jiancDoc.style.cssText='padding: 0'
915
+          const jiancDoc1 = document.getElementsByClassName('edui-editor-iframeholder')[0].getElementsByTagName('iframe')[0].contentDocument.getElementsByTagName('tbody')[0].children[8].children[1]
916
+          jiancDoc1.getElementsByTagName('br')[0].remove()
917
+          jiancDoc1.style.cssText='padding: 0'
680 918
             if(this.Inspect.length<1){
681 919
               let newList2 = document.createElement('p');
682 920
               newList2.style.cssText = 'padding: 5px;'
@@ -709,7 +947,7 @@
709 947
                   newList.appendChild(newListItem4);
710 948
                   newList.appendChild(newListItem5);
711 949
                   newList.appendChild(newListItem6);
712
-                  jiancDoc.appendChild(newList)
950
+                  jiancDoc1.appendChild(newList)
713 951
               for(let i in this.Inspect){
714 952
                 let newList1 = document.createElement('p');
715 953
                 const child1 = document.createElement('p')
@@ -751,22 +989,22 @@
751 989
                   child3.appendChild(newListItem5);
752 990
                   child3.appendChild(newListItem6);
753 991
                 }
754
-                jiancDoc.appendChild(newList1)
992
+                jiancDoc1.appendChild(newList1)
755 993
               }
756 994
             }
757 995
 
758 996
 
759
-          var newListArr =[]
997
+          var newListArr2 =[]
760 998
           for(let j in this.longAdvice){
761 999
             const obj={
762 1000
               id:this.longAdvice[j].id,
763 1001
               newlist:'newList'+j
764 1002
             }
765
-            newListArr.push(obj)
1003
+            newListArr2.push(obj)
766 1004
           }
767 1005
           for(let i in this.longAdvice){
768
-            for(let j in newListArr){
769
-              if(this.longAdvice[i].id==newListArr[j].id){
1006
+            for(let j in newListArr2){
1007
+              if(this.longAdvice[i].id==newListArr2[j].id){
770 1008
                 let newList = document.createElement('p');
771 1009
                 newList.style.cssText='display: flex;text-align: center;border-bottom: 1px solid black;';
772 1010
                 let newListItem1 = document.createElement('span');
@@ -793,16 +1031,14 @@
793 1031
                 newList.appendChild(newListItem4);
794 1032
                 newList.appendChild(newListItem5);
795 1033
                 newList.appendChild(newListItem6);
796
-                iframeDoc.appendChild(newList)
1034
+                iframeDoc1.appendChild(newList)
797 1035
               }
798 1036
             }
799 1037
           }
800
-        // })
801
-
802
-
1038
+        })
803 1039
          this.AuToShow = true
804 1040
 
805
-      //  this.getAutoPatientContent()
1041
+
806 1042
       },
807 1043
       // 本周
808 1044
       getFirstDayOfWeek(date){
@@ -1291,6 +1527,12 @@
1291 1527
         this.$refs.editor.contents = this.new_content
1292 1528
       }
1293 1529
     },
1530
+    beforeMount(){
1531
+      
1532
+    },
1533
+    mounted(){
1534
+
1535
+    }
1294 1536
 
1295 1537
   }
1296 1538
 </script>