XMLWAN vor 3 Jahren
Ursprung
Commit
f6cf203ca8

+ 4 - 2
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Datei anzeigen

2621
             var temp2 = this.deepClone(this.teamList)
2621
             var temp2 = this.deepClone(this.teamList)
2622
 
2622
 
2623
             var temp3 = this.deepClone(templateDrugs)
2623
             var temp3 = this.deepClone(templateDrugs)
2624
-
2624
+            console.log("hhhhhhhhhhhhhh",temp)
2625
+            console.log("hhhh23",temp2)
2626
+            console.log("hhhh23",temp3)
2625
             if (temp3.length > 0) {
2627
             if (temp3.length > 0) {
2626
               for (let b = 0; b < temp3.length; b++) {
2628
               for (let b = 0; b < temp3.length; b++) {
2627
                 let obj = {
2629
                 let obj = {
2658
                   single_dose: temp[b].single_dose,
2660
                   single_dose: temp[b].single_dose,
2659
                   delivery_way: temp[b].delivery_way,
2661
                   delivery_way: temp[b].delivery_way,
2660
                   execution_frequency: temp[b].execution_frequency,
2662
                   execution_frequency: temp[b].execution_frequency,
2661
-                  retail_price: temp[b].retail_price.toString(),
2663
+                  retail_price: temp[b].min_price.toString(),
2662
                   remark: '',
2664
                   remark: '',
2663
                   day: temp[b].drug_day ? temp[b].drug_day : 1,
2665
                   day: temp[b].drug_day ? temp[b].drug_day : 1,
2664
                   prescribing_number: temp[b].prescribing_number,
2666
                   prescribing_number: temp[b].prescribing_number,

+ 1 - 1
src/xt_pages/stock/cancelStockOrderAdd.vue Datei anzeigen

584
                 return
584
                 return
585
              }
585
              }
586
              if(msg == 2){
586
              if(msg == 2){
587
-               this.$message.error("退库数量大于出库数量")
587
+               this.$message.error("该批次退库数量大于出库数量")
588
              }
588
              }
589
               if(msg == 4){
589
               if(msg == 4){
590
                this.$message.error("该批次退库数量大于入库数量")
590
                this.$message.error("该批次退库数量大于入库数量")

+ 3 - 3
src/xt_pages/stock/cancelStockOrderEdit.vue Datei anzeigen

392
         tempObj['id'] = 0
392
         tempObj['id'] = 0
393
         tempObj['good_type_id'] = 0
393
         tempObj['good_type_id'] = 0
394
         tempObj['good_id'] = 0
394
         tempObj['good_id'] = 0
395
-        tempObj['count'] = ''
395
+        tempObj['count'] = 0
396
         tempObj["number"] = ""
396
         tempObj["number"] = ""
397
         tempObj["dealer"] = ""
397
         tempObj["dealer"] = ""
398
         tempObj["manufacturer"]= ""
398
         tempObj["manufacturer"]= ""
399
         tempObj["register_account"] = ""
399
         tempObj["register_account"] = ""
400
         tempObj["remark"] = ""
400
         tempObj["remark"] = ""
401
-        tempObj["price"] = ""
401
+        tempObj["price"] = 0
402
         tempObj["warehouse_info_id"] = 0
402
         tempObj["warehouse_info_id"] = 0
403
         this.recordInfo.recordData.push(tempObj)
403
         this.recordInfo.recordData.push(tempObj)
404
       }, handleDelete: function(index, row) {
404
       }, handleDelete: function(index, row) {
546
                   this.$message.error("退库数量大于出库数量")
546
                   this.$message.error("退库数量大于出库数量")
547
                 }
547
                 }
548
                 if(msg == 4){
548
                 if(msg == 4){
549
-                  this.$message.error("该批次退库数量大于库数量")
549
+                  this.$message.error("该批次退库数量大于库数量")
550
                 }
550
                 }
551
                  if(msg == 5){
551
                  if(msg == 5){
552
                   this.$message.error("该批次退库数量大于入库数量")
552
                   this.$message.error("该批次退库数量大于入库数量")

+ 2 - 2
src/xt_pages/stock/drugs/cancelDrugOrderPrint.vue Datei anzeigen

9
       <div id="dialysis-print-box">
9
       <div id="dialysis-print-box">
10
         <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
10
         <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;">{{orgName}}</div>
11
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;">{{orgName}}</div>
12
-          <div class="order-title" style="font-weight:500;font-size:18px;">药品库登记表</div>
12
+          <div class="order-title" style="font-weight:500;font-size:18px;">药品退库登记表</div>
13
 
13
 
14
           <div style="float: left;margin-bottom: 1px;">单据编号:{{it.order_number}}</div>
14
           <div style="float: left;margin-bottom: 1px;">单据编号:{{it.order_number}}</div>
15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
18
             <tbody>
18
             <tbody>
19
             <tr>
19
             <tr>
20
               <td style="line-height: 50px" width="230">药品名称</td>
20
               <td style="line-height: 50px" width="230">药品名称</td>
21
-              <td style="line-height: 50px" width="260">品名/注册证号(备案凭证号)</td>
21
+              <td style="line-height: 50px" width="260">批准文号</td>
22
               <td style="line-height: 50px" width="230">规格型号</td>
22
               <td style="line-height: 50px" width="230">规格型号</td>
23
               <td style="line-height: 50px" width="200">生产厂商</td>
23
               <td style="line-height: 50px" width="200">生产厂商</td>
24
               <td style="line-height: 50px" width="180">批号(序列号)</td>
24
               <td style="line-height: 50px" width="180">批号(序列号)</td>

+ 2 - 2
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue Datei anzeigen

162
             border
162
             border
163
             highlight-current-row
163
             highlight-current-row
164
             ref="multipleTableOne"
164
             ref="multipleTableOne"
165
-            @current-change="handleCurrentChangeOne"
165
+           
166
             @selection-change="select"
166
             @selection-change="select"
167
             :row-style="{ color: '#303133' }"
167
             :row-style="{ color: '#303133' }"
168
             :header-cell-style="{
168
             :header-cell-style="{
489
         ids: idStr
489
         ids: idStr
490
       };
490
       };
491
 
491
 
492
-      this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
492
+      this.$confirm("确认删除退库单记录?", "删除退库单记录", {
493
         confirmButtonText: "确定",
493
         confirmButtonText: "确定",
494
         cancelButtonText: "取消",
494
         cancelButtonText: "取消",
495
         type: "warning"
495
         type: "warning"

+ 1 - 1
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue Datei anzeigen

371
       },
371
       },
372
       tableRules: {
372
       tableRules: {
373
         return_count: [
373
         return_count: [
374
-          { required: true, message: "数量不能为空", trigge: "blur" }
374
+          { required: true, message: "数量不能为空", trigger: "blur" }
375
         ]
375
         ]
376
       },
376
       },
377
       ruleForm: {
377
       ruleForm: {

+ 5 - 2
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue Datei anzeigen

306
         },
306
         },
307
         tableRules: {
307
         tableRules: {
308
           count: [
308
           count: [
309
-            { required: true, message: '数量不能为空', trigge: 'blur' }
309
+            { required: true, message: '数量不能为空', trigger: 'blur' }
310
           ]
310
           ]
311
 
311
 
312
         },
312
         },
547
                    this.recordInfo.recordData[i].batch_number_id = this.numberList[j].id
547
                    this.recordInfo.recordData[i].batch_number_id = this.numberList[j].id
548
                  }
548
                  }
549
               }
549
               }
550
-             
550
+              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
551
             }
551
             }
552
 
552
 
553
             const params = {
553
             const params = {
567
                 if(response.data.data.msg == 2){
567
                 if(response.data.data.msg == 2){
568
                    this.$message.error("退库数量大于入库数量")
568
                    this.$message.error("退库数量大于入库数量")
569
                 }
569
                 }
570
+                if(response.data.data.msg == 4){
571
+                  this.$message.error("退库数量大于出库数量")
572
+                }
570
               
573
               
571
               }
574
               }
572
             })
575
             })

+ 2 - 2
src/xt_pages/stock/drugs/drugBatchNumber.vue Datei anzeigen

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
9
-       库存:{{getCountTwo(this.$route.query.drug_id,this.$route.query.min_number,this.$route.query.max_unit,this.$route.query.min_unit)}}&nbsp;
9
+       库存:{{this.$route.query.overPlus}}&nbsp;
10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12
       </div>
12
       </div>
136
       this.drugCategory.push(...drugCategory)
136
       this.drugCategory.push(...drugCategory)
137
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
137
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
138
       this.getlist()
138
       this.getlist()
139
-      this.getDrugCountList()
139
+      // this.getDrugCountList()
140
     },
140
     },
