XMLWAN 3 years ago
parent
commit
3e70d1dff2

+ 16 - 0
src/api/drug/drug_stock.js View File

565
     params: params
565
     params: params
566
   })
566
   })
567
 }
567
 }
568
+
569
+export function getDrugWarehouseInfoPrint(params) {
570
+  return request({
571
+    url: '/api/drug/getdrugwarehouseinfoprint',
572
+    method: 'get',
573
+    params: params
574
+  })
575
+}
576
+
577
+export function getDrugOutOrderPrint(params) {
578
+  return request({
579
+    url: '/api/drug/getdrugoutorderprint',
580
+    method: 'get',
581
+    params: params
582
+  })
583
+}

+ 24 - 0
src/api/patient.js View File

476
     params: params
476
     params: params
477
   })
477
   })
478
 }
478
 }
479
+
480
+export function getInspectionMajorItem(params) {
481
+  return request({
482
+    url: '/api/patient/getinspectionmajoritem',
483
+    method: 'get',
484
+    params: params
485
+  })
486
+}
487
+
488
+export function getInspectionDetail(params) {
489
+  return request({
490
+    url: '/api/patient/getinspectiondetail',
491
+    method: 'Get',
492
+    params: params
493
+  })
494
+}
495
+
496
+export function getInspectionItemList(params) {
497
+  return request({
498
+    url: '/api/patient/getinspectionitemlist',
499
+    method: 'get',
500
+    params: params
501
+  })
502
+}

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

580
             } else {
580
             } else {
581
              var msg =  response.data.data.msg
581
              var msg =  response.data.data.msg
582
              if (msg == 1){
582
              if (msg == 1){
583
-                this.$message.error("该耗材无出库记录")
583
+                this.$message.error("无出库记录")
584
                 return
584
                 return
585
              }
585
              }
586
              if(msg == 2){
586
              if(msg == 2){

+ 13 - 10
src/xt_pages/stock/detail/print.vue View File

42
                 {{index+1}}
42
                 {{index+1}}
43
               </td>
43
               </td>
44
               <td style="line-height: 50px">
44
               <td style="line-height: 50px">
45
-                <span>{{item.GoodInfo.good_name}}</span>
45
+                <!-- <span>{{item.GoodInfo.good_name}}</span> -->
46
+                {{item.good_name}}
46
               </td>
47
               </td>
47
               <td style="line-height: 50px">
48
               <td style="line-height: 50px">
48
-                <span>{{item.GoodInfo.specification_name}}</span>
49
+                <!-- <span>{{item.GoodInfo.specification_name}}</span> -->
50
+                {{item.specification_name}}
49
               </td>
51
               </td>
50
              
52
              
51
               <td style="line-height: 50px">
53
               <td style="line-height: 50px">
54
                 <span v-if="type == 4"> {{ item.count }}</span>
56
                 <span v-if="type == 4"> {{ item.count }}</span>
55
               </td>
57
               </td>
56
               <td style="line-height: 50px">
58
               <td style="line-height: 50px">
57
-                <span>{{item.GoodInfo.packing_unit}}</span>
59
+                <!-- <span>{{item.GoodInfo.packing_unit}}</span> -->
60
+                {{item.packing_unit}}
58
               </td>
61
               </td>
59
               <td style="line-height:50px">
62
               <td style="line-height:50px">
60
                 <span v-if="type == 1"> {{ item.price }}</span>
63
                 <span v-if="type == 1"> {{ item.price }}</span>
61
-                <span v-if="type == 2"> {{ item.price }}</span>
64
+                <span v-if="type == 2"> {{ item.packing_price }}</span>
62
                  <span v-if="type == 4"> {{ item.price }}</span>
65
                  <span v-if="type == 4"> {{ item.price }}</span>
63
               </td>
66
               </td>
64
               <td style="line-height:50px">
67
               <td style="line-height:50px">
65
                 <span v-if="type == 1">{{(item.warehousing_count * item.price).toFixed(2)}}</span>
68
                 <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>
69
+                <span v-if="type == 2">{{(item.count * item.packing_price).toFixed(2)}}</span>
67
                 <span v-if="type == 4">{{(item.count * item.price).toFixed(2)}}</span>
70
                 <span v-if="type == 4">{{(item.count * item.price).toFixed(2)}}</span>
68
               </td>
71
               </td>
69
               <td style="line-height: 50px">
72
               <td style="line-height: 50px">
420
       getGoodDetailPrintList(this.queryParams).then(response=>{
423
       getGoodDetailPrintList(this.queryParams).then(response=>{
421
          if(response.data.state == 1){
424
          if(response.data.state == 1){
422
            var list = response.data.data.list
425
            var list = response.data.data.list
423
-           console.log("list",list)
426
+           console.log("新的",list)
427
+           this.stockDatas = list
424
            
428
            
425
          }
429
          }
426
       })
430
       })
431
         if(response.data.state == 1){
435
         if(response.data.state == 1){
432
           var total =   response.data.data.total
436
           var total =   response.data.data.total
433
           var list = response.data.data.list
437
           var list = response.data.data.list
434
-          console.log("list2323223",list)
435
           this.stockDatas = list
438
           this.stockDatas = list
436
         }
439
         }
437
       })
440
       })
446
      getWareOutTotal(){
449
      getWareOutTotal(){
447
        var total = 0
450
        var total = 0
448
        for(let i=0;i<this.stockDatas.length;i++){
451
        for(let i=0;i<this.stockDatas.length;i++){
449
-         total+= this.stockDatas[i].count * this.stockDatas[i].price
452
+         total+= this.stockDatas[i].count * this.stockDatas[i].packing_price
450
        }
453
        }
451
        return total
454
        return total
452
      }
455
      }
457
       this.goodUnit = this.$store.getters.good_unit
460
       this.goodUnit = this.$store.getters.good_unit
458
 
461
 
459
       // this.getDialysisRecord()
462
       // this.getDialysisRecord()
460
-      // this.getGoodDetailPrintList()
461
-      this.getStockDetail()
463
+      this.getGoodDetailPrintList()
464
+      // this.getStockDetail()
462
     }
465
     }
463
 
466
 
464
   }
467
   }

+ 21 - 67
src/xt_pages/stock/detail/stockInDetail.vue View File

202
   GetAllConfig,
202
   GetAllConfig,
203
   getStockDetail,
203
   getStockDetail,
204
   getPrintStockGood,
204
   getPrintStockGood,
205
-  
205
+  getGoodDetailPrintList
206
 } from "@/api/stock";
206
 } from "@/api/stock";
207
 
207
 
208
 export default {
208
 export default {
237
     // this.getPrintStockGood()
237
     // this.getPrintStockGood()
238
     this.org_id = this.$store.getters.xt_user.template_info.org_id
238
     this.org_id = this.$store.getters.xt_user.template_info.org_id
239
     console.log("机构ID",this.org_id)
239
     console.log("机构ID",this.org_id)
240
+    this.getGoodDetailPrintList()
240
   },
241
   },
