Browse Source

新分支

28169 1 year ago
parent
commit
bdbaf7fcee

+ 17 - 17
src/xt_pages/dialysis/dialysisPrintOrder.vue View File

1311
           >
1311
           >
1312
           </DialysisPrintOrderSixtyeight>
1312
           </DialysisPrintOrderSixtyeight>
1313
 
1313
 
1314
-          <DialysisPrintOrderZero
1314
+          <!-- <DialysisPrintOrderZero
1315
             v-bind:childResponse="childResponse"
1315
             v-bind:childResponse="childResponse"
1316
             v-if="org_template_info.template_id == 199"
1316
             v-if="org_template_info.template_id == 199"
1317
           >
1317
           >
1318
-          </DialysisPrintOrderZero>
1318
+          </DialysisPrintOrderZero> -->
1319
         </div>
1319
         </div>
1320
       </el-container>
1320
       </el-container>
1321
     </div>
1321
     </div>
2032
           style: style12,
2032
           style: style12,
2033
           scanStyles: false,
2033
           scanStyles: false,
2034
         });
2034
         });
2035
-        console.log("printjswowoowowowwoow",style12)
2035
+       
2036
 
2036
 
2037
       }else if (this.org_template_info.template_id == 65 || this.org_template_info.template_id == 6) {
2037
       }else if (this.org_template_info.template_id == 65 || this.org_template_info.template_id == 6) {
2038
         printJS({
2038
         printJS({
2058
           style: style2,
2058
           style: style2,
2059
           scanStyles: false,
2059
           scanStyles: false,
2060
         });
2060
         });
2061
-        console.log('77777',this.org_template_info.template_id);
2061
+        // console.log('77777',this.org_template_info.template_id);
2062
       }
2062
       }
2063
       else if (
2063
       else if (
2064
         this.org_template_info.template_id == 53
2064
         this.org_template_info.template_id == 53
2227
           scanStyles: false,
2227
           scanStyles: false,
2228
         });
2228
         });
2229
       } else if (this.org_template_info.template_id == 53 ) {
2229
       } else if (this.org_template_info.template_id == 53 ) {
2230
-        console.log("进来233232323232")
2230
+       
2231
         printJS({
2231
         printJS({
2232
           printable: "dialysis-print-box-1-2",
2232
           printable: "dialysis-print-box-1-2",
2233
           type: "html",
2233
           type: "html",
2241
           style: style12,
2241
           style: style12,
2242
           scanStyles: false,
2242
           scanStyles: false,
2243
         });
2243
         });
2244
-        console.log("printjswowoowowowwoow",style12)
2244
+       
2245
 
2245
 
2246
       }
2246
       }
2247
     },
2247
     },
2281
       return name;
2281
       return name;
2282
     },
2282
     },