141
     components: {
141
     components: {
142
       SettingDialog,
142
       SettingDialog,

+ 143 - 20
src/xt_pages/stock/drugs/drugQueryPrint.vue Datei anzeigen

45
               <td style="line-height: 50px">
45
               <td style="line-height: 50px">
46
                 <span> {{getManufacturerList(item.manufacturer)}}</span>
46
                 <span> {{getManufacturerList(item.manufacturer)}}</span>
47
               </td>
47
               </td>
48
-              <td><span>{{getInCount(item.drug_id)}}{{item.max_unit}}</span ></td>
49
-              <td><span>{{getCount(item.drug_id,item.min_number,item.max_unit,item.min_unit)}}</span></td>
48
+              <td><span v-if="getWarehoseInfo(item.drug_warehouse_info)!=0">{{getWarehoseInfo(item.drug_warehouse_info)}}{{item.max_unit}}</span ></td>
49
+              <td><span v-if="getWarehouseOutInfo(item.drug_warehouse_out,item.max_unit,item.min_unit,item.min_number)!=0">{{getWarehouseOutInfo(item.drug_warehouse_out,item.max_unit,item.min_unit,item.min_number)}}</span></td>
50
               <td>
50
               <td>
51
-                <span>{{getCountTwo(item.drug_id,item.min_number,item.max_unit,item.min_unit)}}</span>
51
+                <span v-if="getOverFlushInfo(item.drug_warehouse_info,item.max_unit,item.min_unit,item.min_number)!=0">{{getOverFlushInfo(item.drug_warehouse_info,item.max_unit,item.min_unit,item.min_number)}}</span>
52
              </td> 
52
              </td> 
53
             </tr>
53
             </tr>
54
             </tbody>
54
             </tbody>
117
         autoCountList:[],
117
         autoCountList:[],
118
         minCount:[],
118
         minCount:[],
119
         drugOutList:[],
119
         drugOutList:[],
120
+        allCountList:[],
120
       }
121
       }
121
     },
122
     },
122
     methods: {
123
     methods: {
164
           start_time:this.$route.query.start_time,
165
           start_time:this.$route.query.start_time,
165
           end_time:this.$route.query.end_time,
166
           end_time:this.$route.query.end_time,
166
         }
167
         }
167
-        console.log("parasm22222",Params)
168
+        console.log("数据23232",Params)
168
         this.WarehouseInfo.warehouseInfoDate = []
169
         this.WarehouseInfo.warehouseInfoDate = []
169
         getAllDrugStockQueryList(Params).then(response => {
170
         getAllDrugStockQueryList(Params).then(response => {
170
           if (response.data.state == 0) {
171
           if (response.data.state == 0) {
239
           page: this.$route.query.page,
240
           page: this.$route.query.page,
240
           limit:this.$route.query.limit,
241
           limit:this.$route.query.limit,
241
           keyword: this.$route.query.keyword,
242
           keyword: this.$route.query.keyword,
242
-          drug_type:this.$route.drug_type,
243
-          start_time:this.$route.start_time,
244
-          end_time:this.$route.end_time,
243
+          drug_type:this.$route.query.drug_type,
244
+          start_time:this.$route.query.start_time,
245
+          end_time:this.$route.query.end_time,
245
         }
246
         }
246
-        console.log("parasm222222",params)
247
+       console.log("数据23232",params)
247
         getDrugStockList(params).then(response=>{
248
         getDrugStockList(params).then(response=>{
248
           if(response.data.state == 1){
249
           if(response.data.state == 1){
249
              var list = response.data.data.list
250
              var list = response.data.data.list
250
              console.log("list99999",list)
251
              console.log("list99999",list)
252
+             for(let i=0;i<list.length;i++){
253
+               for(let j=0;j<list[i].drug_warehouse_info.length;j++){
254
+                 list[i].drug_warehouse_info[j].stock_max_number = list[i].min_number * list[i].drug_warehouse_info[j].stock_max_number
255
+               }
256
+               for(let y=0;y<list[i].drug_warehouse_out.length;y++){
257
+                  if(list[i].drug_warehouse_out[y].count_unit == list[i].max_unit){
258
+                    list[i].drug_warehouse_out[y].count = list[i].drug_warehouse_out[y].count * list[i].min_number
259
+                  }
260
+               }
261
+             }
262
+             
251
              this.tableList = list
263
              this.tableList = list
252
              this.manufacturerList = response.data.data.manufacturerList
264
              this.manufacturerList = response.data.data.manufacturerList
253
              this.loading = false
265
              this.loading = false
277
             var outcountlist = response.data.data.outCountList
289
             var outcountlist = response.data.data.outCountList
278
             console.log("出库数据",outcountlist)
290
             console.log("出库数据",outcountlist)
279
             this.outCountList = outcountlist
291
             this.outCountList = outcountlist
292
+             this.allCountList.push(...outcountlist)
280
             var aucountlist = response.data.data.auCountList
293
             var aucountlist = response.data.data.auCountList
281
             console.log("自动数据",aucountlist)
294
             console.log("自动数据",aucountlist)
295
+          
282
             this.autoCountList = aucountlist
296
             this.autoCountList = aucountlist
297
+            this.allCountList.push(...aucountlist)
283
             var minCount = response.data.data.minCount
298
             var minCount = response.data.data.minCount
284
             console.log("minCount",minCount)
299
             console.log("minCount",minCount)
285
             this.minCount = minCount
300
             this.minCount = minCount
331
         }
346
         }
332
         return count
347
         return count
333
       },
348
       },
334
-      getCount(drug_id,min_number,max_unit,min_unit){
335
-        var count= 0
349
+      // getCount(drug_id,min_number,max_unit,min_unit){
350
+      //   var count= 0
351
+      //   var str = ""
352
+      //   var min_str = ""
353
+      //   for(let i=0;i<this.drugOutList.length;i++){
354
+      //     if(drug_id == this.drugOutList[i].drug_id){
355
+      //        count += parseInt(this.drugOutList[i].count)
356
+      //     }
357
+      //   }
358
+      //   if(parseInt(count/min_number)!=0){
359
+      //     str = parseInt(count/min_number)+ max_unit
360
+      //   }
361
+      //   if((count%min_number)!=0){
362
+      //     min_str =  count%min_number + min_unit
363
+      //   }
364
+      //   return str + min_str
365
+      // },
366
+        getCount(drug_id,min_number,max_unit,min_unit){
367
+        var total= 0
336
         var str = ""
368
         var str = ""
337
         var min_str = ""
369
         var min_str = ""
338
-        for(let i=0;i<this.drugOutList.length;i++){
339
-          if(drug_id == this.drugOutList[i].drug_id){
340
-             count += parseInt(this.drugOutList[i].count)
370
+        var arr = []
371
+        for(let i=0;i<this.allCountList.length;i++){
372
+          if(drug_id == this.allCountList[i].drug_id){
373
+             arr.push(this.allCountList[i])
341
           }
374
           }
342
         }
375
         }
343
-        if(parseInt(count/min_number)!=0){
344
-          str = parseInt(count/min_number)+ max_unit
376
+        var arrTwo = []
377
+        for(let i=0;i<arr.length;i++){
378
+          if(arr[i].drug_id == 1236){
379
+             arrTwo.push(arr[i])
380
+          }
381
+          if(arr[i].count_unit == max_unit){
382
+             arr[i].count = arr[i].count * min_number
383
+          }
384
+          if(arr[i].count_unit == min_unit){
385
+            arr[i].count = arr[i].count
386
+          }
387
+          total += arr[i].count
345
         }
388
         }
346
-        if((count%min_number)!=0){
347
-          min_str =  count%min_number + min_unit
389
+        if(total<min_number){
390
+           str = ""
391
+           min_str = total + min_unit
348
         }
392
         }
393
+        if(total >= min_number){
394
+          if(parseInt(total/min_number)!=0){
395
+            str = parseInt(total/min_number)+ max_unit
396
+          }
397
+          if((total%min_number)!=0){
398
+            min_str =  total%min_number + min_unit
399
+          }
400
+        }
401
+    
349
         return str + min_str
402
         return str + min_str
350
       },
403
       },
351
-
352
       getCountOne(drug_id){
404
       getCountOne(drug_id){
353
         var count= 0
405
         var count= 0
354
         for(let i=0;i<this.drugOutList.length;i++){
406
         for(let i=0;i<this.drugOutList.length;i++){
383
          }
435
          }
384
        }
436
        }
385
        return name
437
        return name
386
-     }
438
+     },
439
+     getWarehoseInfo(arr){
440
+        var total = 0
441
+        if (arr.length > 0) {
442
+          for(let i=0;i<arr.length;i++){
443
+            total += parseInt(arr[i].warehousing_count)
444
+          }
445
+        }
446
+        if(total == 0){
447
+           total = ""
448
+        }
449
+       
450
+        return total
451
+      },
452
+      getOverFlushInfo(arr,max_unit,min_unit,min_number){
453
+       
454
+         var max_str=  ""
455
+         var min_str = ""
456
+         var total = 0
457
+         var newarr = arr
458
+         if(newarr.length > 0 ){
459
+           for(let i=0;i<newarr.length;i++){
460
+            total += (newarr[i].stock_max_number+newarr[i].stock_min_number)
461
+           }
462
+         }
463
+         if (total < min_number){
464
+           min_str = total + min_unit
465
+         }
466
+         if (total == 0) {
467
+            min_str = ""
468
+            max_str = ""
469
+         }
470
+         if (total >=min_number) {
471
+           if(parseInt(total/min_number)!=0){
472
+              max_str = parseInt(total/min_number) + max_unit
473
+           }
474
+           if(total%min_number!=0){
475
+              min_str = total%min_number + min_unit
476
+           }
477
+         
478
+         }
479
+        return max_str + min_str
480
+      },
481
+      getWarehouseOutInfo(arr,max_unit,min_unit,min_number){
482
+         var min_str = ""
483
+         var max_str = ""
484
+        var total = 0
485
+        if (arr.length > 0) {
486
+          for(let i=0;i<arr.length;i++){
487
+            total += parseInt(arr[i].count)
488
+          }
489
+        }
490
+      
491
+        if (total < min_number){
492
+           min_str = total + min_unit
493
+         }
494
+         if (total == 0) {
495
+            min_str = ""
496
+            max_str = ""
497
+         }
498
+         if (total >=min_number) {
499
+           if(parseInt(total/min_number)!=0){
500
+              max_str = parseInt(total/min_number) + max_unit
501
+           }
502
+           if(total%min_number!=0){
503
+              min_str = total%min_number + min_unit
504
+           }
505
+         
506
+         }
507
+        return max_str + min_str
508
+
509
+      }
387
     },
510
     },
388
     created() {
511
     created() {
389
       // this.GetAllDrugStockQueryList()
512
       // this.GetAllDrugStockQueryList()
392
       console.log("222343",drugType)
515
       console.log("222343",drugType)
393
       this.drugType.push(...drugType)
516
       this.drugType.push(...drugType)
394
       this.getlist()
517
       this.getlist()
395
-      this.getDrugCountList()
518
+      // this.getDrugCountList()
396
     }
519
     }
397
 
520
 
398
   }
521
   }

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

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
8
        药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
