Sfoglia il codice sorgente

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 1 anno fa
parent
commit
5f174290c5
1 ha cambiato i file con 123 aggiunte e 52 eliminazioni
  1. 123 52
      src/xt_pages/user/Sitemap.vue

+ 123 - 52
src/xt_pages/user/Sitemap.vue Vedi File

@@ -18,8 +18,8 @@
18 18
         </div>
19 19
       </div>
20 20
       <div style="margin-top:6px;display:flex;flex-wrap: wrap;position:relative;min-height:480px;">
21
-        <div style="width:47%;border:1px solid #ddd;padding: 5px;" id="print_mark_img" ref="imageWrapper">
22
-          <div id="point_mark_img_wrap1" class="print_main_content" style="width: 100%;padding: 0;border: 0;" >
21
+        <div style="width:47%;border:1px solid #ddd;padding: 5px;" id="print_mark_img" >
22
+          <div id="point_mark_img_wrap1" class="print_main_content" style="width: 100%;padding: 0;border: 0;" ref="imageWrapper">
23 23
 
24 24
             <img v-if="fileList.length==0" id="ossPointMarkImg" src="@/assets/evaluate/xgtl_default.png" alt="" srcset="">
25 25
             <img v-if="fileList.length>0" id="ossPointMarkImg" :src="fileList[0].img_url" alt="" srcset="">
@@ -65,9 +65,11 @@
65 65
               > 
66 66
                 <!-- <div  style="width:82px;left:62.17%;top:39.00%;display: inline-block;" @mousedown="A_mousedow($event)" @mouseup="A_moouseup($event)">position: 'absolute',top: 36+'%',left: 48+'%' -->
67 67
                   <!-- {{ item }} @mousedown.self="A_mousedow($event)" @mouseup.self="A_moouseup($event)"-->
68
-                  <!-- <el-input v-model="item.text" size="mini" :style="{width:item.width+'px', border: 1+'px solid transparent', cursor: 'default'}"></el-input> -->
69
-                  <input id="inpu" type="text" v-bind:value="item.text" data-width="82" :style="{width:item.width+'px', border: 1+'px solid transparent', cursor: 'default',outline: 'none'}" class="mark-text-ipt">
70
-                <!-- </div> -->
68
+                  <!-- <el-input v-model:value="item.text" size="mini" :style="{width:item.width+'px', border: 1+'px solid transparent', cursor: 'default'}"></el-input> -->
69
+                  <!-- <input id="inpu" type="text" :value="item.text" data-width="82" :style="{width:item.width+'px', border: 1+'px solid transparent', cursor: 'default',outline: 'none'}" class="mark-text-ipt"> -->
70
+                  <input id="inpu" type="text" v-model="item.text" data-width="82" :style="{width:item.width+'px', border: 1+'px solid transparent', cursor: 'default',outline: 'none'}" class="mark-text-ipt">
71
+                  <!-- <input v-if="value!=''" id="inpu" type="text" v-model="value" data-width="82" :style="{width:item.width+'px', border: 1+'px solid transparent', cursor: 'default',outline: 'none'}" class="mark-text-ipt"> -->
72
+                  <!-- </div> -->
71 73
                 <span class="remove-mark-text" @click="input_deldte($event,item)">×</span>
72 74
                  <span class="mark-text-line" style="transform: rotate(45deg);" data-rotate="45"></span>
73 75
               </div>
@@ -239,6 +241,52 @@
239 241
         <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
240 242
       </span> -->
241 243
     </el-dialog>