241
   data() {
242
   data() {
242
     return {
243
     return {
742
         const res = new Map();
743
         const res = new Map();
743
         return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
744
         return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
744
       },
745
       },
745
-      
746
-      // exportList(){
747
-      //   var obj = {index:"合计",total:0}
748
-      //   obj.total = this.calTotalPrice()
749
-     
750
-      //   for(let i=0;i<this.tableList.length;i++){
751
-      //     this.tableList[i].index = i+1
752
-      //     this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
753
-      //     this.tableList[i].count = this.calCount(this.tableList[i])
754
-      //     this.tableList[i].total = this.calTotal(this.tableList[i])
755
-      //     this.tableList[i].price = this.tableList[i].query_warehousing_info[0].price
756
-      //     this.tableList[i].remark = this.tableList[i].query_warehousing_info[0].remark
757
-      //     this.tableList[i].packing_unit = this.tableList[i].packing_unit
758
-      //   }
759
-      //   console.log("总共条数555",this.tableList)
760
-         
761
-      //   if(this.org_id == 10024){
762
-      //     var arr = this.uniqueOne(this.tableList)
763
-      //     this.tableList = arr
764
-      //     this.tableList.push(obj)
765
-      //     console.log("去重后条数",this.tableList)
766
-        
767
-      //     import('@/vendor/Export2Excel').then(excel => {
768
-      //     const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
769
-      //     const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total','remark']
770
-          
771
-      //     const data = this.formatJson(filterVal, this.tableList)
772
-
773
-      //     console.log("data222222222",data)
774
-      //       excel.export_json_to_excel({
775
-      //         header: tHeader,
776
-      //         data,
777
-      //         filename: '耗材入库明细'
778
-      //       })
779
-      //         this.downloadLoading = false
780
-      //       })
781
-      //   }
782
-      //   if(this.org_id !=10024){
783
-      //      var arr = this.unique(this.tableList)
784
-      //       this.tableList = arr
785
-      //       this.tableList.push(obj)
786
-      //       console.log("去重后条数",this.tableList)
787
-          
788
-      //       import('@/vendor/Export2Excel').then(excel => {
789
-      //       const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
790
-      //       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total','remark']
791
-            
792
-      //       const data = this.formatJson(filterVal, this.tableList)
793
-      //       console.log("data222222222",data)
794
-      //         excel.export_json_to_excel({
795
-      //           header: tHeader,
796
-      //           data,
797
-      //           filename: '耗材入库明细'
798
-      //         })
799
-      //           this.downloadLoading = false
800
-      //         })
801
-      //   }
802
-     
803
-      //   },
746
+    
804
       exportList(){
747
       exportList(){
805
-        // var obj = {index:"合计",total:0}
806
-        // obj.total = this.calTotalPrice()
748
+  
807
         console.log("hhhh",this.tableList)
749
         console.log("hhhh",this.tableList)
808
        
750
        
809
         for(let i=0;i<this.tableList.length;i++){
751
         for(let i=0;i<this.tableList.length;i++){
810
-          this.tableList[i].good_name = this.tableList[i].GoodInfo.good_name
811
-          this.tableList[i].specification_name = this.tableList[i].GoodInfo.specification_name
812
-          this.tableList[i].packing_unit = this.tableList[i].GoodInfo.packing_unit
813
           this.tableList[i].index = i+1  
752
           this.tableList[i].index = i+1  
814
-          this.tableList[i].total_price = (this.tableList[i].warehousing_count * this.tableList[i].price).toFixed(2) 
753
+          this.tableList[i].total_price = (this.tableList[i].warehousing_count * this.tableList[i].packing_price).toFixed(2) 
815
         }
754
         }
816
         console.log("总共条数555",this.tableList)   
755
         console.log("总共条数555",this.tableList)   
817
         import('@/vendor/Export2Excel').then(excel => {
756
         import('@/vendor/Export2Excel').then(excel => {
818
         const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','进货价','总价','备注']
757
         const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','进货价','总价','备注']
819
         const filterVal = ['index','good_name', 'specification_name', 'packing_unit','warehousing_count','price','total_price','remark']
758
         const filterVal = ['index','good_name', 'specification_name', 'packing_unit','warehousing_count','price','total_price','remark']
820
-        
759
+        console.log("hhhhhhhh",this.tableList)
760
+       
821
         const data = this.formatJson(filterVal, this.tableList)
761
         const data = this.formatJson(filterVal, this.tableList)
822
         console.log("data222222222",data)
762
         console.log("data222222222",data)
823
           excel.export_json_to_excel({
763
           excel.export_json_to_excel({
840
        }
780
        }
841
       return name
781
       return name
842
      },
782
      },
783
+     getGoodDetailPrintList(){
784
+        const params = {
785
+          start_time:this.start_time,
786
+          end_time:this.end_time,
787
+          type:1,
788
+        }
789
+      getGoodDetailPrintList(params).then(response=>{
790
+        if(response.data.state == 1){
791
+          var list = response.data.data.list
792
+          console.log("入库详情单",list)
793
+          this.tableList = list
794
+        }
795
+      })
796
+     }
843
   }
797
   }
844
 };
798
 };
845
 </script>
799
 </script>

+ 24 - 49
src/xt_pages/stock/detail/stockOutDetail.vue View File

196
 <script>
196
 <script>
197
 import { uParseTime } from "@/utils/tools";
197
 import { uParseTime } from "@/utils/tools";
198
 import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
198
 import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
199
-import { deleteCancelStock, GetAllConfig, getStockDetail,getPrintStockGood,getGoodInfoList } from "@/api/stock";
199
+import { deleteCancelStock, GetAllConfig, getStockDetail,getPrintStockGood,getGoodInfoList,getGoodDetailPrintList } from "@/api/stock";
200
 
200
 
201
 export default {
201
 export default {
202
   name: "stockOutDetail",
202
   name: "stockOutDetail",
227
     this.fetchAllAdminUsers();
227
     this.fetchAllAdminUsers();
228
     this.goodUnit = this.$store.getters.good_unit
228
     this.goodUnit = this.$store.getters.good_unit
229
     // this.getPrintStockGood()
229
     // this.getPrintStockGood()
230
-    this.getList()
230
+    // this.getList()
231
     var org_id = this.$store.getters.xt_user.org.id
231
     var org_id = this.$store.getters.xt_user.org.id
232
     this.orgId = org_id
232
     this.orgId = org_id
233
     console.log("机构信息",org_id)
233
     console.log("机构信息",org_id)
234
+    this.getGoodDetailPrintList()
235
+    
234
   },
236
   },
235
   data() {
237
   data() {
236
     return {
238
     return {
240
       ],
242
       ],
241
       manufacturer_id: "",
243
       manufacturer_id: "",
242
       dealer_id: "",
244
       dealer_id: "",
243
-      order_type: "",
245
+      order_type:"",
244
 
246
 
245
       searchKey: "",
247
       searchKey: "",
246
       type: 2,
248
       type: 2,
752
         })
754
         })
753
       },
755
       },
754
 
756
 
755
-    //  exportList(){
756
-      
757
-    //   for(let i=0;i<this.tableList.length;i++){
758
-    //      for(let j=0;j<this.goodInfoData.length;j++){
759
-    //         if(this.tableList[i].id === this.goodInfoData[j].id){
760
-    //            this.tableList[i].buy_price = this.goodInfoData[j].buy_price
761
-    //         }
762
-    //      }
763
-    //   }
764
-    //   console.log('合并后',this.tableList)
765
-      
766
-    //   var obj = {index:"合计",total:0}
767
-    //    obj.total = this.getTotalPrice()
768
-    //    for(let i=0;i<this.tableList.length;i++){
769
-    //     this.tableList[i].index = i+1
770
-    //     this.tableList[i].min_unit = this.getUnit(this.tableList[i].good_unit)
771
-    //     this.tableList[i].count = this.getStockCount(this.tableList[i].id)
772
-    //     this.tableList[i].total = (this.getStockCount(this.tableList[i].id) * this.tableList[i].buy_price).toFixed(2)
773
-    //     this.tableList[i].remark = this.tableList[i].query_warehouseout_info[0].remark
774
-    //     this.tableList[i].packing_unit = this.tableList[i].packing_unit
775
-    //    }
776
-    //    var arr = this.unique(this.tableList)
777
-     
778
-    //    this.tableList = arr
779
-    //    this.tableList.push(obj)
780
-    //    import('@/vendor/Export2Excel').then(excel => {
781
-    //    const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
782
-    //    const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','buy_price','total','remark']
783
-
784
-    //    const data = this.formatJson(filterVal, this.tableList)
785
-    //    console.log("data",data)
786
-       
787
-    //     excel.export_json_to_excel({
788
-    //        header: tHeader,
789
-    //        data,
790
-    //        filename: '耗材出库明细'
791
-    //      })
792
-    //       this.downloadLoading = false
793
-    //     })
794
-    //    },
795
     exportList(){
757
     exportList(){
796
        for(let i=0;i<this.tableData.length;i++){
758
        for(let i=0;i<this.tableData.length;i++){
797
         this.tableData[i].index = i+1
759
         this.tableData[i].index = i+1
798
-        this.tableData[i].good_name = this.tableData[i].GoodInfo.good_name
799
-        this.tableData[i].specification_name = this.tableData[i].GoodInfo.specification_name
800
-        this.tableData[i].packing_unit = this.tableData[i].GoodInfo.packing_unit
801
-        this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].price).toFixed(2)
760
+        this.tableData[i].good_name = this.tableData[i].good_name
761
+        this.tableData[i].specification_name = this.tableData[i].specification_name
762
+        this.tableData[i].packing_unit = this.tableData[i].packing_unit
763
+        this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].packing_price).toFixed(2)
802
        }
764
        }
