XMLWAN 3 years ago
parent
commit
cca7fd721d

+ 8 - 0
src/api/stock.js View File

@@ -713,3 +713,11 @@ export function getCancelExportList(params) {
713 713
     params: params
714 714
   })
715 715
 }
716
+
717
+export function getGoodDetailPrintList(params) {
718
+  return request({
719
+    url: '/api/stock/getgooddetailprintlist',
720
+    method: 'get',
721
+    params: params
722
+  })
723
+}

+ 4 - 0
src/xt_pages/stock/cancelStockOrderAdd.vue View File

@@ -128,6 +128,7 @@
128 128
                 style="padding-top: 17px"
129 129
               >
130 130
                 <el-input
131
+                 oninput="value=value.replace(/[^0-9.]/g,'')"
131 132
                   placeholder="请输入退库数量"
132 133
                   type="number"
133 134
                   v-model="scope.row.price"
@@ -528,6 +529,9 @@ export default {
528 529
           for (let i = 0; i < array.length; i++) {
529 530
             array[i].price = (array[i].price).toString()
530 531
             total = total + array[i].price * array[i].return_count;
532
+            if(array[i].number == undefined){
533
+               array[i].number = ""
534
+            }
531 535
           }
532 536
 
533 537
           if (this.recordInfo.recordData.length <= 0) {

+ 1 - 1
src/xt_pages/stock/cancelStockOrderEdit.vue View File

@@ -75,7 +75,7 @@
75 75
             <template slot-scope="scope">
76 76
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
77 77
                             style="padding-top: 17px">
78
-                <el-input type="number" v-model="scope.row.count"></el-input>
78
+                <el-input type="number" v-model="scope.row.count"  oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
79 79
               </el-form-item>
80 80
             </template>
81 81
           </el-table-column>

+ 9 - 9
src/xt_pages/stock/detail/cancelStockDetail.vue View File

@@ -252,7 +252,9 @@ export default {
252 252
         query: {
253 253
           type: 4,
254 254
           start_time: this.start_time,
255
-          end_time: this.end_time
255
+          end_time: this.end_time,
256
+          limit:this.limit,
257
+          page:this.page
256 258
         }
257 259
       });
258 260
     },