244
+    <!-- 打印 -->
245
+    <el-dialog
246
+      title="打印"
247
+      :visible.sync="dayinDialogVisible"
248
+      width="50%"
249
+      center>
250
+      <div>
251
+        <div id="print_img">
252
+          <div class="parint_content">
253
+            <!-- <div> -->
254
+              <div style="text-align: center;font-size:17;margin-bottom: 10px;">血液透析位点图</div>
255
+              <div style="display: flex;border-bottom: 1px solid black;padding: 5px;">
256
+                <div style="width: 200px;">患者姓名:{{ patients.name }}</div>
257
+                <div style="width: 200px;">透析号:{{ patients.dialysis_no }}</div>
258
+                <div style="width: 200px;">住院(门诊)号:{{ patients.admission_number }}</div>
259
+                <div style="width: 200px;">打印时间:{{date}}</div>
260
+              </div>
261
+              
262
+              <div style="width: 530px;margin: 20px auto;">
263
+                <img :src="imgUrls" alt="" srcset="">
264
+                <!-- <img v-if="fileList.length==0" id="ossPointMarkImg" src="@/assets/evaluate/xgtl_default.png" alt="" srcset="">
265
+                <div v-for="(item,indexa) in Aarr" :key="indexa">
266
+                  <div v-if="item.status==2" title="长按右键调整线条角度" class="mark-target mark-target-a mark-target-a1" data-num="1" id="mark-target-a"
267
+                      :style="{left:item.left+'px', top:item.top+'px', cursor: 'move',position: 'absolute'}"
268
+                      @mousedown.self="A_mousedow($event)" @mouseup.self="A_moouseup($event)">{{item.markNum}}
269
+                    <span class="mark-line mark-line-a" style="transform: rotate(160deg);" data-rotate="160"></span>
270
+                  </div>
271
+                </div>
272
+
273
+                <div v-for="(item,indexv) in Varr" :key="indexv">
274
+                  <div v-if="item.status==2" title="长按右键调整线条角度" class="mark-target mark-target-v mark-target-v1" data-num="1" id="mark-target-v"
275
+                        :style="{left: item.left+'px', top: item.top+'px', cursor: 'move', position: 'absolute'}"
276
+                        @mousedown="A_mousedow($event)" @mouseup="A_moouseup($event)">{{item.markNum}}
277
+                    <span class="mark-line mark-line-v" style="transform: rotate(20deg);" data-rotate="20"></span>
278
+                  </div>
279
+                </div> -->
280
+              </div>
281
+            <!-- </div> -->
282
+          </div>
283
+        </div>
284
+      </div>
285
+      <span slot="footer" class="dialog-footer">
286
+        <el-button @click="dayinDialogVisible = false">取 消</el-button>
287
+        <el-button type="primary" @click="dayin">确 定</el-button>
288
+      </span>
289
+    </el-dialog>
242 290
   </div>
243 291
 </template>
244 292
 <script>
@@ -246,6 +294,8 @@ import print from "print-js";
246 294
 import { getFileExtension} from '@/utils/tools'
247 295
 import { saveSitemap,getPatientSitemap,updateSiteMap } from "@/api/patient";
248 296
 import { getToken } from '@/api/qiniu'