803
        import('@/vendor/Export2Excel').then(excel => {
765
        import('@/vendor/Export2Excel').then(excel => {
804
        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
766
        const tHeader = ['序号','耗材名称', '规格型号', '单位','数量','出货价','总价','备注']
805
-       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','price','total_price','remark']
767
+       const filterVal = ['index','good_name', 'specification_name', 'packing_unit','count','packing_price','total_price','remark']
806
 
768
 
807
        const data = this.formatJson(filterVal, this.tableData)
769
        const data = this.formatJson(filterVal, this.tableData)
808
        console.log("data",data)
770
        console.log("data",data)
835
        return total_price
797
        return total_price
836
      },
798
      },
837
    
799
    
838
-     
800
+     getGoodDetailPrintList(){
801
+        const params = {
802
+          start_time:this.start_time,
803
+          end_time:this.end_time,
804
+          type:2,
805
+        }
806
+      getGoodDetailPrintList(params).then(response=>{
807
+        if(response.data.state == 1){
808
+          var list = response.data.data.list
809
+          console.log("出库单详单",list)
810
+          this.tableData = list
811
+        }
812
+      })
813
+     } 
839
   }
814
   }
840
 };
815
 };
841
 </script>
816
 </script>

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

359
       getDrugCancelDetail(params).then(response=>{
359
       getDrugCancelDetail(params).then(response=>{
360
          if(response.data.state == 1){
360
          if(response.data.state == 1){
361
            var order =  response.data.data.order
361
            var order =  response.data.data.order
362
-           console.log("退库详细222222222222222222",order)
362
+          //  console.log("退库详细222222222222222222",order)
363
            this.tableData = order
363
            this.tableData = order
364
            this.tableList = order
364
            this.tableList = order
365
            var total = response.data.data.total
365
            var total = response.data.data.total

+ 34 - 12
src/xt_pages/stock/drugs/components/drugInOrder.vue View File

199
 import { uParseTime } from "@/utils/tools";
199
 import { uParseTime } from "@/utils/tools";
200
 import { fetchAllAdminUsers } from "@/api/doctor";
200
 import { fetchAllAdminUsers } from "@/api/doctor";
201
 import { GetAllConfig } from "@/api/stock";
201
 import { GetAllConfig } from "@/api/stock";
202
-import { getDrugIndetail} from "@/api/drug/drug_stock"
202
+import { getDrugIndetail,getDrugWarehouseInfoPrint} from "@/api/drug/drug_stock"
203
 export default {
203
 export default {
204
   name: "stockInDetail",
204
   name: "stockInDetail",
205
 
205
 
228
     this.fetchAllAdminUsers()
228
     this.fetchAllAdminUsers()
229
     //获取入库单数据
229
     //获取入库单数据
230
     this.getlist()
230
     this.getlist()
231
+    this.getDrugWarehouseInfoPrint() 
232
+
231
   },
233
   },
232
   data() {
234
   data() {
233
     return {
235
     return {
243
       limit: 10,
245
       limit: 10,
244
       manufacturer_id: "",
246
       manufacturer_id: "",
245
       dealer_id: "",
247
       dealer_id: "",
246
-      order_type: "",
248
+      order_type: 1,
247
       checked: false,
249
       checked: false,
248
       total: 0,
250
       total: 0,
249
       pageTotal: 0,
251
       pageTotal: 0,
260
       selectedTableData: [],
262
       selectedTableData: [],
261
       dealer: [],
263
       dealer: [],
262
       tableList:[],
264
       tableList:[],
265
+      tabelePrintList:[],
263
     };
266
     };
264
   },
267
   },
265
   methods: {
268
   methods: {
266
     changeType: function(val) {
269
     changeType: function(val) {
270
+     
267
       this.order_type = val;
271
       this.order_type = val;
268
      
272
      
269
     },
273
     },
416
         }
420
         }
417
       })
421
       })
418
     },
422
     },
423
+    getDrugWarehouseInfoPrint(){
424
+      var params = {
425
+        start_time:this.start_time,
426
+        end_time:this.end_time,
427
+        order_type:this.order_type,
428
+      }
429
+      console.log("params2222",params)
430
+     getDrugWarehouseInfoPrint(params).then(response=>{
431
+          if(response.data.state == 1){
432
+            var list = response.data.data.list
433
+            console.log("入库单详情",list)
434
+            this.tabelePrintList = list
435
+          }   
436
+      })
437
+    },
419
     PrintAction(){
438
     PrintAction(){
439
+      console.log("打印",this.order_type)
420
       this.$router.push("/stock/drugprint?start_time="+this.start_time+"&end_time="+this.end_time+"&order_type="+this.order_type+"&manufacturer_id="+this.manufacturer_id+"&keyword="+this.keyword+"&limit="+this.limit+"&page="+this.page)
440
       this.$router.push("/stock/drugprint?start_time="+this.start_time+"&end_time="+this.end_time+"&order_type="+this.order_type+"&manufacturer_id="+this.manufacturer_id+"&keyword="+this.keyword+"&limit="+this.limit+"&page="+this.page)
421
     },
441
     },
422
     select(){
442
     select(){
432
       return name
452
       return name
433
     },
453
     },