9
-       库存: {{getCountTwo(this.$route.query.drug_id,this.$route.query.min_number,this.$route.query.max_unit,this.$route.query.min_unit)}}
9
+       库存: {{this.$route.query.overPlus}}
10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
10
        规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
11
        厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12
 
12
 
170
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
170
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
171
       // this.getlist()
171
       // this.getlist()
172
       // this.getOutList()
172
       // this.getOutList()
173
-      this.getDrugCountList()
173
+      // this.getDrugCountList()
174
 
174
 
175
       this.getDrugFlow()
175
       this.getDrugFlow()
176
     },
176
     },

+ 1 - 1
src/xt_pages/stock/drugs/drugStockInOrder.vue Datei anzeigen

476
           for (let i = 0; i < response.data.data.list.length; i++) {
476
           for (let i = 0; i < response.data.data.list.length; i++) {
477
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
477
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
478
           }
478
           }
479
-          console.log("列表999988888",this.warehouse.warehouseDate)
479
+          // console.log("列表999988888",this.warehouse.warehouseDate)
480
         }
480
         }
481
       });
481
       });
482
     },
482
     },

+ 57 - 42
src/xt_pages/stock/drugs/drugStockOutOrder.vue Datei anzeigen

233
           </el-table-column> -->
233
           </el-table-column> -->
234
           <el-table-column label="出库数量" align="center">
234
           <el-table-column label="出库数量" align="center">
235
             <template slot-scope="scope">
235
             <template slot-scope="scope">
236
-              <!-- {{getTotalCount(scope.row.drug_id)}} -->
237
-              {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
236
+              <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
237
+              <span v-if="scope.row.is_sys == 1"> {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
238
             </template>
238
             </template>
239
           </el-table-column>
239
           </el-table-column>
240
           <el-table-column label="出货单价" align="center">
240
           <el-table-column label="出货单价" align="center">
349
               <span>批次号</span>
349
               <span>批次号</span>
350
             </template>
350
             </template>
351
             <template slot-scope="scope">
351
             <template slot-scope="scope">
352
-              <span>{{getDrugBatchNumber(scope.row.drug_id)}}</span>
352
+              <span>{{getDrugBatchNumber(scope.row.drug_id,scope.row.count)}}</span>
353
             </template>
353
             </template>
354
           </el-table-column>
354
           </el-table-column>
355
           
355
           
393
               <span>使用数量</span>
393
               <span>使用数量</span>
394
             </template>
394
             </template>
395
             <template slot-scope="scope">
395
             <template slot-scope="scope">
396
-               {{scope.row.count}}
396
+               {{scope.row.count}}{{scope.row.count_unit}}
397
             </template>
397
             </template>
398
           </el-table-column>
398
           </el-table-column>
399
 
399
 
671
       this.$router.push({path:"/drug/out/drugstockoutorderedit?id="+row.id+"&type="+this.type+"&is_sys="+row.is_sys})
671
       this.$router.push({path:"/drug/out/drugstockoutorderedit?id="+row.id+"&type="+this.type+"&is_sys="+row.is_sys})
672
     },
672
     },
673
     handleSearch(val){
673
     handleSearch(val){
674
-      
674
+       console.log("val23233232",val)
675
        this.getInitializtion()
675
        this.getInitializtion()
676
-       this.getSinleOrderDetail(val.id)
676
+       this.getSinleOrderDetail(val.id,val.warehouse_out_time)
677
        this.list = []
677
        this.list = []
678
       //  this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
678
       //  this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
679
 
679
 
944
      }
944
      }
945
      return name
945
      return name
946
    },
946
    },
