Procházet zdrojové kódy

11月14日 库存扣减更新

XMLWAN před 3 roky
rodič
revize
83b364aeeb

+ 4 - 2
src/xt_pages/supply/components/addGoodOrder.vue Zobrazit soubor

@@ -348,7 +348,9 @@ getInitOrder(){
348 348
         this.supplyList = response.data.data.supplyList
349 349
        for(let i=0;i<drugList.length;i++){
350 350
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
351
-            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
351
+            if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
352
+              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
353
+            }
352 354
           }
353 355
         for(let j=0;j<this.manufactuerList.length;j++){
354 356
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
@@ -513,7 +515,7 @@ getWarehoseInfo(arr,max_unit,min_unit,min_number){
513 515
     var min_str = ""
514 516
     if (arr.length > 0) {
515 517
       for(let i=0;i<arr.length;i++){
516
-        total += parseInt(arr[i].stock_max_number)
518
+        total += parseInt(arr[i].stock_max_number+arr[i].stock_min_number)
517 519
       }
518 520
     }
519 521
     if (total < min_number){

+ 7 - 4
src/xt_pages/supply/components/addPurchaseOrder.vue Zobrazit soubor

@@ -282,15 +282,17 @@ getInitOrder(){
282 282
     getInitOrder().then(response=>{
283 283
     if(response.data.state == 1){
284 284
         var drugList = response.data.data.drugList
285
-        
285
+        console.log("druglist23232232323232332",drugList)
286 286
         this.manufactuerList = response.data.data.manufactuerList
287 287
         this.goodTypeList = response.data.data.goodTypeList
288 288
         this.drugTypeList = response.data.data.drugTypeList
289 289
         this.supplyList = response.data.data.supplyList
290 290
        for(let i=0;i<drugList.length;i++){
291
-          
292 291
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
293
-            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
292
+            if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
293
+              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
294
+            }
295
+           
294 296
           }
295 297
         for(let j=0;j<this.manufactuerList.length;j++){
296 298
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
@@ -525,12 +527,13 @@ savePurchaseOrder(){
525 527
 
526 528
 },
527 529
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
530
+    console.log("arr2332233232",arr)
528 531
     var total = 0
529 532
     var max_str=  ""
530 533
     var min_str = ""
531 534
     if (arr.length > 0) {
532 535
       for(let i=0;i<arr.length;i++){
533
-        total += parseInt(arr[i].stock_max_number)
536
+        total += parseInt(arr[i].stock_max_number+arr[i].stock_min_number)
534 537
       }
535 538
     }
536 539
     if (total < min_number){

+ 4 - 2
src/xt_pages/supply/components/editGoodOrder.vue Zobrazit soubor

@@ -347,7 +347,9 @@ getInitOrder(){
347 347
         this.supplyList = response.data.data.supplyList
348 348
        for(let i=0;i<drugList.length;i++){
349 349
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
350
-            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
350
+             if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
351
+              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
352
+            }
351 353
           }
352 354
         for(let j=0;j<this.manufactuerList.length;j++){
353 355
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
@@ -521,7 +523,7 @@ getWarehoseInfo(arr,max_unit,min_unit,min_number){
521 523
     var min_str = ""
522 524
     if (arr.length > 0) {
523 525
       for(let i=0;i<arr.length;i++){
524
-        total += parseInt(arr[i].stock_max_number)
526
+        total += parseInt(arr[i].stock_max_number+arr[i].stock_min_number)
525 527
       }
526 528
     }
527 529
     if (total < min_number){

+ 4 - 2
src/xt_pages/supply/components/editPurchaseOrder.vue Zobrazit soubor

@@ -303,7 +303,9 @@ getInitOrder(){
303 303
         this.supplyList = response.data.data.supplyList
304 304
        for(let i=0;i<drugList.length;i++){
305 305
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
306
-            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
306
+            if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
307
+              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
308
+            }
307 309
           }
308 310
         for(let j=0;j<this.manufactuerList.length;j++){
309 311
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
@@ -469,7 +471,7 @@ getWarehoseInfo(arr,max_unit,min_unit,min_number){
469 471
     var min_str = ""
470 472
     if (arr.length > 0) {
471 473
       for(let i=0;i<arr.length;i++){
472
-        total += parseInt(arr[i].stock_max_number)
474
+        total += parseInt(arr[i].stock_max_number+arr[i].stock_min_number)
473 475
       }
474 476
     }
475 477
     if (total < min_number){