434
      exportList(){
454
      exportList(){
435
-        for(let i=0;i<this.tableList.length;i++){
436
-          this.tableList[i].index = i+1
437
-          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
455
+        for(let i=0;i<this.tabelePrintList.length;i++){
456
+          this.tabelePrintList[i].index = i+1
457
+          this.tabelePrintList[i].drug_name = this.tabelePrintList[i].XtBaseDrug.drug_name
458
+
459
+          this.tabelePrintList[i].unit = this.tabelePrintList[i].XtBaseDrug.dose + this.tabelePrintList[i].XtBaseDrug.dose_unit + "*" + this.tabelePrintList[i].XtBaseDrug.min_number +this.tabelePrintList[i].XtBaseDrug.min_unit +"/"+this.tabelePrintList[i].XtBaseDrug.max_unit
438
         }
460
         }
439
         
461
         
440
        import('@/vendor/Export2Excel').then(excel => {
462
        import('@/vendor/Export2Excel').then(excel => {
441
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
463
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
442
        const filterVal = ['index','drug_name', 'unit', 'min_unit','warehousing_count','price','total_price','remark']
464
        const filterVal = ['index','drug_name', 'unit', 'min_unit','warehousing_count','price','total_price','remark']
443
-       console.log("表格22222222",this.tableList)
465
+       console.log("表格22222222",this.tabelePrintList)
444
        let obj = {'index':'合计','total_price':0}
466
        let obj = {'index':'合计','total_price':0}
445
-       for(let i=0;i<this.tableList.length;i++){
446
-         obj.total_price += this.tableList[i].price * this.tableList[i].warehousing_count
467
+       for(let i=0;i<this.tabelePrintList.length;i++){
468
+         obj.total_price += this.tabelePrintList[i].price * this.tabelePrintList[i].warehousing_count
447
        }
469
        }
448
-       for(let j=0;j<this.tableList.length;j++){
449
-         this.tableList[j].total_price = this.tableList[j].total_price.toFixed(2)
470
+       for(let j=0;j<this.tabelePrintList.length;j++){
471
+         this.tabelePrintList[j].total_price = this.tabelePrintList[j].total_price.toFixed(2)
450
        }
472
        }
451
        obj.total_price = obj.total_price.toFixed(2)
473
        obj.total_price = obj.total_price.toFixed(2)
452
-       this.tableList.push(obj)
453
-       const data = this.formatJson(filterVal, this.tableList)
474
+       this.tabelePrintList.push(obj)
475
+       const data = this.formatJson(filterVal, this.tabelePrintList)
454
        console.log("data",data)
476
        console.log("data",data)
455
        
477
        
456
         excel.export_json_to_excel({
478
         excel.export_json_to_excel({

+ 121 - 27
src/xt_pages/stock/drugs/components/drugOutDetail.vue View File

197
 import { uParseTime } from "@/utils/tools";
197
 import { uParseTime } from "@/utils/tools";
198
 import { fetchAllAdminUsers } from "@/api/doctor";
198
 import { fetchAllAdminUsers } from "@/api/doctor";
199
 import {GetAllConfig } from "@/api/stock";
199
 import {GetAllConfig } from "@/api/stock";
200
-import {getDrugOutDetail } from "@/api/drug/drug_stock"
200
+import {getDrugOutDetail,getDrugOutOrderPrint } from "@/api/drug/drug_stock"
201
  import {getBaseDrugLibList} from '@/api/data'
201
  import {getBaseDrugLibList} from '@/api/data'
202
 export default {
202
 export default {
203
   name: "stockOutDetail",
203
   name: "stockOutDetail",
223
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
223
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
224
       "-" +
224
       "-" +
225
       (nowDay < 10 ? "0" + nowDay : nowDay);
225
       (nowDay < 10 ? "0" + nowDay : nowDay);
226
+    this.getDrugOutOrderPrint()
226
     this.GetConfigInfo();
227
     this.GetConfigInfo();
227
     this.fetchAllAdminUsers();
228
     this.fetchAllAdminUsers();
228
     this.getlist()
229
     this.getlist()
229
     this.getBaseDrugLibList()
230
     this.getBaseDrugLibList()
231
+ 
230
   },
232
   },
231
   data() {
233
   data() {
232
     return {
234
     return {
236
       ],
238
       ],
237
       manufacturer_id: "",
239
       manufacturer_id: "",
238
       dealer_id: "",
240
       dealer_id: "",
239
-      order_type: "",
241
+      order_type:"",
240
 
242
 
241
       searchKey: "",
243
       searchKey: "",
242
       type: 2,
244
       type: 2,
259
       dealer: [],
261
       dealer: [],
260
       tableData:[],
262
       tableData:[],
261
       tableList:[],
263
       tableList:[],
262
-      drugList:[]
264
+      drugList:[],
265
+      tablePrint:[]
263
     };
266
     };
264
   },
267
   },
265
   methods: {
268
   methods: {
375
       }
378
       }
376
     },
379
     },
377
     PrintAction: function() {
380
     PrintAction: function() {
378
-       this.$router.push("/stock/drugoutorderprint?start_time="+this.start_time+"&end_time="+this.end_time+"&order_type="+this.order_type+"&manufacturer_id="+this.manufacturer_id+"&keyword="+this.keyword+"&limit="+this.limit+"&page="+this.page)
381
+       this.$router.push("/stock/drugoutorderprint?start_time="+this.start_time+"&end_time="+this.end_time+"&order_type="+2+"&manufacturer_id="+this.manufacturer_id+"&keyword="+this.keyword+"&limit="+this.limit+"&page="+this.page)
379
     },
382
     },
380
     getlist(){
383
     getlist(){
381
       var params = {
384
       var params = {
458
 
461
 
459
      exportList(){
462
      exportList(){
460
 
463
 
461
-        for(let i=0;i<this.tableList.length;i++){
462
-          for(let j=0;j<this.drugList.length;j++){
463
-             if(this.tableList[i].drug_id == this.drugList[j].id){
464
-               this.tableList[i].last_price = this.drugList[j].last_price
464
+        for(let i=0;i<this.tablePrint.length;i++){
465
+          // for(let j=0;j<this.drugList.length;j++){
466
+          //    if(this.tableList[i].drug_id == this.drugList[j].id){
467
+          //      this.tableList[i].last_price = this.drugList[j].last_price
465
                
468
                
466
-             }
467
-          }
468
-          this.tableList[i].index = i+1
469
+          //    }
470
+          // }
471
+          this.tablePrint[i].index = i+1
472
+          
469
         }
473
         }
470
-        for(let i=0;i<this.tableList.length;i++){
471
-           this.tableList[i].total_price = this.tableList[i].last_price * this.tableList[i].count
472
-           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
474
+        for(let i=0;i<this.tablePrint.length;i++){
475
+           this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
476
+          //  this.tablePrint[i].total_price = this.tablePrint[i].last_price * this.tablePrint[i].count
477
+           this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
478
+           this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
473
         }
479
         }
474
-       console.log("列表数据333333333",this.tableList)
475
-      
480
+       console.log("列表数据333333333",this.tablePrint)
481
+     
476
        import('@/vendor/Export2Excel').then(excel => {
482
        import('@/vendor/Export2Excel').then(excel => {
477
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
483
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
478
-       const filterVal = ['index','drug_name', 'unit', 'min_unit','count','last_price','total_price','remark']
479
-       let obj = {'index':'合计','total_price':0}
480
-       for(let i=0;i<this.tableList.length;i++){
481
-         obj.total_price += (this.tableList[i].last_price * this.tableList[i].count)
482
-       }
483
-       for(let j=0;j<this.tableList.length;j++){
484
-          this.tableList[j].total_price = this.tableList[j].total_price.toFixed(2)
485
-       }
486
-       obj.total_price = obj.total_price.toFixed(2)
487
-       this.tableList.push(obj)
488
-       const data = this.formatJson(filterVal, this.tableList)
484
+       const filterVal = ['index','drug_name', 'unit', 'min_unit','count','min_price','total_price','remark']
485
+      //  let obj = {'index':'合计','total_price':0}
486
+      //  for(let i=0;i<this.tablePrint.length;i++){
487
+      //    obj.total_price += (this.tablePrint[i].min_price * this.tablePrint[i].count)
488
+      //  }
489
+      //  for(let j=0;j<this.tablePrint.length;j++){
490
+      //     this.tablePrint[j].total_price = this.tablePrint[j].total_price.toFixed(2)
491
+      //  }
492
+      //  obj.total_price = obj.total_price.toFixed(2)
493
+      //  this.tablePrint.push(obj)
494
+       const data = this.formatJson(filterVal, this.tablePrint)
489
        console.log("data",data)
495
        console.log("data",data)
490
        
496
        
491
        excel.export_json_to_excel({
497
        excel.export_json_to_excel({
524
           }
530
           }
525
         })
531
         })
526
       },
532
       },
533
+    getDrugOutOrderPrint(){
534
+       var params = {
535
+         start_time:this.start_time,
536
+         end_time:this.end_time,
537
+         order_type:2,
538
+      }  
539
+      console.log("poara232323223233223",params)
540
+     getDrugOutOrderPrint(params).then(response=>{
541
+        if(response.data.state == 1){
542
+            var list = response.data.data.list
543
+            console.log("药品出库详情",list)
544
+            let objInfo = {}
545
+            list.forEach((item,index)=>{
546
+              let { drug_id } = item
547
+              if(!objInfo[drug_id]){
548
+                objInfo[drug_id] = {
549
+                  drug_id,
550
+                  child:[],
551
+                  drug_name:item.XtBaseDrug.drug_name,
552
+                  drug_spec:item.XtBaseDrug.drug_spec,
553
+                  min_unit:item.XtBaseDrug.min_unit,
554
+                  count:0,
555
+                  price:item.XtBaseDrug.retail_price,
556
+                  remark:item.XtBaseDrug.remark,
557
+                  total_price:"",
558
+                  dose:item.XtBaseDrug.dose,
559
+                  dose_unit:item.XtBaseDrug.dose_unit,
560
+                  min_number:item.XtBaseDrug.min_number,
561
+                  max_unit:item.XtBaseDrug.max_unit,
562
+                  min_price:item.XtBaseDrug.min_price,
563
+                }
564
+              }
565
+            })
566
+            let newArr = Object.values(objInfo);
567
+            for(let i=0;i<newArr.length;i++){
568
+              for(let j=0;j<list.length;j++){
569
+                if(newArr[i].drug_id == list[j].drug_id){
570
+                   newArr[i].child.push(list[j])
571
+                }
572
+              }
573
+            }
574
+           this.tablePrint = newArr
575
+           console.log(" this.tablePrint",this.tablePrint)  
576
+        }
577
+     })
578
+    },
579
+   getCount(arr,max_unit,min_unit,min_number){
580
+        var total = 0
581
+        var str = ""
582
+        var min_str = ""
583
+        for(let i=0;i<arr.length;i++){
584
+          if(arr[i].count_unit == max_unit){
585
+            arr[i].count = arr[i].count * arr[i].min_number
586
+          }
587
+        }
588
+        for(let i=0;i<arr.length;i++){
589
+          total+= arr[i].count
590
+        }
591
+
592
+       if(total<min_number){
593
+           str = ""
594
+           min_str = total + min_unit
595
+        }
596
+        if(total >= min_number){
597
+          if(parseInt(total/min_number)!=0){
598
+            str = parseInt(total/min_number)+ max_unit
599
+          }
600
+          if((total%min_number)!=0){
601
+            min_str =  total%min_number + min_unit
602
+          }
603
+        }
604
+        return str + min_str
605
+      },
606
+      getTotalPrice(arr,max_unit,min_number,min_price){
607
+        var total = 0
608
+        for(let i=0;i<arr.length;i++){
609
+          if(arr[i].count_unit == max_unit){
610
+            arr[i].count = arr[i].count * min_number
611
+          }else{
612
+            arr[i].count = arr[i].count
613
+          }
614
+        }  
615
+        for(let j=0;j<arr.length;j++){
616
+          total +=arr[j].count
617
+        }
618
+        console.log("total23232",total)
619
+        return (total*min_price).toFixed(2)
620
+      }
527
   }
621
   }
528
 };
622
 };
529
 </script>
623
 </script>

+ 101 - 8
src/xt_pages/stock/drugs/drugOutOrderPrint.vue View File

41
               </td>
41
               </td>
42
             
42
             
43
               <td style="line-height: 50px">
43
               <td style="line-height: 50px">
44
-                  {{item.count}}
44
+                  <!-- {{item.count}} -->
45
+                  {{getCount(item.child,item.max_unit,item.min_unit,item.min_number)}}
45
               </td>
46
               </td>
46
               <td style="line-height:50px">
47
               <td style="line-height:50px">
47
-                  <!-- {{item.price}} -->
48
-                  {{getPrice(item.drug_id)}}
48
+                  {{item.price}}
49
+                  <!-- {{getPrice(item.drug_id)}} -->
49
               </td>
50
               </td>
50
               <td style="line-height:50px">
51
               <td style="line-height:50px">
51
-                  {{(item.count * getPrice(item.drug_id)).toFixed(2)}}
52
+                  <!-- {{(item.count * getPrice(item.drug_id)).toFixed(2)}} -->
53
+                  <!-- {{item.count*item.price}} -->
54
+                <span ></span>   {{getTotalPrice(item.child,item.max_unit,item.min_number,item.min_price)}}
52
               </td>
55
               </td>
53
               <td style="line-height: 50px">
56
               <td style="line-height: 50px">
54
                  {{item.remark}}
57
                  {{item.remark}}
90
   import { jsGetAge, uParseTime } from '@/utils/tools'
93
   import { jsGetAge, uParseTime } from '@/utils/tools'
91
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
94
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
92
   import print from 'print-js'
95
   import print from 'print-js'
93
-  import { getDrugOutDetail} from "@/api/drug/drug_stock"
96
+  import { getDrugOutDetail,getDrugOutOrderPrint} from "@/api/drug/drug_stock"
94
   export default {
97
   export default {
95
     name: 'dialysisPrintOrder',
98
     name: 'dialysisPrintOrder',
96
     components: {
99
     components: {
190
                  dose:item.dose,
193
                  dose:item.dose,
191
                  dose_unit:item.dose_unit,
194
                  dose_unit:item.dose_unit,
192
                  min_number:item.min_number,
195
                  min_number:item.min_number,
193
-                 max_unit:item.max_unit
196
+                 max_unit:item.max_unit,
197
+                
194
                }
198
                }
195
              }
199
              }
196
           })
200
           })
258
           }
262
           }
259
         }
263
         }