947
-   getSinleOrderDetail(id){
947
+   getSinleOrderDetail(id,start_time){
948
        var params = {
948
        var params = {
949
          id:id,
949
          id:id,
950
+         start_time:start_time,
950
        }
951
        }
951
      getSinleOrderDetail(params).then(response=>{
952
      getSinleOrderDetail(params).then(response=>{
952
         if(response.data.state == 1){
953
         if(response.data.state == 1){
955
           var list =  response.data.data.list
956
           var list =  response.data.data.list
956
           console.log("list2323232",list)
957
           console.log("list2323232",list)
957
           var outList = response.data.data.outList
958
           var outList = response.data.data.outList
959
+          for(let i=0;i<outList.length;i++){
960
+            console.log("55555",outList[i].count_unit)
961
+            console.log("666",outList[i].max_unit)
962
+          if(outList[i].count_unit == outList[i].max_unit){
963
+              outList[i].count =outList[i].count * outList[i].min_number
964
+            }
965
+          }
958
           this.outList = outList
966
           this.outList = outList
959
-         console.log("outList222",outList)
967
+         console.log("出库数据44444",outList)
960
          this.manufacturerList = response.data.data.manufacturerList
968
          this.manufacturerList = response.data.data.manufacturerList
961
          this.dealerList = response.data.data.dealerList
969
          this.dealerList = response.data.data.dealerList
962
          var drugFlowList = response.data.data.drugFlowList
970
          var drugFlowList = response.data.data.drugFlowList
1019
           start_time:this.start_time,
1027
           start_time:this.start_time,
1020
           end_time:this.end_time,
1028
           end_time:this.end_time,
1021
          }
1029
          }
1022
-         console.log("paramsw2ww",params)
1030
+       
1023
         getDrugCountList(params).then(response=>{
1031
         getDrugCountList(params).then(response=>{
1024
           if(response.data.state == 1){
1032
           if(response.data.state == 1){
1025
             var countlist =  response.data.data.countList
1033
             var countlist =  response.data.data.countList
1063
         }
1071
         }
1064
         return str + min_str
1072
         return str + min_str
1065
       },
1073
       },
1066
-      getTotalCount(drug_id){
1074
+      getTotalCount(drug_id,min_number,max_unit,min_unit){
1075
+        console.log("hhhhhhhhh",this.outList)
1067
          var str = ""
1076
          var str = ""
1068
          var min_str = ""
1077
          var min_str = ""
1078
+         var arr = []
1079
+         var total = 0
1069
          for(let i=0;i<this.outList.length;i++){
1080
          for(let i=0;i<this.outList.length;i++){
1070
            if(this.outList[i].drug_id == drug_id){
1081
            if(this.outList[i].drug_id == drug_id){
1071
-            if(parseInt(this.outList[i].count/this.outList[i].min_number)!=0){
1072
-              str = parseInt(this.outList[i].count/this.outList[i].min_number)+ this.outList[i].max_unit
1082
+             total += this.outList[i].count
1083
+           }
1084
+         }
1085
+
1086
+         if (total >=min_number){
1087
+            if(parseInt(total/min_number)!=0){
1088
+              str = parseInt(total/min_number)+ max_unit
1073
             }
1089
             }
1074
-            if((this.outList[i].count%this.outList[i].min_number)!=0){
1075
-              min_str =  this.outList[i].count%this.outList[i].min_number + this.outList[i].min_unit
1090
+            if((total%min_number)!=0){
1091
+              min_str =  total%min_number + min_unit
1076
             }
1092
             }
1077
-           }
1078
          }
1093
          }
1094
+        
1095
+        if (total < min_number){
1096
+            str = ""
1097
+            min_str = total + min_unit
1098
+        }
1099
+       
1079
          return str + min_str
1100
          return str + min_str
1080
       },
1101
       },
1081
       getTotalCountOne(id,min_number,max_unit,min_unit){
1102
       getTotalCountOne(id,min_number,max_unit,min_unit){
1103
+        console.log("列表",this.drugFlowList)
1082
         var arr = []
1104
         var arr = []
1083
         for(let i=0;i<this.drugFlowList.length;i++){
1105
         for(let i=0;i<this.drugFlowList.length;i++){
1084
           if(id == this.drugFlowList[i].drug_id){
1106
           if(id == this.drugFlowList[i].drug_id){
1085
              arr.push(this.drugFlowList[i])
1107
              arr.push(this.drugFlowList[i])
1086
           }
1108
           }
1087
         }
1109
         }
1110
+      
1088
         var total = 0
1111
         var total = 0
1089
         for(let i=0;i<arr.length;i++){
1112
         for(let i=0;i<arr.length;i++){
1090
-          if(arr[i].max_unit == max_unit){
1091
-             arr[i].count = arr[i].count * arr[i].min_number
1113
+          if(arr[i].count_unit == max_unit){
1114
+             arr[i].count = arr[i].count * min_number
1092
           }
1115
           }
1093
-          if(arr[i].max_unit == min_unit){
1116
+          if(arr[i].count_unit == min_unit){
1094
             arr[i].count = arr[i].count
1117
             arr[i].count = arr[i].count
1095
           }
1118
           }
1096
           total += arr[i].count
1119
           total += arr[i].count
1097
         }
1120
         }
1098
-
1121
+      console.log("arr00000000000",arr)
1099
         var str = ""
1122
         var str = ""
1100
         var min_str = ""
1123
         var min_str = ""
1101
-        
1102
-        str = parseInt(total/min_number)+ max_unit
1103
-        min_str =  total%min_number + min_unit
1104
-
1124
+        if(total >= min_number){
1125
+          if(parseInt(total/min_number)!=0){
1126
+            str = parseInt(total/min_number)+ max_unit
1127
+          }
1128
+          if(total%min_number !=0){
1129
+            min_str =  total%min_number + min_unit
1130
+          }
1131
+        }
1132
+        if (total < min_number){
1133
+          str = ""
1134
+          min_str = total + min_unit
1135
+        }
1136
+       
1105
         return str + min_str 
1137
         return str + min_str 
1106
 
1138
 
1107
       },
1139
       },
1179
          total_price = strprice + minstrprice
1211
          total_price = strprice + minstrprice
1180
          return  total_price
1212
          return  total_price
1181
       },
1213
       },
1182
-
1183
-      // getDrugBatchNumber(id){
1184
-        
1185
-      //   var arr= []
1186
-      //   var batchNumber =[]
1187
-        
1188
-      //   for(let i=0;i<this.userList.length;i++){
1189
-      //      if(id == this.userList[i].id){
1190
-      //        for(let j=0;j<this.userList[i].drugwarehouseoutinfo.length;j++){
1191
-      //           batchNumber.push(this.userList[i].drugwarehouseoutinfo[j].batch_number)
1192
-      //        }
1193
-      //      }
1194
-      //   }
1195
-      //   return batchNumber.join(",")
1196
-      // },
1197
-      getDrugBatchNumber(drugid){
1214
+      getDrugBatchNumber(drugid,count){
1198
         var arr = []
1215
         var arr = []
1199
         for(let i=0;i<this.batchNumberList.length;i++){
1216
         for(let i=0;i<this.batchNumberList.length;i++){
1200
-          if(drugid == this.batchNumberList[i].drug_id){
1217
+          if(drugid == this.batchNumberList[i].drug_id && count == this.batchNumberList[i].count){
1201
             arr.push(this.batchNumberList[i].batch_number)
1218
             arr.push(this.batchNumberList[i].batch_number)
1202
           }
1219
           }
1203
         }
1220
         }
1243
           }
1260
           }
1244
          
1261
          
1245
         }
1262
         }
1246
-        console.log("23232323",this.exportList)
1247
-         console.log("了下23",this.drugTypeList)
1248
       
1263
       
1249
        import('@/vendor/Export2Excel').then(excel => {
1264
        import('@/vendor/Export2Excel').then(excel => {
1250
         for(let i=0;i<this.exportList.length;i++){
1265
         for(let i=0;i<this.exportList.length;i++){

+ 6 - 5
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Datei anzeigen

149
               >
149
               >
150
                 <div style="display:flex;">
150
                 <div style="display:flex;">
151
                   <el-input
151
                   <el-input
152
-                     oninput="value=value.replace(/\D|^0/g,'')"
152
+                    oninput="value=value.replace(/\D|^0/g,'')"
153
                     style="width:80px"
153
                     style="width:80px"
154
                     placeholder="请输入出库数量"
154
                     placeholder="请输入出库数量"
155
                     type="number"
155
                     type="number"
337
       },
337
       },
338
       tableRules: {
338
       tableRules: {
339
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
339
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
340
-        count: [{ required: true, message: "数量不能为空", trigge: "blur" }],
341
-        min_unit:[{required:true,message:"单位不能为空",trigge:"blur"}]
340
+        count: [{ required: true, message: "数量不能为空", trigger: "blur" }],
341
+        min_unit:[{required:true,message:"单位不能为空",trigger:"blur"}]
342
       },
342
       },
343
       ruleForm: {
343
       ruleForm: {
344
         manufacturer: [
344
         manufacturer: [
607
               var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
607
               var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
608
               console.log("str22222222",str)
608
               console.log("str22222222",str)
609
               if(msg == 1){
609
               if(msg == 1){
610
-                this.$message.error(str + "库存不足,请入库")
610
+                this.$message.error(str + "该批次库存不足")
611
               }else{
611
               }else{
612
                 this.$message.success("出库成功");
612
                 this.$message.success("出库成功");
613
                 this.recordInfo.recordData = [];
613
                 this.recordInfo.recordData = [];
686
             this.recordInfo.recordData[i].max_unit = val.max_unit
686
             this.recordInfo.recordData[i].max_unit = val.max_unit
687
             this.recordInfo.recordData[i].min_number = val.min_number
687
             this.recordInfo.recordData[i].min_number = val.min_number
688
             this.recordInfo.recordData[i].min_unit = val.min_unit
688
             this.recordInfo.recordData[i].min_unit = val.min_unit
689
-         
689
+          
690
             this.recordInfo.recordData[i].number = val.number
690
             this.recordInfo.recordData[i].number = val.number
691
             if(val.retail_price == 0){
691
             if(val.retail_price == 0){
692
               this.recordInfo.recordData[i].price = ""
692
               this.recordInfo.recordData[i].price = ""
749
     tempObj["dealer"] = ""
749
     tempObj["dealer"] = ""
750
     tempObj["number"] = ""
750
     tempObj["number"] = ""
751
     tempObj["warehouse_info_id"] = 0
751
     tempObj["warehouse_info_id"] = 0
752
+    tempObj["count"] = ""
752
     this.recordInfo.recordData.push(tempObj);
753
     this.recordInfo.recordData.push(tempObj);
753
     this.GetConfigInfo();
754
     this.GetConfigInfo();
754
     this.propForm.goodUnit = this.$store.getters.good_unit;
755
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 9 - 4
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Datei anzeigen

300
         },
300
         },
301
         tableRules: {
301
         tableRules: {
302
           count: [
302
           count: [
303
-            { required: true, message: '数量不能为空', trigge: 'blur' }
303
+            { required: true, message: '数量不能为空', trigger: 'blur' }
304
           ],
304
           ],
305
           price: [
305
           price: [
306
             { required: true, message: '单价不能为空', trigger: 'blur' }
306
             { required: true, message: '单价不能为空', trigger: 'blur' }
449
         tempObj['batch_number'] = ''
449
         tempObj['batch_number'] = ''
450
         tempObj['number'] = ''
450
         tempObj['number'] = ''
451
         tempObj['count_unit'] = ""
451
         tempObj['count_unit'] = ""
452
-        tempObj['dealer'] = 0
453
-        tempObj['manufacturer'] = 0
452
+        tempObj['dealer'] = ""
453
+        tempObj['manufacturer'] = ""
454
         tempObj['warehouse_info_id'] = 0
454
         tempObj['warehouse_info_id'] = 0
455
         this.recordInfo.recordData.push(tempObj)
455
         this.recordInfo.recordData.push(tempObj)
456
       }, handleDelete: function(index, row) {
456
       }, handleDelete: function(index, row) {
755
              this.recordInfo.recordData[i].drug_name = val.drug_name
755
              this.recordInfo.recordData[i].drug_name = val.drug_name
756
              this.recordInfo.recordData[i].drug_type = val.drug_type
756
              this.recordInfo.recordData[i].drug_type = val.drug_type
757
              this.recordInfo.recordData[i].name  = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
757
              this.recordInfo.recordData[i].name  = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
758
-             this.recordInfo.recordData[i].last_price = val.retail_price
758
+             this.recordInfo.recordData[i].price = val.retail_price
759
              this.recordInfo.recordData[i].manufacturer =  val.manufacturer
759
              this.recordInfo.recordData[i].manufacturer =  val.manufacturer
760
              this.recordInfo.recordData[i].number = val.number
760
              this.recordInfo.recordData[i].number = val.number
761
              this.recordInfo.recordData[i].max_unit = val.max_unit
761
              this.recordInfo.recordData[i].max_unit = val.max_unit
762
              this.recordInfo.recordData[i].min_unit = val.min_unit
762
              this.recordInfo.recordData[i].min_unit = val.min_unit
763
+             if(val.dealer == 0){
764
+               this.recordInfo.recordData[i].dealer = ""
765
+             }else{
766
+               this.recordInfo.recordData[i].dealer = val.dealer
767
+             }
763
            }
768
            }
764
         }
769
         }
765
         console.log("333333",this.recordInfo.recordData)
770
         console.log("333333",this.recordInfo.recordData)

+ 165 - 131
src/xt_pages/stock/drugs/query.vue Datei anzeigen

111
         </el-table-column>
111
         </el-table-column>
112
         <el-table-column prop="drug_name" label="入库数量" align="center">
112
         <el-table-column prop="drug_name" label="入库数量" align="center">
113
            <template slot-scope="scope">
113
            <template slot-scope="scope">
114
-             <!-- {{getInCount(scope.row.drug_id)}} -->
115
-              {{getInCount(scope.row.drug_id)}}{{scope.row.max_unit}}
114
+            <span v-if="getWarehoseInfo(scope.row.drug_warehouse_info)!=0">{{getWarehoseInfo(scope.row.drug_warehouse_info)}}{{scope.row.max_unit}}</span> 
116
            </template>
115
            </template>
117
         </el-table-column>
116
         </el-table-column>
118
         <el-table-column prop="drug_name" label="出库数量" align="center">
117
         <el-table-column prop="drug_name" label="出库数量" align="center">
119
            <template slot-scope="scope">
118
            <template slot-scope="scope">
120
-             <!-- {{getOutCount(scope.row.drug_id) + getAutoCount(scope.row.drug_id)}} -->
121
-             {{getCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
119
+            {{getWarehouseOutInfo(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
122
            </template>
120
            </template>
123
         </el-table-column>
121
         </el-table-column>
124
-        <!-- <el-table-column prop="drug_name" label="退库数量" align="center">
125
-           <template slot-scope="scope">
126
-             {{getCancelCount(scope.row.drug_id)}}{{scope.row.max_unit}}
127
-           </template>
128
-        </el-table-column> -->
129
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
122
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
130
            <template slot-scope="scope">
123
            <template slot-scope="scope">
131
-             <span v-if="getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)!=''">{{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
132
-              <span v-if="getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit) ==''">0{{scope.row.max_unit}}0{{scope.row.min_unit}}</span>
124
+             <span>{{getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span> 
133
            </template>
125
            </template>
134
         </el-table-column>
126
         </el-table-column>
135
         <el-table-column prop="drug_name" label="操作" align="center" width="200px">
127
         <el-table-column prop="drug_name" label="操作" align="center" width="200px">
150
         </el-table-column>
142
         </el-table-column>
151
        </el-table>
143
        </el-table>
152
        
144
        
153
-      <el-pagination
145
+    <el-pagination
154
         @size-change="handleSizeChange"
146
         @size-change="handleSizeChange"
155
         @current-change="handleCurrentChange"
147
         @current-change="handleCurrentChange"
156
-        :page-sizes="[10, 50, 100,500,1000]"
148
+        :page-sizes="[10, 50, 100,200,500,1000]"
157
         :page-size="10"
149
         :page-size="10"
158
         background
150
         background
159
         align="right"
151
         align="right"
181
   export default {
173
   export default {
182
     name: 'stockIn',
174
     name: 'stockIn',
183
     created() {
175
     created() {
176
+      
184
       var nowDate = new Date();
177
       var nowDate = new Date();
185
       var nowYear = nowDate.getFullYear();
178
       var nowYear = nowDate.getFullYear();
186
       var nowMonth = nowDate.getMonth() + 1;
179
       var nowMonth = nowDate.getMonth() + 1;
187
       var nowDay = nowDate.getDate();
180
       var nowDay = nowDate.getDate();
188
-      this.end_time =
189
-        nowYear +
190
-        "-" +
191
-        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
192
-        "-" +
193
-        (nowDay < 10 ? "0" + nowDay : nowDay);
181
+      this.end_time =nowYear +"-" +(nowMonth < 10 ? "0" + nowMonth : nowMonth) +"-" +(nowDay < 10 ? "0" + nowDay : nowDay);
194
       nowDate.setMonth(nowDate.getMonth() - 1);
182
       nowDate.setMonth(nowDate.getMonth() - 1);
195
       nowYear = nowDate.getFullYear();
183
       nowYear = nowDate.getFullYear();
196
       nowMonth = nowDate.getMonth() + 1;
184
       nowMonth = nowDate.getMonth() + 1;
197
       nowDay = nowDate.getDate();
185
       nowDay = nowDate.getDate();
198
-      this.start_time =
199
-        nowYear +
200
-        "-" +
201
-        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
202
-        "-" +
203
-        (nowDay < 10 ? "0" + nowDay : nowDay);
186
+      this.start_time =nowYear +"-" +(nowMonth < 10 ? "0" + nowMonth : nowMonth) +"-" +(nowDay < 10 ? "0" + nowDay : nowDay);
187
+      this.getlist()
204
       var drugCategory = getDictionaryDataConfig('system','drug_category')
188
       var drugCategory = getDictionaryDataConfig('system','drug_category')
205
       this.drugCategory.push(...drugCategory)
189
       this.drugCategory.push(...drugCategory)
206
       var drugTypeList = getDictionaryDataConfig('system','drug_type') 
190
       var drugTypeList = getDictionaryDataConfig('system','drug_type') 
207
       this.drugTypeList.push(...drugTypeList)
191
       this.drugTypeList.push(...drugTypeList)
208
-      this.getlist()
209
-      this.getDrugCountList()
192
+     
193
+      // this.getDrugCountList()
194
+     
195
+      
210
     },
196
     },
211
     components: {
197
     components: {
212
       SettingDialog,
198
       SettingDialog,
219
           { path: '/stock/drugs/stock/query', name: '药品库存查询' }
205
           { path: '/stock/drugs/stock/query', name: '药品库存查询' }
220
         ],
206
         ],
221
         keywords: '',
207
         keywords: '',
222
-        total: 0,
208
+       
223
         multipleSelection: [],
209
         multipleSelection: [],
224
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
210
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
225
         start_time: '',
211
         start_time: '',
226
         end_time: '',
212
         end_time: '',
227
         page: 1,
213
         page: 1,
228
         limit: 10,
214
         limit: 10,
215
+        total: 0,
229
         goodType: [],
216
         goodType: [],
230
         goodInfo: [],
217
         goodInfo: [],
231
         tempArr: [],
218
         tempArr: [],
252
         minCount:[],
239
         minCount:[],
253
         drugOutList:[],
240
         drugOutList:[],
254
         cancelCountList:[],
241
         cancelCountList:[],
242
+        allCountList:[],
255
       }
243
       }
256
     },
244
     },
257
     methods: {
245
     methods: {
246
+     //获取库存
247
+      getlist(){
248
+      
249
+        const params = {
250
+          page: this.page,
251
+          limit: this.limit,
252
+          keyword: this.keywords,
253
+          drug_type:this.drug_type,
254
+          start_time:this.start_time,
255
+          end_time:this.end_time,
256
+        }
257
+        console.log("parasm222222",params)
258
+        getDrugStockList(params).then(response=>{
259
+          if(response.data.state == 1){
260
+             var list = response.data.data.list
261
+             console.log("list99999",list)
262
+             for(let i=0;i<list.length;i++){
263
+               for(let j=0;j<list[i].drug_warehouse_info.length;j++){
264
+                 list[i].drug_warehouse_info[j].stock_max_number = list[i].min_number * list[i].drug_warehouse_info[j].stock_max_number
265
+               }
266
+               for(let y=0;y<list[i].drug_warehouse_out.length;y++){
267
+                  if(list[i].drug_warehouse_out[y].count_unit == list[i].max_unit){
268
+                    list[i].drug_warehouse_out[y].count = list[i].drug_warehouse_out[y].count * list[i].min_number
269
+                  }
270
+               }
271
+             }
272
+             console.log("列表list232323323232323223",list)
273
+             this.tableList = list
274
+             var total = response.data.data.total
275
+             this.total = total
276
+             this.manufacturerList = response.data.data.manufacturerList
277
+           
278
+           }
279
+        })
280
+      },
258
       handleSpanTempArr() {
281
       handleSpanTempArr() {
259
         this.tempArr = []
282
         this.tempArr = []
260
 
283
 
301
           }
324
           }
302
         }
325
         }
303
       },
326
       },
304
-      GetAllDrugStockQueryList: function() {
305
-       
306
-        const Params = {
307
-          page: this.page,
308
-          limit: this.limit,
309
-          keyword: this.keywords,
310
-          drug_category:this.drug_category,
311
-          start_time:this.start_time,
312
-          end_time:this.end_time,
313
-        }
314
-        this.WarehouseInfo.loading = true
315
-        this.WarehouseInfo.warehouseInfoDate = []
316
-        getAllDrugStockQueryList(Params).then(response => {
317
-          if (response.data.state == 0) {
318
-            this.WarehouseInfo.loading = false
319
-            this.$message.error(response.data.msg)
320
-            return false
321
-          } else {
322
-            this.WarehouseInfo.loading = false
323
-            this.total = response.data.data.total
324
-            var arr = []
325
-            for (let i = 0; i < response.data.data.list.length; i++) {
326
-              this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
327
-              arr.push(response.data.data.list[i])
328
-            }
329
-           
330
-            for(let i=0;i<arr.length;i++){
331
-               arr[i].stockInCount =  this.stockInCount(arr[i])
332
-               arr[i].salesReturnCount = this.salesReturnCount(arr[i])
333
-               arr[i].reactCount = (this.stockInCount(arr[i]) - this.salesReturnCount(arr[i]))?this.stockInCount(arr[i]) - this.salesReturnCount(arr[i]):0
334
-               arr[i].stockOutCount = this.stockOutCount(arr[i])
335
-               arr[i].cancelStockCount = this.cancelStockCount(arr[i])?this.cancelStockCount(arr[i]):0
336
-               arr[i].reactOutCount = (this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i]))?(this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i])):0
337
-               arr[i].overplusCount = (this.stockInCount(arr[i])-this.salesReturnCount(arr[i])-this.stockOutCount(arr[i])+this.cancelStockCount(arr[i]))?this.stockInCount(arr[i])-this.salesReturnCount(arr[i])-this.stockOutCount(arr[i])+this.cancelStockCount(arr[i]):0
338
-            }
339
-          
340
-             this.tableData = arr
341
-            this.handleSpanTempArr()
342
-          }
343
-        })
344
-      },
327
+    
345
       getSpecificationName: function(id) {
328
       getSpecificationName: function(id) {
346
         let name = ''
329
         let name = ''
347
         for (let i = 0; i < this.goodInfo.length; i++) {
330
         for (let i = 0; i < this.goodInfo.length; i++) {
366
       },
349
       },
367
       handleSizeChange(val) {
350
       handleSizeChange(val) {
368
         this.limit = val
351
         this.limit = val
369
-     
370
         this.getlist()
352
         this.getlist()
371
       },
353
       },
372
       handleCurrentChange(val) {
354
       handleCurrentChange(val) {
373
         this.page = val
355
         this.page = val
374
-       
375
         this.getlist()
356
         this.getlist()
376
       },
357
       },
377
       calculate: function(val) {
358
       calculate: function(val) {
395
         this.$message.error("结束时间不能小于开始时间");
376
         this.$message.error("结束时间不能小于开始时间");
396
         this.end_time = "";
377
         this.end_time = "";
397
       } else {
378
       } else {
398
-        // this.GetAllDrugStockQueryList();
379
+       
399
         this.getlist()
380
         this.getlist()
400
       }
381
       }
401
      
382
      
430
         }
411
         }
431
         return total
412
         return total
432
       },
413
       },
433
-      showStockInDetailDialog: function(val) {
434
-      },
435
-      showSaleReturnDetailDialog: function() {
436
-      },
437
-      showStockOutDetailDialog: function() {
438
-      },
439
-      showCancelStockDetailDialog: function() {
440
-      },
441
       search: function() {
414
       search: function() {
442
         this.getlist()
415
         this.getlist()
443
       }, 
416
       }, 
451
            this.tableList[i].drug_type_name = this.getDrugType(this.tableList[i].drug_type)
424
            this.tableList[i].drug_type_name = this.getDrugType(this.tableList[i].drug_type)
452
            this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number+this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
425
            this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number+this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
453
            this.tableList[i].manufacturer_name = this.getManufacturerList(this.tableList[i].manufacturer)
426
            this.tableList[i].manufacturer_name = this.getManufacturerList(this.tableList[i].manufacturer)
454
-           this.tableList[i].inCount =  this.getInCount(this.tableList[i].drug_id) + this.tableList[i].max_unit
455
-           this.tableList[i].outCount = this.getCount(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
456
-           this.tableList[i].overplusCount = this.getCountTwo(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
427
+
428
+          this.tableList[i].inCount =  this.getWarehoseInfo(this.tableList[i].drug_warehouse_info)
429
+          this.tableList[i].outCount = this.getWarehouseOutInfo(this.tableList[i].drug_warehouse_out,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
430
+          this.tableList[i].overplusCount =  this.getOverFlushInfo(this.tableList[i].drug_warehouse_info,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
457
          }
431
          }
458
        
432
        
459
          console.log("hhhhhhhadhfadf 列表",this.tableList)
433
          console.log("hhhhhhhadhfadf 列表",this.tableList)
489
           query: {drug_type:this.drug_type,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
463
           query: {drug_type:this.drug_type,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
490
         });
464
         });
491
       },
465
       },
492
- 
493
-  //获取库存
494
-      getlist(){
495
-        const params = {
496
-          page: this.page,
497
-          limit: this.limit,
498
-          keyword: this.keywords,
499
-          drug_type:this.drug_type,
500
-          start_time:this.start_time,
501
-          end_time:this.end_time,
502
-        }
503
-        console.log("parasm222222",params)
504
-        getDrugStockList(params).then(response=>{
505
-          if(response.data.state == 1){
506
-             var list = response.data.data.list
507
-             console.log("list99999",list)
508
-             this.tableList = list
509
-             var total = response.data.data.total
510
-             console.log("total",total)
511
-             this.total = total
512
-             this.manufacturerList = response.data.data.manufacturerList
513
-           
514
-           }
515
-        })
516
-      },
517
       getDrugType(id){
466
       getDrugType(id){
518
        
467
        
519
         var name = ""
468
         var name = ""
543
          }
492
          }
544
         }
493
         }
545
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
494
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
546
-        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
495
+        var overPlus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
496
+        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&overPlus="+overPlus})
547
       },
497
       },
548
       handleBatch(val){
498
       handleBatch(val){
549
         var manufacturer_name = ""
499
         var manufacturer_name = ""
553
          }
503
          }
554
         }
504
         }
555
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
505
         var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
556
-        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
506
+        var overPlus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
507
+        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&overPlus="+overPlus})
557
       },
508
       },
558
       getDrugCountList(){
509
       getDrugCountList(){
559
          var params = {
510
          var params = {
565
         getDrugCountList(params).then(response=>{
516
         getDrugCountList(params).then(response=>{
566
           if(response.data.state == 1){
517
           if(response.data.state == 1){
567
             var countlist =  response.data.data.countList
518
             var countlist =  response.data.data.countList
568
-            console.log("入库数据",countlist)
569
             this.countList = countlist
519
             this.countList = countlist
570
-            var outcountlist = response.data.data.outCountList
571
-            console.log("出库数据",outcountlist)
572
-            this.outCountList = outcountlist
573
-            var aucountlist = response.data.data.auCountList
574
-            console.log("自动数据",aucountlist)
575
-            this.autoCountList = aucountlist
576
             var minCount = response.data.data.minCount
520
             var minCount = response.data.data.minCount
577
             console.log("minCount",minCount)
521
             console.log("minCount",minCount)
578
             this.minCount = minCount
522
             this.minCount = minCount
579
             var cancelCountList =  response.data.data.cancelCountList
523
             var cancelCountList =  response.data.data.cancelCountList
580
-            console.log("退库数据",cancelCountList)
581
             this.cancelCountList = cancelCountList
524
             this.cancelCountList = cancelCountList
582
             var info = response.data.data.info
525
             var info = response.data.data.info
583
             for(let i=0;i<info.length;i++){
526
             for(let i=0;i<info.length;i++){
585
                  info[i].count = info[i].count * info[i].min_number
528
                  info[i].count = info[i].count * info[i].min_number
586
               }
529
               }
587
             }
530
             }
531
+            console.log("搜有列表",this.autoCountList)
588
             console.log("info2222222",info)
532
             console.log("info2222222",info)
589
             this.drugOutList = info
533
             this.drugOutList = info
590
           }
534
           }
627
         }
571
         }
628
         return count
572
         return count
629
       },
573
       },
630
-      getCount(drug_id,min_number,max_unit,min_unit){
631
-        var count= 0
574
+     getCount(drug_id,min_number,max_unit,min_unit){
575
+        var total= 0
632
         var str = ""
576
         var str = ""
633
         var min_str = ""
577
         var min_str = ""
634
-        for(let i=0;i<this.drugOutList.length;i++){
635
-          if(drug_id == this.drugOutList[i].drug_id){
636
-             count += parseInt(this.drugOutList[i].count)
578
+        var arr = []
579
+        for(let i=0;i<this.allCountList.length;i++){
580
+          if(drug_id == this.allCountList[i].drug_id){
581
+             arr.push(this.allCountList[i])
637
           }
582
           }
638
         }
583
         }
639
-        if(parseInt(count/min_number)!=0){
640
-          str = parseInt(count/min_number)+ max_unit
584
+        var arrTwo = []
585
+        for(let i=0;i<arr.length;i++){
586
+          if(arr[i].drug_id == 1236){
587
+             arrTwo.push(arr[i])
588
+          }
589
+          if(arr[i].count_unit == max_unit){
590
+             arr[i].count = arr[i].count * min_number
591
+          }
592
+          if(arr[i].count_unit == min_unit){
593
+            arr[i].count = arr[i].count
594
+          }
595
+          total += arr[i].count
596
+        }
597
+        if(total<min_number){
598
+           str = ""
599
+           min_str = total + min_unit
641
         }
600
         }
642
-        if((count%min_number)!=0){
643
-          min_str =  count%min_number + min_unit
601
+        if(total >= min_number){
602
+          if(parseInt(total/min_number)!=0){
603
+            str = parseInt(total/min_number)+ max_unit
604
+          }
605
+          if((total%min_number)!=0){
606
+            min_str =  total%min_number + min_unit
607
+          }
644
         }
608
         }
609
+    
645
         return str + min_str
610
         return str + min_str
646
       },
611
       },
647
-
612
+  
648
       getCountOne(drug_id){
613
       getCountOne(drug_id){
649
         var count= 0
614
         var count= 0
650
         for(let i=0;i<this.drugOutList.length;i++){
615
         for(let i=0;i<this.drugOutList.length;i++){
669
        if(parseInt(count/min_number)!=0){
634
        if(parseInt(count/min_number)!=0){
670
          str = parseInt(count/min_number) + max_unit
635
          str = parseInt(count/min_number) + max_unit
671
        }
636
        }
672
-       console.log("str2222",str)
637
+     
673
        if((count%min_number)!=0){
638
        if((count%min_number)!=0){
674
          str_min = count%min_number + min_unit
639
          str_min = count%min_number + min_unit
675
        }
640
        }
676
-
677
-       console.log("str0000000",str,str_min)
678
        return str+str_min
641
        return str+str_min
679
      },
642
      },
680
       getCancelCount(id){
643
       getCancelCount(id){
686
         }
649
         }
687
         return count
650
         return count
688
       },
651
       },
652
+      getWarehoseInfo(arr){
653
+        var total = 0
654
+        if (arr.length > 0) {
655
+          for(let i=0;i<arr.length;i++){
656
+            total += parseInt(arr[i].warehousing_count)
657
+          }
658
+        }
659
+        if(total == 0){
660
+           total = ""
661
+        }
662
+       
663
+        return total
664
+      },
665
+      getOverFlushInfo(arr,max_unit,min_unit,min_number){
666
+       
667
+         var max_str=  ""
668
+         var min_str = ""
669
+         var total = 0
670
+         var newarr = arr
671
+         if(newarr.length > 0 ){
672
+           for(let i=0;i<newarr.length;i++){
673
+            total += (newarr[i].stock_max_number+newarr[i].stock_min_number)
674
+           }
675
+         }
676
+         if (total < min_number){
677
+           min_str = total + min_unit
678
+         }
679
+         if (total == 0) {
680
+            min_str = ""
681
+            max_str = ""
682
+         }
683
+         if (total >=min_number) {
684
+           if(parseInt(total/min_number)!=0){
685
+              max_str = parseInt(total/min_number) + max_unit
686
+           }
687
+           if(total%min_number!=0){
688
+              min_str = total%min_number + min_unit
689
+           }
690
+         
691
+         }
692
+        return max_str + min_str
693
+      },
694
+      getWarehouseOutInfo(arr,max_unit,min_unit,min_number){
695
+         var min_str = ""
696
+         var max_str = ""
697
+        var total = 0
698
+        if (arr.length > 0) {
699
+          for(let i=0;i<arr.length;i++){
700
+            total += parseInt(arr[i].count)
701
+          }
702
+        }
703
+      
704
+        if (total < min_number){
705
+           min_str = total + min_unit
706
+         }
707
+         if (total == 0) {
708
+            min_str = ""
709
+            max_str = ""
710
+         }
711
+         if (total >=min_number) {
712
+           if(parseInt(total/min_number)!=0){
713
+              max_str = parseInt(total/min_number) + max_unit
714
+           }
715
+           if(total%min_number!=0){
716
+              min_str = total%min_number + min_unit
717
+           }
718
+         
719
+         }
720
+        return max_str + min_str
721
+
722
+      }
689
     }
723
     }
690
   }
724
   }
691
 </script>
725
 </script>

+ 2 - 3
src/xt_pages/stock/stockBatchNumber.vue Datei anzeigen

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
         耗材名称:{{this.$route.query.good_name}} &nbsp;
8
         耗材名称:{{this.$route.query.good_name}} &nbsp;
9
-        <!-- 库存: {{getInCount(this.$route.query.id)- getOutCount(this.$route.query.id) - getAutoCount(this.$route.query.id) + getCancelCount(this.$route.query.id)}}{{this.$route.query.packing_unit}}&nbsp; -->
10
-        库存: {{getStockCount(this.$route.query.id)}}
9
+        库存:{{this.$route.query.overCount}}{{packing_unit}} &nbsp;
11
         规格:{{this.$route.query.specification_name}} &nbsp;
10
         规格:{{this.$route.query.specification_name}} &nbsp;
12
         厂家:{{this.$route.query.manufacturer}} 
11
         厂家:{{this.$route.query.manufacturer}} 
13
       </div>
12
       </div>
140
         "-" +
139
         "-" +
141
         (nowDay < 10 ? "0" + nowDay : nowDay);
140
         (nowDay < 10 ? "0" + nowDay : nowDay);
142
       this.getlist()
141
       this.getlist()
143
-      this.getStockDrugCount()
142
+      // this.getStockDrugCount()
144
       this.packing_unit = this.$route.query.packing_unit
143
       this.packing_unit = this.$route.query.packing_unit
145
     },