2283
     setAdminUserES(id) {
2283
     setAdminUserES(id) {
2284
-      console.log(id);
2284
+      // console.log(id);
2285
       if (id == 0) {
2285
       if (id == 0) {
2286
         return "";
2286
         return "";
2287
       }
2287
       }
2303
       getDialysisRecord(this.queryParams).then((response) => {
2303
       getDialysisRecord(this.queryParams).then((response) => {
2304
         if (response.data.state == 1) {
2304
         if (response.data.state == 1) {
2305
           this.childResponse = response;
2305
           this.childResponse = response;
2306
-          console.log('this.org_template_info是数据',response.data.data.org_template_info.template_id);
2306
+          // console.log('this.org_template_info是数据',response.data.data.org_template_info.template_id);
2307
           this.org_template_info = response.data.data.org_template_info;
2307
           this.org_template_info = response.data.data.org_template_info;
2308
           this.loading = false;
2308
           this.loading = false;
2309
           //   this.adminUser = response.data.data.users
2309
           //   this.adminUser = response.data.data.users
2730
       });
2730
       });
2731
     },
2731
     },
2732
     changePatient(schedual) {
2732
     changePatient(schedual) {
2733
-      console.log(schedual);
2733
+      // console.log(schedual);
2734
       var xtdate = parseTime(schedual.schedule_date, "{y}-{m}-{d}");
2734
       var xtdate = parseTime(schedual.schedule_date, "{y}-{m}-{d}");
2735
       this.$router.push(
2735
       this.$router.push(
2736
         "/dialysis/print?xtdate=" +
2736
         "/dialysis/print?xtdate=" +
2757
     getData() {
2757
     getData() {
2758
       let patientArr = [];
2758
       let patientArr = [];
2759
       patientArr = JSON.parse(JSON.stringify(this.zone_schedules));
2759
       patientArr = JSON.parse(JSON.stringify(this.zone_schedules));
2760
-      console.log("patientArr", patientArr);
2760
+      // console.log("patientArr", patientArr);
2761
       let arr1 = [];
2761
       let arr1 = [];
2762
       if (this.patientStateVal == 0) {
2762
       if (this.patientStateVal == 0) {
2763
         arr1 = patientArr;
2763
         arr1 = patientArr;
2764
-        console.log(arr1);
2764
+        // console.log(arr1);
2765
       } else if (this.patientStateVal == 1) {
2765
       } else if (this.patientStateVal == 1) {
2766
         let arr = [];
2766
         let arr = [];
2767
         arr = patientArr;
2767
         arr = patientArr;
2782
             }
2782
             }
2783
           }
2783
           }
2784
         }
2784
         }
2785
-        console.log("执行1", arr);
2785
+        // console.log("执行1", arr);
2786
         arr1 = arr;
2786
         arr1 = arr;
2787
       } else if (this.patientStateVal == 2) {
2787
       } else if (this.patientStateVal == 2) {
2788
         let arr = [];
2788
         let arr = [];
2800
                   .systolic_blood_pressure != 0)
2800
                   .systolic_blood_pressure != 0)
2801
             ) {
2801
             ) {
2802
               // 删除元素后改变i的值
2802
               // 删除元素后改变i的值
2803
-              console.log("几次");
2803
+              // console.log("几次");
2804
               arr[i].schedules.splice(j--, 1);
2804
               arr[i].schedules.splice(j--, 1);
2805
             }
2805
             }
2806
           }
2806
           }
2807
         }
2807
         }
2808
-        console.log("执行2", arr);
2808
+        // console.log("执行2", arr);
2809
         arr1 = arr;
2809
         arr1 = arr;
2810
       } else if (this.patientStateVal == 3) {
2810
       } else if (this.patientStateVal == 3) {
2811
         let arr = [];
2811
         let arr = [];
2921
         newArr.push(...item.schedules);
2921
         newArr.push(...item.schedules);
2922
       });
2922
       });
2923
       this.tableData = newArr;
2923
       this.tableData = newArr;
2924
-      console.log("table", this.tableData);
2924
+      // console.log("table", this.tableData);
2925
     },
2925
     },
2926
   },
2926
   },
2927
   watch: {
2927
   watch: {
2951
     },
2951
     },
2952
   },
2952
   },
2953
   created() {
2953
   created() {
2954
-    console.log("hhahahhahahahah=======",this.org_template_info.template_id)
2955
-    console.log("this.$store.getters.xt_user.org.id",this.$store.getters.xt_user.org.id)
2954
+    // console.log("hhahahhahahahah=======",this.org_template_info.template_id)
2955
+    // console.log("this.$store.getters.xt_user.org.id",this.$store.getters.xt_user.org.id)
2956
     var schedule_type_selected = this.$store.getters.schedule_type_selected;
2956
     var schedule_type_selected = this.$store.getters.schedule_type_selected;
2957
     var zone_selected = this.$store.getters.zone_selected;
2957
     var zone_selected = this.$store.getters.zone_selected;
2958
     var patient_state_selected = this.$store.getters.patient_state_selected;
2958
     var patient_state_selected = this.$store.getters.patient_state_selected;

+ 2 - 2
src/xt_pages/dialysis/newDoctorAdvice.vue View File

42
 
42
 
43
        
43
        
44
       </div>
44
       </div>
45
-      <div class="filter-container">
45
+      <!-- <div class="filter-container">
46
       <el-input style="width:200px" placeholder="请输入药品名称" v-model="keyword"></el-input>
46
       <el-input style="width:200px" placeholder="请输入药品名称" v-model="keyword"></el-input>
47
        <el-button type="primary" @click="toSeachOne">搜索</el-button>
47
        <el-button type="primary" @click="toSeachOne">搜索</el-button>
48
 
48
 
49
        
49
        
50
-      </div>
50
+      </div> -->
51
       <div class="cell clearfix">
51
       <div class="cell clearfix">
52
         <label class="title">
52
         <label class="title">
53
           <span class="name">日期查询:</span>
53
           <span class="name">日期查询:</span>

+ 8 - 6
src/xt_pages/dialysis/template/DialysisPrintOrderFiftyThree.vue View File

1752
       return name;
1752
       return name;
1753
     },
1753
     },