260
         return price
264
         return price
265
+      },
266
+      getDrugOutOrderPrint(){
267
+         var params = {
268
+          start_time:this.start_time,
269
+          end_time:this.end_time,
270
+          order_type:parseInt(this.order_type),
271
+        }
272
+        console.log("params22222",params)
273
+        getDrugOutOrderPrint(params).then(response=>{
274
+          if(response.data.state == 1){
275
+            var list = response.data.data.list
276
+            console.log("药品出库详情",list)
277
+            let objInfo = {}
278
+            list.forEach((item,index)=>{
279
+              let { drug_id } = item
280
+              if(!objInfo[drug_id]){
281
+                objInfo[drug_id] = {
282
+                  drug_id,
283
+                  child:[],
284
+                  drug_name:item.XtBaseDrug.drug_name,
285
+                  drug_spec:item.XtBaseDrug.drug_spec,
286
+                  min_unit:item.XtBaseDrug.min_unit,
287
+                  count:0,
288
+                  price:item.XtBaseDrug.retail_price,
289
+                  remark:item.XtBaseDrug.remark,
290
+                  total_price:"",
291
+                  dose:item.XtBaseDrug.dose,
292
+                  dose_unit:item.XtBaseDrug.dose_unit,
293
+                  min_number:item.XtBaseDrug.min_number,
294
+                  max_unit:item.XtBaseDrug.max_unit,
295
+                  min_price:item.XtBaseDrug.min_price,
296
+                }
297
+              }
298
+            })
299
+            let newArr = Object.values(objInfo);
300
+            for(let i=0;i<newArr.length;i++){
301
+              for(let j=0;j<list.length;j++){
302
+                if(newArr[i].drug_id == list[j].drug_id){
303
+                   newArr[i].child.push(list[j])
304
+                }
305
+              }
306
+            }
307
+            console.log("list2334444",newArr)
308
+            this.cancelStockDate = newArr
309
+          }
310
+        })
311
+      },
312
+      getCount(arr,max_unit,min_unit,min_number){
313
+        var total = 0
314
+        var str = ""
315
+        var min_str = ""
316
+        for(let i=0;i<arr.length;i++){
317
+          if(arr[i].count_unit == max_unit){
318
+            arr[i].count = arr[i].count * arr[i].min_number
319
+          }
320
+        }
321
+        for(let i=0;i<arr.length;i++){
322
+          total+= arr[i].count
323
+        }
324
+
325
+       if(total<min_number){
326
+           str = ""
327
+           min_str = total + min_unit
328
+        }
329
+        if(total >= min_number){
330
+          if(parseInt(total/min_number)!=0){
331
+            str = parseInt(total/min_number)+ max_unit
332
+          }
333
+          if((total%min_number)!=0){
334
+            min_str =  total%min_number + min_unit
335
+          }
336
+        }
337
+        return str + min_str
338
+      },
339
+      getTotalPrice(arr,max_unit,min_number,min_price){
340
+        var total = 0
341
+        for(let i=0;i<arr.length;i++){
342
+          if(arr[i].count_unit == max_unit){
343
+            arr[i].count = arr[i].count * min_number
344
+          }else{
345
+            arr[i].count = arr[i].count
346
+          }
347
+        }  
348
+        for(let j=0;j<arr.length;j++){
349
+          total +=arr[j].count
350
+        }
351
+        console.log("total23232",total)
352
+        return (total*min_price).toFixed(2)
261
       }
353
       }
262
     },
354
     },
263
     created() {
355
     created() {
264
       var xtuser = this.$store.getters.xt_user
356
       var xtuser = this.$store.getters.xt_user
265
       this.orgname = xtuser.org.org_name
357
       this.orgname = xtuser.org.org_name
266
-      this.getlist()
267
-      this.getBaseDrugLibList()
358
+      // this.getlist()
359
+      // this.getBaseDrugLibList()
360
+      this.getDrugOutOrderPrint()
268
     }
361
     }
269
 
362
 
270
   }
363
   }

+ 24 - 5
src/xt_pages/stock/drugs/drugPrint.vue View File

31
                 {{index+1}}
31
                 {{index+1}}
32
               </td>
32
               </td>
33
               <td style="line-height: 50px">
33
               <td style="line-height: 50px">
34
-                <span>{{item.drug_name}}</span>
34
+                <span>{{item.XtBaseDrug.drug_name}}</span>
35
               </td>
35
               </td>
36
               <td style="line-height: 50px">
36
               <td style="line-height: 50px">
37
                 <!-- <span>{{item.drug_spec}}</span> -->
37
                 <!-- <span>{{item.drug_spec}}</span> -->
38
-                <span>{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
38
+                <span>{{item.XtBaseDrug.dose}}{{item.XtBaseDrug.dose_unit}}*{{item.XtBaseDrug.min_number}}{{item.XtBaseDrug.min_unit}}/{{item.XtBaseDrug.max_unit}}</span>
39
               </td>
39
               </td>
40
               <td style="line-height: 50px">
40
               <td style="line-height: 50px">
41
-                <span>{{item.min_unit}}</span>
41
+                <span>{{item.XtBaseDrug.min_unit}}</span>
42
               </td>
42
               </td>
43
             
43
             
44
               <td style="line-height: 50px">
44
               <td style="line-height: 50px">
89
   import { jsGetAge, uParseTime } from '@/utils/tools'
89
   import { jsGetAge, uParseTime } from '@/utils/tools'
90
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
90
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
91
   import print from 'print-js'
91
   import print from 'print-js'
92
-  import { getDrugIndetail} from "@/api/drug/drug_stock"
92
+  import { getDrugIndetail,getDrugWarehouseInfoPrint} from "@/api/drug/drug_stock"
93
   export default {
93
   export default {
94
     name: 'dialysisPrintOrder',
94
     name: 'dialysisPrintOrder',
95
     components: {
95
     components: {
221
            total += this.cancelStockDate[i].price*this.cancelStockDate[i].warehousing_count
221
            total += this.cancelStockDate[i].price*this.cancelStockDate[i].warehousing_count
222
         }
222
         }
223
         return total
223
         return total
224
+      },
225
+      getDrugWarehouseInfoPrint(){
226
+         var params = {
227
+          start_time:this.start_time,
228
+          end_time:this.end_time,
229
+          order_type:this.order_type,
230
+         }
231
+         console.log("params2222",params)
232
+        getDrugWarehouseInfoPrint(params).then(response=>{
233
+           if(response.data.state == 1){
234
+             var list = response.data.data.list
235
+             console.log("入库单详情",list)
236
+             this.cancelStockDate  = list
237
+           }   
238
+        })
239
+
240
+        
224
       }
241
       }
225
     },