144
     },
146
     components: {
145
     components: {

+ 2 - 3
src/xt_pages/stock/stockFlow.vue Datei anzeigen

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
        耗材名称:{{this.$route.query.good_name}} &nbsp;
8
        耗材名称:{{this.$route.query.good_name}} &nbsp;
9
-       <!-- 库存:  {{getInCount(this.$route.query.id)- getOutCount(this.$route.query.id) - getAutoCount(this.$route.query.id) + getCancelCount(this.$route.query.id)}}{{this.$route.query.packing_unit }} &nbsp; -->
10
-       库存: {{getStockCount(this.$route.query.id)}}{{this.$route.query.packing_unit }}
9
+       库存: {{this.$route.query.overCount}}{{packing_unit}} &nbsp;
11
        规格:{{this.$route.query.specification_name}} &nbsp;
10
        规格:{{this.$route.query.specification_name}} &nbsp;
12
        厂家:{{this.$route.query.manufacturer}} 
11
        厂家:{{this.$route.query.manufacturer}} 
13
       </div>
12
       </div>
167
         (nowDay < 10 ? "0" + nowDay : nowDay);
166
         (nowDay < 10 ? "0" + nowDay : nowDay);
168
       // this.getlist()
167
       // this.getlist()
169
       // this.getStockOutList()
168
       // this.getStockOutList()
170
-      this.getStockDrugCount()
169
+      // this.getStockDrugCount()
171
     
170
     
172
       this.getStockFlow()
171
       this.getStockFlow()
173
       this.packing_unit = this.$route.query.packing_unit
172
       this.packing_unit = this.$route.query.packing_unit

+ 2 - 2
src/xt_pages/stock/stockInOrderEdit.vue Datei anzeigen

671
             stockIn: this.recordInfo.recordData
671
             stockIn: this.recordInfo.recordData
672
           };
672
           };