@@ -558,16 +560,14 @@ export default {
558 560
      
559 561
         for(let i=0;i<this.tableList.length;i++){
560 562
           this.tableList[i].index = i+1
561
-          this.tableList[i].drug_name =  this.typeNameOne(this.tableList[i].good_id) 
562
-          this.tableList[i].drug_spec =  this.specificationName(this.tableList[i].good_id)
563
-          this.tableList[i].min_unit = this.getUnit(this.tableList[i].GoodInfo.good_unit)
564
-          this.tableList[i].remark = this.tableList[i].GoodInfo.remark
565
-          this.tableList[i].packing_unit = this.tableList[i].packing_unit
566
-         
563
+          this.tableList[i].good_name = this.tableList[i].GoodInfo.good_name
564
+          this.tableList[i].specification_name = this.tableList[i].GoodInfo.specification_name
565
+          this.tableList[i].packing_unit = this.tableList[i].GoodInfo.packing_unit
566
+          this.tableList[i].total_price = (this.tableList[i].count * this.tableList[i].price).toFixed(2)
567 567
         }
568 568
        import('@/vendor/Export2Excel').then(excel => {
569
-       const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','备注']
570
-       const filterVal = ['index','drug_name', 'drug_spec', 'packing_unit','count','remark']
569
+       const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','退库价','总价','备注']
570
+       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total_price','remark']
571 571
        
572 572
        const data = this.formatJson(filterVal, this.tableList)
573 573
        console.log("data",data)

+ 82 - 45
src/xt_pages/stock/detail/print.vue View File

@@ -10,8 +10,8 @@
10 10
         <div class="dialysis-print-order">
11 11
           <div class="order-yy-name">{{orgname}}</div>
12 12
           <div class="order-title" v-if="type == 1">入库单</div>
13
-          <div class="order-title" v-if="type == 2">退货单</div>
14
-          <div class="order-title" v-if="type == 3">出库单</div>
13
+        
14
+          <div class="order-title" v-if="type == 2">出库单</div>
15 15
           <div class="order-title" v-if="type == 4">退库单</div>
16 16
 
17 17
           <div style="float: left;margin-bottom: 10px;">{{getDateOne()}}</div>
@@ -23,68 +23,68 @@
23 23
             <tbody>
24 24
             <tr>
25 25
               <td style="line-height: 50px" width="50">序号</td>
26
-              <td style="line-height: 50px" width="250">耗材名称</td>
27
-              <td style="line-height: 50px" width="250">规格型号</td>
26
+              <td style="line-height: 50px" width="200">耗材名称</td>
27
+              <td style="line-height: 50px" width="200">规格型号</td>
28
+              <td style="line-height: 50px" width="80">数量</td>
28 29
               <td style="line-height: 50px" width="50">单位</td>
29 30
             
30
-              <td style="line-height: 50px" width="80">数量</td>
31
-              <td style="line-height:50px" width="80" v-if="type == 1">进货价</td>
32
-              <td style="line-height:50px" width="80" v-if="type == 3">出货价</td>
33
-              <td style="line-height: 50px" width="80" v-if="type == 1 || type == 3">总价</td>
34
-              <td style="line-height: 50px" width="">备 注</td>
31
+              <td style="line-height:50px" width="80">
32
+                <span v-if="type == 1">进货价</span> 
33
+                <span v-if="type == 2">出货价</span> 
34
+                <span v-if="type == 4">退库价</span> 
35
+              </td>
36
+              <td style="line-height: 50px" width="80">总价</td>
37
+              <td style="line-height: 50px" width="80">备 注</td>
35 38
             </tr>
36 39
 
37
-            <tr v-for="(stock,index) in stockDatas" :key="stock.id">
40
+            <tr v-for="(item,index) in stockDatas" :key="item.id">
38 41
               <td style="line-height: 50px">&nbsp;
39 42
                 {{index+1}}
40 43
               </td>
41 44
               <td style="line-height: 50px">
42
-                <span>{{stock.good_name}}</span>
45
+                <span>{{item.GoodInfo.good_name}}</span>
43 46
               </td>
44 47
               <td style="line-height: 50px">
45
-                <span v-if="stock">{{stock.specification_name}}</span>
48
+                <span>{{item.GoodInfo.specification_name}}</span>
46 49
               </td>
50
+             
47 51
               <td style="line-height: 50px">
48
-                <span>{{stock.packing_unit}}</span>
52
+                <span v-if="type == 1"> {{ item.warehousing_count }}</span>
53
+                <span v-if="type == 2"> {{ item.count }}</span>
54
+                <span v-if="type == 4"> {{ item.count }}</span>
49 55
               </td>
50
-            
51 56
               <td style="line-height: 50px">
52
-                <span v-if="type == 3">
53
-                  <span v-if="org_id == 10090">{{getWareOut(stock.id)}}</span>
54
-                  <span else>{{getStockCount(stock.id)}}</span>
55
-                </span>
56
-                <span v-else>{{calCount(stock)}}</span> 
57
+                <span>{{item.GoodInfo.packing_unit}}</span>
57 58
               </td>
58
-              <td style="line-height:50px" v-if="type == 1 && stock.query_warehousing_info.length > 0">{{stock.query_warehousing_info[0].price}}</td>
59
-              <td style="line-height:50px" v-if="type == 3 && stock.query_warehouseout_info.length > 0">
60
-                <!-- {{stock.query_warehouseout_info[0].price}} -->
61
-                {{getReailPrice(stock.id)}}
59
+              <td style="line-height:50px">
60
+                <span v-if="type == 1"> {{ item.price }}</span>
61
+                <span v-if="type == 2"> {{ item.price }}</span>
62
+                 <span v-if="type == 4"> {{ item.price }}</span>
63
+              </td>
64
+              <td style="line-height:50px">
65
+                <span v-if="type == 1">{{(item.warehousing_count * item.price).toFixed(2)}}</span>
66
+                <span v-if="type == 2">{{(item.count * item.price).toFixed(2)}}</span>
67
+                <span v-if="type == 4">{{(item.count * item.price).toFixed(2)}}</span>
68
+              </td>
69
+              <td style="line-height: 50px">
70
+                 <span v-if="type == 1">{{item.remark}}</span>
62 71
               </td>
63
-              <td style="line-height: 50px" v-if="type == 1">{{calTotal(stock)}}</td>
64
-              <td style="line-height: 50px" v-if="type == 3">
65
-                
66
-                  <span v-if="org_id == 10090">{{getPrice(stock.id)}}</span>
67
-                  <span v-else>{{(getStockCount(stock.id) * getReailPrice(stock.id)).toFixed(2)}}</span> 
68
-               
69
-             </td>
70
-              <td style="line-height: 50px"></td>
71 72
             </tr>
72 73
             </tbody>
73 74
           </table>
74
-          <table class="print-table" border="1" v-if="type == 1 || type == 3">
75
-            <tbody>
75
+          <table class="print-table" border="1">
76 76
             <tr>
77
-              <td width="633" style="line-height: 50px">合计</td>
77
+              <td style="line-height: 50px" colspan="6" width="550">合计</td>
78
+              <td width="80" style="line-height: 50px" >
79
+                <span v-if="type == 1">{{getWareInfoTotal().toFixed(2)}}</span> 
80
+                <span v-if="type == 2">{{getWareOutTotal().toFixed(2)}}</span> 
81
+                <span v-if="type == 4">{{getWareOutTotal().toFixed(2)}}</span> 
82
+              </td>
78 83
               <td width="80" style="line-height: 50px">
79
-                <span v-if="type == 1">{{calTotalPrice()}}</span>
80
-                <span v-if="type == 3 && org_id!=10090">{{getTotalPrice().toFixed(2)}}</span>
81
-                <span v-if="type == 3 && org_id==10090">{{getTotalPriceOne().toFixed(2)}}</span>
84
+
82 85
               </td>
83
-              <td></td>
84 86
             </tr>
85
-
86
-            </tbody>
87
-          </table>
87
+          </table> 
88 88
 
89 89
           <div style="display:flex;margin-top:20px;float:right;">
90 90
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
@@ -104,7 +104,7 @@
104 104
 </template>
105 105
 
106 106
 <script>
107
-  import { getPrintStockGood } from '@/api/stock'
107
+  import { getPrintStockGood,getGoodDetailPrintList,getStockDetail } from '@/api/stock'
108 108
   import { getDataConfig } from '@/utils/data'
109 109
   import { jsGetAge, uParseTime } from '@/utils/tools'
110 110
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
@@ -127,7 +127,9 @@
127 127
         queryParams: {
128 128
           start_time: this.$route.query.start_time,
129 129
           end_time: this.$route.query.end_time,
130
-          type: this.$route.query.type
130
+          type: this.$route.query.type,
131
+          limit:this.$route.query.limit,
132
+          page:this.$route.query.page,
131 133
         },
132 134
         totalPrice: 0,
133 135
         stockDatas: [],
@@ -414,14 +416,49 @@
414 416
         const res = new Map();
415 417
         return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
416 418
      },
419
+     getGoodDetailPrintList(){
420
+      getGoodDetailPrintList(this.queryParams).then(response=>{
421
+         if(response.data.state == 1){
422
+           var list = response.data.data.list
423
+           console.log("list",list)
424
+           
425
+         }
426
+      })
427
+     },
428
+
429
+     getStockDetail(){
430
+      getStockDetail(this.queryParams).then(response=>{
431
+        if(response.data.state == 1){
432
+          var total =   response.data.data.total
433
+          var list = response.data.data.list
434
+          console.log("list2323223",list)
435
+          this.stockDatas = list
436
+        }
437
+      })
438
+     },
439
+     getWareInfoTotal(){
440
+       var total = 0
441
+       for(let i=0;i<this.stockDatas.length;i++){
442
+         total+= this.stockDatas[i].warehousing_count * this.stockDatas[i].price
443
+       }
444
+       return total
445
+     },
446
+     getWareOutTotal(){
447
+       var total = 0
448
+       for(let i=0;i<this.stockDatas.length;i++){
449
+         total+= this.stockDatas[i].count * this.stockDatas[i].price
450
+       }
451
+       return total
452
+     }
417 453
     },
418 454
     created() {
419 455
       var xtuser = this.$store.getters.xt_user
420 456
       this.orgname = xtuser.org.org_name
421 457
       this.goodUnit = this.$store.getters.good_unit
422 458
 
423
-      this.getDialysisRecord()
424
-
459
+      // this.getDialysisRecord()
460
+      // this.getGoodDetailPrintList()
461
+      this.getStockDetail()
425 462
     }
426 463
 
427 464
   }