297
+const moment = require('moment')
298
+import html2canvas from "html2canvas"
249 299
 export default{
250 300
   components:{
251 301
     // quillEditor
@@ -257,6 +307,7 @@ export default{
257 307
       centerDialogVisible: false,
258 308
       imgDialogVisible:false,
259 309
       shiyituDialogVisible:false,
310
+      dayinDialogVisible:false,
260 311
       imgUrl:[],
261 312
       
262 313
       fangxiangA:[{markNum:'',left:'',top:''}],//a端进针方向的数组
@@ -289,12 +340,8 @@ export default{
289 340
       obj_a:{a_markNum:'',a_left:'',a_top:''},//助辅工具a的对象
290 341
       obj_v:{v_markNum:'',v_left:'',v_top:''},//助辅工具v的对象
291 342
 
292
-      // A_left:390,
293
-      // A_top:180,
294 343
       a_num:1,//控制a端是否显示和高亮
295 344
 
296
-      // V_left:0,
297
-      // V_top:0
298 345
       v_num:1,//控制v端是否显示和高亮
299 346
 
300 347
       text_arr:[],//文本框
@@ -329,24 +376,24 @@ export default{
329 376
       {markNum:'6',v_num:'1'},{markNum:'7',v_num:'1'},{markNum:'8',v_num:'1'},{markNum:'9',v_num:'1'},
330 377
       {markNum:'10',v_num:'1'},{markNum:'11',v_num:'1'},{markNum:'12',v_num:'1'}],
331 378
 
332
-      // fangxiangA:[{markNum:'A',left:'400',top:'78',fangxiangA_num:1}],
333
-      // fangxiangV:[{markNum:'V',left:'100',top:'78'}],
334
-      // fuzhuA:[{a_markNum:'A',a_left:'360',a_top:'56',xuanzhuan_a:0,scalea_num:1}],
335
-      // fuzhuV:[{a_markNum:'V',v_left:'56',v_top:'56',xuanzhuan_v:0,scalev_num:1}],
336 379
       patientID:0,
337 380
       id:0,
338 381
       texts:null,
339
-      value:'',
382
+      imgUrls:'',
383
+      patients:{},
384
+      date:moment(new Date()).format("YYYY-MM-DD"),
340 385
     }
341 386
   },
342 387
   created(){
388
+    
343 389
     const id = this.$route.params && this.$route.params.id;
344 390
     this.patientID = parseInt(id);
345
-
391
+   
346 392
     // this.getPatientSitemap(this.patientID)
347 393
   },
348 394
   mounted(){
349
-    console.log('asdfdfgfd',this.fangxiangA);
395
+    console.log('asdfdfgfd',this.value);
396
+    console.log('333333',this.date);
350 397
   },
351 398
   methods:{
352 399
     add(){
@@ -517,7 +564,7 @@ export default{
517 564
     mousedown(e){
518 565
       const tet=document.getElementsByClassName('text')
519 566
       var textlen=this.text_arr
520
-      console.log('ZXCBVCB',textlen,e.target.value);
567
+      console.log('ZXCBVCB',textlen,'33333',this.value);
521 568
       const even= e.target.value
522 569
       // console.log('zxcvbnvxcz',even);
523 570
       for(let i=0;i<tet.length;i++){
@@ -551,7 +598,6 @@ export default{
551 598
         }
552 599
       }
553 600
     },
554
-
555 601
     fuzhuA_down(e){
556 602
       const fuzhuA= document.getElementById('jinzhen-jiaodu-target-A')
557 603
       const fuzhua_x =e.clientX - fuzhuA.offsetLeft
@@ -604,7 +650,7 @@ export default{
604 650
       }
605 651
     },
606 652
     punctureclick(e,val){
607
-      console.log('event',e,'value',val);
653
+      console.log('event',e,'value',this.value);
608 654
       const text=e.target
609 655
       const textlen=this.text_arr.length
610 656
 
@@ -724,19 +770,43 @@ export default{
724 770
       }
725 771
     },
726 772
     printtup(){
727
-      const style='@media print{.print_main_content{#ossPointMarkImg {width: 520px;min-height: 600px;height: auto;border-radius: 2px;pointer-events: none;} #point_mark_img_wrap1 {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;position: relative;padding: 4px;width: 600px;background-color: #fff;border: 1px solid #ddd;border-radius: 4px;} .mark-target-a{background: #E73535;top: 40px; left: 40px;} .mark-line{background: #E73535;} .mark-target-v{background: rgb(53,162,231);.mark-line{background: #35A2E7;}}  .mark-target-a,.mark-target-v {position: absolute;z-index: 1001;width: 26px;border-radius: 13px;height: 26px;text-align: center;line-height: 26px;font-size: 18px;cursor: move;color: rgb(255,255,255);.mark-line {transform: rotate(160deg);transform-origin: left bottom;}.mark-line {display: inline-block;position: absolute;left: 50%;top: 50%;width: 86px;height: 1px;cursor: default;z-index: -1;} div.add-mark-text-wrap {position: absolute;top: 36%;left: 48%;border-radius: 4px;width: 60px;height: 24px;line-height: 24px;z-index: 1005;display: inline-block;} .remove-mark-text{overflow: hidden;} b.xtgl-ccz-arrow-a {border-left-color: #E73535;border-top-color: #E73535;} b.xtgl-ccz-arrow-v {border-left-color: #35a2e7;border-top-color: #35a2e7;} b.xtgl-ccz-arrow {position: absolute;width: 7px;height: 7px;border-left-width: 2px;border-left-style: solid;border-top-width: 2px;border-top-style: solid;top: -3px;right: 0;transform: rotate(138deg);} b.xtgl-ccz-arrow-v {border-left-color: #35a2e7;border-top-color: #35a2e7;}div.frame-image {position: absolute;overflow: hidden;top: 0px;left: 0px;width: 100%;height: 100%;background-image: url('+'../../assets/evaluate/tool-a.png'+');background-position: center center;background-size: 100%; background-repeat: no-repeat;}}}'
728
-      // const style='@media print{.print_main_content{#ossPointMarkImg {width: 100%;min-height: 600px;height: auto;border-radius: 2px;pointer-events: none;} #point_mark_img_wrap1 {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;position: relative;padding: 4px;width: 600px;background-color: #fff;border: 1px solid #ddd;border-radius: 4px;}  b.xtgl-ccz-arrow-a {border-left-color: #E73535;border-top-color: #E73535;}
729
-      // b.xtgl-ccz-arrow {position: absolute;width: 7px;height: 7px;border-left-width: 2px;border-left-style: solid;border-top-width: 2px;border-top-style: solid;top: -3px;right: 0;transform: rotate(138deg);} b.xtgl-ccz-arrow-v {border-left-color: #35a2e7;border-top-color: #35a2e7;}
730
-      // .mark-target-a{background: #E73535;top: 40px;left: 40px;} .mark-line{background: #E73535;}}}'
731
-      // const style='@media print{.print_main_content{#ossPointMarkImg {width: 100%;min-height: 600px;height: auto;border-radius: 2px;pointer-events: none;} #point_mark_img_wrap1 {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;position: relative;padding: 4px;width: 600px;background-color: #fff;border: 1px solid #ddd;border-radius: 4px;} .mark-target-a{background: #E73535;top: 40px; left: 40px;} .mark-line{background: #E73535;} .mark-target-v{background: rgb(53,162,231);.mark-line{background: #35A2E7;}}  .mark-target-a,.mark-target-v {position: absolute;z-index: 1001;width: 26px;border-radius: 13px;height: 26px;text-align: center;line-height: 26px;font-size: 18px;cursor: move;color: rgb(255,255,255);.mark-line {transform: rotate(160deg);transform-origin: left bottom;}.mark-line {display: inline-block;position: absolute;left: 50%;top: 50%;width: 86px;height: 1px;cursor: default;z-index: -1;} div.add-mark-text-wrap {position: absolute;top: 36%;left: 48%;border-radius: 4px;width: 60px;height: 24px;line-height: 24px;z-index: 1005;display: inline-block;} input {width: 100px;width: 60px;max-width: 400px;border: 1px solid transparent;padding: 4px;color: #333;height: 24px;cursor: pointer;background-color: #fcfcfc;position: absolute;left: 0;top: 0;font-size: 13px;z-index: 1002;border-radius: 2px !important;outline: none;}.mark-text-ipt {cursor: default;}}}}'
732
-
773
+      if(this.id==0){
774
+        this.$message('请先保存');
775
+      }else{
776
+      this.dayinDialogVisible = true
777
+      }
778
+      html2canvas(this.$refs.imageWrapper,{backgroundColor: null}).then(canvas => {
779
+        // 转成图片,生成图片地址
780
+        this.imgUrls = canvas.toDataURL("image/png");
781
+        // console.log('123424534',this.imgUrls)
782
+      });
783
+      // const style='@media print{.print_main_content{#ossPointMarkImg {width: 520px;min-height: 600px;height: auto;border-radius: 2px;pointer-events: none;} #point_mark_img_wrap1 {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;position: relative;padding: 4px;width: 600px;background-color: #fff;border: 1px solid #ddd;border-radius: 4px;} 
784
+       
785
+      // div.add-mark-text-wrap {position: absolute;top: 36%;left: 48%;border-radius: 4px;width: 60px;height: 24px;line-height: 24px;z-index: 1005;display: inline-block;} .remove-mark-text{overflow: hidden;} b.xtgl-ccz-arrow-a {border-left-color: #E73535;border-top-color: #E73535;} b.xtgl-ccz-arrow-v {border-left-color: #35a2e7;border-top-color: #35a2e7;} b.xtgl-ccz-arrow {position: absolute;width: 7px;height: 7px;border-left-width: 2px;border-left-style: solid;border-top-width: 2px;border-top-style: solid;top: -3px;right: 0;transform: rotate(138deg);} b.xtgl-ccz-arrow-v {border-left-color: #35a2e7;border-top-color: #35a2e7;}div.frame-image {position: absolute;overflow: hidden;top: 0px;left: 0px;width: 100%;height: 100%;background-image: url('+'../../assets/evaluate/tool-a.png'+');background-position: center center;background-size: 100%; background-repeat: no-repeat;}}}'
786
+      // // // const style='@media print{.print_main_content{#ossPointMarkImg {width: 100%;min-height: 600px;height: auto;border-radius: 2px;pointer-events: none;} #point_mark_img_wrap1 {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;position: relative;padding: 4px;width: 600px;background-color: #fff;border: 1px solid #ddd;border-radius: 4px;}  b.xtgl-ccz-arrow-a {border-left-color: #E73535;border-top-color: #E73535;}
787
+      // // b.xtgl-ccz-arrow {position: absolute;width: 7px;height: 7px;border-left-width: 2px;border-left-style: solid;border-top-width: 2px;border-top-style: solid;top: -3px;right: 0;transform: rotate(138deg);} b.xtgl-ccz-arrow-v {border-left-color: #35a2e7;border-top-color: #35a2e7;}
788
+      // // .mark-target-a{background: #E73535;top: 40px;left: 40px;} .mark-line{background: #E73535;}}}'
789
+      // // const style='@media print{.print_main_content{#ossPointMarkImg {width: 100%;min-height: 600px;height: auto;border-radius: 2px;pointer-events: none;} #point_mark_img_wrap1 {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;position: relative;padding: 4px;width: 600px;background-color: #fff;border: 1px solid #ddd;border-radius: 4px;} .mark-target-a{background: #E73535;top: 40px; left: 40px;} .mark-line{background: #E73535;} .mark-target-v{background: rgb(53,162,231);.mark-line{background: #35A2E7;}}  .mark-target-a,.mark-target-v {position: absolute;z-index: 1001;width: 26px;border-radius: 13px;height: 26px;text-align: center;line-height: 26px;font-size: 18px;cursor: move;color: rgb(255,255,255);.mark-line {transform: rotate(160deg);transform-origin: left bottom;}.mark-line {display: inline-block;position: absolute;left: 50%;top: 50%;width: 86px;height: 1px;cursor: default;z-index: -1;} div.add-mark-text-wrap {position: absolute;top: 36%;left: 48%;border-radius: 4px;width: 60px;height: 24px;line-height: 24px;z-index: 1005;display: inline-block;} input {width: 100px;width: 60px;max-width: 400px;border: 1px solid transparent;padding: 4px;color: #333;height: 24px;cursor: pointer;background-color: #fcfcfc;position: absolute;left: 0;top: 0;font-size: 13px;z-index: 1002;border-radius: 2px !important;outline: none;}.mark-text-ipt {cursor: default;}}}}'
790
+
791
+      // printJS({
792
+      //   printable: "print_mark_img",
793
+      //   type: "html",
794
+      //   style: style,
795
+      //   scanStyles: false
796
+      // });
797
+      
798
+    },
799
+    // 打印
800
+    dayin(){
801
+      
802
+      const style='@media print{.parint_content{width:960px;} #ossPointMarkImg {width: 520px;min-height: 600px;height: auto;border-radius: 2px;pointer-events: none;} .mark-target-a{background: #E73535;top: 40px; left: 40px;} .mark-line{background: #E73535;} .mark-target-v{background: rgb(53,162,231);.mark-line{background: #35A2E7;}}  .mark-target-a,.mark-target-v {position: absolute;z-index: 1001;width: 26px;border-radius: 13px;height: 26px;text-align: center;line-height: 26px;font-size: 18px;cursor: move;color: rgb(255,255,255);.mark-line {transform: rotate(160deg);transform-origin: left bottom;}.mark-line {display: inline-block;position: absolute;left: 50%;top: 50%;width: 86px;height: 1px;cursor: default;z-index: -1;}}'
733 803
       printJS({
734
-        printable: "print_mark_img",
804
+        printable: "print_img",
735 805
         type: "html",
736 806
         style: style,
737 807
         scanStyles: false
738 808
       });
739
-      
809
+      this.dayinDialogVisible = false
740 810
     },
741 811
     imgv_click(){
742 812
       if(this.img_v==false){
@@ -1036,7 +1106,8 @@ export default{
1036 1106
             var sitemap = response.data.data.sitemap
1037 1107
             console.log('idzhesdfasd',sitemap);
1038 1108
             var patients = response.data.data.patients
1039
-            console.log("患者信息",patients)
1109
+            this.patients=patients
1110
+            console.log("患者信息",this.patients.name)
1040 1111
             if(sitemap.id>0){
1041 1112
               if(sitemap.is_append == 1){
1042 1113
               this.is_append =true
@@ -1425,34 +1496,34 @@ div.add-mark-text-wrap {
1425 1496
   line-height: 24px;
1426 1497
   z-index: 1005;
1427 1498
   display: inline-block;
1428
-  .el-input {
1429
-    /* position: relative; */
1430
-    font-size: 14px;
1431
-    display: inline-block;
1432
-    width: 100%;
1433
-  }
1499
+  // .el-input {
1500
+  //   /* position: relative; */
1501
+  //   font-size: 14px;
1502
+  //   display: inline-block;
1503
+  //   width: 100%;
1504
+  // }
1505
+  .input{
1506
+  width: 224px;
1507
+  height: 40px;
1508
+  line-height: 40px;
1509
+  background: #F3F6FB;
1510
+  border-radius: 4px;
1511
+  padding:0  12px;
1512
+  margin-right: 20px;
1513
+}
1514
+.input ::v-deep .el-input__inner {
1515
+  width: 100%;
1516
+  border: none;
1517
+  outline: none;
1518
+  font-size: 14px;
1519
+  background: #F3F6FB;
1520
+}
1521
+
1434 1522
 }
1435 1523
 div.add-mark-text-wrap input.mark-text-ipt {
1436 1524
     cursor: default;
1437 1525
 }
1438
-// div.add-mark-text-wrap input {
1439
-//     width: 100px;
1440
-//     width: 60px;
1441
-//     max-width: 400px;
1442
-//     border: 1px solid transparent;
1443
-//     padding: 4px;
1444
-//     color: #333;
1445
-//     height: 24px;
1446
-//     cursor: pointer;
1447
-//     background-color: #fcfcfc;
1448
-//     // position: absolute;
1449
-//     // left: 0;
1450
-//     // top: 0;
1451
-//     font-size: 13px;
1452
-//     z-index: 1002;
1453
-//     border-radius: 2px !important;
1454
-//     outline: none;
1455
-// }
1526
+
1456 1527
 input, button, textarea, select, optgroup, option {
1457 1528
     font-family: inherit;
1458 1529
     font-size: inherit;