673
           console.log("params2222",params)
673
           console.log("params2222",params)
674
-        
674
+          
675
           EditWarehouse(
675
           EditWarehouse(
676
             params,
676
             params,
677
             this.warehousing_time,
677
             this.warehousing_time,
803
             this.recordInfo.recordData[i].good_type_id = val.id
803
             this.recordInfo.recordData[i].good_type_id = val.id
804
             this.recordInfo.recordData[i].good_name = val.good_name
804
             this.recordInfo.recordData[i].good_name = val.good_name
805
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
805
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
806
-            this.recordInfo.recordData[i].name = val.specification_name + "*" + val.min_number+val.min_unit +"/"+val.packing_unit
806
+            this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
807
             this.recordInfo.recordData[i].number =  val.number
807
             this.recordInfo.recordData[i].number =  val.number
808
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
808
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
809
             this.recordInfo.recordData[i].remark = val.remark
809
             this.recordInfo.recordData[i].remark = val.remark

+ 17 - 7
src/xt_pages/stock/stockOutOrder.vue Datei anzeigen

606
               <span>使用人</span>
606
               <span>使用人</span>
607
             </template>
607
             </template>
608
             <template slot-scope="scope">
608
             <template slot-scope="scope">
609
-              <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
609
+              <span v-if="scope.row.is_total == 0">{{scope.row.name}}</span>
610
               <span v-if="scope.row.is_total == 1"></span>
610
               <span v-if="scope.row.is_total == 1"></span>
611
             </template>
611
             </template>
612
           </el-table-column>
612
           </el-table-column>
615
               <span>使用数量</span>
615
               <span>使用数量</span>
616
             </template>
616
             </template>
617
             <template slot-scope="scope">
617
             <template slot-scope="scope">
618
-              <span v-if="scope.row.is_total == 0">{{scope.row.count}}{{scope.row.info.packing_unit}}</span>
618
+              <span v-if="scope.row.is_total == 0">{{scope.row.count}}{{scope.row.packing_unit}}</span>
619
               <span  v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
619
               <span  v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
620
 
620
 
621
             </template>
621
             </template>
634
               <span>批次号</span>
634
               <span>批次号</span>
635
             </template>
635
             </template>
636
             <template slot-scope="scope">
636
             <template slot-scope="scope">
637
-              <!-- <span v-if="scope.row.is_total == 0">{{getNumber(scope.row.id)}}</span> -->
638
-               <span v-if="scope.row.is_total ==0">{{getBatchNumber(scope.row.patient_id,scope.row.good_id)}}</span>
637
+               <span v-if="scope.row.is_total ==0">{{scope.row.number}}</span>
639
             </template>
638
             </template>
640
           </el-table-column>
639
           </el-table-column>
641
 <!-- 
640
 <!-- 
1539
               var stockflowlist = response.data.data.stockFlowList
1538
               var stockflowlist = response.data.data.stockFlowList
1540
               console.log("stockflowlist",stockflowlist)
1539
               console.log("stockflowlist",stockflowlist)
1541
               this.stockFlowList = stockflowlist
1540
               this.stockFlowList = stockflowlist
1542
-              for (let i = 0; i < arrList.length; i++) {
1543
-                var obj = arrList[i]
1541
+              // for (let i = 0; i < arrList.length; i++) {
1542
+              //   var obj = arrList[i]
1543
+              //   obj['is_total'] = 0
1544
+              //   this.userList.push(obj)
1545
+              //   total = total + arrList[i].count
1546
+              // }
1547
+              // this.userList.push({
1548
+              //   is_total: 1,
1549
+              //   total: total,
1550
+              // })
1551
+
1552
+              for (let i = 0; i <  this.stockFlowList.length; i++) {
1553
+                var obj =  this.stockFlowList[i]
1544
                 obj['is_total'] = 0
1554
                 obj['is_total'] = 0
1545
                 this.userList.push(obj)
1555
                 this.userList.push(obj)
1546
-                total = total + arrList[i].count
1556
+                total = total +  this.stockFlowList[i].count
1547
               }
1557
               }
1548
               this.userList.push({
1558
               this.userList.push({
1549
                 is_total: 1,
1559
                 is_total: 1,

+ 45 - 8
src/xt_pages/stock/stockPrint.vue Datei anzeigen

36
                                    <td>{{getGoodType(item.good_type_id)}}</td>
36
                                    <td>{{getGoodType(item.good_type_id)}}</td>
37
                                    <td>{{item.good_name }}</td>
37
                                    <td>{{item.good_name }}</td>
38
                                    <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
38
                                    <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
39
-                                   <td>{{item.price}}</td>
39
+                                   <td>{{item.buy_price}}</td>
40
                                    <td>{{getManufacture(item.manufacturer)}}</td>
40
                                    <td>{{getManufacture(item.manufacturer)}}</td>
41
-                                   <td>{{getInCount(item.good_id)}}</td>
42
-                                   <!-- <td><span>{{getOutCount(item.good_id) + getAutoCount(item.good_id)}}</span></td>  -->
43
-                                   <td><span>{{getInCount(item.good_id) - getStockCount(item.good_id)}}{{item.packing_unit}}</span></td>
44
-                                   <!-- <td>{{getInCount(item.good_id)- getOutCount(item.good_id) - getAutoCount(item.good_id)}}</td> -->
45
-                                   <!-- <td>{{getCancelCount(item.good_id)}}{{item .packing_unit}}</td> -->
46
-                                   <td> {{getStockCount(item.good_id)}} {{item.packing_unit}} </td>
41
+                                   <td>
42
+                                      <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
43
+                                   </td>
44
+                                   <td>
45
+                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info) - getOverplus(item.xt_warehouse_info) - getCancelInfo(item.cancel_stock_info)}}{{item.packing_unit}}</span>
46
+                                   </td>
47
+                                  
48
+                                   <td>
49
+                                     <span v-if="getOverplus(item.xt_warehouse_info)>0">{{getOverplus(item.xt_warehouse_info)}}{{item.packing_unit}}</span>  
50
+                                   </td>
47
                                 </tr>
51
                                 </tr>
48
                             </tbody>
52
                             </tbody>
49
                         </table>
53
                         </table>
251
        }
255
        }
252
      }