242
     },
226
     created() {
243
     created() {
227
       var xtuser = this.$store.getters.xt_user
244
       var xtuser = this.$store.getters.xt_user
228
       this.orgname = xtuser.org.org_name
245
       this.orgname = xtuser.org.org_name
229
-      this.getlist()
246
+      // this.getlist()
247
+     
230
 
248
 
249
+      this.getDrugWarehouseInfoPrint()
231
       
250
       
232
 
251
 
233
     }
252
     }

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

696
               'stockIn': this.recordInfo.recordData
696
               'stockIn': this.recordInfo.recordData
697
             }
697
             }
698
             console.log("params2222222",params)
698
             console.log("params2222222",params)
699
-             
699
+            
700
             postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
700
             postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
701
               if (response.data.state == 0) {
701
               if (response.data.state == 0) {
702
                 this.$message.error(response.data.msg)
702
                 this.$message.error(response.data.msg)

+ 3 - 14
src/xt_pages/stock/drugs/drugStockOutOrder.vue View File

319
               <span>使用人</span>
319
               <span>使用人</span>
320
             </template>
320
             </template>
321
             <template slot-scope="scope">
321
             <template slot-scope="scope">
322
-              <!-- <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
323
-              <span  v-if="scope.row.is_total == 1"></span> -->
324
               {{scope.row.user.name}}
322
               {{scope.row.user.name}}
325
             </template>
323
             </template>
326
           </el-table-column>
324
           </el-table-column>
330
             </template>
328
             </template>
331
             <template slot-scope="scope">
329
             <template slot-scope="scope">
332
               <span >{{scope.row.count}}{{scope.row.count_unit}}</span>
330
               <span >{{scope.row.count}}{{scope.row.count_unit}}</span>
333
-              <!-- <span  v-if="scope.row.is_total == 1">{{scope.row.total}}</span> -->
334
             </template>
331
             </template>
335
           </el-table-column>
332
           </el-table-column>
336
 
333
 
954
           this.tableShow = true
951
           this.tableShow = true
955
           this.tableList = []
952
           this.tableList = []
956
           var list =  response.data.data.list
953
           var list =  response.data.data.list
957
-          console.log("list2323232",list)
958
           var outList = response.data.data.outList
954
           var outList = response.data.data.outList
959
           for(let i=0;i<outList.length;i++){
955
           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){
956
           if(outList[i].count_unit == outList[i].max_unit){
963
               outList[i].count =outList[i].count * outList[i].min_number
957
               outList[i].count =outList[i].count * outList[i].min_number
964
             }
958
             }
965
           }
959
           }
966
           this.outList = outList
960
           this.outList = outList
967
-         console.log("出库数据44444",outList)
968
          this.manufacturerList = response.data.data.manufacturerList
961
          this.manufacturerList = response.data.data.manufacturerList
969
          this.dealerList = response.data.data.dealerList
962
          this.dealerList = response.data.data.dealerList
970
          var drugFlowList = response.data.data.drugFlowList
963
          var drugFlowList = response.data.data.drugFlowList
971
          this.drugFlowList = drugFlowList
964
          this.drugFlowList = drugFlowList
972
-         console.log("23232323232323",drugFlowList)
973
          for(let i=0;i<list.length;i++){
965
          for(let i=0;i<list.length;i++){
974
            if(list[i].batch_number == "0" || list[i].batch_number == 0){
966
            if(list[i].batch_number == "0" || list[i].batch_number == 0){
975
               list[i].batch_number = ""
967
               list[i].batch_number = ""
1072
         return str + min_str
1064
         return str + min_str
1073
       },
1065
       },
1074
       getTotalCount(drug_id,min_number,max_unit,min_unit){
1066
       getTotalCount(drug_id,min_number,max_unit,min_unit){
1075
-        console.log("hhhhhhhhh",this.outList)
1076
          var str = ""
1067
          var str = ""
1077
          var min_str = ""
1068
          var min_str = ""
1078
          var arr = []
1069
          var arr = []
1100
          return str + min_str
1091
          return str + min_str
1101
       },
1092
       },
1102
       getTotalCountOne(id,min_number,max_unit,min_unit){
1093
       getTotalCountOne(id,min_number,max_unit,min_unit){
1103
-        console.log("列表",this.drugFlowList)
1104
         var arr = []
1094
         var arr = []
1105
         for(let i=0;i<this.drugFlowList.length;i++){
1095
         for(let i=0;i<this.drugFlowList.length;i++){
1106
           if(id == this.drugFlowList[i].drug_id){
1096
           if(id == this.drugFlowList[i].drug_id){
1107
              arr.push(this.drugFlowList[i])
1097
              arr.push(this.drugFlowList[i])
1108
           }
1098
           }
1109
         }
1099
         }
1110
-      
1111
         var total = 0
1100
         var total = 0
1112
         for(let i=0;i<arr.length;i++){
1101
         for(let i=0;i<arr.length;i++){
1113
           if(arr[i].count_unit == max_unit){
1102
           if(arr[i].count_unit == max_unit){
1118
           }
1107
           }
1119
           total += arr[i].count
1108
           total += arr[i].count
1120
         }
1109
         }
1121
-      console.log("arr00000000000",arr)
1122
         var str = ""
1110
         var str = ""
1123
         var min_str = ""
1111
         var min_str = ""
1124
         if(total >= min_number){
1112
         if(total >= min_number){
1133
           str = ""
1121
           str = ""
1134
           min_str = total + min_unit
1122
           min_str = total + min_unit
1135
         }
1123
         }
1136
-       
1137
         return str + min_str 
1124
         return str + min_str 
1138
-
1139
       },
1125
       },
1140
     //   getTotalCountOne(id,min_number,max_unit,min_unit){
1126
     //   getTotalCountOne(id,min_number,max_unit,min_unit){
1141
        
1127
        
1212
          return  total_price
1198
          return  total_price
1213
       },
1199
       },
