see999 před 3 roky
rodič
revize
ef9e69ba46

+ 6 - 6
src/xt_pages/dialysis/batch_print/batch_print_order_fortyThree.vue Zobrazit soubor

@@ -462,7 +462,7 @@
462 462
                         </td>
463 463
                         <td height="32px" colspan="2" class="advice-name" style="padding-left:7px;">
464 464
                             <span style="padding-left:5px;display:inline-block;">
465
-                              <span>{{ advice.project.project_name }}</span>
465
+                              <span>{{ advice && advice.project ? advice.project.project_name : '' }}</span>
466 466
                             </span>
467 467
                         </td>
468 468
 
@@ -757,20 +757,20 @@ export default {
757 757
               this.records[recordIndex].his_advices &&
758 758
               this.records[recordIndex].his_advices.length + this.records[recordIndex].his_project.length < 6
759 759
             ) {
760
-              delghThree = 6 - this.records[recordIndex].his_advices.length
760
+              delghThree = 6 - (this.records[recordIndex].his_advices.length + this.records[recordIndex].his_project.length)
761 761
             } else {
762 762
               delghThree = 0
763 763
             }
764 764
 
765 765
             if (delghThree > 0) {
766 766
               if (
767
-                typeof this.records[recordIndex].his_advices === 'undefined' ||
768
-                this.records[recordIndex].his_advices == null
767
+                typeof this.records[recordIndex].his_project === 'undefined' ||
768
+                this.records[recordIndex].his_project == null
769 769
               ) {
770
-                this.records[recordIndex].his_advices = []
770
+                this.records[recordIndex].his_project = []
771 771
               }
772 772
               for (let index = 0; index < delghThree; index++) {
773
-                this.records[recordIndex].his_advices.push([])
773
+                this.records[recordIndex].his_project.push([])
774 774
               }
775 775
             }
776 776
             this.records[recordIndex].his_advices = this.records[recordIndex].his_advices.sort((a,b)=>{ return a.id-b.id})

+ 6 - 6
src/xt_pages/dialysis/template/DialysisPrintOrderFortyThree.vue Zobrazit soubor

@@ -431,7 +431,7 @@
431 431
                   </span>
432 432
                   </td>
433 433
                   <td height="32px" colspan="2" class="advice-name" style="padding-left:7px;">
434
-                    <span>{{ advice.project.project_name }}</span>
434
+                    <span>{{ advice && advice.project ? advice.project.project_name : '' }}</span>
435 435
                   </td>
436 436
                   <td height="32px">
437 437
                       <span v-if="setAdminUserES(advice.doctor) == ''">{{ getAdminUser(advice.doctor) }}</span>
@@ -1260,16 +1260,16 @@ export default {
1260 1260
           }
1261 1261
         })
1262 1262
         this.projects = projects
1263
-        if (this.doctor_advices.length + this.projects.length <= 6) {
1264
-          var nl = 6
1263
+        if ((this.doctor_advices.length + this.projects.length) <= 6) {
1264
+          var nl = 6 - (this.doctor_advices.length + this.projects.length)
1265 1265
           this.print_length = 6
1266 1266
 
1267 1267
           for (let index = 0; index < nl; index++) {
1268 1268
             if (
1269
-              this.doctor_advices[index] == undefined ||
1270
-              this.doctor_advices[index].length <= 0
1269
+              this.projects[index] == undefined ||
1270
+              this.projects[index].length <= 0
1271 1271
             ) {
1272
-              this.doctor_advices.push([])
1272
+              this.projects.push([])
1273 1273
             } else {
1274 1274
               continue
1275 1275
             }