256
      }
253
      return stock_count
257
      return stock_count
258
+     },
259
+   getWareInfo(arr){
260
+     var total = 0
261
+     if(arr.length > 0){
262
+       for(let i=0;i<arr.length;i++){
263
+         total += parseInt(arr[i].warehousing_count)
264
+       }
265
+     }else{
266
+       total = ""
267
+     }
268
+     return total
269
+   },
270
+   getOverplus(arr){
271
+     var total = 0
272
+     if(arr.length > 0){
273
+      for(let i=0;i<arr.length;i++){
274
+        total += arr[i].stock_count
275
+      }
276
+     }else{
277
+       total = ""
278
+     }
279
+     return total
280
+   },
281
+   getCancelInfo(arr){
282
+     var total = 0
283
+     if(arr.length > 0){
284
+      for(let i=0;i<arr.length;i++){
285
+        total += arr[i].count
286
+      }
287
+     }else{
288
+       total = ""
254
      }
289
      }
290
+     return total
291
+   }
255
     },
292
     },
256
     created(){
293
     created(){
257
       var starttime =  this.$route.query.start_time
294
       var starttime =  this.$route.query.start_time
266
       this.limit = this.$route.query.limit
303
       this.limit = this.$route.query.limit
267
       this.getlist()
304
       this.getlist()
268
       this.GetAllGoodType()
305
       this.GetAllGoodType()
269
-      this.getStockDrugCount()
306
+      // this.getStockDrugCount()
270
     }
307
     }