1214
       getDrugBatchNumber(drugid,count){
1200
       getDrugBatchNumber(drugid,count){
1201
+        console.log("drug_id2323",drug_id)
1202
+        console.log("count",count)
1203
+        console.log("hhhhhhhhhhh",this.batchNumberList)
1215
         var arr = []
1204
         var arr = []
1216
         for(let i=0;i<this.batchNumberList.length;i++){
1205
         for(let i=0;i<this.batchNumberList.length;i++){
1217
           if(drugid == this.batchNumberList[i].drug_id && count == this.batchNumberList[i].count){
1206
           if(drugid == this.batchNumberList[i].drug_id && count == this.batchNumberList[i].count){

+ 5 - 5
src/xt_pages/user/components/PatientSidebar.vue View File

102
               name: '1-2',
102
               name: '1-2',
103
               label: '病程管理'
103
               label: '病程管理'
104
             },
104
             },
105
-            // {
106
-            //   name: '1-9',
107
-            //   label: '阶段小结'
108
-            // },
105
+            {
106
+              name: '1-9',
107
+              label: '阶段小结'
108
+            },
109
             {
109
             {
110
               name: '1-3',
110
               name: '1-3',
111
               label: '检验检查'
111
               label: '检验检查'
188
       }else if (name == '1-8'){
188
       }else if (name == '1-8'){
189
         this.$router.push({path:'/patients/patients/'+this.id+'/inspectionInfectious'})
189
         this.$router.push({path:'/patients/patients/'+this.id+'/inspectionInfectious'})
190
       }else if (name == '1-9'){
190
       }else if (name == '1-9'){
191
-        this.$router.push({path:'/patients/patients/'+2448+'/templateSummary'})
191
+        this.$router.push({path:'/patients/patients/'+this.id+'/templateSummary'})
192
       }
192
       }
193
     },
193
     },
194
     changePatient(value) {
194
     changePatient(value) {

+ 258 - 42
src/xt_pages/user/templateSummary.vue View File

36
                   color: '#606266'
36
                   color: '#606266'
37
                 }"
37
                 }"
38
                 :row-style="{ color: '#303133' }" ref="record_table" :data="records"
38
                 :row-style="{ color: '#303133' }" ref="record_table" :data="records"
39
-                        border highlight-current-row @current-change="didChangeCurrentRecord"
39
+                        border highlight-current-row @current-change="changeCurrentRecordOne"
40
                         @selection-change="didSelectionChange"
40
                         @selection-change="didSelectionChange"
41
                         :row-class-name="tableRow"
41
                         :row-class-name="tableRow"
42
                         @row-click="onRowClick"
42
                         @row-click="onRowClick"
43
               >
43
               >
44
                 <el-table-column type="selection" width="40" align="center"></el-table-column>
44
                 <el-table-column type="selection" width="40" align="center"></el-table-column>
45
-                <el-table-column label="阶段小结名称" align="center">
46
-                  <template slot-scope="scope">
47
-                    <!-- {{ scope.row.title}} -->
48
-                  </template>
49
-                </el-table-column>
50
-                <el-table-column label="记录时间" align="center">
51
-                  <template slot-scope="scope">
52
-                    <!-- {{ recordTime(scope.row.record_time) }} -->
53
-                  </template>
54
-                </el-table-column>
55
-                <el-table-column label="记录医生" align="center">
45
+                <el-table-column label="检查项目" align="center">
56
                   <template slot-scope="scope">
46
                   <template slot-scope="scope">
57
-                    <!-- {{ doctorName(scope.row.recorder) }} -->
47
+                   
58
                   </template>
48
                   </template>
59
                 </el-table-column>
49
                 </el-table-column>
60
               </el-table>
50
               </el-table>
62
             <el-col :span="14">
52
             <el-col :span="14">
63
               <div class="record_content_panel">
53
               <div class="record_content_panel">
64
                 <div style="background-color:rgb(245, 247, 250)" class="title">病程内容</div>
54
                 <div style="background-color:rgb(245, 247, 250)" class="title">病程内容</div>
65
-                <div class="content">
66
-                  <span v-if="current_select_record" v-html="current_select_record.content">{{current_select_record.content }}</span>
67
-                  <span v-else></span>
68
-                </div>
55
+                  <el-table :header-cell-style="{
56
+                     backgroundColor: 'rgb(245, 247, 250)',
57
+                     color: '#606266'
58
+                   }"
59
+                   :row-style="{ color: '#303133' }" ref="record_table" :data="records"
60
+                        border highlight-current-row @current-change="didChangeCurrentRecord"
61
+                        @selection-change="didSelectionChange"
62
+                        :row-class-name="tableRow"
63
+                        @row-click="onRowClick"
64
+                 >
65
+                  <el-table-column type="selection" width="40" align="center"></el-table-column>
66
+                  <el-table-column label="检查项目" align="center">
67
+                    <template slot-scope="scope">
68
+                    
69
+                    </template>
70
+                  </el-table-column>
71
+                </el-table>
69
               </div>
72
               </div>
70
             </el-col>
73
             </el-col>
71
           </el-row>
74
           </el-row>
103
                      </el-radio-group>
106
                      </el-radio-group>
104
                     </el-form-item> 
107
                     </el-form-item> 
105
                   </el-col>
108
                   </el-col>
109
+                  
106
                   <el-col :span="8" v-if="form.radio == 1">
110
                   <el-col :span="8" v-if="form.radio == 1">
107
                     <el-form-item>
111
                     <el-form-item>
108
                       <el-date-picker
112
                       <el-date-picker
267
                   </el-row>
271
                   </el-row>
268
                   <el-row>
272
                   <el-row>
269
                     <label class="title"><span class="name">阶段小结化验结果</span> : </label>
273
                     <label class="title"><span class="name">阶段小结化验结果</span> : </label>
270
-                     <el-select v-model="form.template_inspection_id" placeholder="请选择">
271
-                        <el-option
272
-                        v-for="item in options"
273
-                        :key="item.value"
274
-                        :label="item.label"
275
-                        :value="item.value">
276
-                        </el-option>
277
-                     </el-select>
278
-                     <el-input tyep="text" v-model="form.template_inspection_content"></el-input>
274
+                    <el-button type="primary" @click="toInspection">选择检验检查</el-button>
275
+                     <el-input tyep="text" v-model="form.template_inspection_content" style="height:100px"></el-input>
279
                   </el-row>
276
                   </el-row>
280
                   <el-row>
277
                   <el-row>
281
                     <el-col :span="8">
278
                     <el-col :span="8">
302
                   </el-row>
299
                   </el-row>
303
               </el-form>
300
               </el-form>
304
             </div>
301
             </div>
305
-
306
-
307
-          
308
             <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
302
             <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
309
               <el-button @click="show_dialog = false">取消</el-button>
303
               <el-button @click="show_dialog = false">取消</el-button>
310
               <el-button type="primary" @click="createAction">保存
304
               <el-button type="primary" @click="createAction">保存
314
         </div>
308
         </div>
315
       </el-dialog>
309
       </el-dialog>
316
 
310
 
317
-
311
+       <el-dialog
312
+        title="提示"
313
+        :visible.sync="dialogVisibleInspection"
314
+        width="80%"
315
+        >
316
+        <span>
317
+          <el-form>
318
+            <el-row>
319
+              <el-form-item>
320
+                <span>选择检验检查时间:</span>
321
+                <div>
322
+                  <el-form-item
323
+                   label="年份:"
324
+                   prop="startYear"
325
+                   style="width:100%;"
326
+                 >
327
+                 <el-date-picker 
328
+                    v-model="startYear" 
329
+                    class="timePicker" 
330
+                    type="month" 
331
+                    placeholder=""
332
+                    format="yyyy-MM" 
333
+                    value-format="yyyy-MM">
334
+	               </el-date-picker>
335
+                 </el-form-item>
336
+                 <!-- <el-form-item  label="月份:"
337
+                   prop="startYear"
338
+                   style="width:100%;">     
339
+                  <el-date-picker
340
+                    v-model="startMonth"
341
+                    type="month"
342
+                    format="MM"
343
+                    value-format="MM"
344
+                    placeholder="请选择">
345
+                  </el-date-picker>  
346
+                 </el-form-item> -->
347
+                </div>
348
+              </el-form-item>
349
+            </el-row>
350
+            <el-row>
351
+               <span>选择检验检查项目:</span>
352
+                 <div class="record">
353
+                  <el-row :gutter="15">
354
+                    <el-col :span="10">
355
+                      <el-table :header-cell-style="{
356
+                          backgroundColor: 'rgb(245, 247, 250)',
357
+                          color: '#606266'
358
+                        }"
359
+                        :row-style="{ color: '#303133' }" :data="tableList"
360
+                                border highlight-current-row @current-change="changeCurrentRecord"
361
+                                @selection-change="selectionChangeOne"
362
+                                :row-class-name="tableRow"
363
+                                @row-click="onRowClick"
364
+                                ref="singleTable"
365
+                      >
366
+                        <el-table-column type="selection" width="40" align="center"></el-table-column>
367
+                        <el-table-column label="检验项目" align="center">
368
+                          <template slot-scope="scope">
369
+                            {{scope.row.project_name}}
370
+                          </template>
371
+                        </el-table-column>
372
+                      </el-table>
373
+                    </el-col>
374
+                    <el-col :span="14">
375
+                      <div class="record_content_panel">
376
+                        <el-table :header-cell-style="{
377
+                          backgroundColor: 'rgb(245, 247, 250)',
378
+                          color: '#606266'
379
+                        }"
380
+                        :row-style="{ color: '#303133' }" ref="record_table" :data="tableData"
381
+                                border highlight-current-row @current-change="didChangeCurrentRecord"
382
+                                @selection-change="selectionChange"
383
+                                :row-class-name="tableRow"
384
+                                @row-click="onRowClick"
385
+                                
386
+                      >
387
+                        <el-table-column label="检验项目" align="center">
388
+                          <template slot-scope="scope">
389
+                            {{scope.row.item_name}}
390
+                          </template>
391
+                        </el-table-column>
392
+                        <el-table-column label="结果" align="center">
393
+                          <template slot-scope="scope">
394
+                           <span v-if="parseInt(scope.row.inspect_value) < parseInt(scope.row.range_min)">
395
+                             {{scope.row.inspect_value}}↓
396
+                          </span> 
397
+                           <span v-if="parseInt(scope.row.inspect_value) > parseInt(scope.row.range_max)">
398
+                             {{scope.row.inspect_value}}↑
399
+                          </span> 
400
+                          </template>
401
+                        </el-table-column>
402
+                        <el-table-column label="参考值" align="center">
403
+                          <template slot-scope="scope">
404
+                           {{scope.row.range_min}} ~  {{scope.row.range_max}}
405
+                          </template>
406
+                        </el-table-column>
407
+                        <el-table-column label="单位" align="center">
408
+                          <template slot-scope="scope">
409
+                            {{scope.row.unit}}
410
+                          </template>
411
+                        </el-table-column>
412
+                      </el-table>
413
+                      </div>
414
+                    </el-col>
415
+                  </el-row>
416
+                </div>
417
+            </el-row>
418
+          </el-form>
419
+
420
+        </span>
421
+        <span slot="footer" class="dialog-footer">
422
+          <el-button @click="dialogVisibleInspection = false">取 消</el-button>
423
+          <el-button type="primary" @click="toContent">确 定</el-button>
424
+        </span>
425
+      </el-dialog>
318
   