+ 3 - 1
src/xt_pages/stock/detail/salesReturnDetail.vue View File

@@ -329,7 +329,9 @@ export default {
329 329
         query: {
330 330
           type: 2,
331 331
           start_time: this.start_time,
332
-          end_time: this.end_time
332
+          end_time: this.end_time,
333
+          limit:this.limit,
334
+          page:this.page
333 335
         }
334 336
       });
335 337
     },

+ 96 - 60
src/xt_pages/stock/detail/stockInDetail.vue View File

@@ -233,7 +233,7 @@ export default {
233 233
     this.fetchAllAdminUsers();
234 234
     this.goodUnit = this.$store.getters.good_unit
235 235
 
236
-    this.getPrintStockGood()
236
+    // this.getPrintStockGood()
237 237
     this.org_id = this.$store.getters.xt_user.template_info.org_id
238 238
     console.log("机构ID",this.org_id)
239 239
   },
@@ -277,17 +277,17 @@ export default {
277 277
     changeType: function(val) {
278 278
       this.order_type = val;
279 279
       this.GetCancelStock();
280
-      this.getPrintStockGood()
280
+      // this.getPrintStockGood()
281 281
     },
282 282
     changeManufacturer: function(val) {
283 283
       this.manufacturer_id = val;
284 284
       this.GetCancelStock();
285
-      this.getPrintStockGood()
285
+      // this.getPrintStockGood()
286 286
     },
287 287
     changeDealer: function(val) {
288 288
       this.dealer_id = val;
289 289
       this.GetCancelStock();
290
-      this.getPrintStockGood()
290
+      // this.getPrintStockGood()
291 291
     },
292 292
     getTypeName: function(row) {
293 293
       let name = "";
@@ -336,6 +336,7 @@ export default {
336 336
         keywords: this.searchKey
337 337
       };
338 338
       this.cancelStockDate = [];
339
+      this.tableList = []
339 340
       getStockDetail(Params).then(response => {
340 341
         if (response.data.state == 0) {
341 342
           this.$message.error(response.data.msg);
@@ -345,6 +346,7 @@ export default {
345 346
           console.log("hhhhhhshsss",response.data.data.list)
346 347
           var total_price = 0
347 348
           for (let i = 0; i < response.data.data.list.length; i++) {
349
+            this.tableList.push(response.data.data.list[i])
348 350
             var obj = response.data.data.list[i];
349 351
             total_price += response.data.data.list[i].price * response.data.data.list[i].warehousing_count
350 352
             obj["is_total"] = 0;
@@ -394,11 +396,15 @@ export default {
394 396
         } else {
395 397
           this.total = response.data.data.total;
396 398
           var total_price = ""
399
+         
400
+        
397 401
           for (let i = 0; i < response.data.data.list.length; i++) {
402
+            this.tableList.push(response.data.data.list[i])
398 403
             var obj = response.data.data.list[i];
399 404
             obj["is_total"] = 0;
400 405
             this.cancelStockDate.push(obj);
401 406
           }
407
+        
402 408
           this.cancelStockDate.push({
403 409
             warehousing_order: "合计",
404 410
             is_total: 1,
@@ -453,12 +459,12 @@ export default {
453 459
     handleSizeChange(val) {
454 460
       this.limit = val;
455 461
       this.GetCancelStock();
456
-      this.getPrintStockGood()
462
+      // this.getPrintStockGood()
457 463
     },
458 464
     handleCurrentChange(val) {
459 465
       this.page = val;
460 466
       this.GetCancelStock();
461
-      this.getPrintStockGood()
467
+      // this.getPrintStockGood()
462 468
     },
463 469
     startTimeChange(val) {
464 470
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
@@ -467,7 +473,7 @@ export default {
467 473
         this.start_time = "";
468 474
       } else {
469 475
         this.GetCancelStock();
470
-        this.getPrintStockGood()
476
+        // this.getPrintStockGood()
471 477
       }
472 478
     },
473 479
     endTimeChange(val) {
@@ -477,7 +483,7 @@ export default {
477 483
         this.end_time = "";
478 484
       } else {
479 485
         this.GetCancelStock();
480
-        this.getPrintStockGood()
486
+        // this.getPrintStockGood()
481 487
       }
482 488
     },
483 489
     getTimestamp(time) {
@@ -634,7 +640,10 @@ export default {
634 640
         query: {
635 641
           type: 1,
636 642
           start_time: this.start_time,
637
-          end_time: this.end_time
643
+          end_time: this.end_time,
644
+          limit:this.limit,
645
+          page:this.page,
646
+          keywords:this.$router.keywords,
638 647
         }
639 648
       });
640 649
     },
@@ -733,64 +742,91 @@ export default {
733 742
         return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
734 743
       },
735 744
       
736
-      exportList(){
737
-        var obj = {index:"合计",total:0}
738
-        obj.total = this.calTotalPrice()
745
+      // exportList(){
746
+      //   var obj = {index:"合计",total:0}
747
+      //   obj.total = this.calTotalPrice()
739 748
      
740
-        for(let i=0;i<this.tableList.length;i++){
741
-          this.tableList[i].index = i+1
742
-          this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
743
-          this.tableList[i].count = this.calCount(this.tableList[i])
744
-          this.tableList[i].total = this.calTotal(this.tableList[i])
745
-          this.tableList[i].price = this.tableList[i].query_warehousing_info[0].price
746
-          this.tableList[i].remark = this.tableList[i].query_warehousing_info[0].remark
747
-          this.tableList[i].packing_unit = this.tableList[i].packing_unit
748
-        }
749
-        console.log("总共条数555",this.tableList)
749
+      //   for(let i=0;i<this.tableList.length;i++){
750
+      //     this.tableList[i].index = i+1
751
+      //     this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
752
+      //     this.tableList[i].count = this.calCount(this.tableList[i])
753
+      //     this.tableList[i].total = this.calTotal(this.tableList[i])
754
+      //     this.tableList[i].price = this.tableList[i].query_warehousing_info[0].price
755
+      //     this.tableList[i].remark = this.tableList[i].query_warehousing_info[0].remark
756
+      //     this.tableList[i].packing_unit = this.tableList[i].packing_unit
757
+      //   }
758
+      //   console.log("总共条数555",this.tableList)
750 759
          
751
-        if(this.org_id == 10024){
752
-          var arr = this.uniqueOne(this.tableList)
753
-          this.tableList = arr
754
-          this.tableList.push(obj)
755
-          console.log("去重后条数",this.tableList)
760
+      //   if(this.org_id == 10024){
761
+      //     var arr = this.uniqueOne(this.tableList)
762
+      //     this.tableList = arr
763
+      //     this.tableList.push(obj)
764
+      //     console.log("去重后条数",this.tableList)
756 765
         
757
-          import('@/vendor/Export2Excel').then(excel => {
758
-          const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
759
-          const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total','remark']
766
+      //     import('@/vendor/Export2Excel').then(excel => {
767
+      //     const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
768
+      //     const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total','remark']
760 769
           
761
-          const data = this.formatJson(filterVal, this.tableList)
762
-
763
-          console.log("data222222222",data)
764
-            excel.export_json_to_excel({
765
-              header: tHeader,
766
-              data,
767
-              filename: '耗材入库明细'
768
-            })
769
-              this.downloadLoading = false
770
-            })
771
-        }
772
-        if(this.org_id !=10024){
773
-           var arr = this.unique(this.tableList)
774
-            this.tableList = arr
775
-            this.tableList.push(obj)
776
-            console.log("去重后条数",this.tableList)
770
+      //     const data = this.formatJson(filterVal, this.tableList)
771
+
772
+      //     console.log("data222222222",data)
773
+      //       excel.export_json_to_excel({
774
+      //         header: tHeader,
775
+      //         data,
776
+      //         filename: '耗材入库明细'
777
+      //       })
778
+      //         this.downloadLoading = false
779
+      //       })
780
+      //   }
781
+      //   if(this.org_id !=10024){
782
+      //      var arr = this.unique(this.tableList)
783
+      //       this.tableList = arr
784
+      //       this.tableList.push(obj)
785
+      //       console.log("去重后条数",this.tableList)
777 786
           
778
-            import('@/vendor/Export2Excel').then(excel => {
779
-            const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
780
-            const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total','remark']
787
+      //       import('@/vendor/Export2Excel').then(excel => {
788
+      //       const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
789
+      //       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total','remark']
781 790
             
782
-            const data = this.formatJson(filterVal, this.tableList)
783
-            console.log("data222222222",data)
784
-              excel.export_json_to_excel({
785
-                header: tHeader,
786
-                data,
787
-                filename: '耗材入库明细'
788
-              })
789
-                this.downloadLoading = false
790
-              })
791
-        }
791
+      //       const data = this.formatJson(filterVal, this.tableList)
792
+      //       console.log("data222222222",data)
793
+      //         excel.export_json_to_excel({
794
+      //           header: tHeader,
795
+      //           data,
796
+      //           filename: '耗材入库明细'
797
+      //         })
798
+      //           this.downloadLoading = false
799
+      //         })
800
+      //   }
792 801
      
793
-        },
802
+      //   },
803
+      exportList(){
804
+        // var obj = {index:"合计",total:0}
805
+        // obj.total = this.calTotalPrice()
806
+        console.log("hhhh",this.tableList)
807
+       
808
+        for(let i=0;i<this.tableList.length;i++){
809
+          this.tableList[i].good_name = this.tableList[i].GoodInfo.good_name
810
+          this.tableList[i].specification_name = this.tableList[i].GoodInfo.specification_name
811
+          this.tableList[i].packing_unit = this.tableList[i].GoodInfo.packing_unit
812
+          this.tableList[i].index = i+1  
813
+          this.tableList[i].total_price = (this.tableList[i].warehousing_count * this.tableList[i].price).toFixed(2) 
814
+        }
815
+        console.log("总共条数555",this.tableList)   
816
+        import('@/vendor/Export2Excel').then(excel => {
817
+        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','进货价','总价','备注']
818
+        const filterVal = ['index','good_name', 'specification_name', 'packing_unit','warehousing_count','price','total_price','remark']
819
+        
820
+        const data = this.formatJson(filterVal, this.tableList)
821
+        console.log("data222222222",data)
822
+          excel.export_json_to_excel({
823
+            header: tHeader,
824
+            data,
825
+            filename: '耗材入库明细'
826
+          })
827
+            this.downloadLoading = false
828
+        })
829
+      },
794 830
      formatJson(filterVal, jsonData) {
795 831
         return jsonData.map(v => filterVal.map(j => v[j]));
796 832
      },

+ 63 - 34
src/xt_pages/stock/detail/stockOutDetail.vue View File

@@ -225,7 +225,7 @@ export default {
225 225
     this.GetConfigInfo();
226 226
     this.fetchAllAdminUsers();
227 227
     this.goodUnit = this.$store.getters.good_unit
228
-    this.getPrintStockGood()
228
+    // this.getPrintStockGood()
229 229
     this.getList()
230 230
     var org_id = this.$store.getters.xt_user.org.id
231 231
     this.orgId = org_id
@@ -265,18 +265,19 @@ export default {
265 265
       stockTotal:[],
266 266
       goodInfoData:[],
267 267
       orgId:"",
268
+      tableData:[]
268 269
     };
269 270
   },
270 271
   methods: {
271 272
     changeType: function(val) {
272 273
       this.order_type = val;
273 274
       this.GetCancelStock();
274
-      this.getPrintStockGood()
275
+      // this.getPrintStockGood()
275 276
     },
276 277
     changeManufacturer: function(val) {
277 278
       this.manufacturer_id = val;
278 279
       this.GetCancelStock();
279
-      this.getPrintStockGood()
280
+      // this.getPrintStockGood()
280 281
     },
281 282
     getTypeName: function(row) {
282 283
       let name = "";
@@ -335,6 +336,7 @@ export default {
335 336
 
336 337
           this.total = response.data.data.total;
337 338
           for (let i = 0; i < response.data.data.list.length; i++) {
339
+            this.tableData.push(response.data.data.list[i])
338 340
             var obj = response.data.data.list[i];
339 341
             obj["is_total"] = 0;
340 342
             this.cancelStockDate.push(obj);
@@ -379,7 +381,9 @@ export default {
379 381
           this.total = response.data.data.total;
380 382
           console.log("详情23233323",response.data.data.list)
381 383
           for (let i = 0; i < response.data.data.list.length; i++) {
384
+            this.tableData.push(response.data.data.list[i])
382 385
             var obj = response.data.data.list[i];
386
+
383 387
             obj["is_total"] = 0;
384 388
             this.cancelStockDate.push(obj);
385 389
             
@@ -439,12 +443,12 @@ export default {
439 443
     handleSizeChange(val) {
440 444
       this.limit = val;
441 445
       this.GetCancelStock();
442
-      this.getPrintStockGood()
446
+      // this.getPrintStockGood()
443 447
     },
444 448
     handleCurrentChange(val) {
445 449
       this.page = val;
446 450
       this.GetCancelStock();
447
-      this.getPrintStockGood()
451
+      // this.getPrintStockGood()
448 452
     },
449 453
     startTimeChange(val) {
450 454
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
@@ -453,7 +457,7 @@ export default {
453 457
         this.start_time = "";
454 458
       } else {
455 459
         this.GetCancelStock();
456
-        this.getPrintStockGood()
460
+        // this.getPrintStockGood()
457 461
       }
458 462
     },
459 463
     endTimeChange(val) {
@@ -463,7 +467,7 @@ export default {
463 467
         this.end_time = "";
464 468
       } else {
465 469
         this.GetCancelStock();
466
-        this.getPrintStockGood()
470
+        // this.getPrintStockGood()
467 471
       }
468 472
     },
469 473
     getTimestamp(time) {
@@ -625,9 +629,11 @@ export default {
625 629
       this.$router.push({
626 630
         path: "/stock/print",
627 631
         query: {
628
-          type: 3,
632
+          type: 2,
629 633
           start_time: this.start_time,
630
-          end_time: this.end_time
634
+          end_time: this.end_time,
635
+          limit:this.limit,
636
+          page:this.page
631 637
         }
632 638
       });
633 639
     },
@@ -745,36 +751,59 @@ export default {
745 751
         })
746 752
       },
747 753
 
748
-     exportList(){
754
+    //  exportList(){
749 755
       
750
-      for(let i=0;i<this.tableList.length;i++){
751
-         for(let j=0;j<this.goodInfoData.length;j++){
752
-            if(this.tableList[i].id === this.goodInfoData[j].id){
753
-               this.tableList[i].buy_price = this.goodInfoData[j].buy_price
754
-            }
755
-         }
756
-      }
757
-      console.log('合并后',this.tableList)
756
+    //   for(let i=0;i<this.tableList.length;i++){
757
+    //      for(let j=0;j<this.goodInfoData.length;j++){
758
+    //         if(this.tableList[i].id === this.goodInfoData[j].id){
759
+    //            this.tableList[i].buy_price = this.goodInfoData[j].buy_price
760
+    //         }
761
+    //      }
762
+    //   }
763
+    //   console.log('合并后',this.tableList)
758 764
       
759
-      var obj = {index:"合计",total:0}
760
-       obj.total = this.getTotalPrice()
761
-       for(let i=0;i<this.tableList.length;i++){
762
-        this.tableList[i].index = i+1
763
-        this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
764
-        this.tableList[i].count = this.getStockCount(this.tableList[i].id)
765
-        this.tableList[i].total = (this.getStockCount(this.tableList[i].id) * this.tableList[i].buy_price).toFixed(2)
766
-        this.tableList[i].remark = this.tableList[i].query_warehouseout_info[0].remark
767
-        this.tableList[i].packing_unit = this.tableList[i].packing_unit
768
-       }
769
-       var arr = this.unique(this.tableList)
765
+    //   var obj = {index:"合计",total:0}
766
+    //    obj.total = this.getTotalPrice()
767
+    //    for(let i=0;i<this.tableList.length;i++){
768
+    //     this.tableList[i].index = i+1
769
+    //     this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
770
+    //     this.tableList[i].count = this.getStockCount(this.tableList[i].id)
771
+    //     this.tableList[i].total = (this.getStockCount(this.tableList[i].id) * this.tableList[i].buy_price).toFixed(2)
772
+    //     this.tableList[i].remark = this.tableList[i].query_warehouseout_info[0].remark
773
+    //     this.tableList[i].packing_unit = this.tableList[i].packing_unit
774
+    //    }
775
+    //    var arr = this.unique(this.tableList)
770 776
      
771
-       this.tableList = arr
772
-       this.tableList.push(obj)
777
+    //    this.tableList = arr
778
+    //    this.tableList.push(obj)
779
+    //    import('@/vendor/Export2Excel').then(excel => {
780
+    //    const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
781
+    //    const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','buy_price','total','remark']
782
+
783
+    //    const data = this.formatJson(filterVal, this.tableList)
784
+    //    console.log("data",data)
785
+       
786
+    //     excel.export_json_to_excel({
787
+    //        header: tHeader,
788
+    //        data,
789
+    //        filename: '耗材出库明细'
790
+    //      })
791
+    //       this.downloadLoading = false
792
+    //     })
793
+    //    },
794
+    exportList(){
795
+       for(let i=0;i<this.tableData.length;i++){
796
+        this.tableData[i].index = i+1
797
+        this.tableData[i].good_name = this.tableData[i].GoodInfo.good_name
798
+        this.tableData[i].specification_name = this.tableData[i].GoodInfo.specification_name
799
+        this.tableData[i].packing_unit = this.tableData[i].GoodInfo.packing_unit
800
+        this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].price).toFixed(2)
801
+       }
773 802
        import('@/vendor/Export2Excel').then(excel => {
774 803
        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
775
-       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','buy_price','total','remark']
804
+       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total_price','remark']
776 805
 
777
-       const data = this.formatJson(filterVal, this.tableList)
806
+       const data = this.formatJson(filterVal, this.tableData)
778 807
        console.log("data",data)
779 808
        
780 809
         excel.export_json_to_excel({
@@ -784,7 +813,7 @@ export default {
784 813
          })
785 814
           this.downloadLoading = false
786 815
         })
787
-       },
816
+     },
788 817
      formatJson(filterVal, jsonData) {
789 818
         return jsonData.map(v => filterVal.map(j => v[j]));
790 819
      },

+ 3 - 1
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue View File

@@ -303,7 +303,7 @@ export default {
303 303
       searchKey: "",
304 304
       type: 1,
305 305
       page: 1,
306
-      limit: 10,
306
+      limit: 5,
307 307
       checked: false,
308 308
       total: 0,
309 309
       pageTotal: 0,
@@ -368,6 +368,8 @@ export default {
368 368
           this.$message.error(response.data.msg);
369 369
           return false;
370 370
         } else {
371
+          console.log("列表23232323232323",response.data.data.list)
372
+          
371 373
           this.total = response.data.data.total;
372 374
           for (let i = 0; i < response.data.data.list.length; i++) {
373 375
             this.cancelStockDate.push(response.data.data.list[i]);

+ 5 - 3
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue View File

@@ -155,6 +155,7 @@
155 155
               >
156 156
               <div style="display:flex;">
157 157
                 <el-input
158
+                  oninput="value=value.replace(/[^0-9.]/g,'')"
158 159
                   style="width:100px"
159 160
                   placeholder="请输入退库数量"
160 161
                   type="number"
@@ -498,7 +499,7 @@ export default {
498 499
       tempObj["product_date"] = ""
499 500
       tempObj["expiry_date"] = ""
500 501
       tempObj["batch_number"] = ""
501
-      tempObj["batch_number_id"] = ""
502
+      tempObj["batch_number_id"] = 0
502 503
       this.recordInfo.recordData.push(tempObj);
503 504
     },
504 505
     handleDelete: function(index, row) {
@@ -607,7 +608,8 @@ export default {
607 608
           const params = {
608 609
             cancelStock: this.recordInfo.recordData
609 610
           };
610
-          console.log("params2222",params)
611
+          console.log("params2222",params,this.return_time)
612
+        
611 613
           postDrugCancelStock(
612 614
             params,
613 615
             this.return_time,
@@ -751,7 +753,7 @@ export default {
751 753
     tempObj["product_date"] = ""
752 754
     tempObj["expiry_date"] = ""
753 755
     tempObj["batch_number"] = ""
754
-    tempObj["batch_number_id"] = ""
756
+    tempObj["batch_number_id"] = 0
755 757
     this.unitList =  getDataConfig('hemodialysis','units')
756 758
     console.log("单位",this.unitList)
757 759
     this.recordInfo.recordData.push(tempObj);

+ 38 - 10
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue View File

@@ -81,6 +81,7 @@
81 81
               >
82 82
               <div style="display:flex;">
83 83
                 <el-input
84
+                 oninput="value=value.replace(/[^0-9.]/g,'')"
84 85
                   style="width:100px"
85 86
                   placeholder="请输入退库数量"
86 87
                   type="number"
@@ -133,12 +134,12 @@
133 134
                 :prop="'recordData.' + scope.$index + '.return_count'"
134 135
                 style="padding-top: 17px"
135 136
               >
136
-               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
137
+               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" :disabled="canCelShow">
137 138
                   <el-option
138 139
                     v-for="(item,index) in numberList"
139 140
                     :key="index"
140 141
                     :label="item.batch_number"
141
-                    :value="item.batch_number">
142
+                    :value="item.id">
142 143
                   </el-option>
143 144
               </el-select>
144 145
               </el-form-item>
@@ -341,6 +342,7 @@
341 342
         dealerList:[],
342 343
         numberList:[],
343 344
         unitList:[],
345
+        canCelShow:true
344 346
       }
345 347
     },
346 348
     methods: {
@@ -426,13 +428,20 @@
426 428
         }
427 429
         return name;
428 430
       }, handleEdit: function(index, row) {
431
+        this.canCelShow = false
429 432
         const tempObj = {}
430 433
         tempObj['id'] = 0
431
-        tempObj['drug_id'] = 0
432
-        tempObj['count'] = ''
433
-        tempObj['price'] = ''
434
-        tempObj['retail_price'] = ''
435
-
434
+        tempObj["return_count"] = "";
435
+        tempObj["price"] = "";
436
+        tempObj["retail_price"] = "";
437
+        tempObj["register_account"] = ""
438
+        tempObj["dealer"] = ""
439
+        tempObj["manufacturer"] =""
440
+        tempObj["remark"] = ""
441
+        tempObj["product_date"] = ""
442
+        tempObj["expiry_date"] = ""
443
+        tempObj["batch_number"] = ""
444
+        tempObj["batch_number_id"] = 0
436 445
 
437 446
         this.recordInfo.recordData.push(tempObj)
438 447
       }, handleDelete: function(index, row) {
@@ -529,18 +538,36 @@
529 538
                 return
530 539
               }
531 540
             }
541
+            console.log("hhhhh3223",this.recordInfo.recordData)
542
+            console.log("900000000",this.numberList)
543
+            for(let i=0;i<this.recordInfo.recordData.length;i++){
544
+              for(let j=0;j<this.numberList.length;j++){
545
+                 if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
546
+                   this.recordInfo.recordData[i].batch_number = this.numberList[j].batch_number
547
+                   this.recordInfo.recordData[i].batch_number_id = this.numberList[j].id
548
+                 }
549
+              }
550
+             
551
+            }
532 552
 
533 553
             const params = {
534 554
               'cancelStock': this.recordInfo.recordData
535 555
             }
556
+            console.log("232323223",this.recordInfo.recordData)
557
+           
536 558
             editDrugCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
537 559
               if (response.data.state == 0) {
538 560
                 this.$message.error(response.data.msg)
539 561
                 return false
540 562
               } else {
541
-                this.$message.success('退库成功')
542
-
543
-                this.$router.back(-1)
563
+                if (response.data.data.msg == 1){
564
+                   this.$message.success('退库成功')
565
+                   this.$router.back(-1)
566
+                }
567
+                if(response.data.data.msg == 2){
568
+                   this.$message.error("退库数量大于入库数量")
569
+                }
570
+              
544 571
               }
545 572
             })
546 573
           } else {
@@ -569,6 +596,7 @@
569 596
               this.recordInfo.recordData.push(response.data.data.list[i])
570 597
             }
571 598
             this.cancelStock = response.data.data.info
599
+            console.log("hhhh23hh2hh23h223",this.cancelStock)
572 600
             this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
573 601
             this.form.manufacturer = this.cancelStock.manufacturer
574 602
             this.form.dealer = this.cancelStock.dealer

+ 4 - 2
src/xt_pages/stock/drugs/drugStockFlow.vue View File

@@ -67,12 +67,14 @@
67 67
              <span v-if="scope.row.consumable_type == 1">手动入库</span>
68 68
              <span v-if="scope.row.consumable_type == 2">手动出库</span>
69 69
              <span v-if="scope.row.consumable_type == 3">自动出库</span>
70
+             <span v-if="scope.row.consumable_type == 4">手动退库</span>
70 71
            </template>
71 72
         </el-table-column>
72 73
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
73 74
            <template slot-scope="scope">
74 75
              <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
75 76
               <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>
77
+              <span v-if="scope.row.consumable_type == 4">{{scope.row.cancel_order_number}}</span>
76 78
            </template>
77 79
         </el-table-column>
78 80
         <el-table-column prop="drug_name" label="操作日期" align="center">
@@ -85,7 +87,7 @@
85 87
              <span v-if="scope.row.consumable_type == 1">{{scope.row.count}}{{scope.row.max_unit}}</span>
86 88
              <span v-if="scope.row.consumable_type == 2">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
87 89
              <span v-if="scope.row.consumable_type == 3">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
88
-
90
+             <span v-if="scope.row.consumable_type == 4">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
89 91
             
90 92
            </template>
91 93
         </el-table-column>
@@ -214,7 +216,7 @@
214 216
           {id:1,name:"手动入库"},
215 217
           {id:2,name:"手动出库"},
216 218
           {id:3,name:"自动出库"},
217
-        
219
+          {id:4,name:"手动退库"},
218 220
 
219 221
         ],
220 222
         outList:[],

+ 1 - 0
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue View File

@@ -124,6 +124,7 @@
124 124
               >
125 125
               <div style="display:flex;">
126 126
                 <el-input
127
+                  oninput="value=value.replace(/[^0-9.]/g,'')"
127 128
                   placeholder="请输入入库数量"
128 129
                   type="number"
129 130
                   v-model="scope.row.warehousing_count"

+ 1 - 0
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue View File

@@ -189,6 +189,7 @@
189 189
               >
190 190
                 <div style="display:flex;">
191 191
                   <el-input
192
+                    oninput="value=value.replace(/[^0-9.]/g,'')"
192 193
                     placeholder="请输入入库数量"
193 194
                     type="number"
194 195
                     v-model="scope.row.warehousing_count"

+ 1 - 0
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue View File

@@ -149,6 +149,7 @@
149 149
               >
150 150
                 <div style="display:flex;">
151 151
                   <el-input
152
+                    oninput="value=value.replace(/[^0-9.]/g,'')"
152 153
                     style="width:80px"
153 154
                     placeholder="请输入出库数量"
154 155
                     type="number"

+ 1 - 0
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue View File

@@ -110,6 +110,7 @@
110 110
               >
111 111
                 <div style="display:flex;">
112 112
                   <el-input
113
+                   oninput="value=value.replace(/[^0-9.]/g,'')"
113 114
                    style="width:100px"
114 115
                    :disabled="drug_show"
115 116
                     placeholder="请输入出库数量"

+ 1 - 1
src/xt_pages/stock/drugs/query.vue View File

@@ -123,7 +123,7 @@
123 123
         </el-table-column>
124 124
         <el-table-column prop="drug_name" label="退库数量" align="center">
125 125
            <template slot-scope="scope">
126
-             {{getCancelCount(scope.row.drug_id)}}
126
+             {{getCancelCount(scope.row.drug_id)}}{{scope.row.max_unit}}
127 127
            </template>
128 128
         </el-table-column>
129 129
         <el-table-column prop="drug_name" label="剩余库存量" align="center">

+ 3 - 0
src/xt_pages/stock/stockFlow.vue View File

@@ -65,6 +65,7 @@
65 65
              <span v-if="scope.row.consumable_type == 1">手动入库</span>
66 66
              <span v-if="scope.row.consumable_type == 2">手动出库</span>
67 67
              <span v-if="scope.row.consumable_type == 3">自动出库</span>
68
+             <span v-if="scope.row.consumable_type == 4">手动退库</span>
68 69
            </template>
69 70
         </el-table-column>
70 71
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
@@ -72,6 +73,7 @@
72 73
             <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
73 74
             <span v-if="scope.row.consumable_type == 2">{{scope.row.warehouse_out_order_number}}</span>  
74 75
             <span v-if="scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>  
76
+            <span v-if="scope.row.consumable_type == 4">{{scope.row.cancel_order_number}}</span>  
75 77
            </template>
76 78
         </el-table-column>
77 79
         <el-table-column prop="drug_name" label="操作日期" align="center">
@@ -210,6 +212,7 @@
210 212
           {id:1,name:"手动入库"},
211 213
           {id:2,name:"手动出库"},
212 214
           {id:3,name:"自动出库"},
215
+          {id:4,name:"手动退库"},
213 216
         ],
214 217
         countList:[],
215 218
         outCountList:[],

+ 1 - 1
src/xt_pages/stock/stockInOrderAdd.vue View File

@@ -101,7 +101,7 @@
101 101
             <template slot-scope="scope">
102 102
               <el-form-item :prop="'recordData.' + scope.$index + '.warehousing_count'"
103 103
                             :rules='tableRules.warehousing_count' style="padding-top: 20px">
104
-                <el-input placeholder="请输入入库数量" type="number" v-model="scope.row.warehousing_count"></el-input>
104
+                <el-input placeholder="请输入入库数量" type="number" v-model="scope.row.warehousing_count"  oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
105 105
                   {{scope.row.min_unit}}
106 106
               </el-form-item>
107 107
             

+ 2 - 1
src/xt_pages/stock/stockInOrderEdit.vue View File

@@ -198,6 +198,7 @@
198 198
                 style="padding-top: 20px"
199 199
               >
200 200
                 <el-input
201
+                  oninput="value=value.replace(/[^0-9.]/g,'')"
201 202
                   placeholder="请输入入库数量"
202 203
                   type="number"
203 204
                   v-model="scope.row.warehousing_count"
@@ -824,7 +825,7 @@ export default {
824 825
           
825 826
           }
826 827
          
827
-         if(val.xt_warehouse_info.length > 0){
828
+         if(val.xt_warehouse_info !=null &&  val.xt_warehouse_info.length > 0){
828 829
            
829 830
           for(let j=0;j<val.xt_warehouse_info.length;j++){
830 831
               this.numberList.push(val.xt_warehouse_info[j])