271
 }
308
 }
272
 </script>
309
 </script>

+ 48 - 25
src/xt_pages/stock/stockQuery.vue Datei anzeigen

93
          </el-table-column>
93
          </el-table-column>
94
         <el-table-column label="进货单价" align="center">
94
         <el-table-column label="进货单价" align="center">
95
           <template slot-scope="scope">
95
           <template slot-scope="scope">
96
-            {{scope.row.price}}
96
+             {{scope.row.buy_price}}
97
           </template>
97
           </template>
98
         </el-table-column>
98
         </el-table-column>
99
         <el-table-column label="生产商" align="center">
99
         <el-table-column label="生产商" align="center">
103
         </el-table-column>
103
         </el-table-column>
104
        <el-table-column label="入库数量" align="center">
104
        <el-table-column label="入库数量" align="center">
105
          <template slot-scope="scope">
105
          <template slot-scope="scope">
106
-          <span>{{getInCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span>
106
+          
107
+          <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span>
107
          </template>
108
          </template>
108
        </el-table-column>
109
        </el-table-column>
109
        <el-table-column label="出库数量" align="center">
110
        <el-table-column label="出库数量" align="center">
110
          <template slot-scope="scope">
111
          <template slot-scope="scope">
111
-           <!-- <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span> -->
112
-
113
-           {{getInCount(scope.row.good_id) - getStockCount(scope.row.good_id)}}{{scope.row.packing_unit}}
112
+            <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info) - getOverplus(scope.row.xt_warehouse_info) - getCancelInfo(scope.row.cancel_stock_info)}}{{scope.row.packing_unit}}</span>
114
          </template>
113
          </template>
115
        </el-table-column>
114
        </el-table-column>
116
 
115
 
117
-       <!-- <el-table-column label="退库数量" align="center">
118
-         <template slot-scope="scope">
119
-           <span>{{getCancelCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span>
120
-
121
-         </template>
122
-       </el-table-column>
123
-       -->
124
        <el-table-column label="剩余库存量" align="center">
116
        <el-table-column label="剩余库存量" align="center">
125
          <template slot-scope="scope">
117
          <template slot-scope="scope">
126
-           <!-- {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id) + getCancelCount(scope.row.good_id)}} {{scope.row.packing_unit}} -->
127
-           
128
-           {{getStockCount(scope.row.good_id)}} {{scope.row.packing_unit}} 
129
-
118
+           <span v-if="getOverplus(scope.row.xt_warehouse_info)>0">{{getOverplus(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span>
130
          </template>
119
          </template>
131
        </el-table-column>
120
        </el-table-column>
132
        <el-table-column label="操作" align="center" width="260px">
121
        <el-table-column label="操作" align="center" width="260px">
199
     this.GetAllGoodInfo();
188
     this.GetAllGoodInfo();
200
     this.GetAllGoodType();
189
     this.GetAllGoodType();
201
     this.getlist()
190
     this.getlist()
202
-    this.getStockDrugCount()
191
+    // this.getStockDrugCount()
203
   },
192
   },
204
   components: {
193
   components: {
205
     BreadCrumb
194
     BreadCrumb
406
          import('@/vendor/Export2Excel').then(excel => {
395
          import('@/vendor/Export2Excel').then(excel => {
407
 
396
 
408
          const tHeader = ['耗材类型', '耗材名称', '规格&单位','进货单价','生产商','入库数量','出库数量','库存剩余量']
397
          const tHeader = ['耗材类型', '耗材名称', '规格&单位','进货单价','生产商','入库数量','出库数量','库存剩余量']
409
-         const filterVal = ['type_name', 'good_name', 'unit','price','prodect_name','inCount','outCount','overplus']
398
+         const filterVal = ['type_name', 'good_name', 'unit','buy_price','prodect_name','inCount','outCount','overplus']
410
 
399
 
411
        
400
        
412
          for(let i=0;i<this.tableList.length;i++){
401
          for(let i=0;i<this.tableList.length;i++){
413
            this.tableList[i].type_name = this.getGoodType(this.tableList[i].good_type_id)
402
            this.tableList[i].type_name = this.getGoodType(this.tableList[i].good_type_id)
414
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
403
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
415
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
404
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
416
-           this.tableList[i].inCount =  this.getInCount(this.tableList[i].good_id)
417
-          //  this.tableList[i].outCount = this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
418
-          //  this.tableList[i].overplus =this.getInCount(this.tableList[i].good_id)- this.getOutCount(this.tableList[i].good_id) - this.getAutoCount(this.tableList[i].good_id)
419
-          this.tableList[i].outCount =  this.getInCount(this.tableList[i].good_id) - this.getStockCount(this.tableList[i].good_id)
420
-          this.tableList[i].overplus = this.getStockCount(this.tableList[i].good_id)
405
+           this.tableList[i].inCount =  this.getWareInfo(this.tableList[i].xt_warehouse_info)
406
+        
407
+          this.tableList[i].outCount = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getOverplus(this.tableList[i].xt_warehouse_info) - this.getCancelInfo(this.tableList[i].cancel_stock_info)
408
+          this.tableList[i].overplus = this.getOverplus(this.tableList[i].xt_warehouse_info)
421
          }
409
          }
422
          console.log("table",this.tableList)
410
          console.log("table",this.tableList)
423
          const data = this.formatJson(filterVal, this.tableList)
411
          const data = this.formatJson(filterVal, this.tableList)
505
           }
493
           }
506
        }
494
        }
507
       specification_name = val.specification_name + "/" + val.packing_unit
495
       specification_name = val.specification_name + "/" + val.packing_unit
508
-      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit})
496
+      var overCount  = this.getOverplus(val.xt_warehouse_info)
497
+      this.$router.push({path:"/stock/in/stockflow?id="+val.id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
509
     },
498
     },
510
     toClickOne(val){
499
     toClickOne(val){
511
        var manufacturer_name = ""
500
        var manufacturer_name = ""
516
           }
505
           }
517
        }
506
        }
518
       specification_name = val.specification_name + "/" + val.packing_unit
507
       specification_name = val.specification_name + "/" + val.packing_unit
519
-      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit})
508
+       var overCount  = this.getOverplus(val.xt_warehouse_info)
509
+      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
520
     },
510
     },
521
     getStockDrugCount(){
511
     getStockDrugCount(){
522
         var params ={
512
         var params ={
585
        }
575
        }
586
      }
576
      }
587
      return stock_count
577
      return stock_count
578
+   },
579
+   getWareInfo(arr){
580
+     var total = 0
581
+     if(arr.length > 0){
582
+       for(let i=0;i<arr.length;i++){
583
+         total += parseInt(arr[i].warehousing_count)
584
+       }
585
+     }else{
586
+       total = ""
587
+     }
588
+     return total
589
+   },
590
+   getOverplus(arr){
591
+     var total = 0
592
+     if(arr.length > 0){
593
+      for(let i=0;i<arr.length;i++){
594
+        total += arr[i].stock_count
595
+      }
596
+     }else{
597
+       total = ""
598
+     }
599
+     return total
600
+   },
601
+   getCancelInfo(arr){
602
+     var total = 0
603
+     if(arr.length > 0){
604
+      for(let i=0;i<arr.length;i++){
605
+        total += arr[i].count
606
+      }
607
+     }else{
608
+       total = ""
609
+     }
610
+     return total
588
    }
611
    }
589
   }
612
   }
590
 };
613
 };