ソースを参照

9月11日杨青

杨青 1 年間 前
コミット
107e7fc4f7
共有1 個のファイルを変更した69 個の追加18 個の削除を含む
  1. 69 18
      src/xt_pages/user/Sitemap.vue

+ 69 - 18
src/xt_pages/user/Sitemap.vue ファイルの表示

@@ -245,12 +245,46 @@
245 245
     <el-dialog
246 246
       title="打印"
247 247
       :visible.sync="dayinDialogVisible"
248
-      width="30%"
248
+      width="50%"
249 249
       center>
250
-      <span></span>
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>
251 285
       <span slot="footer" class="dialog-footer">
252 286
         <el-button @click="dayinDialogVisible = false">取 消</el-button>
253
-        <el-button type="primary" @click="dayinDialogVisible = false">确 定</el-button>
287
+        <el-button type="primary" @click="dayin">确 定</el-button>
254 288
       </span>
255 289
     </el-dialog>
256 290
   </div>
@@ -260,7 +294,8 @@ import print from "print-js";
260 294
 import { getFileExtension} from '@/utils/tools'
261 295
 import { saveSitemap,getPatientSitemap,updateSiteMap } from "@/api/patient";
262 296
 import { getToken } from '@/api/qiniu'
263
-// import html2canvas from "html2canvas"
297
+const moment = require('moment')
298
+import html2canvas from "html2canvas"
264 299
 export default{
265 300
   components:{
266 301
     // quillEditor
@@ -272,6 +307,7 @@ export default{
272 307
       centerDialogVisible: false,
273 308
       imgDialogVisible:false,
274 309
       shiyituDialogVisible:false,
310
+      dayinDialogVisible:false,
275 311
       imgUrl:[],
276 312
       
277 313
       fangxiangA:[{markNum:'',left:'',top:''}],//a端进针方向的数组
@@ -304,12 +340,8 @@ export default{
304 340
       obj_a:{a_markNum:'',a_left:'',a_top:''},//助辅工具a的对象
305 341
       obj_v:{v_markNum:'',v_left:'',v_top:''},//助辅工具v的对象
306 342
 
307
-      // A_left:390,
308
-      // A_top:180,
309 343
       a_num:1,//控制a端是否显示和高亮
310 344
 
311
-      // V_left:0,
312
-      // V_top:0
313 345
       v_num:1,//控制v端是否显示和高亮
314 346
 
315 347
       text_arr:[],//文本框
@@ -344,25 +376,24 @@ export default{
344 376
       {markNum:'6',v_num:'1'},{markNum:'7',v_num:'1'},{markNum:'8',v_num:'1'},{markNum:'9',v_num:'1'},
345 377
       {markNum:'10',v_num:'1'},{markNum:'11',v_num:'1'},{markNum:'12',v_num:'1'}],
346 378
 
347
-      // fangxiangA:[{markNum:'A',left:'400',top:'78',fangxiangA_num:1}],
348
-      // fangxiangV:[{markNum:'V',left:'100',top:'78'}],
349
-      // fuzhuA:[{a_markNum:'A',a_left:'360',a_top:'56',xuanzhuan_a:0,scalea_num:1}],
350
-      // fuzhuV:[{a_markNum:'V',v_left:'56',v_top:'56',xuanzhuan_v:0,scalev_num:1}],
351 379
       patientID:0,
352 380
       id:0,
353 381
       texts:null,
354
-      value:'',
355 382
       imgUrls:'',
383
+      patients:{},
384
+      date:moment(new Date()).format("YYYY-MM-DD"),
356 385
     }
357 386
   },
358 387
   created(){
388
+    
359 389
     const id = this.$route.params && this.$route.params.id;
360 390
     this.patientID = parseInt(id);
361
-
391
+   
362 392
     // this.getPatientSitemap(this.patientID)
363 393
   },
364 394
   mounted(){
365 395
     console.log('asdfdfgfd',this.value);
396
+    console.log('333333',this.date);
366 397
   },
367 398
   methods:{
368 399
     add(){
@@ -739,13 +770,20 @@ export default{
739 770
       }
740 771
     },
741 772
     printtup(){
773
+      if(this.id==0){
774
+        this.$message('请先保存');
775
+      }else{
776
+      this.dayinDialogVisible = true
777
+      }
742 778
       html2canvas(this.$refs.imageWrapper,{backgroundColor: null}).then(canvas => {
743 779
         // 转成图片,生成图片地址
744 780
         this.imgUrls = canvas.toDataURL("image/png");
745
-        console.log('123424534',this.imgUrls)
781
+        // console.log('123424534',this.imgUrls)
746 782
       });
747
-      // 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;}}}'
748
-      // // 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;}
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;}
749 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;}
750 788
       // // .mark-target-a{background: #E73535;top: 40px;left: 40px;} .mark-line{background: #E73535;}}}'
751 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;}}}}'
@@ -758,6 +796,18 @@ export default{
758 796
       // });
759 797
       
760 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;}}'
803
+      printJS({
804
+        printable: "print_img",
805
+        type: "html",
806
+        style: style,
807
+        scanStyles: false
808
+      });
809
+      this.dayinDialogVisible = false
810
+    },
761 811
     imgv_click(){
762 812
       if(this.img_v==false){
763 813
         console.log('asdfas2222');
@@ -1056,7 +1106,8 @@ export default{
1056 1106
             var sitemap = response.data.data.sitemap
1057 1107
             console.log('idzhesdfasd',sitemap);
1058 1108
             var patients = response.data.data.patients
1059
-            console.log("患者信息",patients)
1109
+            this.patients=patients
1110
+            console.log("患者信息",this.patients.name)
1060 1111
             if(sitemap.id>0){
1061 1112
               if(sitemap.is_append == 1){
1062 1113
               this.is_append =true