Quellcode durchsuchen

库存显示展示

XMLWAN vor 2 Jahren
Ursprung
Commit
ae1aed0aa7
2 geänderte Dateien mit 67 neuen und 0 gelöschten Zeilen
  1. 46 0
      src/xt_pages/stock/drugs/drugStockFlow.vue
  2. 21 0
      src/xt_pages/stock/stockFlow.vue

+ 46 - 0
src/xt_pages/stock/drugs/drugStockFlow.vue Datei anzeigen

131
               {{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}
131
               {{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}
132
             
132
             
133
            </template>
133
            </template>
134
+        </el-table-column>
135
+         <el-table-column prop="drug_name" label="剩余库存" align="center">
136
+           <template slot-scope="scope">
137
+             {{scope.row.over_count}}
138
+           </template>
139
+        </el-table-column>
140
+        <el-table-column prop="drug_name" label="使用人" align="center">
141
+           <template slot-scope="scope">
142
+             <span > {{getPatientName(scope.row.patient_id)}}</span>
143
+           </template>
144
+        </el-table-column>
145
+        <el-table-column prop="drug_name" label="剩余库存" align="center">
146
+           <template slot-scope="scope">
147
+             <span > {{getDrugCount(scope.row.over_count,scope.row.BaseDrugLib.max_unit,scope.row.BaseDrugLib.min_unit,scope.row.BaseDrugLib.min_number)}}</span>
148
+           </template>
134
         </el-table-column>
149
         </el-table-column>
135
         <!-- <el-table-column prop="drug_name" label="批号" align="center">
150
         <!-- <el-table-column prop="drug_name" label="批号" align="center">
136
            <template slot-scope="scope">
151
            <template slot-scope="scope">
257
         total:0,
272
         total:0,
258
         drug:{},
273
         drug:{},
259
         houseList:[],
274
         houseList:[],
275
+        patientList:[],
260
       }
276
       }
261
     },
277
     },
262
     methods:{
278
     methods:{
509
             var drug = response.data.data.drug
525
             var drug = response.data.data.drug
510
            
526
            
511
             this.drug = drug
527
             this.drug = drug
528
+            this.patientList = response.data.data.patientList
512
 
529
 
513
             this.houseList = response.data.data.houseList
530
             this.houseList = response.data.data.houseList
514
           }
531
           }
552
       }
569
       }
553
       return storehouse_name
570
       return storehouse_name
554
      },
571
      },
572
+     getPatientName(id){
573
+       var name = ""
574
+       for(let i=0;i<this.patientList.length;i++){
575
+          if(id == this.patientList[i].id){
576
+              name = this.patientList[i].name
577
+          }
578
+       }
579
+       return name
580
+     },
581
+     getDrugCount(total,max_unit,min_unit,min_number){
582
+        var max_str = "";
583
+        var min_str = "";
584
+        if (total < min_number) {
585
+        min_str = total + min_unit;
586
+      }
587
+      if (total == 0) {
588
+        min_str = "";
589
+        max_str = "";
590
+      }
591
+      if (total >= min_number) {
592
+        if (parseInt(total / min_number) != 0) {
593
+          max_str = parseInt(total / min_number) + max_unit;
594
+        }
595
+        if (total % min_number != 0) {
596
+          min_str = (total % min_number) + min_unit;
597
+        }
598
+      }
599
+      return max_str + min_str;
600
+     }
555
     }
601
     }
556
   }
602
   }
557
 </script>
603
 </script>

+ 21 - 0
src/xt_pages/stock/stockFlow.vue Datei anzeigen

131
              <span > {{getManufacturer(scope.row.manufacturer)}}</span>
131
              <span > {{getManufacturer(scope.row.manufacturer)}}</span>
132
            </template>
132
            </template>
133
         </el-table-column>
133
         </el-table-column>
134
+        <el-table-column prop="drug_name" label="使用人" align="center">
135
+           <template slot-scope="scope">
136
+             <span > {{getPatientName(scope.row.patient_id)}}</span>
137
+           </template>
138
+        </el-table-column>
139
+        <el-table-column prop="drug_name" label="剩余库存" align="center">
140
+           <template slot-scope="scope">
141
+             <span > {{scope.row.over_count}}</span>
142
+           </template>
143
+        </el-table-column>
134
        </el-table>
144
        </el-table>
135
        
145
        
136
       <el-pagination
146
       <el-pagination
236
         cancelCountList:[],
246
         cancelCountList:[],
237
         good:{},
247
         good:{},
238
         houseList:[],
248
         houseList:[],
249
+        patientList:[]
239
       }
250
       }
240
     },
251
     },
241
     methods:{
252
     methods:{
443
            var manufacturerList = response.data.data.manufacturerList
454
            var manufacturerList = response.data.data.manufacturerList
444
            this.manufacturerList = manufacturerList
455
            this.manufacturerList = manufacturerList
445
            this.houseList = response.data.data.houseList
456
            this.houseList = response.data.data.houseList
457
+           this.patientList = response.data.data.patients
446
           }
458
           }
447
        })
459
        })
448
      },
460
      },
469
          specification_name = this.good.specification_name
481
          specification_name = this.good.specification_name
470
        }
482
        }
471
        return specification_name
483
        return specification_name
484
+     },
485
+     getPatientName(id){
486
+       var name = ""
487
+       for(let i=0;i<this.patientList.length;i++){
488
+          if(id == this.patientList[i].id){
489
+              name = this.patientList[i].name
490
+          }
491
+       }
492
+       return name
472
      }
493
      }
473
     }
494
     }
474
   }
495
   }