426
   
319
     </div>
427
     </div>
320
   </div>
428
   </div>
326
   import PatientSidebar from './components/PatientSidebar'
434
   import PatientSidebar from './components/PatientSidebar'
327
   import Editor from '@/components/Editor'
435
   import Editor from '@/components/Editor'
328
 
436
 
329
-  import { getInitDataList } from '@/api/patient'
437
+  import { getInitDataList,getInspectionMajorItem,getInspectionDetail,getInspectionItemList } from '@/api/patient'
330
   import { parseTime } from '@/utils'
438
   import { parseTime } from '@/utils'
331
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
439
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
332
   import { uParseTime } from '@/utils/tools'
440
   import { uParseTime } from '@/utils/tools'
406
           {id:4,name:"第四季度"},
514
           {id:4,name:"第四季度"},
407
         ],
515
         ],
408
         options:[],
516
         options:[],
517
+        dialogVisibleInspection:false,
518
+        InspectionMajor:[],
519
+        other_start_time:"",
520
+        startYear:new Date(),
521
+        startMonth:(new Date().getMonth+1).toString(),
522
+        tableList:[],
523
+        tableData:[],
524
+        inspectDataList:[],
525
+        projectList:[],
409
       }
526
       }
410
     },
527
     },
411
     created() {
528
     created() {
412
-    //   this.patient_id = parseInt(this.$route.query.id)
413
-    //   if (isNaN(this.patient_id) || this.patient_id <= 0) {
414
-    //     this.$notify.error({
415
-    //       title: '错误',
416
-    //       message: '无效的id'
417
-    //     })
418
-    //     this.$router.push('/patients/patients')
419
-    //     return
420
-    //   }
529
+      this.patient_id = parseInt(this.$route.query.id)
530
+      console.log("hhhhhh",this.patient_id)
531
+      if (isNaN(this.patient_id) || this.patient_id <= 0) {
532
+        this.$notify.error({
533
+          title: '错误',
534
+          message: '无效的id'
535
+        })
536
+        this.$router.push('/patients/patients')
537
+        return
538
+      }
421
       var now = new Date()
539
       var now = new Date()
422
       this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
540
       this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
423
 
541
 
441
         (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
559
         (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
442
         '-' +
560
         '-' +
443
         (nowDay < 10 ? '0' + nowDay : nowDay)
561
         (nowDay < 10 ? '0' + nowDay : nowDay)
562
+      this.other_start_time = nowYear +'-' +(nowMonth < 10 ? '0' + nowMonth : nowMonth) +'-' + (nowDay < 10 ? '0' + nowDay : nowDay)
444
       this.getlist()
563
       this.getlist()
564
+      this.getInspectionMajor()
565
+
445
     },
566
     },
446
     methods: {
567
     methods: {
447
       getTime(val) {
568
       getTime(val) {
468
       },
589
       },
469
       didChangeCurrentRecord(){
590
       didChangeCurrentRecord(){
470
 
591
 
592
+      },
593
+      changeCurrentRecord(val){
594
+      
595
+        this.getInspectionDetai(val)
596
+      },
597
+      selectionChangeOne(val){
598
+        console.log("val23232323",val)
599
+       
600
+        this.getInspectionItemList(val)
471
       },
601
       },
472
       startTimeChange(){
602
       startTimeChange(){
473
 
603
 
477
       },
607
       },
478
       print(){
608
       print(){
479
 
609
 
610
+      },
611
+      tableRow(){
612
+
480
       },
613
       },
481
       getQuarter(year,quarter){
614
       getQuarter(year,quarter){
482
         var start_time = ""
615
         var start_time = ""
502
 
635
 
503
         // }
636
         // }
504
 
637
 
638
+      },
639
+      didSelectionChange(){
640
+
641
+      },
642
+      changeCurrentRecordOne(){
643
+
644
+      },
645
+      changeCurrentRecordOne(){
646
+
505
       },
647
       },
506
       getlist(){
648
       getlist(){
507
         var params={
649
         var params={
511
         }
653
         }
512
         console.log("param222222",params)
654
         console.log("param222222",params)
513
         console.log(moment(moment(2020 + '-01-01').toDate()).quarter(2).format("YYYY-MM-DD"))
655
         console.log(moment(moment(2020 + '-01-01').toDate()).quarter(2).format("YYYY-MM-DD"))
514
-      getInitDataList(params).then(response=>{
656
+        getInitDataList(params).then(response=>{
657
+
658
+       })
659
+      },
660
+      toInspection(){
661
+        this.dialogVisibleInspection = true
662
+      },
663
+
664
+      //获取大项数据来源
665
+      getInspectionMajor(){
666
+          var params = {
667
+            other_start_time:this.getTime(this.startYear),
668
+            // patient_id:this.$route.query.id,
669
+             patient_id:2448,
670
+          }
671
+        console.log("params",params)
672
+        getInspectionMajorItem(params).then(response=>{
673
+          if(response.data.state == 1){
674
+            var list = response.data.data.list
675
+            console.log("list23232323",list)
676
+            this.tableList = list
677
+            // this.$refs.singleTable.setCurrentRow(list[0])
678
+          }
679
+        })
680
+      },
681
+      //获取小项的值
682
+      getInspectionDetai(val){
683
+        var params = {
684
+          project_id:val.project_id,
685
+          patient_id:val.patient_id,
686
+          inspect_date:val.inspect_date,
687
+        }
688
+        console.log("param2233233223",params)
689
+       getInspectionDetail(params).then(response=>{
690
+          if(response.data.state ==1){
691
+            var list = response.data.data.list
692
+            console.log("详情222",list)
693
+            this.tableData = list
694
+          }
695
+       })
696
+      },
697
+      selectionChange(val){
698
+        console.log("val233223",val)
699
+        selectionChange().then(response=>{
515
 
700
 
516
-      })
701
+        })
702
+      },
703
+      getInspectionItemList(val){
704
+       
705
+       for(let i=0;i<val.length;i++){
706
+        this.projectList.push(val[i].project_id)
707
+        this.inspectDataList.push(val[i].inspect_date)
708
+      }
709
+    
710
+      },
711
+      toContent(){
712
+      
713
+         var str = this.inspectDataList.join(",")
714
+         var inspe_date = this.projectList.join(",")
715
+         var params = {
716
+           ids:str,
717
+           inspect_date:inspe_date,
718
+           patient_id:2448,
719
+         }
720
+         console.log("params",params)
721
+        getInspectionItemList(params).then(response=>{
722
+           if(response.data.state == 1){
723
+             var list = response.data.data.list
724
+             console.log("list23223322332",list)
725
+             var str = ""
726
+             for(let i=0;i<list.length;i++){
727
+               str += (list[i].item_name + ":" + list[i].inspect_value)
728
+             }
729
+            this.form.template_inspection_content = str
730
+            this.dialogVisibleInspection = true
731
+           }
732
+        })  
517
       }
733
       }
518
     }
734
     }
519
   }
735
   }

+ 4 - 1
src/xt_pages/workforce/template.vue View File

364
 
364
 
365
 
365
 
366
         })
366
         })
367
+      },
368
+      beforeUpload(){
369
+
367
       },
370
       },
368
       handleSuccess({ results, header }) {
371
       handleSuccess({ results, header }) {
369
-       
372
+         consle.log("result32eeeeeeee",results)
370
         let headers = []
373
         let headers = []
371
         for (let key in results[0]) {
374
         for (let key in results[0]) {
372
           headers.push(key)
375
           headers.push(key)