1754
     setAdminUserES(id) {
1754
     setAdminUserES(id) {
1755
-      console.log(id);
1756
-      if (id == 0) {
1755
+      // console.log(id);
1756
+      if (id == 0 || id == "undefined") {
1757
         return "";
1757
         return "";
1758
-      }
1759
-      if (id in this.operatorMaps) {
1758
+      }else{
1759
+        if (id in this.operatorMaps) {
1760
         return this.operatorMaps[id].url;
1760
         return this.operatorMaps[id].url;
1761
-      } else {
1762
-        return "";
1761
+        } else {
1762
+          return "";
1763
+        }
1763
       }
1764
       }
1765
+     
1764
     },
1766
     },
1765
     modeName(mode_id) {
1767
     modeName(mode_id) {
1766
       return typeof this.modeOptions[mode_id] !== "undefined" &&
1768
       return typeof this.modeOptions[mode_id] !== "undefined" &&

+ 6 - 4
src/xt_pages/dialysis/template/DialysisPrintOrderFortySeven.vue View File

1541
                           />
1541
                           />
1542
                         </td>
1542
                         </td>
1543
                         <td v-else>
1543
                         <td v-else>
1544
-                          <span v-if="setAdminUserES(advice.doctor) == ''">{{
1545
-                            getAdminUser(advice.doctor)
1546
-                          }}</span>
1544
+                          <span
1545
+                            v-if="setAdminUserES(advice.advice_doctor) == ''"
1546
+                            >{{ getAdminUser(advice.advice_doctor) }}</span
1547
+                          >
1547
                           <img
1548
                           <img
1548
                             style="height: 30px"
1549
                             style="height: 30px"
1549
-                            :src="setAdminUserES(advice.doctor)"
1550
+                            :src="setAdminUserES(advice.advice_doctor)"
1550
                             alt=""
1551
                             alt=""
1551
                             srcset=""
1552
                             srcset=""
1553
+                            v-else
1552
                           />
1554
                           />
1553
                         </td>
1555
                         </td>
1554
                         <!-- <td height="35px">
1556
                         <!-- <td height="35px">

+ 107 - 50
src/xt_pages/dialysis/template/DialysisPrintOrderZero.vue View File

1
 <template>
1
 <template>
2
     <div >
2
     <div >
3
       <!-- <el-button type="primary" @click="checkData">一键核对</el-button> -->
3
       <!-- <el-button type="primary" @click="checkData">一键核对</el-button> -->
4
-      <el-button type="primary" @click="toUpload">一键上传</el-button>
4
+      <el-button type="primary" @click="getPdf">一键上传</el-button>
5
       <div >
5
       <div >
6
         <div
6
         <div
7
-          id="dialysis-print-box-64-1  "
7
+          id="dialysis-print-box-64-1"
8
           class="dialysis-print-order print-template-two print_page_main_content"
8
           class="dialysis-print-order print-template-two print_page_main_content"
9
           
9
           
10
         >
10
         >
11
-        <!-- style="padding:10px 0 0 40px  ;" -->
12
           <div id="dialysis-print-box-64">
11
           <div id="dialysis-print-box-64">
13
             <!-- <div 10px 0 0 40px
12
             <!-- <div 10px 0 0 40px
14
               class="order-yy-name"
13
               class="order-yy-name"
650
   import html2pdf from 'html2pdf.js'
649
   import html2pdf from 'html2pdf.js'
651
   import { UploadPrintOrder } from "@/api/role/admin"
650
   import { UploadPrintOrder } from "@/api/role/admin"
652
   import { HTML5_FMT } from "moment";
651
   import { HTML5_FMT } from "moment";
653
-  import html2canvas from 'html2canvas'
652
+  import html2Canvas from 'html2canvas'
654
   import { jsPDF } from 'jspdf';
653
   import { jsPDF } from 'jspdf';
655
   export default {
654
   export default {
656
     data() {
655
     data() {
1242
         }
1241
         }
1243
         return name
1242
         return name
1244
       },
1243
       },
1244
+
1245
+      getPdf() {
1246
+        // let dom = document.getElementById("dialysis-print-box-64")
1247
+        html2Canvas(document.querySelector('#dialysis-print-box-64'), {
1248
+          allowTaint: false,
1249
+          taintTest: false,
1250
+          logging: false,
1251
+          useCORS: true,
1252
+          dpi: window.devicePixelRatio * 4, // 将分辨率提高到特定的DPI 提高四倍
1253
+          scale: 4 // 按比例增加分辨率
1254
+        }).then(canvas => {
1255
+          // eslint-disable-next-line
1256
+          var pdf = new jsPDF('p', 'mm', 'a4') // A4纸,纵向
1257
+          var ctx = canvas.getContext('2d')
1258
+          var a4w = 190; var a4h = 277 // A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277
1259
+          var imgHeight = Math.floor(a4h * canvas.width / a4w) // 按A4显示比例换算一页图像的像素高度
1260
+          var renderedHeight = 0
1261
+
1262
+          while (renderedHeight < canvas.height) {
1263
+            var page = document.createElement('canvas')
1264
+            page.width = canvas.width
1265
+            page.height = Math.min(imgHeight, canvas.height - renderedHeight)// 可能内容不足一页
1266
+
1267
+            // 用getImageData剪裁指定区域,并画到前面创建的canvas对象中
1268
+            page.getContext('2d').putImageData(ctx.getImageData(0, renderedHeight, canvas.width, Math.min(imgHeight, canvas.height - renderedHeight)), 0, 0)
1269
+            pdf.addImage(page.toDataURL('image/jpeg', 1.0), 'JPEG', 10, 10, a4w, Math.min(a4h, a4w * page.height / page.width)) // 添加图像到页面,保留10mm边距
1270
+
1271
+            renderedHeight += imgHeight
1272
+            if (renderedHeight < canvas.height) {
1273
+              pdf.addPage()// 如果后面还有内容,添加一个空页
1274
+            }
1275
+            // delete page;
1276
+          }
1277
+          console.log("podeww22222",pdf)
1278
+          var newBase64Data =  pdf.output("dataurlstring").split("base64,")[1]
1279
+          console.log("newBase64Data",newBase64Data)
1280
+          // const blob = this.base64ToBlob(newBase64Data, 'application/pdf');
1281
+          // this.openPdf(blob);
1282
+          // // 保存文件
1283
+          // pdf.save(中国 + '.pdf')
1284
+
1285
+          var data = {
1286
+              name:newBase64Data,
1287
+            }
1288
+            UploadPrintOrder(data).then(response=>{
1289
+              if(response.data.state == 1){
1290
+                var sign =  response.data.data.sign
1291
+                console.log("SIGNWWOOWWO")
1292
+                var pdfBase64 = response.data.data.pdfBase64
1293
+                console.log("pdfBase64",pdfBase64)
1294
+                this.$message.success("保存成功!")
1295
+                const blob = this.base64ToBlob(pdfBase64, 'application/pdf');
1296
+                this.openPdf(blob);
1297
+              }
1298
+            })
1299
+        })
1300
+      },
1301
+
1245
   
1302
   
1246
-      toUpload() {
1303
+      // toUpload() {
1247
          
1304
          
1248
-          let dom = document.getElementById("dialysis-print-box-64")
1249
-          //调用方法下载
1250
-          html2canvas(dom, {
1251
-            useCORS: true, //允许跨域
1252
-            allowTaint: false,
1253
-            logging: false,
1254
-            letterRendering: true,
1255
-            ddpi: window.devicePixelRatio * 4, //将分辨率提高到特定的DPI 提高四倍
1256
-            scale: 4, //按比例增加分辨率
1257
-            background: '#fff',//pdf背景色为白色,默认是黑色的
1258
-          }).then((canvas) => {
1259
-            //返回图片dataURL,参数:图片格式和清晰度(0-1)
1260
-            var pageData = canvas.toDataURL('image/jpeg', 1.0);
1261
-  
1262
-            //方向默认竖直,尺寸ponits,格式a4[595.28,841.89]
1263
-            var pdf = new jsPDF('', 'pt', 'a4');
1264
-  
1265
-            //addImage后两个参数控制添加图片的尺寸,此处将页面高度按照a4纸宽高比列进行压缩
1266
-            //  pdf.addImage(pageData, 'JPEG', 0, 0, 595.28, 592.28 / canvas.width * canvas.height);
1267
-             pdf.addImage(pageData, 'JPEG', 0, 0, 555.28, 592.28 / canvas.width * canvas.height);
1305
+      //     let dom = document.getElementById("dialysis-print-box-64")
1306
+      //     //调用方法下载
1307
+      //     html2canvas(dom, {
1308
+      //       useCORS: true, //允许跨域
1309
+      //       allowTaint: false,
1310
+      //       logging: false,
1311
+      //       letterRendering: true,
1312
+      //       ddpi: window.devicePixelRatio * 4, //将分辨率提高到特定的DPI 提高四倍
1313
+      //       scale: 4, //按比例增加分辨率
1314
+      //       background: '#fff',//pdf背景色为白色,默认是黑色的
1315
+      //     }).then((canvas) => {
1316
+      //       //返回图片dataURL,参数:图片格式和清晰度(0-1)
1317
+      //       var pageData = canvas.toDataURL('image/jpeg', 1.0);
1318
+  
1319
+      //       //方向默认竖直,尺寸ponits,格式a4[595.28,841.89]
1320
+      //       var pdf = new jsPDF('', 'pt', 'a4');
1321
+  
1322
+      //       //addImage后两个参数控制添加图片的尺寸,此处将页面高度按照a4纸宽高比列进行压缩
1323
+      //       //  pdf.addImage(pageData, 'JPEG', 0, 0, 595.28, 592.28 / canvas.width * canvas.height);
1324
+      //       pdf.addImage(pageData, 'JPEG', 0, 0, 555.28, 592.28 / canvas.width * canvas.height);
1268
             
1325
             
1269
-            console.log("pdf222222222222222222",pdf)
1326
+      //       console.log("pdf222222222222222222",pdf)
1270
 
1327
 
1271
-            var newBase64Data =  pdf.output("dataurlstring").split("base64,")[1]
1272
-            // console.log("base63",newBase64Data)
1273
-            const blob = this.base64ToBlob(newBase64Data, 'application/pdf');
1274
-            console.log("blobwoowowowwo",blob)
1275
-            this.openPdf(blob);
1328
+      //       var newBase64Data =  pdf.output("dataurlstring").split("base64,")[1]
1329
+      //       // console.log("base63",newBase64Data)
1330
+      //       const blob = this.base64ToBlob(newBase64Data, 'application/pdf');
1331
+      //       console.log("blobwoowowowwo",blob)
1332
+      //       this.openPdf(blob);
1276
             
1333
             
1277
-            // var data = {
1278
-            //   name:newBase64Data,
1279
-            // }
1280
-            // UploadPrintOrder(data).then(response=>{
1281
-            //   if(response.data.state == 1){
1282
-            //     var sign =  response.data.data.sign
1283
-            //     console.log("SIGNWWOOWWO")
1284
-            //     var pdfBase64 = response.data.data.pdfBase64
1285
-            //     console.log("pdfBase64",pdfBase64)
1286
-            //     this.$message.success("保存成功!")
1287
-            //     const blob = this.base64ToBlob(pdfBase64, 'application/pdf');
1288
-            //     this.openPdf(blob);
1289
-            //   }
1290
-            // })
1334
+      //       // var data = {
1335
+      //       //   name:newBase64Data,
1336
+      //       // }
1337
+      //       // UploadPrintOrder(data).then(response=>{
1338
+      //       //   if(response.data.state == 1){
1339
+      //       //     var sign =  response.data.data.sign
1340
+      //       //     console.log("SIGNWWOOWWO")
1341
+      //       //     var pdfBase64 = response.data.data.pdfBase64
1342
+      //       //     console.log("pdfBase64",pdfBase64)
1343
+      //       //     this.$message.success("保存成功!")
1344
+      //       //     const blob = this.base64ToBlob(pdfBase64, 'application/pdf');
1345
+      //       //     this.openPdf(blob);
1346
+      //       //   }
1347
+      //       // })
1291
             
1348
             
1292
-            // this.viewPdf(newBase64Data)
1293
-            //保存到pdf,名字是stone
1294
-            // pdf.save('stone.pdf');
1349
+      //       // this.viewPdf(newBase64Data)
1350
+      //       //保存到pdf,名字是stone
1351
+      //       // pdf.save('stone.pdf');
1295
            
1352
            
1296
-          });
1297
-        },
1353
+      //     });
1354
+      //   },
1298
      
1355
      
1299
       viewPdf(content) {
1356
       viewPdf(content) {
1300
         console.log("content",content);
1357
         console.log("content",content);