XMLWAN 2 年 前
コミット
940fe1c7b4
共有36 個のファイルを変更した4578 個の追加595 個の削除を含む
  1. 0 1
      src/api/config.js
  2. 9 0
      src/api/dialysis.js
  3. 8 0
      src/api/drug/drug.js
  4. 8 0
      src/api/drug/drug_stock.js
  5. 15 0
      src/api/patient.js
  6. 6 5
      src/router/index_路由未分离前.js
  7. 9 0
      src/router/modules/dialysis.js
  8. 6 6
      src/router/modules/drugs.js
  9. 72 7
      src/router/modules/stock.js
  10. 3 2
      src/xt_pages/data/druguseTemplate.vue
  11. 3 3
      src/xt_pages/dialysis/components/consumables.vue
  12. 3 2
      src/xt_pages/dialysis/details/assessmentBefore.vue
  13. 4 0
      src/xt_pages/stock/cancelStockOrderAdd.vue
  14. 4 1
      src/xt_pages/stock/cancelStockOrderEdit.vue
  15. 171 13
      src/xt_pages/stock/drugs/components/drugPatientQuery.vue
  16. 824 66
      src/xt_pages/stock/drugs/components/drugQuery.vue
  17. 48 6
      src/xt_pages/stock/drugs/components/expiryDateDrugQuery.vue
  18. 694 59
      src/xt_pages/stock/drugs/components/purchaseDrugQuery.vue
  19. 43 3
      src/xt_pages/stock/drugs/drugBatchNumber.vue
  20. 13 5
      src/xt_pages/stock/drugs/drugNewQuery.vue
  21. 8 5
      src/xt_pages/stock/drugs/drugStockFlow.vue
  22. 595 71
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  23. 52 8
      src/xt_pages/stock/query/expiryDateQuery.vue
  24. 507 66
      src/xt_pages/stock/query/goodNewQuery.vue
  25. 155 17
      src/xt_pages/stock/query/patientQuery.vue
  26. 477 44
      src/xt_pages/stock/query/purchaseStockQuery.vue
  27. 40 4
      src/xt_pages/stock/stockBatchNumber.vue
  28. 3 2
      src/xt_pages/stock/stockFlow.vue
  29. 11 10
      src/xt_pages/stock/stockInOrderAdd.vue
  30. 4 3
      src/xt_pages/stock/stockInOrderEdit.vue
  31. 13 5
      src/xt_pages/stock/stockNewQuery.vue
  32. 331 72
      src/xt_pages/stock/stockOutOrder.vue
  33. 5 8
      src/xt_pages/stock/stockOutOrderAdd.vue
  34. 4 2
      src/xt_pages/stock/stockOutOrderEdit.vue
  35. 353 90
      src/xt_pages/user/dialysisSolution.vue
  36. 77 9
      src/xt_pages/workforce/components/template_table.vue

+ 0 - 1
src/api/config.js ファイルの表示

60
     url: '/api/systemprescription/get',
60
     url: '/api/systemprescription/get',
61
     method: 'get',
61
     method: 'get',
62
     params: params
62
     params: params
63
-
64
   })
63
   })
65
 }
64
 }
66
 
65
 

+ 9 - 0
src/api/dialysis.js ファイルの表示

299
     params: params
299
     params: params
300
   })
300
   })
301
 }
301
 }
302
+
303
+export function getPatientDialysisSolutionGroupList(params) {
304
+  console.log('params22222', params)
305
+  return request({
306
+    url: '/api/patient/getpatientdialysissolutiongrouplist',
307
+    method: 'get',
308
+    params: params
309
+  })
310
+}

+ 8 - 0
src/api/drug/drug.js ファイルの表示

587
     params: params
587
     params: params
588
   })
588
   })
589
 }
589
 }
590
+
591
+export function toSendGoodInfomation(params) {
592
+  return request({
593
+    url: '/api/stock/tosendgoodinfomation',
594
+    method: 'get',
595
+    params: params
596
+  })
597
+}

+ 8 - 0
src/api/drug/drug_stock.js ファイルの表示

636
     params: params
636
     params: params
637
   })
637
   })
638
 }
638
 }
639
+
640
+export function getDrugInitDataList(params) {
641
+  return request({
642
+    url: '/api/drug/getdruginitdatalist',
643
+    method: 'get',
644
+    params: params
645
+  })
646
+}

+ 15 - 0
src/api/patient.js ファイルの表示

58
   })
58
   })
59
 }
59
 }
60
 
60
 
61
+export function findePatientDialysisLongSolutions(params) {
62
+  return request({
63
+    url: '/api/patient/findepatientdialysislongsolutions',
64
+    method: 'get',
65
+    params: params
66
+  })
67
+}
68
+
61
 export function createPatientDialysisSolution(id, solution, mode) {
69
 export function createPatientDialysisSolution(id, solution, mode) {
62
   return request({
70
   return request({
63
     url: '/api/patients/dialysissolution/create?patient=' + id + '&mode=' + mode,
71
     url: '/api/patients/dialysissolution/create?patient=' + id + '&mode=' + mode,
597
   })
605
   })
598
 }
606
 }
599
 
607
 
608
+export function getDialysisSolutionDetailList(params) {
609
+  return request({
610
+    url: '/api/patient/getdialysissolutiondetaillist',
611
+    method: 'get',
612
+    params: params
613
+  })
614
+}

+ 6 - 5
src/router/index_路由未分离前.js ファイルの表示

817
         component: () => import('@/xt_pages/stock/otherCancelStockOrder'),
817
         component: () => import('@/xt_pages/stock/otherCancelStockOrder'),
818
         name: 'otherCancelStockOrder',
818
         name: 'otherCancelStockOrder',
819
         meta: { title: 'otherCancelStockOrder', noCache: true }
819
         meta: { title: 'otherCancelStockOrder', noCache: true }
820
-      }, {
821
-        path: '/stock/query',
822
-        component: () => import('@/xt_pages/stock/stockQuery'),
823
-        name: 'stockQuery',
824
-        meta: { title: 'stockQuery' }
825
       },
820
       },
821
+      // {
822
+      //   path: '/stock/query',
823
+      //   component: () => import('@/xt_pages/stock/stockQuery'),
824
+      //   name: 'stockQuery',
825
+      //   meta: { title: 'stockQuery' }
826
+      // },
826
       {
827
       {
827
         path: '/stock/detail',
828
         path: '/stock/detail',
828
         component: () => import('@/xt_pages/stock/stockDetailIndex'),
829
         component: () => import('@/xt_pages/stock/stockDetailIndex'),

+ 9 - 0
src/router/modules/dialysis.js ファイルの表示

78
         noCache: true
78
         noCache: true
79
       }
79
       }
80
     },
80
     },
81
+    {
82
+      path: '/dialysis/consumable/index',
83
+      component: () => import('@/xt_pages/dialysis/details/consumable/index'),
84
+      name: '透前准备',
85
+      meta: {
86
+        title: '透前准备',
87
+        noCache: true
88
+      }
89
+    },
81
     {
90
     {
82
       path: '/dialysis/consumableDrugs_print',
91
       path: '/dialysis/consumableDrugs_print',
83
       component: () => import('@/xt_pages/dialysis/consumableDrugs_print'),
92
       component: () => import('@/xt_pages/dialysis/consumableDrugs_print'),

+ 6 - 6
src/router/modules/drugs.js ファイルの表示

12
     isChild: true
12
     isChild: true
13
   },
13
   },
14
   children: [
14
   children: [
15
-    {
16
-      path: '/stock/drugs/stock/query',
17
-      component: () => import('@/xt_pages/stock/drugs/query'),
18
-      name: 'drugsQuery',
19
-      meta: { title: 'drugsQuery', noCache: true }
20
-    },
15
+    // {
16
+    //   path: '/stock/drugs/stock/query',
17
+    //   component: () => import('@/xt_pages/stock/drugs/query'),
18
+    //   name: 'drugsQuery',
19
+    //   meta: { title: 'drugsQuery', noCache: true }
20
+    // },
21
     {
21
     {
22
       path: '/stock/drugs/drugNewQuery',
22
       path: '/stock/drugs/drugNewQuery',
23
       component: () => import('@/xt_pages/stock/drugs/drugNewQuery'),
23
       component: () => import('@/xt_pages/stock/drugs/drugNewQuery'),

+ 72 - 7
src/router/modules/stock.js ファイルの表示

12
     isChild: true
12
     isChild: true
13
   },
13
   },
14
   children: [
14
   children: [
15
-    {
16
-      path: '/stock/query',
17
-      component: () => import('@/xt_pages/stock/stockQuery'),
18
-      name: 'stockQuery',
19
-      meta: { title: 'stockQuery', noCache: true }
20
-    },
15
+    // {
16
+    //   path: '/stock/query',
17
+    //   component: () => import('@/xt_pages/stock/stockQuery'),
18
+    //   name: 'stockQuery',
19
+    //   meta: { title: 'stockQuery', noCache: true }
20
+    // },
21
     {
21
     {
22
       path: '/stock/new/query',
22
       path: '/stock/new/query',
23
       component: () => import('@/xt_pages/stock/stockNewQuery'),
23
       component: () => import('@/xt_pages/stock/stockNewQuery'),
24
       name: 'stockNewQuery',
24
       name: 'stockNewQuery',
25
       meta: { title: 'stockNewQuery', noCache: true }
25
       meta: { title: 'stockNewQuery', noCache: true }
26
     },
26
     },
27
+
27
     {
28
     {
28
       path: '/stock/in',
29
       path: '/stock/in',
29
       component: () => import('@/xt_pages/stock/stockInOrder'),
30
       component: () => import('@/xt_pages/stock/stockInOrder'),
369
         noCache: true
370
         noCache: true
370
       }
371
       }
371
     },
372
     },
372
-
373
     {
373
     {
374
       path: '/stock/inventoryTransfer/Addtrans',
374
       path: '/stock/inventoryTransfer/Addtrans',
375
       component: () => import('@/xt_pages/stock/inventoryTransfer/Addtrans'),
375
       component: () => import('@/xt_pages/stock/inventoryTransfer/Addtrans'),
404
         title: '编辑调拨',
404
         title: '编辑调拨',
405
         noCache: true
405
         noCache: true
406
       }
406
       }
407
+    },
408
+    {
409
+      path: '/good/new/query/print',
410
+      component: () => import('@/xt_pages/stock/query/goodNewQueryPrint'),
411
+      name: 'goodNewQueryPrint',
412
+      hidden: true,
413
+      is_menu: false,
414
+      meta: { title: 'goodNewQueryPrint', noCache: true }
415
+    },
416
+    {
417
+      path: '/purchase/stock/query/print',
418
+      component: () => import('@/xt_pages/stock/query/purchaseStockQueryPrint'),
419
+      name: 'purchaseStockQueryPrint',
420
+      hidden: true,
421
+      is_menu: false,
422
+      meta: { title: 'purchaseStockQueryPrint', noCache: true }
423
+    },
424
+    {
425
+      path: '/expiry/date/query/print',
426
+      component: () => import('@/xt_pages/stock/query/expiryDateQueryPrint'),
427
+      name: 'expiryDateQueryPrint',
428
+      hidden: true,
429
+      is_menu: false,
430
+      meta: { title: 'expiryDateQueryPrint', noCache: true }
431
+    },
432
+    {
433
+      path: '/patient/query/print',
434
+      component: () => import('@/xt_pages/stock/query/patientQueryPrint'),
435
+      name: 'patientQuery',
436
+      hidden: true,
437
+      is_menu: false,
438
+      meta: { title: 'patientQuery', noCache: true }
439
+    },
440
+    {
441
+      path: '/drugs/purchase/query/print',
442
+      component: () => import('@/xt_pages/stock/drugs/components/purchaseDrugQueryPrint'),
443
+      name: 'purchaseDrugQueryPrint',
444
+      hidden: true,
445
+      is_menu: false,
446
+      meta: { title: 'purchaseDrugQueryPrint', noCache: true }
447
+    },
448
+    {
449
+      path: '/drugs/expiry/date/query/print',
450
+      component: () => import('@/xt_pages/stock/drugs/components/expiryDateDrugQueryPrint'),
451
+      name: 'expiryDateDrugQueryPrint',
452
+      hidden: true,
453
+      is_menu: false,
454
+      meta: { title: 'expiryDateDrugQueryPrint', noCache: true }
455
+    },
456
+    {
457
+      path: '/drugs/patient/print',
458
+      component: () => import('@/xt_pages/stock/drugs/components/drugPatientQueryPrint'),
459
+      name: 'drugPatientQueryPrint',
460
+      hidden: true,
461
+      is_menu: false,
462
+      meta: { title: 'drugPatientQueryPrint', noCache: true }
463
+    },
464
+    {
465
+      path: '/drugs/query/print',
466
+      component: () => import('@/xt_pages/stock/drugs/components/drugQueryPrint'),
467
+      name: 'drugQueryPrint',
468
+      hidden: true,
469
+      is_menu: false,
470
+      meta: { title: 'drugQueryPrint', noCache: true }
407
     }
471
     }
472
+
408
   ]
473
   ]
409
 }
474
 }

+ 3 - 2
src/xt_pages/data/druguseTemplate.vue ファイルの表示

889
                             v-for="item in unitsOption"
889
                             v-for="item in unitsOption"
890
                             :key="item.id"
890
                             :key="item.id"
891
                             :label="item.name "
891
                             :label="item.name "
892
-                            :value="item.id"
892
+                            :value="item.name"
893
                           ></el-option>
893
                           ></el-option>
894
                         </el-select>
894
                         </el-select>
895
                       </el-col>
895
                       </el-col>
2283
             return row.drug_spec + '' + row.drug_spec_unit + ' * ' + row.prescribing_number + row.prescribing_number_unit
2283
             return row.drug_spec + '' + row.drug_spec_unit + ' * ' + row.prescribing_number + row.prescribing_number_unit
2284
           }
2284
           }
2285
         }
2285
         }
2286
-      }, newRecordActionTwo() {
2286
+      },
2287
+       newRecordActionTwo() {
2287
         this.templateFormTwoVisible = true
2288
         this.templateFormTwoVisible = true
2288
       }, deleteRecordActionTwo() {
2289
       }, deleteRecordActionTwo() {
2289
         if (this.table_current_index_two == -1) {
2290
         if (this.table_current_index_two == -1) {

+ 3 - 3
src/xt_pages/dialysis/components/consumables.vue ファイルの表示

304
               }
304
               }
305
             }
305
             }
306
 
306
 
307
-          //  console.log("99999999",this.list)
307
+           console.log("99999999",this.list)
308
            let a = []
308
            let a = []
309
           this.list.map(item => {
309
           this.list.map(item => {
310
             a.push(item.good_type)
310
             a.push(item.good_type)
346
               obj2[str] = i[str]
346
               obj2[str] = i[str]
347
             })
347
             })
348
             tempTwo.push(obj2)
348
             tempTwo.push(obj2)
349
-            console.log(325556574342354234234,tempTwo)
349
+            // console.log(325556574342354234234,tempTwo)
350
           })
350
           })
351
 
351
 
352
           this.arrList.push(...tempTwo)
352
           this.arrList.push(...tempTwo)
353
-          console.log("cccccccc",this.arrList)
353
+          // console.log("cccccccc",this.arrList)
354
           }
354
           }
355
         })
355
         })
356
       },
356
       },

+ 3 - 2
src/xt_pages/dialysis/details/assessmentBefore.vue ファイルの表示

181
           <span class="content">{{this.record.blood_access_part_id}}</span>
181
           <span class="content">{{this.record.blood_access_part_id}}</span>
182
           <span class="unit"> </span>
182
           <span class="unit"> </span>
183
         </li>
183
         </li>
184
+
184
       </ul>
185
       </ul>
185
       <ul>
186
       <ul>
186
         <li v-if="isShow('舒张压')">
187
         <li v-if="isShow('舒张压')">
267
           <span class="unit"></span>
268
           <span class="unit"></span>
268
         </li>
269
         </li>
269
 
270
 
270
-        <li v-if="isShow('血管通路操作')">
271
-          <label>血管通路操作:</label>
271
+        <li v-if="isShow('血管通路')">
272
+          <label>血管通路:</label>
272
           <span class="content">{{
273
           <span class="content">{{
273
             getBloodAccessOpera(this.record.blood_access_part_opera_id)
274
             getBloodAccessOpera(this.record.blood_access_part_opera_id)
274
           }}</span>
275
           }}</span>

+ 4 - 0
src/xt_pages/stock/cancelStockOrderAdd.vue ファイルの表示

18
           size="small"
18
           size="small"
19
           type="primary"
19
           type="primary"
20
           @click="submit()"
20
           @click="submit()"
21
+          v-loding="loading"
21
           class="filter-item"
22
           class="filter-item"
22
           >保 存</el-button>
23
           >保 存</el-button>
23
 
24
 
372
       storehouse_id:"",
373
       storehouse_id:"",
373
       cancel_stock_id:0,
374
       cancel_stock_id:0,
374
       showCheck:false,
375
       showCheck:false,
376
+      loading:false,
375
     };
377
     };
376
   },
378
   },
377
   methods: {
379
   methods: {
580
       this.$router.go(-1);
582
       this.$router.go(-1);
581
     },
583
     },
582
     submit() {
584
     submit() {
585
+      this.loading = true
583
       this.$refs["tableForm"].validate(valid => {
586
       this.$refs["tableForm"].validate(valid => {
584
         if (valid) {
587
         if (valid) {
585
           const array = this.recordInfo.recordData;
588
           const array = this.recordInfo.recordData;
633
               loading.close()
636
               loading.close()
634
               return false;
637
               return false;
635
             } else {
638
             } else {
639
+            this.loading = false
636
              this.$message.success("保存成功!")
640
              this.$message.success("保存成功!")
637
              var cancelStock = response.data.data.cancelStock
641
              var cancelStock = response.data.data.cancelStock
638
              this.cancel_stock_id = cancelStock.id
642
              this.cancel_stock_id = cancelStock.id

+ 4 - 1
src/xt_pages/stock/cancelStockOrderEdit.vue ファイルの表示

5
       <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
5
       <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
       <div style="float:right;">
6
       <div style="float:right;">
7
         <el-button size="small"  @click="back()" class="filter-item">取 消</el-button>
7
         <el-button size="small"  @click="back()" class="filter-item">取 消</el-button>
8
-        <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
8
+        <el-button size="small"  type="primary" @click="submit()" v-loading="loding" class="filter-item" >保 存</el-button>
9
         <el-button size="small"  type="primary" @click="toCheck()" class="filter-item" v-if="is_check == 2">审 核</el-button>
9
         <el-button size="small"  type="primary" @click="toCheck()" class="filter-item" v-if="is_check == 2">审 核</el-button>
10
         <el-button size="small"  type="primary" @click="toReturnCheck()" class="filter-item" v-if="is_check == 1">反 审 核</el-button>
10
         <el-button size="small"  type="primary" @click="toReturnCheck()" class="filter-item" v-if="is_check == 1">反 审 核</el-button>
11
       </div>
11
       </div>
339
         list:[],
339
         list:[],
340
         is_check:0,
340
         is_check:0,
341
         disabled:false,
341
         disabled:false,
342
+        loading:false
342
       }
343
       }
343
     },
344
     },
344
     methods: {
345
     methods: {
535
         this.$router.go(-1)
536
         this.$router.go(-1)
536
       },
537
       },
537
       submit() {
538
       submit() {
539
+        this.loading = true
538
         this.$refs['tableForm'].validate((valid) => {
540
         this.$refs['tableForm'].validate((valid) => {
539
           if (valid) {
541
           if (valid) {
540
             const array = this.recordInfo.recordData
542
             const array = this.recordInfo.recordData
578
                 loading.close()
580
                 loading.close()
579
                 return false
581
                 return false
580
               } else {
582
               } else {
583
+                this.loading = false
581
                 var msg =  response.data.data.msg
584
                 var msg =  response.data.data.msg
582
                 if (msg == 1){
585
                 if (msg == 1){
583
                     this.$message.error("该耗材无出库记录")
586
                     this.$message.error("该耗材无出库记录")

+ 171 - 13
src/xt_pages/stock/drugs/components/drugPatientQuery.vue ファイルの表示

1
 <template>
1
 <template>
2
     <div class="main-contain">
2
     <div class="main-contain">
3
-        <div class="app-container">
3
+        <div class="app-container"  v-loading="loading"
4
+        element-loading-text="拼命加载中">
4
          <el-container>
5
          <el-container>
5
                <div style="width:27%">
6
                <div style="width:27%">
6
                 <el-row>
7
                 <el-row>
41
                   </el-row>
42
                   </el-row>
42
 
43
 
43
                   <el-row>
44
                   <el-row>
45
+                    
44
                       <el-table
46
                       <el-table
45
                           ref="singleTable"
47
                           ref="singleTable"
46
                           :data="patientList"
48
                           :data="patientList"
83
                   <el-tabs>
85
                   <el-tabs>
84
 
86
 
85
                    <el-tab-pane label="患者使用列表">
87
                    <el-tab-pane label="患者使用列表">
86
-                   
88
+                     <div style="float:right;margin-bottom:10px">
89
+                      <el-button type="primary" @click="toPrint">打印</el-button>
90
+                      <el-button type="primary" @click="exportList">导出</el-button>
91
+                      </div>
87
                      <el-table
92
                      <el-table
88
                           :data="tableList"
93
                           :data="tableList"
89
                           highlight-current-row
94
                           highlight-current-row
101
                       align="center"
106
                       align="center"
102
                       >
107
                       >
103
                       <template slot-scope="scope">
108
                       <template slot-scope="scope">
104
-                        {{scope.row.drug.drug_name}}
109
+                        {{scope.row.drug_name}}
105
                       </template>
110
                       </template>
106
                     </el-table-column>
111
                     </el-table-column>
107
                      <el-table-column
112
                      <el-table-column
109
                       label="生产厂家"
114
                       label="生产厂家"
110
                       align="center">
115
                       align="center">
111
                       <template slot-scope="scope">
116
                       <template slot-scope="scope">
112
-                        {{getManufacturName(scope.row.manufacturer)}}
117
+                        {{scope.row.manufacturer}}
113
                       </template>
118
                       </template>
114
                      </el-table-column>
119
                      </el-table-column>
115
                       <el-table-column
120
                       <el-table-column
117
                       label="规格&单位"
122
                       label="规格&单位"
118
                       align="center">
123
                       align="center">
119
                       <template slot-scope="scope">
124
                       <template slot-scope="scope">
120
-                        {{scope.row.drug.dose}}{{scope.row.drug.dose_unit}} * {{scope.row.drug.min_number}}{{scope.row.drug.min_unit}}/{{scope.row.drug.max_unit}}
125
+                        {{scope.row.dose}}{{scope.row.dose_unit}} * {{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
121
                       </template>
126
                       </template>
122
                      </el-table-column>
127
                      </el-table-column>
123
                       <el-table-column
128
                       <el-table-column
125
                       label="数量"
130
                       label="数量"
126
                       align="center">
131
                       align="center">
127
                       <template slot-scope="scope">
132
                       <template slot-scope="scope">
128
-                        {{scope.row.count}}
133
+                         {{getCount(scope.row.child,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
129
                       </template>
134
                       </template>
130
                      </el-table-column>
135
                      </el-table-column>
131
 
136
 
132
                      </el-table>
137
                      </el-table>
133
                       <el-pagination
138
                       <el-pagination
134
                         @size-change="handleSizeChange"
139
                         @size-change="handleSizeChange"
135
-                        @current-change="handleCurrentChange"
140
+                        @current-change="handleCurrentChangeOne"
136
                         :page-sizes="[10, 50, 100,200,500,1000]"
141
                         :page-sizes="[10, 50, 100,200,500,1000]"
137
                         :page-size="10"
142
                         :page-size="10"
138
                         background
143
                         background
175
       limit:10,
180
       limit:10,
176
       page:1,
181
       page:1,
177
       total:0,
182
       total:0,
183
+      loading:false,
178
     }
184
     }
179
   },
185
   },
180
   methods:{
186
   methods:{
182
       this.limit = val;
188
       this.limit = val;
183
       this.getDrugWarehouseOutDetailByPatientId()
189
       this.getDrugWarehouseOutDetailByPatientId()
184
     },
190
     },
185
-    handleCurrentChange(val) {
191
+    handleCurrentChangeOne(val) {
186
       this.page = val;
192
       this.page = val;
193
+      console.log("val3232232323",val)
187
       this.getDrugWarehouseOutDetailByPatientId()
194
       this.getDrugWarehouseOutDetailByPatientId()
188
     },
195
     },
189
     startTimeChange(){
196
     startTimeChange(){
193
       this.handleCurrentChange(this.patient)
200
       this.handleCurrentChange(this.patient)
194
     },
201
     },
195
     getlist(){
202
     getlist(){
203
+        this.loading = true
196
         var params = {
204
         var params = {
197
           keyword:this.keyword,
205
           keyword:this.keyword,
198
         }
206
         }
199
       getGoodPatientList(params).then(response=>{
207
       getGoodPatientList(params).then(response=>{
200
         if(response.data.state == 1){
208
         if(response.data.state == 1){
209
+          this.loading = false
201
           var list = response.data.data.list
210
           var list = response.data.data.list
202
           this.patientList = list
211
           this.patientList = list
203
           this.$refs.singleTable.setCurrentRow(this.patientList[0]);
212
           this.$refs.singleTable.setCurrentRow(this.patientList[0]);
220
      getDrugWarehouseOutDetailByPatientId(params).then(response=>{
229
      getDrugWarehouseOutDetailByPatientId(params).then(response=>{
221
         if(response.data.state == 1){
230
         if(response.data.state == 1){
222
           var list = response.data.data.list
231
           var list = response.data.data.list
232
+          console.log("list233223232323",list)
233
+          var outlist = response.data.data.outlist
223
           this.manufacturerList = response.data.data.manufacturerList
234
           this.manufacturerList = response.data.data.manufacturerList
224
-          this.tableList = list
235
+          if(list!=null && list.length > 0){
236
+            for(let i=0;i<list.length;i++){
237
+              if(list[i].count_unit == list[i].drug.max_unit){
238
+                 list[i].count = list[i].count * list[i].drug.min_number
239
+              }
240
+            }
241
+          }
242
+          let dataInfo = {}
243
+          list.forEach((item, index) => {
244
+            let { drug_id } = item
245
+            if (!dataInfo[drug_id]) {
246
+              dataInfo[drug_id] = {
247
+                drug_id,
248
+                child: [],
249
+                dose:item.drug.dose,
250
+                dose_unit:item.drug.dose_unit,
251
+                min_number:item.drug.min_number,
252
+                min_unit:item.drug.min_unit,
253
+                max_unit:item.drug.max_unit,
254
+                drug_name:item.drug.drug_name,
255
+                manufacturer:this.getManufacturName(item.manufacturer),
256
+              }
257
+            }
258
+          })
259
+          let arr = Object.values(dataInfo)
260
+          arr.forEach((item,index)=>{
261
+            for(let i=0;i<outlist.length;i++){
262
+               if(item.drug_id == outlist[i].drug_id){
263
+                 item.child.push(outlist[i])
264
+               }
265
+            }
266
+          })
267
+        
268
+        
269
+          this.tableList = arr
225
           this.total = response.data.data.total
270
           this.total = response.data.data.total
226
         }
271
         }
227
      })
272
      })
228
    },
273
    },
229
    getDrugWarehouseOutDetailByPatientId(){
274
    getDrugWarehouseOutDetailByPatientId(){
230
       var params = {
275
       var params = {
231
-         patient_id:this.patient,
276
+         patient_id:this.patient.id,
232
          start_time:this.start_time,
277
          start_time:this.start_time,
233
          end_time:this.end_time,
278
          end_time:this.end_time,
234
          limit:this.limit,
279
          limit:this.limit,
235
          page:this.page,
280
          page:this.page,
236
        }
281
        }
282
+      console.log("hh23232323232323",params)
237
      getDrugWarehouseOutDetailByPatientId(params).then(response=>{
283
      getDrugWarehouseOutDetailByPatientId(params).then(response=>{
238
         if(response.data.state == 1){
284
         if(response.data.state == 1){
239
           var list = response.data.data.list
285
           var list = response.data.data.list
286
+         console.log("list233223232323",list)
287
+          var outlist = response.data.data.outlist
240
           this.manufacturerList = response.data.data.manufacturerList
288
           this.manufacturerList = response.data.data.manufacturerList
241
-          this.tableList = list
289
+          if(list!=null && list.length > 0){
290
+            for(let i=0;i<list.length;i++){
291
+              if(list[i].count_unit == list[i].drug.max_unit){
292
+                 list[i].count = list[i].count * list[i].drug.min_number
293
+              }
294
+            }
295
+          }
296
+          let dataInfo = {}
297
+          list.forEach((item, index) => {
298
+            let { drug_id } = item
299
+            if (!dataInfo[drug_id]) {
300
+              dataInfo[drug_id] = {
301
+                drug_id,
302
+                child: [],
303
+                dose:item.drug.dose,
304
+                dose_unit:item.drug.dose_unit,
305
+                min_number:item.drug.min_number,
306
+                min_unit:item.drug.min_unit,
307
+                max_unit:item.drug.max_unit,
308
+                drug_name:item.drug.drug_name,
309
+                manufacturer:this.getManufacturName(item.manufacturer),
310
+              }
311
+            }
312
+          })
313
+          let arr = Object.values(dataInfo)
314
+          arr.forEach((item,index)=>{
315
+            for(let i=0;i<outlist.length;i++){
316
+               if(item.drug_id == outlist[i].drug_id){
317
+                 item.child.push(outlist[i])
318
+               }
319
+            }
320
+          })
321
+         
322
+         
323
+          this.tableList = arr
242
         }
324
         }
243
      })
325
      })
244
    },
326
    },
250
         } 
332
         } 
251
      }
333
      }
252
      return manufacturer_name
334
      return manufacturer_name
253
-   }
335
+   },
336
+   open(){
337
+    this.getlist()
338
+   },
339
+   getCount(val,min_number,max_unit,min_unit){
340
+    var total = 0
341
+    var min_str = ""
342
+    var max_str = ""
343
+    if(val!=null && val.length>0){
344
+      for(let i=0;i<val.length;i++){
345
+        total +=val[i].count
346
+      }
347
+    }
348
+    if (total < min_number) {
349
+      min_str = total + min_unit;
350
+    }
351
+    if (total == 0) {
352
+      min_str = "";
353
+      max_str = "";
354
+    }
355
+    if (total >= min_number) {
356
+      if (parseInt(total / min_number) != 0) {
357
+        max_str = parseInt(total / min_number) + max_unit;
358
+      }
359
+      if (total % min_number != 0) {
360
+        min_str = (total % min_number) + min_unit;
361
+      }
362
+    }
363
+    return max_str + min_str;  
364
+   },
365
+   toPrint(){
366
+    var patient_name = ""
367
+    for(let i=0;i<this.patientList.length;i++){
368
+       if(this.patient.id == this.patientList[i].id){
369
+        patient_name = this.patientList[i].name
370
+       }
371
+    }
372
+    this.$router.push({path:"/drugs/patient/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&patient_id="+this.patient.id+"&patient_name="+patient_name})
373
+   },
374
+   exportList(){
375
+      for(let i=0;i<this.tableList.length;i++){
376
+        this.tableList[i].index = i+1
377
+        this.tableList[i].count_name = this.getCount(this.tableList[i].child,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
378
+        this.tableList[i].query_date = this.start_time + "~" + this.end_time
379
+        this.tableList[i].specification_name = this.tableList[i].dose +this.tableList[i].dose_unit + "*"+this.tableList[i].min_number+this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
380
+        this.tableList[i].patient_name = ""
381
+        if(this.tableList[i].index == 1){
382
+          this.tableList[i].patient_name = this.getPatientName(this.patient.id)
383
+        }
384
+      
385
+      }
386
+      import('@/vendor/Export2Excel').then(excel => {
387
+       
388
+        const tHeader = ['序号','患者姓名','查询日期','药品名称','生产厂家','规格&单位','数量']
389
+        const filterVal = ['index','patient_name','query_date','drug_name', 'manufacturer','specification_name','count_name']
390
+
391
+        const data = this.formatJson(filterVal,this.tableList)
392
+
393
+        excel.export_json_to_excel({
394
+          header: tHeader,
395
+          data,
396
+          filename: '患者药品使用查询表'
397
+        })
398
+       })
399
+       },
400
+       formatJson(filterVal, jsonData) {
401
+        return jsonData.map(v => filterVal.map(j => v[j]))
402
+       },
403
+       getPatientName(id){
404
+         var patient_name = ""
405
+        for(let i=0;i<this.patientList.length;i++){
406
+          if(id == this.patientList[i].id){
407
+            patient_name = this.patientList[i].name
408
+          }
409
+        }
410
+        return patient_name
411
+       }
254
   },
412
   },
255
   created(){
413
   created(){
256
     var nowDate = new Date();
414
     var nowDate = new Date();
273
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
431
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
274
       "-" +
432
       "-" +
275
       (nowDay < 10 ? "0" + nowDay : nowDay);
433
       (nowDay < 10 ? "0" + nowDay : nowDay);
276
-     this.getlist()
434
+    
277
   },
435
   },
278
   
436
   
279
 }
437
 }

File diff suppressed because it is too large
+ 824 - 66
src/xt_pages/stock/drugs/components/drugQuery.vue


+ 48 - 6
src/xt_pages/stock/drugs/components/expiryDateDrugQuery.vue ファイルの表示

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
-     <div class="app-container ">
3
+     <div class="app-container "  v-loading="loading"
4
+        element-loading-text="拼命加载中">
4
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
5
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
5
          <div>
6
          <div>
6
           <span>有效期:</span>
7
           <span>有效期:</span>
28
           <el-input v-model="keyword" style="width:200px" placeholder="请输入药品名称或生产厂商" ></el-input>
29
           <el-input v-model="keyword" style="width:200px" placeholder="请输入药品名称或生产厂商" ></el-input>
29
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
30
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
30
          </div>
31
          </div>
32
+          <div>
33
+            <el-button  type="primary"  @click="toPrint">打印</el-button>
34
+            <el-button  type="primary"  @click="exportList">导出</el-button>
35
+         </div>
31
         </div>
36
         </div>
32
            <el-table
37
            <el-table
33
             :row-style="{ color: '#303133' }"
38
             :row-style="{ color: '#303133' }"
66
             </el-table-column>
71
             </el-table-column>
67
             <el-table-column label="库存" align="center">
72
             <el-table-column label="库存" align="center">
68
               <template slot-scope="scope">
73
               <template slot-scope="scope">
69
-                 {{scope.row.stock_max_number}}{{scope.row.XtBaseDrug.max_unit}}{{scope.row.stock_min_number}}{{scope.row.XtBaseDrug.min_unit}}
74
+                <span v-if="scope.row.stock_max_number > 0"> {{scope.row.stock_max_number}}{{scope.row.XtBaseDrug.max_unit}}</span>
75
+                <span v-if="scope.row.stock_min_number > 0">{{scope.row.stock_min_number}}{{scope.row.XtBaseDrug.min_unit}}</span>  
70
               </template>
76
               </template>
71
             </el-table-column>
77
             </el-table-column>
72
         
78
         
165
      nowtime:0,
171
      nowtime:0,
166
      start_time:"",
172
      start_time:"",
167
      drugTypeList:[],
173
      drugTypeList:[],
174
+     loading:false,
168
     }
175
     }
169
   
176
   
170
   },
177
   },
191
       })
198
       })
192
     },
199
     },
193
     getlist(){
200
     getlist(){
201
+        this.loading = true
194
         var params = {
202
         var params = {
195
           storehouse_id:this.storehouse_id,
203
           storehouse_id:this.storehouse_id,
196
           expiry_type:this.expiry_type,
204
           expiry_type:this.expiry_type,
201
         }
209
         }
202
       getDrugExpiryDateQuery(params).then(response=>{
210
       getDrugExpiryDateQuery(params).then(response=>{
203
          if(response.data.state == 1){
211
          if(response.data.state == 1){
212
+            this.loading = false
204
             var list = response.data.data.list
213
             var list = response.data.data.list
205
             this.tableList = list
214
             this.tableList = list
206
             var manufacturerList = response.data.data.manufacturerList
215
             var manufacturerList = response.data.data.manufacturerList
471
     return (startDate - endDate ) / (1 * 24 * 60 * 60 * 1000);
480
     return (startDate - endDate ) / (1 * 24 * 60 * 60 * 1000);
472
   },
481
   },
473
   changeExpriyList(val){
482
   changeExpriyList(val){
474
-   
483
+    this.limit = 10
484
+    this.page = 1
475
     if(val ==0){
485
     if(val ==0){
476
      this.start_time = ""
486
      this.start_time = ""
477
      this.getlist()
487
      this.getlist()
522
     var time = year + "-" + month + "-" + day
532
     var time = year + "-" + month + "-" + day
523
     return time;
533
     return time;
524
   },
534
   },
525
-  },
526
-  created(){
535
+  open(){
536
+    this.houseList = []
527
     this.getStorehouseList()
537
     this.getStorehouseList()
528
     this.getlist()
538
     this.getlist()
529
-  }
539
+  },
540
+  toPrint(){
541
+   this.$router.push({path:"/drugs/expiry/date/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&storehouse_id="+this.storehouse_id+"&expiry_type="+this.expiry_type})
542
+  },
543
+  exportList(){
544
+       for(let i=0;i<this.tableList.length;i++){
545
+          this.tableList[i].index = i+1
546
+          this.tableList[i].good_type_name = this.getDrugTypeName(this.tableList[i].XtBaseDrug.drug_type)
547
+          this.tableList[i].drug_name = this.tableList[i].XtBaseDrug.drug_name
548
+          this.tableList[i].specification_name = this.tableList[i].XtBaseDrug.dose + this.tableList[i].XtBaseDrug.dose_unit +"*"+this.tableList[i].XtBaseDrug.min_number+this.tableList[i].XtBaseDrug.min_unit+"/"+this.tableList[i].XtBaseDrug.max_unit
549
+          this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
550
+          this.tableList[i].expiry = this.getTime(this.tableList[i].expiry_date)
551
+          this.tableList[i].stock_count =  this.tableList[i].stock_max_number + this.tableList[i].XtBaseDrug.max_unit + this.tableList[i].stock_min_number + this.tableList[i].XtBaseDrug.min_unit
552
+          this.tableList[i].flush_date = this.getDaysBetween(this.getTime(this.tableList[i].expiry_date),this.getTime(this.nowtime))
553
+       }
554
+      import('@/vendor/Export2Excel').then(excel => {
555
+       
556
+        const tHeader = ['序号','药品类型','药品名称','规格&单位','生产厂商','进货价','库存','批号','有效期','剩余天数']
557
+        const filterVal = ['index','good_type_name', 'drug_name','specification_name','manufacturer_name','price','stock_count','batch_number','expiry','flush_date']
558
+
559
+        const data = this.formatJson(filterVal,this.tableList)
560
+
561
+        excel.export_json_to_excel({
562
+          header: tHeader,
563
+          data,
564
+          filename: '药品有效期查询表'
565
+        })
566
+       })
567
+       },
568
+       formatJson(filterVal, jsonData) {
569
+        return jsonData.map(v => filterVal.map(j => v[j]))
570
+       },
571
+  },
530
 }
572
 }
531
 </script>
573
 </script>
532
 
574
 

+ 694 - 59
src/xt_pages/stock/drugs/components/purchaseDrugQuery.vue ファイルの表示

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
-     <div class="app-container ">
3
+     <div class="app-container " v-loading="loading"
4
+        element-loading-text="拼命加载中">
4
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
5
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
5
          <div>
6
          <div>
6
           <span>操作时间:</span>
7
           <span>操作时间:</span>
37
            @change="changeGoodTypeName">
38
            @change="changeGoodTypeName">
38
             <el-option
39
             <el-option
39
               v-for="item in drugTypeList"
40
               v-for="item in drugTypeList"
40
-              :key="item.id"
41
+              :key="item.value"
41
               :label="item.name"
42
               :label="item.name"
42
-              :value="item.id">
43
+              :value="item.value">
43
             </el-option>
44
             </el-option>
44
           </el-select>
45
           </el-select>
45
           <el-input v-model="keyword" style="width:200px" placeholder="请输入药品名称或生产厂商" ></el-input>
46
           <el-input v-model="keyword" style="width:200px" placeholder="请输入药品名称或生产厂商" ></el-input>
46
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
47
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
47
          </div>
48
          </div>
49
+         <div>
50
+           <el-button  type="primary" @click="toPrint">打印</el-button>
51
+           <el-button  type="primary" @click="exportList">导出</el-button>
52
+         </div>
48
         </div>
53
         </div>
49
 
54
 
50
            <el-table
55
            <el-table
79
             </el-table-column>
84
             </el-table-column>
80
             <el-table-column label="期初结余" align="center">
85
             <el-table-column label="期初结余" align="center">
81
                
86
                
82
-                 <el-table-column prop="stockIn" label="数量" width="100" align="center">
87
+                 <el-table-column prop="drugIn" label="数量" width="100" align="center">
83
                    
88
                    
84
                  </el-table-column>
89
                  </el-table-column>
85
               
90
               
86
-                <el-table-column prop="last_price" label="进货金额" width="100" align="center">
91
+                <el-table-column prop="drugInMoney" label="进货金额" width="100" align="center">
87
                    
92
                    
88
                 </el-table-column>
93
                 </el-table-column>
89
-                <el-table-column prop="stockMoney" label="销售金额" width="100" align="center">
94
+                <el-table-column prop="drugSaleMoney" label="销售金额" width="100" align="center">
90
                  
95
                  
91
                 </el-table-column>
96
                 </el-table-column>
92
              
97
              
93
             </el-table-column>
98
             </el-table-column>
94
             <el-table-column label="本期增加" align="center">
99
             <el-table-column label="本期增加" align="center">
95
              
100
              
96
-                <el-table-column prop="stockAdd" label="数量" width="100" align="center">
101
+                <el-table-column prop="drugAdd" label="数量" width="100" align="center">
97
                 
102
                 
98
                 </el-table-column>
103
                 </el-table-column>
99
              
104
              
100
-                <el-table-column prop="last_price" label="进货金额" width="100" align="center">
105
+                <el-table-column prop="drugAddPrice" label="进货金额" width="100" align="center">
101
                   
106
                   
102
                 </el-table-column>
107
                 </el-table-column>
103
-                <el-table-column  prop="addStockMoney" label="销售金额"  width="100" align="center">
108
+                <el-table-column  prop="drugAddSalePrice" label="销售金额"  width="100" align="center">
104
                 </el-table-column>
109
                 </el-table-column>
105
               
110
               
106
             </el-table-column>
111
             </el-table-column>
107
          
112
          
108
             <el-table-column label="本期减少" align="center">
113
             <el-table-column label="本期减少" align="center">
109
-               <el-table-column prop="outStock" label="数量" width="100" align="center">
114
+               <el-table-column prop="drugOut" label="数量" width="100" align="center">
110
                 </el-table-column>
115
                 </el-table-column>
111
-                <el-table-column  prop="last_price"  label="进货金额" width="100" align="center">
116
+                <el-table-column  prop="drugOutPrice"  label="进货金额" width="100" align="center">
112
                 </el-table-column>
117
                 </el-table-column>
113
-                <el-table-column prop="stockOutMoney" label="销售金额" width="100" align="center">
118
+                <el-table-column prop="drugOutSalePrice" label="销售金额" width="100" align="center">
114
                 </el-table-column>
119
                 </el-table-column>
115
             </el-table-column>
120
             </el-table-column>
116
           
121
           
117
             <el-table-column label="期末结余" align="center">
122
             <el-table-column label="期末结余" align="center">
118
-              <el-table-column prop="overStock" label="数量" width="100" align="center">
123
+              <el-table-column prop="overDrug" label="数量" width="100" align="center">
119
               </el-table-column>
124
               </el-table-column>
120
-              <el-table-column prop="last_price" label="进货金额" width="100" align="center">
125
+              <el-table-column prop="overDrugPrice" label="进货金额" width="100" align="center">
121
               </el-table-column>
126
               </el-table-column>
122
-              <el-table-column prop="oveMoney" label="销售金额" width="100" align="center">
127
+              <el-table-column prop="oveDrugSaleMoney" label="销售金额" width="100" align="center">
123
               </el-table-column>
128
               </el-table-column>
124
             </el-table-column>
129
             </el-table-column>
125
 
130
 
147
 </template>
152
 </template>
148
 <script>
153
 <script>
149
 import { getStorehouseList,getPurchaseDrugQuery } from "@/api/drug/drug"
154
 import { getStorehouseList,getPurchaseDrugQuery } from "@/api/drug/drug"
150
-
155
+const moment = require('moment')
151
 import { uParseTime } from '@/utils/tools'
156
 import { uParseTime } from '@/utils/tools'
152
 export default {
157
 export default {
153
 
158
 
155
     return{
160
     return{
156
      tableList:[],
161
      tableList:[],
157
      goodList:[
162
      goodList:[
158
-      {id:1,name:"全部耗材"},
163
+      {id:1,name:"全部药品"},
159
       {id:2,name:"库存预警"},
164
       {id:2,name:"库存预警"},
160
      ],
165
      ],
161
      houseList:[],
166
      houseList:[],
169
      total:0,
174
      total:0,
170
      keyword:"",
175
      keyword:"",
171
      drugTypeList:[],
176
      drugTypeList:[],
172
-     start_time:"",
173
-     end_time:"",
177
+     start_time:moment().startOf('month').format("YYYY-MM-DD"),
178
+     end_time:moment().endOf('month').format("YYYY-MM-DD"),
174
      countList:[],
179
      countList:[],
175
      outCountList:[],
180
      outCountList:[],
176
      autoCountList:[],
181
      autoCountList:[],
184
      patientList:[],
189
      patientList:[],
185
      good_name:"",
190
      good_name:"",
186
      specification_name:"",
191
      specification_name:"",
187
-     
192
+     loading:false,
188
     }
193
     }
189
   
194
   
190
   },
195
   },
193
 
198
 
194
     },
199
     },
195
     changeGoodTypeName(){
200
     changeGoodTypeName(){
201
+      this.drugTypeList = []
196
       this.getlist()
202
       this.getlist()
197
     },
203
     },
198
     getStorehouseList(){
204
     getStorehouseList(){
211
       })
217
       })
212
     },
218
     },
213
     getlist(){
219
     getlist(){
220
+        this.loading = true
214
         var params = {
221
         var params = {
215
           good_type:this.good_type,
222
           good_type:this.good_type,
216
           keyword:this.keyword,
223
           keyword:this.keyword,
221
         }
228
         }
222
       getPurchaseDrugQuery(params).then(response=>{
229
       getPurchaseDrugQuery(params).then(response=>{
223
          if(response.data.state == 1){
230
          if(response.data.state == 1){
231
+            this.loading = false
224
             var list = response.data.data.list
232
             var list = response.data.data.list
225
             for (let i = 0; i < list.length; i++) {
233
             for (let i = 0; i < list.length; i++) {
226
-              for (let j = 0; j < list[i].drug_warehouse_info.length; j++) {
227
-                if (list[i].max_unit == list[i].drug_warehouse_info[j].max_unit) {
228
-                   list[i].drug_warehouse_info[j].stock_max_number =list[i].min_number *list[i].drug_warehouse_info[j].stock_max_number
229
-                   list[i].drug_warehouse_info[j].warehousing_count =list[i].min_number *list[i].drug_warehouse_info[j].warehousing_count
230
-                 }
234
+
235
+              //期初结余入库
236
+              if(list[i].DrugWarehouseInfoStart!=null && list[i].DrugWarehouseInfoStart.length > 0){
237
+                for(let j=0;j<list[i].DrugWarehouseInfoStart.length;j++){
238
+                  if(list[i].max_unit == list[i].DrugWarehouseInfoStart[j].max_unit){
239
+                     list[i].DrugWarehouseInfoStart[j].count =list[i].min_number * list[i].DrugWarehouseInfoStart[j].count
240
+                  }
241
+                }
242
+              }
243
+             
244
+             //期初结余出库
245
+              if(list[i].DrugWarehouseOutInfoStart!=null && list[i].DrugWarehouseOutInfoStart.length>0){
246
+                for(let j=0;j<list[i].DrugWarehouseOutInfoStart.length;j++){
247
+                  if(list[i].max_unit == list[i].DrugWarehouseOutInfoStart[j].max_unit){
248
+                    list[i].DrugWarehouseOutInfoStart[j].count =  list[i].DrugWarehouseOutInfoStart[j].count*list[i].min_number
249
+                  }
250
+                }
251
+              }
252
+
253
+              //期初结余退库
254
+               if(list[i].WareStartStockCancelInfo!=null && list[i].WareStartStockCancelInfo.length>0){
255
+                for(let j=0;j<list[i].WareStartStockCancelInfo.length;j++){
256
+                  if(list[i].max_unit == list[i].WareStartStockCancelInfo[j].max_unit){
257
+                    list[i].WareStartStockCancelInfo[j].count =  list[i].WareStartStockCancelInfo[j].count*list[i].min_number
258
+                  }
259
+                }
260
+              }
261
+
262
+
263
+              //期末结余入库
264
+              if(list[i].DrugWarehouseInfoEnd!=null && list[i].DrugWarehouseInfoEnd.length > 0){
265
+                for(let j=0;j<list[i].DrugWarehouseInfoEnd.length;j++){
266
+                   if(list[i].max_unit == list[i].DrugWarehouseInfoEnd[j].max_unit){
267
+                     list[i].DrugWarehouseInfoEnd[j].count = list[i].min_number * list[i].DrugWarehouseInfoEnd[j].count
268
+                   }
269
+                }
270
+              }
271
+             
272
+              //期末结余出库
273
+               if(list[i].DrugWarehouseOutInfoEnd!=null && list[i].DrugWarehouseOutInfoEnd.length>0){
274
+                for(let j=0;j<list[i].DrugWarehouseOutInfoEnd.length;j++){
275
+                  if(list[i].max_unit == list[i].DrugWarehouseOutInfoEnd[j].max_unit){
276
+                    list[i].DrugWarehouseOutInfoEnd[j].count =  list[i].DrugWarehouseOutInfoEnd[j].count*list[i].min_number
277
+                  }
231
                 }
278
                 }
232
-                for (let y = 0; y < list[i].drug_warehouse_out.length; y++) {
233
-                  if (list[i].drug_warehouse_out[y].count_unit == list[i].max_unit) {
234
-                    list[i].drug_warehouse_out[y].count =list[i].drug_warehouse_out[y].count * list[i].min_number
279
+              }
280
+
281
+              //期末结余退库
282
+               if(list[i].WareEndStockCancelInfo!=null && list[i].WareEndStockCancelInfo.length>0){
283
+                for(let j=0;j<list[i].WareEndStockCancelInfo.length;j++){
284
+                  if(list[i].max_unit == list[i].WareEndStockCancelInfo[j].max_unit){
285
+                    list[i].WareEndStockCancelInfo[j].count =  list[i].WareEndStockCancelInfo[j].count*list[i].min_number
235
                   }
286
                   }
236
                 }
287
                 }
237
-                for (let z = 0; z < list[i].drug_cancel_stock_info.length; z++) {
238
-                  if (list[i].drug_cancel_stock_info[z].max_unit == list[i].max_unit) {
239
-                    list[i].drug_cancel_stock_info[z].count =list[i].drug_cancel_stock_info[z].count * list[i].min_number
288
+              }
289
+
290
+              //期中增加
291
+              if(list[i].DrugWarehouseInfoStartEnd!=null && list[i].DrugWarehouseInfoStartEnd.length > 0){
292
+                for(let j=0;j<list[i].DrugWarehouseInfoStartEnd.length;j++){
293
+                   if(list[i].max_unit == list[i].DrugWarehouseInfoStartEnd[j].max_unit){
294
+                     list[i].DrugWarehouseInfoStartEnd[j].count =list[i].min_number * list[i].DrugWarehouseInfoStartEnd[j].count
240
                    }
295
                    }
241
                 }
296
                 }
242
-            }
243
-            var arr = [];
244
-            for (let i = 0; i < list.length; i++) {
245
-             if (list[i].drug_warehouse_info.length > 0) {
246
-               arr.push(list[i]);
247
               }
297
               }
298
+           
299
+              //期中减少
300
+              if(list[i].DrugWarehouseOutInfoStartEnd!=null && list[i].DrugWarehouseOutInfoStartEnd.length > 0){
301
+                for(let j=0;j<list[i].DrugWarehouseOutInfoStartEnd.length;j++){
302
+                   if(list[i].max_unit == list[i].DrugWarehouseOutInfoStartEnd[j].max_unit){
303
+                     list[i].DrugWarehouseOutInfoStartEnd[j].count =list[i].min_number * list[i].DrugWarehouseOutInfoStartEnd[j].count
304
+                   }
305
+                }
306
+              }
307
+
308
+              //期中退库
309
+              if(list[i].WareStartEndStockCancelInfo!=null && list[i].WareStartEndStockCancelInfo.length > 0){
310
+                for(let j=0;j<list[i].WareStartEndStockCancelInfo.length;j++){
311
+                   if(list[i].max_unit == list[i].WareStartEndStockCancelInfo[j].max_unit){
312
+                     list[i].WareStartEndStockCancelInfo[j].count =list[i].min_number * list[i].WareStartEndStockCancelInfo[j].count
313
+                   }
314
+                }
315
+              }
316
+           
317
+           
318
+
319
+              //期初盘盈
320
+              if(list[i].WareStartStockInventoryProfit!=null && list[i].WareStartStockInventoryProfit.length > 0){
321
+                for(let j=0;j<list[i].WareStartStockInventoryProfit.length;j++){
322
+                  if(list[i].max_unit == list[i].WareStartStockInventoryProfit[j].max_unit){
323
+                     list[i].WareStartStockInventoryProfit[j].count = list[i].WareStartStockInventoryProfit[j].count * list[i].min_number
324
+                  }
325
+                }
326
+              }
327
+
328
+              //期初盘亏
329
+              if(list[i].WareStartStockInventoryLosses!=null && list[i].WareStartStockInventoryLosses.length > 0){
330
+                 for(let j=0;j<list[i].WareStartStockInventoryLosses.length;j++){
331
+                   if(list[i].max_unit == list[i].WareStartStockInventoryLosses[j].max_unit){
332
+                      list[i].WareStartStockInventoryLosses.count = list[i].WareStartStockInventoryLosses[j].count * list[i].min_number
333
+                   }
334
+                 }
335
+              }
336
+              
337
+      
338
+
339
+             //期中盘盈
340
+             if(list[i].WareStartEndStockInventoryProfit!=null && list[i].WareStartEndStockInventoryProfit.length > 0){
341
+                for(let j=0;j<list[i].WareStartEndStockInventoryProfit.length;j++){
342
+                  if(list[i].max_unit == list[i].WareStartEndStockInventoryProfit[j].max_unit){
343
+                    list[i].WareStartEndStockInventoryProfit[j].count = list[i].WareStartEndStockInventoryProfit[j].count * list[i].min_number
344
+                  }
345
+                }
346
+             }
347
+
348
+             //期中盘亏
349
+             if(list[i].WareStartEndStockInventoryLosses!=null && list[i].WareStartEndStockInventoryLosses.length > 0){
350
+               for(let j=0;j<list[i].WareStartEndStockInventoryLosses.length;j++){
351
+                 if(list[i].max_unit == list[i].WareStartEndStockInventoryLosses[j].max_unit){
352
+                    list[i].WareStartEndStockInventoryLosses[j].count = list[i].WareStartEndStockInventoryLosses[j].count * list[i].min_number
353
+                 }
354
+               }
355
+             }
356
+             //期末盘盈
357
+             if(list[i].WareEndStockInventoryProfit!=null && list[i].WareEndStockInventoryProfit.length >0){
358
+               for(let j=0;j<list[i].WareEndStockInventoryProfit.length;j++){
359
+                 if(list[i].max_unit == list[i].WareEndStockInventoryProfit[j].max_unit){
360
+                    list[i].WareEndStockInventoryProfit[j].count = list[i].WareEndStockInventoryProfit[j].count * list[i].min_number
361
+                 }
362
+               }
363
+             }
364
+             //期末盘亏
365
+             if(list[i].WareEndStockInventoryLosses!=null && list[i].WareEndStockInventoryLosses.length > 0){
366
+               for(let j=0;j<list[i].WareEndStockInventoryLosses.length;j++){
367
+                if(list[i].max_unit == list[i].WareEndStockInventoryLosses[j].max_unit){
368
+                   list[i].WareEndStockInventoryLosses[j].count = list[i].WareEndStockInventoryLosses[j].count * list[i].min_number
369
+                }
370
+               }
371
+             }
248
             }
372
             }
249
-            for(let i=0;i<arr.length;i++){
250
-              arr[i].stockIn = this.getDrugWarehouseInfoStart(arr[i].drug_warehouse_info,arr[i].min_number,arr[i].min_unit,arr[i].max_unit,arr[i].drug_warehouse_out)
251
-              arr[i].stockMoney = this.getDrugWarehouseInfoMoneyStart(arr[i].drug_warehouse_info,arr[i].min_number,arr[i].min_unit,arr[i].max_unit,arr[i].last_price,arr[i].drug_warehouse_out)
252
-              arr[i].stockAdd = this.getDrugWarehouseInfoStockAdd(arr[i].drug_warehouse_info,arr[i].min_number,arr[i].min_unit,arr[i].max_unit)
253
-              arr[i].addStockMoney = this.getDrugWarehouseInfoaddMoney(arr[i].drug_warehouse_info,arr[i].min_number,arr[i].min_unit,arr[i].max_unit,arr[i].last_price)
254
-              arr[i].outStock = this.getDrugWarehouseOutInfo(arr[i].drug_warehouse_out,arr[i].min_number,arr[i].min_unit,arr[i].max_unit)
255
-              arr[i].stockOutMoney = this.getDrugWarehouseOutMoney(arr[i].drug_warehouse_out,arr[i].min_number,arr[i].min_unit,arr[i].max_unit,arr[i].last_price)
256
-              arr[i].overStock = this.getDrugWarehouseInfo(arr[i].drug_warehouse_info,arr[i].min_number,arr[i].min_unit,arr[i].max_unit)
257
-              arr[i].oveMoney =  this.getDrugWarehouseInfoMoney(arr[i].drug_warehouse_info,arr[i].min_number,arr[i].min_unit,arr[i].max_unit,arr[i].last_price)
373
+
374
+            console.log("list23323223322332232323322323wode",list)
375
+            for(let i=0;i<list.length;i++){
376
+              list[i].last_price_in = 0
377
+              list[i].drugIn = this.getDrugWarehouseInfoOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
378
+              list[i].drugInMoney = this.getDrugInMoneyOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
379
+              list[i].drugSaleMoney = this.getSaleMoneyOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
380
+
381
+              list[i].drugAdd = this.drugAddInfo(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
382
+              list[i].drugAddPrice = this.getdrugAddPrice(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
383
+              list[i].drugAddSalePrice = this.drugAddSalePrice(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
384
+
385
+              list[i].drugOut=  this.getDrugOut(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
386
+              list[i].drugOutPrice = this.getDrugOutPrice(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
387
+              list[i].drugOutSalePrice = this.getDrugOutSaleprice(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
388
+
389
+              list[i].overDrug = this.getDrugWarehouseInfo(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
390
+              list[i].overDrugPrice =  this.getDrugInMoney(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
391
+              list[i].oveDrugSaleMoney =  this.getSaleMoney(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
258
             }
392
             }
259
-            this.tableList = arr;
393
+            this.tableList = list;
260
             this.total = response.data.data.total
394
             this.total = response.data.data.total
261
             this.manufacturerList = response.data.data.manufacturerList
395
             this.manufacturerList = response.data.data.manufacturerList
262
             var drugTypeList = response.data.data.drugTypeList
396
             var drugTypeList = response.data.data.drugTypeList
263
-            var obj = {id:0,name:"全部"}
397
+            var obj = {value:0,name:"全部"}
264
             this.drugTypeList.push(obj)
398
             this.drugTypeList.push(obj)
265
             for(let i=0;i<drugTypeList.length;i++){
399
             for(let i=0;i<drugTypeList.length;i++){
266
                this.drugTypeList.push(drugTypeList[i])
400
                this.drugTypeList.push(drugTypeList[i])
279
       return manufacturer_name
413
       return manufacturer_name
280
     },
414
     },
281
     handleSizeChange(val) {
415
     handleSizeChange(val) {
416
+      this.drugTypeList = []
282
       this.limit = val;
417
       this.limit = val;
283
       this.getlist()
418
       this.getlist()
284
     },
419
     },
285
     handleCurrentChange(val) {
420
     handleCurrentChange(val) {
286
       this.page = val;
421
       this.page = val;
422
+      this.drugTypeList = []
287
       this.getlist()
423
       this.getlist()
288
     },
424
     },
289
    seach(){
425
    seach(){
426
+    this.drugTypeList = []
427
+    this.houseList= []
290
     this.getlist()
428
     this.getlist()
291
    },
429
    },
292
    getDrugTypeName(id){
430
    getDrugTypeName(id){
335
     return name
473
     return name
336
   },
474
   },
337
   endTimeChange(){
475
   endTimeChange(){
338
-
476
+    this.getlist()
339
   },
477
   },
340
   startTimeChange(){
478
   startTimeChange(){
479
+    this.getlist()
480
+  },
481
+  getDrugWarehouseInfoOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
482
+   var total = 0
483
+   var totalOne =0
484
+   var totalTwo = 0
485
+   var totalthree= 0
486
+   var totalfour = 0
487
+   var totalfive = 0
488
+   var max_str = "";
489
+   var min_str = "";
490
+   if(arr!=null && arr.length > 0){
491
+    for(let i=0;i<arr.length;i++){
492
+      totalOne += arr[i].count
493
+     }
494
+   }
495
+   if(arr2!=null && arr2.length > 0){
496
+    for(let i=0;i<arr2.length;i++){
497
+      totalTwo += arr2[i].count
498
+     }
499
+   }
500
+   if(arr3!=null && arr3.length > 0){
501
+    for(let i=0;i<arr3.length;i++){
502
+      totalthree += arr3[i].count
503
+     } 
504
+   }
505
+  if(arr4!=null && arr4.length > 0){
506
+    for(let i=0;i<arr4.length;i++){
507
+      totalfour += arr4[i].count
508
+     } 
509
+  }
510
+
511
+  if(arr5!=null && arr5.length > 0){
512
+    for(let i=0;i<arr5.length;i++){
513
+      totalfive += arr5[i].count
514
+     } 
515
+  }
516
+  console.log("totalONE223323232323232",totalOne)
517
+  console.log("totalTwo2oo2o32o3o32o23",totalTwo)
518
+  console.log("totalfive",totalfive)
519
+  console.log("00-------------------------")
520
+  total = totalOne - totalTwo + totalthree - totalfour + totalfive
521
+  if (total < min_number) {
522
+     min_str = total + min_unit;
523
+   }
524
+  if (total == 0) {
525
+     min_str = "";
526
+     max_str = "";
527
+  }
528
+  if (total >= min_number) {
529
+    if (parseInt(total / min_number) != 0) {
530
+      max_str = parseInt(total / min_number) + max_unit;
531
+    }
532
+    if (total % min_number != 0) {
533
+      min_str = (total % min_number) + min_unit;
534
+    }
535
+   }
536
+  return max_str + min_str;  
341
 
537
 
342
   },
538
   },
343
-  getDrugWarehouseInfo(arr,min_number,min_unit,max_unit){
539
+  getDrugWarehouseInfo(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
344
    var total = 0
540
    var total = 0
541
+   var total_one= 0
542
+   var total_two = 0
543
+   var total_three = 0
544
+   var total_four = 0
545
+   var total_five = 0
345
    var max_str = "";
546
    var max_str = "";
346
    var min_str = "";
547
    var min_str = "";
347
-   if(arr.length > 0){
548
+   if(arr!=null && arr.length > 0){
348
     for(let i=0;i<arr.length;i++){
549
     for(let i=0;i<arr.length;i++){
349
-      total += arr[i].stock_max_number + arr[i].stock_min_number
550
+      total_one += arr[i].count 
551
+     }
552
+   }
553
+   if(arr4!=null && arr4.length > 0){
554
+    for(let i=0;i<arr4.length;i++){
555
+      total_four += arr4[i].count 
350
      }
556
      }
351
    }
557
    }
558
+   if(arr2!=null && arr2.length > 0){
559
+     for(let i=0;i<arr2.length;i++){
560
+       total_two+= arr2[i].count
561
+     }
562
+   }
563
+   if(arr3!=null && arr3.length >0){
564
+     for(let i=0;i<arr3.length;i++){
565
+       total_three +=arr3[i].count
566
+     }  
567
+   }
568
+
569
+    if(arr5!=null && arr5.length >0){
570
+     for(let i=0;i<arr5.length;i++){
571
+       total_five +=arr5[i].count
572
+     }  
573
+   }
574
+
575
+  total = total_one - total_four +total_two - total_three + total_five
576
+  if(total < 0){
577
+    total = 0
578
+  }
352
   if (total < min_number) {
579
   if (total < min_number) {
353
      min_str = total + min_unit;
580
      min_str = total + min_unit;
354
    }
581
    }
373
    var out_total = 0
600
    var out_total = 0
374
    var max_str = "";
601
    var max_str = "";
375
    var min_str = "";
602
    var min_str = "";
376
-   if(arr.length > 0){
603
+   if(arr!=null &&arr.length > 0){
377
     for(let i=0;i<arr.length;i++){
604
     for(let i=0;i<arr.length;i++){
378
       add_total += arr[i].warehousing_count
605
       add_total += arr[i].warehousing_count
379
      }
606
      }
419
       outTotal += outArr[i].count
646
       outTotal += outArr[i].count
420
      }
647
      }
421
    }
648
    }
422
-   console.log("adw23223wode",addTotal)
423
-   console.log("233232232tade",outTotal)
649
+
424
    total = addTotal - outTotal
650
    total = addTotal - outTotal
425
    if (total < min_number) {
651
    if (total < min_number) {
426
       min_str = total 
652
       min_str = total 
435
    }
661
    }
436
  
662
  
437
    total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
663
    total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
438
-    console.log("total_price",total_price)
664
+
439
    return total_price
665
    return total_price
440
   },
666
   },
441
   getDrugWarehouseInfoMoney(arr,min_number,min_unit,max_unit,last_price){
667
   getDrugWarehouseInfoMoney(arr,min_number,min_unit,max_unit,last_price){
461
    }
687
    }
462
  
688
  
463
    total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
689
    total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
464
-    console.log("total_price",total_price)
690
+   
465
    return total_price
691
    return total_price
466
   },
692
   },
467
   getDrugWarehouseInfoStockAdd(arr,min_number,min_unit,max_unit){
693
   getDrugWarehouseInfoStockAdd(arr,min_number,min_unit,max_unit){
516
    total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
742
    total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
517
    return total_price
743
    return total_price
518
   },
744
   },
745
+  getDrugInMoneyOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
746
+   
747
+   var totalOne = 0
748
+   var totalTwo =0
749
+   var total_three = 0
750
+   var total_four = 0
751
+   var totalFive = 0
752
+   var total_price = 0
753
+   if(arr!=null&&arr.length > 0){
754
+    for(let i=0;i<arr.length;i++){
755
+      totalOne += (arr[i].warehousing_count/min_number*arr[i].price) + arr[i].warehousing_count*(arr[i].price/min_number)
756
+     }
757
+   }
758
+  
759
+  if(arr2!=null&&arr2.length > 0){
760
+    for(let i=0;i<arr2.length;i++){
761
+      totalTwo += ((arr2[i].count/min_number) * arr2[i].price) + ((arr2[i].count%min_number)*(arr2[i].price/min_number))
762
+     }
763
+   }
764
+
765
+  
766
+  if(arr3!=null&&arr3.length > 0){
767
+    for(let i=0;i<arr3.length;i++){
768
+      total_three+=arr3[i].count* arr3[i].xt_drug_warehouse_info.retail_price 
769
+     }
770
+   }
771
+
772
+  if(arr4!=null&&arr4.length > 0){
773
+    for(let i=0;i<arr4.length;i++){
774
+      total_four+=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
775
+     }
776
+   }
777
+
778
+  if(arr5!=null&&arr5.length > 0){
779
+    for(let i=0;i<arr5.length;i++){
780
+      totalFive += ((arr5[i].count/min_number) * arr5[i].price) + ((arr5[i].count%min_number)*(arr5[i].price/min_number))
781
+     }
782
+   }
783
+
784
+   total_price =(totalOne - totalTwo + total_three - total_four + totalFive).toFixed(2)
785
+   if(total_price >0){
786
+    return total_price
787
+   }else{
788
+    return 0
789
+   }
790
+  
791
+  },
792
+  getDrugInMoney(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
793
+  
794
+   var total_price = 0
795
+   var total_one_price = 0
796
+   var total_two_price = 0
797
+   var total_four_price =0
798
+   var total_three_price = 0
799
+   var total_five_price = 0
800
+   if(arr!=null&&arr.length > 0){
801
+    for(let i=0;i<arr.length;i++){
802
+      total_one_price += arr[i].count * (arr[i].price/min_number)
803
+     }
804
+   }
805
+   
806
+   if(arr4!=null && arr4.length > 0){
807
+     for(let i=0;i<arr4.length;i++){
808
+       total_four_price +=arr4[i].count * arr4[i].xt_drug_warehouse_info.price/min_number
809
+     }
810
+   }
811
+
812
+   if(arr2!=null && arr2.length > 0){
813
+     for(let i=0;i<arr2.length;i++){
814
+       total_two_price += arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
815
+     }
816
+   }
817
+  
818
+  if(arr3!=null && arr3.length > 0){
819
+     for(let i=0;i<arr3.length;i++){
820
+       total_three_price += arr3[i].count * arr3[i].xt_drug_warehouse_info.price/min_number
821
+     }
822
+   }
823
+
824
+   if(arr5!=null && arr5.length > 0){
825
+     for(let i=0;i<arr5.length;i++){
826
+       total_five_price += arr5[i].count * arr5[i].xt_drug_warehouse_info.price/min_number
827
+     }
828
+   }
829
+ 
830
+   total_price = total_one_price - total_four_price + total_two_price - total_three_price + total_five_price
831
+   if(total_price > 0){
832
+     return total_price.toFixed(2)
833
+   }else{
834
+    return 0
835
+   }
836
+  },
837
+  getSaleMoney(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
838
+  
839
+   var total_price = 0
840
+   var total_price_one = 0
841
+   var total_price_two = 0
842
+   var total_price_four = 0
843
+   var total_price_three =0
844
+   var total_price_five = 0
845
+   if(arr!=null&&arr.length > 0){
846
+    for(let i=0;i<arr.length;i++){
847
+      total_price_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
848
+     }
849
+   }
850
+   if(arr4!=null && arr4.length>0){
851
+    for(let i=0;i<arr4.length > 0;i++){
852
+      total_price_four += arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
853
+    }
854
+   }
855
+   if(arr2!=null && arr2.length > 0){
856
+    for(let i=0;i<arr2.length;i++){
857
+     total_price_two += arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
858
+    }
859
+    
860
+   }
861
+
862
+  if(arr3!=null && arr3.length > 0){
863
+    for(let i=0;i<arr3.length;i++){
864
+      total_price_three += arr3[i].count * arr3[i].xt_drug_warehouse_info.retail_price
865
+    }
866
+    
867
+   }
868
+
869
+  if(arr5!=null && arr5.length > 0){
870
+    for(let i=0;i<arr5.length;i++){
871
+      total_price_five += arr5[i].count * arr5[i].xt_drug_warehouse_info.retail_price
872
+    }
873
+    
874
+   }
875
+
876
+  total_price = total_price_one - total_price_four + total_price_two - total_price_three + total_price_five
877
+   if(total_price >0){
878
+     return total_price.toFixed(2)
879
+   }else{
880
+    return 0
881
+   }
882
+  
883
+  },
884
+  getSaleMoneyOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
885
+  var totalOne = 0
886
+   var totalTwo =0
887
+   var total_price = 0
888
+   var total_three= 0
889
+   var total_four = 0
890
+   var total_five = 0
891
+   if(arr!=null&&arr.length > 0){
892
+    for(let i=0;i<arr.length;i++){
893
+      totalOne += arr[i].count*arr[i].xt_drug_warehouse_info.retail_price 
894
+     }
895
+   }
896
+  
897
+  if(arr2!=null&&arr2.length > 0){
898
+    for(let i=0;i<arr2.length;i++){
899
+      totalTwo += arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
900
+     }
901
+   }
902
+  
903
+  if(arr3!=null&&arr3.length > 0){
904
+    for(let i=0;i<arr3.length;i++){
905
+      total_three+=arr3[i].count* arr3[i].xt_drug_warehouse_info.retail_price 
906
+     }
907
+   }
908
+
909
+  if(arr4!=null&&arr4.length > 0){
910
+    for(let i=0;i<arr4.length;i++){
911
+      total_four+=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
912
+     }
913
+   }
914
+
915
+   if(arr5!=null&&arr5.length > 0){
916
+    for(let i=0;i<arr5.length;i++){
917
+      total_four+=arr5[i].count * arr5[i].xt_drug_warehouse_info.retail_price
918
+     }
919
+   }
920
+   console.log("arr333333333332",arr3)
921
+   console.log("arr4233232323223233wi",arr4)
922
+   console.log("total_pricewode",(totalOne - totalTwo+total_three - total_four).toFixed(2))
923
+   total_price =(totalOne - totalTwo+total_three - total_four + total_five).toFixed(2)
924
+   if(total_price > 0){
925
+      return total_price
926
+   }else{
927
+     return 0
928
+   }
929
+  
930
+  },
519
   getDrugWarehouseOutInfo(arr,min_number,min_unit,max_unit){
931
   getDrugWarehouseOutInfo(arr,min_number,min_unit,max_unit){
520
    var total = 0
932
    var total = 0
521
    var max_str = "";
933
    var max_str = "";
565
     total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
977
     total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
566
     return total_price
978
     return total_price
567
    }
979
    }
568
-  }
569
-  
570
   },
980
   },
571
-  created(){
981
+   open(){
982
+    this.houseList= []
983
+    this.drugTypeList = []
572
     this.getStorehouseList()
984
     this.getStorehouseList()
573
     this.getlist()
985
     this.getlist()
986
+   },
574
   
987
   
988
+  drugAddInfo(arr,min_number,min_unit,max_unit,arr2){
989
+    var total = 0
990
+    var totalone = 0
991
+    var totaltwo = 0
992
+    var max_str = "";
993
+    var min_str = "";
994
+    if(arr!=null && arr.length > 0){
995
+      for(let i=0;i<arr.length;i++){
996
+        totalone += arr[i].count
997
+      }
998
+    }
999
+    if(arr2!=null && arr2.length >0){
1000
+      for(let i=0;i<arr2.length;i++){
1001
+        totaltwo += arr2[i].count
1002
+      }
1003
+    }
1004
+    total = totalone + totaltwo
1005
+
1006
+    if (total < min_number) {
1007
+      min_str = total + min_unit;
1008
+    }
1009
+    if (total == 0) {
1010
+      min_str = "";
1011
+      max_str = "";
1012
+    }
1013
+    if (total >= min_number) {
1014
+      if (parseInt(total / min_number) != 0) {
1015
+        max_str = parseInt(total / min_number) + max_unit;
1016
+      }
1017
+      if (total % min_number != 0) {
1018
+        min_str = (total % min_number) + min_unit;
1019
+      }
1020
+    }
1021
+    return max_str + min_str;  
1022
+   },
1023
+   getdrugAddPrice(arr,min_number,min_unit,max_unit,arr2){
1024
+    var total = 0
1025
+    var totalone =0 
1026
+    var totaltwo = 0
1027
+    var total_price = 0
1028
+
1029
+    if(arr!=null&&arr.length > 0){
1030
+      for(let i=0;i<arr.length;i++){
1031
+        totalone += arr[i].count * arr[i].xt_drug_warehouse_info.price/min_number
1032
+      }
1033
+    }
1034
+   
1035
+    if(arr2!=null && arr2.length > 0){
1036
+     for(let i=0;i<arr2.length;i++){
1037
+       totaltwo +=arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
1038
+      }
1039
+    }
1040
+    total = totalone + totaltwo
1041
+    total_price =total.toFixed(2)
1042
+    return total_price
1043
+   },
1044
+   drugAddSalePrice(arr,min_number,min_unit,max_unit,arr2){
1045
+    var total = 0
1046
+    var total_one = 0
1047
+    var total_two = 0
1048
+    var total_price = 0
1049
+    if(arr!=null&&arr.length > 0){
1050
+      for(let i=0;i<arr.length;i++){
1051
+        total_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
1052
+      }
1053
+    }
1054
+
1055
+   if(arr2!=null&&arr2.length > 0){
1056
+      for(let i=0;i<arr2.length;i++){
1057
+       total_two +=arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
1058
+      }
1059
+    }
1060
+    
1061
+    total = total_one + total_two
1062
+
1063
+    total_price = total.toFixed(2)
1064
+    return total_price
1065
+   },
1066
+   getDrugOut(arr,min_number,min_unit,max_unit,arr2,arr3){
1067
+    var total = 0
1068
+    var totalone = 0
1069
+    var totaltwo = 0
1070
+    var totalthree = 0
1071
+    var min_str = ""
1072
+    var max_str = ""
1073
+    if(arr!=null&&arr.length > 0){
1074
+      for(let i=0;i<arr.length;i++){
1075
+         totalone +=arr[i].count
1076
+      }
1077
+    }
1078
+    if(arr2!=null && arr2.length>0){
1079
+      for(let i=0;i<arr2.length;i++){
1080
+        totaltwo +=arr2[i].count
1081
+      }
1082
+    }
1083
+    if(arr3!=null && arr3.length>0){
1084
+      for(let i=0;i<arr3.length;i++){
1085
+        totalthree +=arr3[i].count
1086
+      }
1087
+    }
1088
+    total = totalone + totaltwo - totalthree
1089
+    if (total < min_number) {
1090
+      min_str = total + min_unit;
1091
+    }
1092
+    if (total == 0) {
1093
+      min_str = "";
1094
+      max_str = "";
1095
+    }
1096
+    if (total >= min_number) {
1097
+      if (parseInt(total / min_number) != 0) {
1098
+        max_str = parseInt(total / min_number) + max_unit;
1099
+      }
1100
+      if (total % min_number != 0) {
1101
+        min_str = (total % min_number) + min_unit;
1102
+      }
1103
+   }
1104
+   return max_str + min_str;  
1105
+   },
1106
+   getDrugOutPrice(arr,min_number,min_unit,max_unit,arr2,arr3){
1107
+    
1108
+    var total_price = 0
1109
+    var total_one_price =0
1110
+    var total_two_price = 0
1111
+    var total_three_price = 0
1112
+    var total = 0
1113
+    var total_two = 0
1114
+    var total_three = 0
1115
+    if(arr!=null&&arr.length > 0){
1116
+      for(let i=0;i<arr.length;i++){
1117
+        total_one_price += arr[i].count * (arr[i].xt_drug_warehouse_info.price/min_number) 
1118
+        total += arr[i].count
1119
+      }
1120
+    }
1121
+    if(arr2!=null && arr2.length>0){
1122
+      for(let i=0;i<arr2.length;i++){
1123
+        total_two_price +=arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
1124
+        total_two +=arr2[i].count
1125
+      }
1126
+    }
1127
+
1128
+    if(arr3!=null && arr3.length>0){
1129
+      for(let i=0;i<arr3.length;i++){
1130
+        total_three_price +=arr3[i].count * arr3[i].xt_drug_warehouse_info.price/min_number
1131
+        total_three +=arr3[i].count
1132
+      }
1133
+    }
1134
+   
1135
+    total_price = total_one_price + total_two_price - total_three_price
1136
+    if(total_price > 0){
1137
+      return total_price.toFixed(2)
1138
+    }else{
1139
+     return 0
1140
+    }
1141
+    
1142
+   },
1143
+   getDrugOutSaleprice(arr,min_number,min_unit,max_unit,arr3,arr4){
1144
+    var total_price = 0
1145
+    var total_price_one = 0
1146
+    var total_price_two = 0
1147
+    var total_price_three = 0 
1148
+    if(arr!=null&&arr.length > 0){
1149
+      for(let i=0;i<arr.length;i++){
1150
+        total_price_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
1151
+      }
1152
+    }
1153
+
1154
+    if(arr3!=null && arr3.length >0){
1155
+      for(let i=0;i<arr3.length;i++){
1156
+         total_price_two +=arr3[i].count * arr3[i].xt_drug_warehouse_info.retail_price
1157
+      }
1158
+    }
1159
+
1160
+    if(arr4!=null && arr4.length >0){
1161
+      for(let i=0;i<arr4.length;i++){
1162
+         total_price_three +=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
1163
+      }
1164
+    }
1165
+   
1166
+   total_price = total_price_one + total_price_two - total_price_three
1167
+    
1168
+    if(total_price > 0){
1169
+      return total_price.toFixed(2)
1170
+    }else{
1171
+     return 0
1172
+    }
1173
+    
1174
+   },
1175
+   toPrint(){
1176
+    this.$router.push({path:"/drugs/purchase/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&good_type="+this.good_type})
1177
+   },
1178
+    exportList: function() {
1179
+       for(let i=0;i<this.tableList.length;i++){
1180
+          this.tableList[i].index = i+1
1181
+          this.tableList[i].query_date = this.start_time+"~"+this.end_time
1182
+          this.tableList[i].good_type = this.getDrugTypeName(this.tableList[i].drug_type)
1183
+          this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
1184
+          this.tableList[i].specification_name = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number + this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
1185
+          
1186
+        }
1187
+        import('@/vendor/Export2Excel').then(excel => {
1188
+           const multiHeader = [['序号', '查询日期','  药品类型','药品名称','规格&单位','生产产商', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
1189
+           const header = ['', '','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
1190
+           const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:I1', 'J1:L1', 'M1:O1', 'P1:R1']
1191
+           const filterVal = ['index', 'query_date', 'good_type','drug_name','specification_name','manufacturer_name','drugIn','drugInMoney','drugSaleMoney','drugAdd','drugAddPrice','drugAddSalePrice','drugOut','drugOutPrice','drugOutSalePrice','overDrug','overDrugPrice','oveDrugSaleMoney']
1192
+    
1193
+           const data = this.formatJson(filterVal, this.tableList)
1194
+           
1195
+           const filename = '药品进销存查询'
1196
+     
1197
+          
1198
+            excel.export_json_to_excel({
1199
+              multiHeader,
1200
+              header,
1201
+              merges,
1202
+              data,
1203
+              filename
1204
+            })
1205
+        })
1206
+     },
1207
+    formatJson(filterVal, jsonData) {
1208
+      return jsonData.map(v => filterVal.map(j => v[j]));
1209
+    },
575
   }
1210
   }
576
 }
1211
 }
577
 </script>
1212
 </script>

+ 43 - 3
src/xt_pages/stock/drugs/drugBatchNumber.vue ファイルの表示

13
         >&nbsp;
13
         >&nbsp;
14
       </div>
14
       </div>
15
       <div class="cell clearfix">
15
       <div class="cell clearfix">
16
-        <span>日期查询:</span>
16
+        <span>入库时间:</span>
17
         <el-date-picker
17
         <el-date-picker
18
           size="small"
18
           size="small"
19
           v-model="start_time"
19
           v-model="start_time"
41
           value-format="yyyy-MM-dd"
41
           value-format="yyyy-MM-dd"
42
           @change="endTimeChange"
42
           @change="endTimeChange"
43
         ></el-date-picker>
43
         ></el-date-picker>
44
+        <span>有效期:</span>
45
+        <el-date-picker
46
+          size="small"
47
+          v-model="start_first_time"
48
+          prefix-icon="el-icon-date"
49
+          :editable="false"
50
+          style="width: 196px"
51
+          type="date"
52
+          placeholder="选择日期时间"
53
+          align="right"
54
+          format="yyyy-MM-dd"
55
+          value-format="yyyy-MM-dd"
56
+          @change="startTimeFirstChange"
57
+        ></el-date-picker
58
+        >-
59
+        <el-date-picker
60
+          size="small"
61
+          v-model="end_first_time"
62
+          prefix-icon="el-icon-date"
63
+          :editable="false"
64
+          style="width: 196px; margin-right: 10px"
65
+          type="date"
66
+          placeholder="选择日期时间"
67
+          align="right"
68
+          format="yyyy-MM-dd"
69
+          value-format="yyyy-MM-dd"
70
+          @change="endTimeFirstChange"
71
+        ></el-date-picker>
44
       </div>
72
       </div>
45
 
73
 
46
       <el-table :data="tableList" border style="width: 100%">
74
       <el-table :data="tableList" border style="width: 100%">
104
             {{ scope.row.price }}
132
             {{ scope.row.price }}
105
           </template>
133
           </template>
106
         </el-table-column>
134
         </el-table-column>
107
-        <!-- <el-table-column prop="drug_name" label="该批次剩余库存" align="center">
135
+        <el-table-column prop="drug_name" label="该批次剩余库存" align="center">
108
           <template slot-scope="scope">
136
           <template slot-scope="scope">
109
            <span v-if="scope.row.stock_max_number >0">{{ scope.row.stock_max_number }}{{drug.max_unit}}</span> 
137
            <span v-if="scope.row.stock_max_number >0">{{ scope.row.stock_max_number }}{{drug.max_unit}}</span> 
110
            <span v-if="scope.row.stock_min_number >0">{{scope.row.stock_min_number}}{{drug.min_unit}}</span>
138
            <span v-if="scope.row.stock_min_number >0">{{scope.row.stock_min_number}}{{drug.min_unit}}</span>
111
           </template>
139
           </template>
112
-        </el-table-column> -->
140
+        </el-table-column>
113
          <el-table-column prop="remake" label="备注" align="center">
141
          <el-table-column prop="remake" label="备注" align="center">
114
           <template slot-scope="scope">
142
           <template slot-scope="scope">
115
             {{ scope.row.remark }}
143
             {{ scope.row.remark }}
209
       drugOutList: [],
237
       drugOutList: [],
210
       drug: {},
238
       drug: {},
211
       houseList: [],
239
       houseList: [],
240
+      start_first_time:"",
241
+      end_first_time:"",
212
     };
242
     };
213
   },
243
   },
214
   watch: {
244
   watch: {
222
         drug_id: this.$route.query.drug_id,
252
         drug_id: this.$route.query.drug_id,
223
         page: this.page,
253
         page: this.page,
224
         limit: this.limit,
254
         limit: this.limit,
255
+        start_time:this.start_time,
256
+        end_time:this.end_time,
257
+        start_first_time:this.start_first_time,
258
+        end_first_time:this.end_first_time,
225
       };
259
       };
226
       getBatchOrderDetail(params).then((response) => {
260
       getBatchOrderDetail(params).then((response) => {
227
         if (response.data.state == 1) {
261
         if (response.data.state == 1) {
400
       }
434
       }
401
       return storehouse_name;
435
       return storehouse_name;
402
     },
436
     },
437
+    startTimeFirstChange(){
438
+      this.getlist()
439
+    },
440
+    endTimeFirstChange(){
441
+      this.getlist()
442
+    }
403
   },
443
   },
404
 };
444
 };
405
 </script>
445
 </script>

+ 13 - 5
src/xt_pages/stock/drugs/drugNewQuery.vue ファイルの表示

10
               <DrugQuery></DrugQuery>
10
               <DrugQuery></DrugQuery>
11
             </el-tab-pane>
11
             </el-tab-pane>
12
             <el-tab-pane label="进销存查询" name="second">
12
             <el-tab-pane label="进销存查询" name="second">
13
-               <PurchaseDrugQuery></PurchaseDrugQuery>
13
+               <PurchaseDrugQuery ref="mychild"></PurchaseDrugQuery>
14
            </el-tab-pane>
14
            </el-tab-pane>
15
             <el-tab-pane label="有效期查询" name="third">
15
             <el-tab-pane label="有效期查询" name="third">
16
-                <ExpiryDateDrugQuery></ExpiryDateDrugQuery>
16
+                <ExpiryDateDrugQuery ref="mychildOne"></ExpiryDateDrugQuery>
17
             </el-tab-pane>
17
             </el-tab-pane>
18
             <el-tab-pane label="患者查询" name="fourth">
18
             <el-tab-pane label="患者查询" name="fourth">
19
-                <DrugPatientQuery></DrugPatientQuery>
19
+                <DrugPatientQuery ref="mychildtwo"></DrugPatientQuery>
20
             </el-tab-pane>
20
             </el-tab-pane>
21
         </el-tabs>
21
         </el-tabs>
22
      </div>
22
      </div>
51
     };
51
     };
52
   },
52
   },
53
   methods:{
53
   methods:{
54
-    handleClick(){
55
-        
54
+    handleClick(val){
55
+      if(val.name == "second"){
56
+       this.$refs.mychild.open()
57
+      }   
58
+      if(val.name == "third"){
59
+       this.$refs.mychildOne.open()
60
+      }
61
+      if(val.name == "fourth"){
62
+        this.$refs.mychildtwo.open()
63
+      }
56
     }
64
     }
57
   }
65
   }
58
 };
66
 };

+ 8 - 5
src/xt_pages/stock/drugs/drugStockFlow.vue ファイルの表示

95
               <span>{{getHouseName(scope.row.storehouse_id)}}</span>
95
               <span>{{getHouseName(scope.row.storehouse_id)}}</span>
96
            </template>
96
            </template>
97
         </el-table-column>
97
         </el-table-column>
98
-        <el-table-column prop="drug_name" label="数量" align="center">
98
+        <el-table-column prop="drug_name" label="数量&单位" align="center">
99
            <template slot-scope="scope">
99
            <template slot-scope="scope">
100
-              {{scope.row.count}}
100
+              <span v-if="scope.row.consumable_type != 2 &&  scope.row.consumable_type != 3 && scope.row.consumable_type != 5 && scope.row.consumable_type != 7">{{scope.row.count}}{{scope.row.max_unit}}</span>
101
+              <span v-if="(scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 5 || scope.row.consumable_type == 7) && parseInt(scope.row.count/scope.row.BaseDrugLib.min_number) >0">{{parseInt(scope.row.count/scope.row.BaseDrugLib.min_number)}}{{scope.row.BaseDrugLib.max_unit}}</span>
102
+              <span v-if="(scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 5 || scope.row.consumable_type == 7) && scope.row.count%scope.row.BaseDrugLib.min_number >0">{{scope.row.count%scope.row.BaseDrugLib.min_number}}{{scope.row.BaseDrugLib.min_unit}}</span>
101
            </template>
103
            </template>
102
         </el-table-column>
104
         </el-table-column>
103
 
105
 
104
-        <el-table-column prop="drug_name" label="单位" align="center">
106
+        <!-- <el-table-column prop="drug_name" label="单位" align="center">
105
            <template slot-scope="scope">
107
            <template slot-scope="scope">
106
               {{scope.row.max_unit}}
108
               {{scope.row.max_unit}}
107
            </template>
109
            </template>
108
-        </el-table-column>
110
+        </el-table-column> -->
109
 
111
 
110
 
112
 
111
        <!-- <el-table-column prop="drug_name" label="剩余量" align="center">
113
        <!-- <el-table-column prop="drug_name" label="剩余量" align="center">
270
                list[i].drug_way = 4
272
                list[i].drug_way = 4
271
                this.tableList.push(list[i])
273
                this.tableList.push(list[i])
272
             }
274
             }
275
+            console.log("tablelist323223232323wode",this.tableList)
273
             var total = response.data.data.total
276
             var total = response.data.data.total
274
             this.total = total
277
             this.total = total
275
             var manufacturerList = response.data.data.manufacturerList
278
             var manufacturerList = response.data.data.manufacturerList
489
        getDrugFlow(params).then(response=>{
492
        getDrugFlow(params).then(response=>{
490
           if(response.data.state ==1){
493
           if(response.data.state ==1){
491
             var list = response.data.data.list
494
             var list = response.data.data.list
492
-           
495
+            console.log("list2o2o33o23233o3oowo",list)
493
             this.tableList = list
496
             this.tableList = list
494
             var total = response.data.data.total
497
             var total = response.data.data.total
495
            
498
            

+ 595 - 71
src/xt_pages/stock/drugs/drugStockOutOrder.vue ファイルの表示

259
             backgroundColor: 'rgb(245, 247, 250)',
259
             backgroundColor: 'rgb(245, 247, 250)',
260
             color: '#606266',
260
             color: '#606266',
261
           }"
261
           }"
262
+          :cell-class-name="cellStyle"
262
         >
263
         >
263
           <el-table-column label="药品名称" align="center">
264
           <el-table-column label="药品名称" align="center">
264
             <template slot-scope="scope">
265
             <template slot-scope="scope">
287
               {{ getHouseName(scope.row.storehouse_id) }}
288
               {{ getHouseName(scope.row.storehouse_id) }}
288
             </template>
289
             </template>
289
           </el-table-column>
290
           </el-table-column>
290
-          <!-- <el-table-column label="剩余库存" align="center" v-if="is_sys == 0">
291
+          <el-table-column label="出库数量" align="center">
291
             <template slot-scope="scope">
292
             <template slot-scope="scope">
292
-              {{scope.row.stock_count}}
293
+
294
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
295
+                  <td style="border-right: none; border-inline-end:none;text-align: center">
296
+                    <span v-if="is_sys==1">{{getOutCountSix(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_id)}}</span>
297
+                    <!-- <span v-if="is_sys == 1"> {{getOutCount(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span> -->
298
+                    <span v-if="is_sys == 0"> {{getOutCountOne(item.batch_number,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}} </span>
299
+                  </td>
300
+               </tr>
293
             </template>
301
             </template>
294
-          </el-table-column> -->
295
-          <el-table-column label="出库数量" align="center">
302
+          </el-table-column>
303
+          <el-table-column label="批次" align="center">
296
             <template slot-scope="scope">
304
             <template slot-scope="scope">
297
-              <span>
298
-                {{
299
-                  getTotalCountOne(
300
-                    scope.row.drug_id,
301
-                    scope.row.min_number,
302
-                    scope.row.max_unit,
303
-                    scope.row.min_unit
304
-                  )
305
-                }}</span
306
-              >
305
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
306
+                  <td style="border-right: none; border-inline-end:none;text-align: center">
307
+                    <span v-if="is_sys == 1">{{getBatchNumber(item.warehousing_detail_id)}}</span> 
308
+                    <span v-if="is_sys == 0">{{getBatchNumberOne(item.batch_number)}}</span>
309
+                  </td>
310
+               </tr>
307
             </template>
311
             </template>
308
           </el-table-column>
312
           </el-table-column>
309
           <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
313
           <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
310
             <template slot-scope="scope">
314
             <template slot-scope="scope">
311
-              <span>{{ getXuserName(scope.row.admin_user_id) }} </span>
315
+                <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
316
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
317
+                     {{getXuserName(scope.row.admin_user_id)}}
318
+                  </td>
319
+               </tr>
312
             </template>
320
             </template>
313
           </el-table-column>
321
           </el-table-column>
314
           <el-table-column label="单价" align="center">
322
           <el-table-column label="单价" align="center">
315
             <template slot-scope="scope">
323
             <template slot-scope="scope">
316
-              <span v-if="scope.row.price > 0"> {{ scope.row.price }}</span>
317
-              <span v-if="scope.row.price == 0">
318
-                {{ scope.row.retail_price }}</span
319
-              >
324
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
325
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
326
+                    <span v-if="is_sys == 1">{{getPrice(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span> 
327
+                    <span v-if="is_sys == 0">{{getPriceOne(item.batch_number,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span> 
328
+                  </td>
329
+               </tr>
320
             </template>
330
             </template>
321
           </el-table-column>
331
           </el-table-column>
322
           <!-- <el-table-column label="进货价" align="center" v-if="is_sys == 0">
332
           <!-- <el-table-column label="进货价" align="center" v-if="is_sys == 0">
326
           </el-table-column> -->
336
           </el-table-column> -->
327
           <el-table-column label="总价" align="center">
337
           <el-table-column label="总价" align="center">
328
             <template slot-scope="scope">
338
             <template slot-scope="scope">
329
-              <span v-if="org_id == 10210 || org_id == 9671">{{
330
-                (scope.row.count * scope.row.price).toFixed(2)
331
-              }}</span>
332
-              <span v-if="org_id != 10210 && org_id != 9671">
333
-                <span v-if="scope.row.price > 0">{{
334
-                  getAllPriceOne(
335
-                    scope.row.drug_id,
336
-                    scope.row.price,
337
-                    scope.row.price,
338
-                    scope.row.max_unit,
339
-                    scope.row.count_unit,
340
-                    scope.row.min_number,
341
-                    scope.row.is_sys
342
-                  ).toFixed(2)
343
-                }}</span>
344
-                <span v-if="scope.row.price == 0">{{
345
-                  getAllPriceOne(
346
-                    scope.row.drug_id,
347
-                    scope.row.retail_price,
348
-                    scope.row.min_price,
349
-                    scope.row.max_unit,
350
-                    scope.row.count_unit,
351
-                    scope.row.min_number,
352
-                    scope.row.is_sys
353
-                  ).toFixed(2)
354
-                }}</span>
355
-              </span>
339
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
340
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
341
+                    <span v-if="is_sys == 1">{{getTotalPrice(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
342
+                    <span v-if="is_sys == 0">{{getTotalPriceOne(item.batch_number,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
343
+                  </td>
344
+                  </td>
345
+               </tr>
356
             </template>
346
             </template>
357
           </el-table-column>
347
           </el-table-column>
358
           <el-table-column label="生产厂家" align="center">
348
           <el-table-column label="生产厂家" align="center">
359
             <template slot-scope="scope">
349
             <template slot-scope="scope">
360
-              {{ getManufacturerName(scope.row.manufacturer) }}
350
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
351
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
352
+                    <span v-if="is_sys == 1"> {{getAllManufacturerName(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
353
+                    <span v-if="is_sys == 0"> {{getManufacturerName(scope.row.manufacturer)}}</span>
354
+                  </td>
355
+               </tr>
361
             </template>
356
             </template>
362
           </el-table-column>
357
           </el-table-column>
363
           <el-table-column label="生产日期" align="center">
358
           <el-table-column label="生产日期" align="center">
364
             <template slot-scope="scope">
359
             <template slot-scope="scope">
365
-              {{ getTime(scope.row.product_date) }}
360
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
361
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
362
+                    <span v-if="is_sys == 1"> {{getProductDate(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
363
+                    <span v-if="is_sys == 0"> {{getTime(scope.row.product_date)}}</span>
364
+                  </td>
365
+               </tr>
366
             </template>
366
             </template>
367
           </el-table-column>
367
           </el-table-column>
368
           <el-table-column label="有效日期" align="center">
368
           <el-table-column label="有效日期" align="center">
369
             <template slot-scope="scope">
369
             <template slot-scope="scope">
370
-              {{ getTime(scope.row.expiry_date) }}
370
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
371
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
372
+                   <span v-if="is_sys == 1"> {{getExpiryDate(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
373
+                   <span v-if="is_sys == 0"> {{getTime(scope.row.expiry_date)}}</span>
374
+                  </td>
375
+               </tr>
371
             </template>
376
             </template>
372
           </el-table-column>
377
           </el-table-column>
373
           <el-table-column label="经销商" align="center">
378
           <el-table-column label="经销商" align="center">
374
             <template slot-scope="scope">
379
             <template slot-scope="scope">
375
-              {{ getDealerName(scope.row.dealer) }}
380
+                <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
381
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
382
+                    <span v-if="is_sys ==1">{{getDealer(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
383
+                    <span v-if="is_sys ==0">{{getDealerName(scope.row.dealer)}}</span>  
384
+                  </td>
385
+               </tr>
376
             </template>
386
             </template>
377
           </el-table-column>
387
           </el-table-column>
378
           <el-table-column label="批准文号" align="center">
388
           <el-table-column label="批准文号" align="center">
379
             <template slot-scope="scope">
389
             <template slot-scope="scope">
380
-              <span v-if="scope.row.number != ''">{{ scope.row.number }}</span>
381
-              <span v-if="scope.row.number == '0'"></span>
390
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
391
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
392
+                    <span v-if="is_sys == 1">{{getNumber(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span> 
393
+                    <span v-if="is_sys == 0">{{scope.row.number}}</span> 
394
+                  </td>
395
+               </tr>
382
             </template>
396
             </template>
383
           </el-table-column>
397
           </el-table-column>
384
           <el-table-column label="备注" align="center">
398
           <el-table-column label="备注" align="center">
385
             <template slot-scope="scope">
399
             <template slot-scope="scope">
386
-              {{ scope.row.remark }}
400
+               <tr style="background: none" v-for="(item,index) in scope.row.child" :key="index">
401
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
402
+                    <span v-if="is_sys == 1">{{getRemark(item.warehousing_detail_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
403
+                    <span v-if="is_sys == 0">{{scope.row.remark}}</span>
404
+                  </td>
405
+               </tr>
387
             </template>
406
             </template>
388
           </el-table-column>
407
           </el-table-column>
389
           <el-table-column label="操作" align="center">
408
           <el-table-column label="操作" align="center">
438
             </template>
457
             </template>
439
             <template slot-scope="scope">
458
             <template slot-scope="scope">
440
               <span
459
               <span
441
-                >{{ scope.row.ctime | parseTime("{y}-{m}-{d} {h}:{i}") }}
460
+                >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
442
               </span>
461
               </span>
443
             </template>
462
             </template>
444
           </el-table-column>
463
           </el-table-column>
493
             </template>
512
             </template>
494
             <template slot-scope="scope">
513
             <template slot-scope="scope">
495
               <span
514
               <span
496
-                >{{ scope.row.ctime | parseTime("{y}-{m}-{d} {h}:{i}") }}
515
+                >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
497
               </span>
516
               </span>
498
             </template>
517
             </template>
499
           </el-table-column>
518
           </el-table-column>
635
        {id:0,name:"全部"},
654
        {id:0,name:"全部"},
636
        {id:1,name:"已审核"},
655
        {id:1,name:"已审核"},
637
        {id:2,name:"未审核"},
656
        {id:2,name:"未审核"},
638
-      ]
657
+      ],
658
+      tabList:[],
659
+      tabListOne:[],
660
+      outList:[],
639
     };
661
     };
640
   },
662
   },
641
   methods: {
663
   methods: {
1162
           this.tableShow = true;
1184
           this.tableShow = true;
1163
           this.tableList = [];
1185
           this.tableList = [];
1164
           var list = response.data.data.list;
1186
           var list = response.data.data.list;
1165
-          // console.log("lisrt233232323232233223", list);
1187
+         
1166
           this.manufacturerList = response.data.data.manufacturerList;
1188
           this.manufacturerList = response.data.data.manufacturerList;
1167
           this.dealerList = response.data.data.dealerList;
1189
           this.dealerList = response.data.data.dealerList;
1168
           var drugFlowList = response.data.data.drugFlowList;
1190
           var drugFlowList = response.data.data.drugFlowList;
1191
+          var drugList = response.data.data.drugList
1192
+        
1193
+          this.tabList = drugList
1194
+          var drugListOne = response.data.data.drugListFlow
1195
+          var drugListTwo=  response.data.data.drugListOne
1169
 
1196
 
1197
+          var drugoutlist = response.data.data.drugoutlist
1198
+          this.outList = drugoutlist
1170
           if (is_sys == 1) {
1199
           if (is_sys == 1) {
1171
             if (drugFlowList.length > 0) {
1200
             if (drugFlowList.length > 0) {
1172
               for (let i = 0; i < drugFlowList.length; i++) {
1201
               for (let i = 0; i < drugFlowList.length; i++) {
1173
-                if (
1174
-                  drugFlowList[i].count_unit ==
1175
-                  drugFlowList[i].XtBaseDrug.max_unit
1176
-                ) {
1177
-                  drugFlowList[i].count =
1178
-                    drugFlowList[i].count *
1179
-                    drugFlowList[i].XtBaseDrug.min_number;
1202
+                 drugFlowList[i].child = []
1203
+                if (drugFlowList[i].count_unit ==drugFlowList[i].XtBaseDrug.max_unit) {
1204
+                   drugFlowList[i].count =drugFlowList[i].count * drugFlowList[i].XtBaseDrug.min_number;
1180
                 }
1205
                 }
1181
-                if (
1182
-                  drugFlowList[i].count_unit ==
1183
-                  drugFlowList[i].XtBaseDrug.min_unit
1184
-                ) {
1185
-                  drugFlowList[i].count = drugFlowList[i].count;
1206
+                if (drugFlowList[i].count_unit ==drugFlowList[i].XtBaseDrug.min_unit) {
1207
+                    drugFlowList[i].count = drugFlowList[i].count;
1208
+                }
1209
+                for(let j=0;j<drugListOne.length;j++){
1210
+                   if(drugFlowList[i].drug_id == drugListOne[j].drug_id){
1211
+                       drugFlowList[i].child.push(drugListOne[j])
1212
+                   }
1186
                 }
1213
                 }
1187
               }
1214
               }
1188
             }
1215
             }
1189
-
1216
+            console.log("数据元23322323232323322332我的",drugFlowList)
1190
             this.drugFlowList = drugFlowList;
1217
             this.drugFlowList = drugFlowList;
1191
           }
1218
           }
1192
           if (is_sys == 0 || is_sys == 12) {
1219
           if (is_sys == 0 || is_sys == 12) {
1193
             var flowlist = response.data.data.flowlist;
1220
             var flowlist = response.data.data.flowlist;
1194
             this.drugFlowList = [];
1221
             this.drugFlowList = [];
1195
             for (let i = 0; i < flowlist.length; i++) {
1222
             for (let i = 0; i < flowlist.length; i++) {
1223
+               flowlist[i].child = []
1196
               if (flowlist[i].count_unit == flowlist[i].max_unit) {
1224
               if (flowlist[i].count_unit == flowlist[i].max_unit) {
1197
                 flowlist[i].count = flowlist[i].count * flowlist[i].min_number;
1225
                 flowlist[i].count = flowlist[i].count * flowlist[i].min_number;
1198
                 flowlist[i].count_unit = flowlist[i].min_unit;
1226
                 flowlist[i].count_unit = flowlist[i].min_unit;
1200
               if (flowlist[i].count_unit == flowlist[i].min_unit) {
1228
               if (flowlist[i].count_unit == flowlist[i].min_unit) {
1201
                 flowlist[i].count = flowlist[i].count;
1229
                 flowlist[i].count = flowlist[i].count;
1202
               }
1230
               }
1231
+              if(list[i].is_sys == 1){
1232
+               for(let j=0;j<drugListOne.length;j++){
1233
+                if(flowlist[i].drug_id == drugListOne[j].drug_id){
1234
+                  flowlist[i].child.push(drugListOne[j])
1235
+                }
1236
+               }
1237
+              }
1238
+              if(list[i].is_sys == 0){
1239
+               for(let j=0;j<drugListTwo.length;j++){
1240
+                if(flowlist[i].drug_id == drugListTwo[j].drug_id){
1241
+                  flowlist[i].child.push(drugListTwo[j])
1242
+                }
1243
+               }
1244
+              }
1245
+             
1203
             }
1246
             }
1204
             this.drugFlowList = flowlist;
1247
             this.drugFlowList = flowlist;
1248
+            console.log("数据我的喔喔喔喔喔喔",this.drugFlowList)
1205
           }
1249
           }
1206
 
1250
 
1207
           for (let i = 0; i < list.length; i++) {
1251
           for (let i = 0; i < list.length; i++) {
1212
             if (list[i].number == "0" || list[i].number == 0) {
1256
             if (list[i].number == "0" || list[i].number == 0) {
1213
               list[i].number = "";
1257
               list[i].number = "";
1214
             }
1258
             }
1259
+            list[i].child = []
1260
+            if(list[i].is_sys == 1){
1261
+              for(let j=0;j<drugListOne.length;j++){
1262
+                if(list[i].drug_id == drugListOne[j].drug_id){
1263
+                  list[i].child.push(drugListOne[j])
1264
+                }
1265
+             }
1266
+            }
1267
+            if(list[i].is_sys == 0){
1268
+              for(let j=0;j<drugListTwo.length;j++){
1269
+                if(list[i].drug_id == drugListTwo[j].drug_id){
1270
+                  list[i].child.push(drugListTwo[j])
1271
+                }
1272
+               }
1273
+            }
1215
           }
1274
           }
1275
+         console.log("list2332323232232323",list)
1216
           this.tableList = list;
1276
           this.tableList = list;
1217
-          // console.log("单价23323232323232232332232323233223", this.tableList);
1277
+
1218
         }
1278
         }
1219
       });
1279
       });
1220
     },
1280
     },
1555
     },
1615
     },
1556
     changeCheckType(){
1616
     changeCheckType(){
1557
       this.GetWarehouseOut();
1617
       this.GetWarehouseOut();
1618
+    },
1619
+    // 合并单元格样式
1620
+    cellStyle({ row, column, rowIndex, columnIndex }) {
1621
+      let arr = [5,6, 7, 8, 9,10,11,12,13,14];
1622
+      if (arr.indexOf(columnIndex) > -1) {
1623
+        return "spanClass";
1624
+      }
1625
+    },
1626
+    getOutCountSix(warehouse_info_id,max_unit,min_unit,min_number,drug_id){
1627
+      var arr = []
1628
+      var total = 0
1629
+      var max_str = ""
1630
+      var min_str = ""
1631
+      for(let j=0;j<this.outList.length;j++){
1632
+        if(warehouse_info_id == this.outList[j].warehouse_info_id && drug_id == this.outList[j].drug_id){
1633
+           arr.push(this.outList[j])
1634
+        }
1635
+      }
1636
+      
1637
+      if(arr.length > 0){
1638
+        for(let i=0;i<arr.length;i++){
1639
+           total +=arr[i].count
1640
+        }
1641
+      }
1642
+     
1643
+      if (total < min_number) {
1644
+        min_str = total + min_unit;
1645
+      }
1646
+      if (total == 0) {
1647
+        min_str = "";
1648
+        max_str = "";
1649
+      }
1650
+      if (total >= min_number) {
1651
+        if (parseInt(total / min_number) != 0) {
1652
+          max_str = parseInt(total / min_number) + max_unit;
1653
+        }
1654
+        if (total % min_number != 0) {
1655
+          min_str = (total % min_number) + min_unit;
1656
+        }
1657
+      }
1658
+      return max_str + min_str;
1659
+    },
1660
+    getOutCount(warehouse_info_id,max_unit,min_unit,min_number){
1661
+      var arr = []
1662
+      var total = 0
1663
+      var max_str = ""
1664
+      var min_str = ""
1665
+      for(let j=0;j<this.tabList.length;j++){
1666
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1667
+           arr.push(this.tabList[j])
1668
+        }
1669
+      }
1670
+      
1671
+      if(arr.length > 0){
1672
+        for(let i=0;i<arr.length;i++){
1673
+           total +=arr[i].count
1674
+        }
1675
+      }
1676
+     
1677
+      if (total < min_number) {
1678
+        min_str = total + min_unit;
1679
+      }
1680
+      if (total == 0) {
1681
+        min_str = "";
1682
+        max_str = "";
1683
+      }
1684
+      if (total >= min_number) {
1685
+        if (parseInt(total / min_number) != 0) {
1686
+          max_str = parseInt(total / min_number) + max_unit;
1687
+        }
1688
+        if (total % min_number != 0) {
1689
+          min_str = (total % min_number) + min_unit;
1690
+        }
1691
+      }
1692
+      return max_str + min_str;
1693
+    },
1694
+    getOutCountOne(batch_number,max_unit,min_unit,min_number){
1695
+     
1696
+      var arr = []
1697
+      var total = 0
1698
+      var max_str = ""
1699
+      var min_str = ""
1700
+      for(let j=0;j<this.tabList.length;j++){
1701
+        if(batch_number == this.tabList[j].batch_number){
1702
+           arr.push(this.tabList[j])
1703
+        }
1704
+      }
1705
+      
1706
+      if(arr.length > 0){
1707
+        for(let i=0;i<arr.length;i++){
1708
+           total +=arr[i].count
1709
+        }
1710
+      }
1711
+     
1712
+      if (total < min_number) {
1713
+        min_str = total + min_unit;
1714
+      }
1715
+      if (total == 0) {
1716
+        min_str = "";
1717
+        max_str = "";
1718
+      }
1719
+      if (total >= min_number) {
1720
+        if (parseInt(total / min_number) != 0) {
1721
+          max_str = parseInt(total / min_number) + max_unit;
1722
+        }
1723
+        if (total % min_number != 0) {
1724
+          min_str = (total % min_number) + min_unit;
1725
+        }
1726
+      }
1727
+      return max_str + min_str;
1728
+    },
1729
+    getBatchNumber(warehouse_info_id){
1730
+     var arr = []
1731
+     var batch_number = 0
1732
+     for(let j=0;j<this.tabList.length;j++){
1733
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1734
+           arr.push(this.tabList[j])
1735
+        }
1736
+      }
1737
+     if(arr.length > 0){
1738
+       batch_number = arr[0].batch_number
1739
+     }
1740
+     return batch_number
1741
+    },
1742
+   getBatchNumberOne(number){
1743
+     var arr = []
1744
+     var batch_number = 0
1745
+     for(let j=0;j<this.tabList.length;j++){
1746
+        if(number == this.tabList[j].batch_number){
1747
+           arr.push(this.tabList[j])
1748
+        }
1749
+      }
1750
+     if(arr.length > 0){
1751
+       batch_number = arr[0].batch_number
1752
+     }
1753
+     return batch_number
1754
+    },
1755
+    getPrice(warehouse_info_id,max_unit,min_unit,min_number){
1756
+      var arr = []
1757
+      var price = 0
1758
+      for(let j=0;j<this.tabList.length;j++){
1759
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1760
+           arr.push(this.tabList[j])
1761
+        }
1762
+      }
1763
+      
1764
+      if(arr.length > 0){
1765
+        price = arr[0].price
1766
+      }
1767
+      return price
1768
+    },
1769
+    getPriceOne(number,max_unit,min_unit,min_number){
1770
+      var arr = []
1771
+      var price = 0
1772
+      for(let j=0;j<this.tabList.length;j++){
1773
+        if(number == this.tabList[j].batch_number){
1774
+           arr.push(this.tabList[j])
1775
+        }
1776
+      }
1777
+      
1778
+      if(arr.length > 0){
1779
+        price = arr[0].price
1780
+      }
1781
+      return price
1782
+    },
1783
+    getTotalPrice(warehouse_info_id,max_unit,min_unit,min_number){
1784
+      
1785
+      var arr = []
1786
+      var total = 0
1787
+      var max_str = 0
1788
+      var min_str = 0
1789
+      var price = 0
1790
+      var all_price = 0
1791
+      for(let j=0;j<this.tabList.length;j++){
1792
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1793
+           arr.push(this.tabList[j])
1794
+        }
1795
+      }
1796
+     
1797
+      if(arr.length > 0){
1798
+        for(let i=0;i<arr.length;i++){
1799
+           total +=arr[i].count
1800
+           price = arr[0].price
1801
+        }
1802
+      }
1803
+     
1804
+      if (total < min_number) {
1805
+        min_str = total
1806
+      }
1807
+      if (total == 0) {
1808
+        min_str = 0;
1809
+        max_str = 0;
1810
+      }
1811
+      if (total >= min_number) {
1812
+        if (parseInt(total / min_number) != 0) {
1813
+          max_str = parseInt(total / min_number)
1814
+        }
1815
+        if (total % min_number != 0) {
1816
+          min_str = (total % min_number)
1817
+        }
1818
+      }
1819
+      if(max_unit!=min_unit){
1820
+        all_price = max_str * min_number * price + min_str * price
1821
+      }
1822
+      if(max_unit == min_unit){
1823
+         all_price = max_str * price + min_str * price
1824
+      }
1825
+      if(all_price > 0){
1826
+        return all_price.toFixed(2)
1827
+      }else{
1828
+        return 0
1829
+      }
1830
+    },
1831
+   getTotalPriceOne(number,max_unit,min_unit,min_number){
1832
+   
1833
+      var arr = []
1834
+      var total = 0
1835
+      var max_str = 0
1836
+      var min_str = 0
1837
+      var price = 0
1838
+      var all_price = 0
1839
+      for(let j=0;j<this.tabList.length;j++){
1840
+        if(number == this.tabList[j].batch_number){
1841
+           arr.push(this.tabList[j])
1842
+        }
1843
+      }
1844
+      console.log("Arr233322332",arr)
1845
+      if(arr.length > 0){
1846
+        for(let i=0;i<arr.length;i++){
1847
+           total +=arr[i].count
1848
+           price = arr[0].price
1849
+        }
1850
+      }
1851
+     
1852
+      if (total < min_number) {
1853
+        min_str = total
1854
+      }
1855
+      if (total == 0) {
1856
+        min_str = 0;
1857
+        max_str = 0;
1858
+      }
1859
+      if (total >= min_number) {
1860
+        if (parseInt(total / min_number) != 0) {
1861
+          max_str = parseInt(total / min_number)
1862
+        }
1863
+        if (total % min_number != 0) {
1864
+          min_str = (total % min_number)
1865
+        }
1866
+      }
1867
+     
1868
+      if(max_unit!=min_unit){
1869
+        all_price = max_str  * min_number * price + min_str * price
1870
+      }
1871
+      if(max_unit == min_unit){
1872
+         all_price = max_str * price + min_str * price
1873
+      }
1874
+      if(all_price > 0){
1875
+        return all_price.toFixed(2)
1876
+      }else{
1877
+        return 0
1878
+      }
1879
+    },
1880
+    getAllManufacturerName(warehouse_info_id,max_unit,min_unit,min_number){
1881
+      var arr = []
1882
+      var manufacture_id = 0
1883
+      var manufacturer_name = ""
1884
+      for(let j=0;j<this.tabList.length;j++){
1885
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1886
+           arr.push(this.tabList[j])
1887
+        }
1888
+      }
1889
+      if(arr.length >0){
1890
+        manufacture_id = arr[0].manufacturer
1891
+      }
1892
+      manufacturer_name = this.getManufacturerName(manufacture_id)
1893
+      return manufacturer_name
1894
+    },
1895
+    getAllManufacturerNameOne(number,max_unit,min_unit,min_number){
1896
+      var arr = []
1897
+      var manufacture_id = 0
1898
+      var manufacturer_name = ""
1899
+      for(let j=0;j<this.tabList.length;j++){
1900
+        if(number == this.tabList[j].number){
1901
+           arr.push(this.tabList[j])
1902
+        }
1903
+      }
1904
+      if(arr.length >0){
1905
+        manufacture_id = arr[0].manufacturer
1906
+      }
1907
+      manufacturer_name = this.getManufacturerName(manufacture_id)
1908
+      return manufacturer_name
1909
+    },
1910
+    getProductDate(warehouse_info_id,max_unit,min_unit,min_number){
1911
+      var arr = []
1912
+      var product_date = 0
1913
+      
1914
+      for(let j=0;j<this.tabList.length;j++){
1915
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1916
+           arr.push(this.tabList[j])
1917
+        }
1918
+      }
1919
+      if(arr.length >0){
1920
+        product_date = arr[0].product_date
1921
+      }
1922
+      return this.getTime(product_date)
1923
+    },
1924
+   getProductDateOne(number,max_unit,min_unit,min_number){
1925
+      var arr = []
1926
+      var product_date = 0
1927
+      
1928
+      for(let j=0;j<this.tabList.length;j++){
1929
+        if(number == this.tabList[j].number){
1930
+           arr.push(this.tabList[j])
1931
+        }
1932
+      }
1933
+      if(arr.length >0){
1934
+        product_date = arr[0].product_date
1935
+      }
1936
+      return this.getTime(product_date)
1937
+    },
1938
+    getExpiryDate(warehouse_info_id,max_unit,min_unit,min_number){
1939
+      var arr = []
1940
+      var expiry_date = 0
1941
+      
1942
+      for(let j=0;j<this.tabList.length;j++){
1943
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1944
+           arr.push(this.tabList[j])
1945
+        }
1946
+      }
1947
+      if(arr.length >0){
1948
+        expiry_date = arr[0].expire_date
1949
+      }
1950
+      return this.getTime(expiry_date)
1951
+    },
1952
+    getExpiryDateOne(number,max_unit,min_unit,min_number){
1953
+      var arr = []
1954
+      var expiry_date = 0
1955
+      
1956
+      for(let j=0;j<this.tabList.length;j++){
1957
+        if(number == this.tabList[j].number){
1958
+           arr.push(this.tabList[j])
1959
+        }
1960
+      }
1961
+      if(arr.length >0){
1962
+        expiry_date = arr[0].expire_date
1963
+      }
1964
+      return this.getTime(expiry_date)
1965
+    },
1966
+    getDealer(warehouse_info_id,max_unit,min_unit,min_number){
1967
+      var arr = []
1968
+      var dealer = 0
1969
+      
1970
+      for(let j=0;j<this.tabList.length;j++){
1971
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
1972
+           arr.push(this.tabList[j])
1973
+        }
1974
+      }
1975
+      if(arr.length >0){
1976
+        dealer = arr[0].dealer
1977
+      }
1978
+      return this.getDealerName(dealer)
1979
+    },
1980
+   getDealerOne(number,max_unit,min_unit,min_number){
1981
+      var arr = []
1982
+      var dealer = 0
1983
+      
1984
+      for(let j=0;j<this.tabList.length;j++){
1985
+        if(number == this.tabList[j].number){
1986
+           arr.push(this.tabList[j])
1987
+        }
1988
+      }
1989
+      if(arr.length >0){
1990
+        dealer = arr[0].dealer
1991
+      }
1992
+      return this.getDealerName(dealer)
1993
+    },
1994
+    getNumber(warehouse_info_id,max_unit,min_unit,min_number){
1995
+      var arr = []
1996
+      var number = ""
1997
+      
1998
+      for(let j=0;j<this.tabList.length;j++){
1999
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
2000
+           arr.push(this.tabList[j])
2001
+        }
2002
+      }
2003
+      if(arr.length >0){
2004
+        number = arr[0].number
2005
+      }
2006
+      return number
2007
+    },
2008
+    getNumberOne(number,max_unit,min_unit,min_number){
2009
+      var arr = []
2010
+      var number = ""
2011
+      
2012
+      for(let j=0;j<this.tabList.length;j++){
2013
+        if(number == this.tabList[j].number){
2014
+           arr.push(this.tabList[j])
2015
+        }
2016
+      }
2017
+      if(arr.length >0){
2018
+        number = arr[0].number
2019
+      }
2020
+      return number
2021
+    },
2022
+    getRemark(warehouse_info_id,max_unit,min_unit,min_number){
2023
+      var arr = []
2024
+      var remark = ""
2025
+      for(let j=0;j<this.tabList.length;j++){
2026
+        if(warehouse_info_id == this.tabList[j].warehousing_detail_id){
2027
+           arr.push(this.tabList[j])
2028
+        }
2029
+      }
2030
+      if(arr.length >0){
2031
+        if(arr[0].DrugWarehouseInfoOne!=null){
2032
+         remark = arr[0].DrugWarehouseInfoOne.remark
2033
+        }
2034
+      }
2035
+      return remark
1558
     }
2036
     }
1559
   },
2037
   },
1560
 };
2038
 };
1625
   background-color: #d0d3da;
2103
   background-color: #d0d3da;
1626
 }
2104
 }
1627
 </style>
2105
 </style>
2106
+<style>
2107
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
2108
+  font-size: 12px;
2109
+}
2110
+
2111
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
2112
+  background: #6fb5fa;
2113
+}
2114
+
2115
+.count {
2116
+  color: #bd2c00;
2117
+}
2118
+
2119
+.el-table td,
2120
+.el-table th.is-leaf,
2121
+.el-table--border,
2122
+.el-table--group {
2123
+  border-color: #d0d3da;
2124
+}
2125
+
2126
+.el-table--border::after,
2127
+.el-table--group::after,
2128
+.el-table::before {
2129
+  background-color: #d0d3da;
2130
+}
2131
+
2132
+/* 合并表格线样式 */
2133
+.spanClass .cell {
2134
+  padding: 0 !important;
2135
+}
2136
+
2137
+.spanClass .cell tr {
2138
+  display: inline-block;
2139
+  width: 100%;
2140
+}
2141
+
2142
+.spanClass .cell tr td {
2143
+  padding: 10px 0;
2144
+  border-bottom: 1px solid #ebeef5;
2145
+  display: block;
2146
+  width: 100%;
2147
+}
2148
+.spanClass .cell tr:last-of-type td {
2149
+  border-bottom: none;
2150
+}
2151
+</style>

+ 52 - 8
src/xt_pages/stock/query/expiryDateQuery.vue ファイルの表示

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
-     <div class="app-container ">
3
+     <div class="app-container "
4
+        v-loading="loading"
5
+        element-loading-text="拼命加载中">
4
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
6
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
5
          <div>
7
          <div>
6
           <span>有效期:</span>
8
           <span>有效期:</span>
28
           <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
30
           <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
29
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
31
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
30
          </div>
32
          </div>
33
+         <div>
34
+           <el-button type="primary" size="small" @click="toPrint">打印</el-button>
35
+           <el-button type="primary" size="small" @click="exportList">导出</el-button>
36
+         </div>
31
         </div>
37
         </div>
32
            <el-table
38
            <el-table
33
             :row-style="{ color: '#303133' }"
39
             :row-style="{ color: '#303133' }"
51
             </el-table-column>
57
             </el-table-column>
52
             <el-table-column label="规格&单位" align="center">
58
             <el-table-column label="规格&单位" align="center">
53
                 <template slot-scope="scope">
59
                 <template slot-scope="scope">
54
-                   {{scope.row.GoodInfo.specification_name}}
60
+                   {{scope.row.GoodInfo.specification_name}}/{{scope.row.GoodInfo.packing_unit}}
55
                 </template>
61
                 </template>
56
             </el-table-column>
62
             </el-table-column>
57
             <el-table-column label="生产厂商" align="center">
63
             <el-table-column label="生产厂商" align="center">
101
           >
107
           >
102
             </el-pagination>
108
             </el-pagination>
103
      </div>
109
      </div>
104
-
105
-
110
+    
111
+  
106
 
112
 
107
    
113
    
108
 
114
 
164
      ],
170
      ],
165
      nowtime:0,
171
      nowtime:0,
166
      start_time:"",
172
      start_time:"",
173
+     loading:false,
167
     }
174
     }
168
   
175
   
169
   },
176
   },
175
 
182
 
176
     },
183
     },
177
     getStorehouseList(){
184
     getStorehouseList(){
185
+
178
       getStorehouseList().then(response=>{
186
       getStorehouseList().then(response=>{
179
          if(response.data.state == 1){
187
          if(response.data.state == 1){
188
+        
180
            var houseList = response.data.data.list
189
            var houseList = response.data.data.list
181
            var obj = {id:0,storehouse_name:"全部"}
190
            var obj = {id:0,storehouse_name:"全部"}
182
            this.houseList.push(obj)
191
            this.houseList.push(obj)
190
       })
199
       })
191
     },
200
     },
192
     getlist(){
201
     getlist(){
202
+        this.loading = true
193
         var params = {
203
         var params = {
194
           storehouse_id:this.storehouse_id,
204
           storehouse_id:this.storehouse_id,
195
           expiry_type:this.expiry_type,
205
           expiry_type:this.expiry_type,
200
         }
210
         }
201
       getGoodExpiryDateQuery(params).then(response=>{
211
       getGoodExpiryDateQuery(params).then(response=>{
202
          if(response.data.state == 1){
212
          if(response.data.state == 1){
213
+           this.loading = false
203
             var list = response.data.data.list
214
             var list = response.data.data.list
204
             this.tableList = list
215
             this.tableList = list
205
             var manufacturerList = response.data.data.manufacturerList
216
             var manufacturerList = response.data.data.manufacturerList
492
     return (startDate - endDate ) / (1 * 24 * 60 * 60 * 1000);
503
     return (startDate - endDate ) / (1 * 24 * 60 * 60 * 1000);
493
   },
504
   },
494
   changeExpriyList(val){
505
   changeExpriyList(val){
495
-   
506
+    this.limit = 10
507
+    this.page = 1
496
     if(val ==0){
508
     if(val ==0){
497
      this.start_time = ""
509
      this.start_time = ""
498
      this.getlist()
510
      this.getlist()
543
     var time = year + "-" + month + "-" + day
555
     var time = year + "-" + month + "-" + day
544
     return time;
556
     return time;
545
   },
557
   },
546
-  },
547
-  created(){
558
+  open(){
559
+    this.houseList = []
548
     this.getStorehouseList()
560
     this.getStorehouseList()
549
     this.getlist()
561
     this.getlist()
550
-  }
562
+  },
563
+  toPrint(){
564
+    this.$router.push({path:"/expiry/date/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&storehouse_id="+this.storehouse_id+"&expiry_type="+this.expiry_type})
565
+  },
566
+   exportList(){
567
+       for(let i=0;i<this.tableList.length;i++){
568
+          this.tableList[i].index = i+1
569
+          this.tableList[i].good_type_name = this.getGoodTypeName(this.tableList[i].GoodInfo.good_type_id)
570
+          this.tableList[i].good_name = this.tableList[i].GoodInfo.good_name
571
+          this.tableList[i].specification_name = this.tableList[i].GoodInfo.specification_name + "/" + this.tableList[i].GoodInfo.packing_unit
572
+          this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
573
+          this.tableList[i].expiry = this.getTime(this.tableList[i].expiry_date)
574
+          this.tableList[i].flush_date = this.getDaysBetween(this.getTime(this.tableList[i].expiry_date),this.getTime(this.nowtime))
575
+       }
576
+      import('@/vendor/Export2Excel').then(excel => {
577
+       
578
+        const tHeader = ['序号','耗材类型','耗材名称','规格&单位','生产厂商','进货价','库存','批号','有效期','剩余天数']
579
+        const filterVal = ['index','good_type_name', 'good_name','specification_name','manufacturer_name','price','stock_count','number','expiry','flush_date']
580
+
581
+        const data = this.formatJson(filterVal,this.tableList)
582
+
583
+        excel.export_json_to_excel({
584
+          header: tHeader,
585
+          data,
586
+          filename: '耗材有效期查询表'
587
+        })
588
+       })
589
+       },
590
+       formatJson(filterVal, jsonData) {
591
+        return jsonData.map(v => filterVal.map(j => v[j]))
592
+       },
593
+  },
594
+ 
551
 }
595
 }
552
 </script>
596
 </script>
553
 
597
 

+ 507 - 66
src/xt_pages/stock/query/goodNewQuery.vue ファイルの表示

30
           <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
30
           <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
31
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
31
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
32
          </div>
32
          </div>
33
+          <div>
34
+            <!-- <el-button size="small" type="primary" @click="toClickTwo">脚本</el-button> -->
35
+            <el-button size="small" type="primary" @click="exportList">导出</el-button>
36
+            <el-button size="small" type="primary" @click="toPrint">打印</el-button>
37
+          </div>
33
         </div>
38
         </div>
34
 
39
 
35
            <el-table
40
            <el-table
41
             :data="tableList"
46
             :data="tableList"
42
             :class="signAndWeighBoxPatients"
47
             :class="signAndWeighBoxPatients"
43
             border
48
             border
49
+           :cell-class-name="cellStyle"
44
           >
50
           >
45
             <el-table-column label="耗材类型" align="center">
51
             <el-table-column label="耗材类型" align="center">
46
               <template slot-scope="scope">
52
               <template slot-scope="scope">
54
             </el-table-column>
60
             </el-table-column>
55
             <el-table-column label="规格&单位" align="center">
61
             <el-table-column label="规格&单位" align="center">
56
                 <template slot-scope="scope">
62
                 <template slot-scope="scope">
57
-                  {{scope.row.specification_name}}
63
+                  {{scope.row.specification_name}}/{{scope.row.packing_unit}}
58
                 </template>
64
                 </template>
59
             </el-table-column>
65
             </el-table-column>
60
             <el-table-column label="生产厂商" align="center">
66
             <el-table-column label="生产厂商" align="center">
69
             </el-table-column>
75
             </el-table-column>
70
             <el-table-column label="仓库名称" align="center">
76
             <el-table-column label="仓库名称" align="center">
71
               <template slot-scope="scope">
77
               <template slot-scope="scope">
72
-                <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
78
+                <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
73
                   <td style="border-right: none; border-inline-end: none;text-align: center" >
79
                   <td style="border-right: none; border-inline-end: none;text-align: center" >
74
-                    {{getHouseName(item.storehouse_id)}}
80
+                      {{getHouseName(item.storehouse_id)}}
75
                   </td>
81
                   </td>
76
                 </tr>
82
                 </tr>
77
               </template>
83
               </template>
78
             </el-table-column>
84
             </el-table-column>
79
         
85
         
80
-            <el-table-column label="入库量" align="center">
86
+            <el-table-column label="入库量" align="center">
81
               <template slot-scope="scope">
87
               <template slot-scope="scope">
82
-                <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
88
+                <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
83
                   <td style="border-right: none; border-inline-end: none;text-align: center">
89
                   <td style="border-right: none; border-inline-end: none;text-align: center">
84
-                  {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id)}}&nbsp;
90
+                    {{getGoodIn(scope.row.xt_good_stock,item.storehouse_id)}}
85
                   </td>
91
                   </td>
86
                 </tr>
92
                 </tr>
87
                </template>
93
                </template>
88
             </el-table-column>
94
             </el-table-column>
89
           
95
           
90
-            <el-table-column label="出库量" align="center">
96
+            <el-table-column label="出库量" align="center">
91
               <template slot-scope="scope">
97
               <template slot-scope="scope">
92
-                <span v-if="org_id == 3907 || org_id == 9583">{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}</span>
93
-                <span v-if="org_id!=3907 && org_id!=9583">
94
-                  <tr style="background: none" v-for="(item,index) in scope.row.warehouse_out_info" :key="index">
98
+                <span>
99
+                  <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
95
                     <td style="border-right: none; border-inline-end: none;text-align: center">
100
                     <td style="border-right: none; border-inline-end: none;text-align: center">
96
-                      <span style="color:#0099FF" @click="toDialogClick(scope.row.id,scope.row.good_name,scope.row.specification_name)"> {{getWareOutInfoCount(scope.row.warehouse_out_info,item.storehouse_id)}}</span>&nbsp;
101
+                      <span> 
102
+                         {{getGoodAct(scope.row.xt_good_stock,item.storehouse_id)}}
103
+                      </span>
97
                     </td>
104
                     </td>
98
                   </tr>
105
                   </tr>
99
               </span>
106
               </span>
102
 
109
 
103
             <el-table-column label="退库数量" align="center">
110
             <el-table-column label="退库数量" align="center">
104
               <template slot-scope="scope">
111
               <template slot-scope="scope">
105
-                  <tr style="background: none" v-for="(item,index) in scope.row.cancel_stock_info" :key="index">
112
+                  <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
106
                     <td style="border-right: none; border-inline-end: none;text-align: center">
113
                     <td style="border-right: none; border-inline-end: none;text-align: center">
107
-                      {{getCancelCountInfo(scope.row.cancel_stock_info,item.storehouse_id)}}&nbsp; 
114
+                      {{getGoodCancel(scope.row.xt_good_stock,item.storehouse_id)}}
108
                     </td>
115
                     </td>
109
                   </tr>
116
                   </tr>
110
 
117
 
113
 
120
 
114
              <el-table-column label="实际出库" align="center">
121
              <el-table-column label="实际出库" align="center">
115
               <template slot-scope="scope">
122
               <template slot-scope="scope">
116
-                <span v-if="org_id == 3907 || org_id == 9583">{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}</span>
117
-                <span v-if="org_id!=3907 && org_id!=9583">
118
-                  <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
123
+              
124
+                <span>
125
+                  <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
119
                     <td style="border-right: none; border-inline-end: none;text-align: center">
126
                     <td style="border-right: none; border-inline-end: none;text-align: center">
120
-                    {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id) - getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}&nbsp;
127
+                    
128
+                      <span style="color:#0099FF" @click="toDialogClick(scope.row.id,scope.row.good_name,scope.row.specification_name,item.storehouse_id)">
129
+                         {{getGoodOut(scope.row.xt_good_stock,item.storehouse_id)}} 
130
+                       </span>
121
                     </td>
131
                     </td>
122
                   </tr>
132
                   </tr>
123
                </span>
133
                </span>
126
 
136
 
127
             <el-table-column label="剩余库存" align="center">
137
             <el-table-column label="剩余库存" align="center">
128
               <template slot-scope="scope">
138
               <template slot-scope="scope">
129
-                <span v-if="org_id == 3907 || org_id == 9583">
130
-                  {{
131
-                    getWareInfo(scope.row.xt_warehouse_info) -
132
-                    getAutoCount(scope.row.id) -
133
-                    getOutCount(scope.row.id) +
134
-                    getCancelCount(scope.row.id)
135
-                    }}
136
-                </span>
137
-                <span v-if="org_id!=3907 && org_id!=9583">
138
-                  <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
139
+                
140
+                <span>
141
+                  <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
139
                     <td style="border-right: none; border-inline-end: none;text-align: center">
142
                     <td style="border-right: none; border-inline-end: none;text-align: center">
140
-                    {{getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}&nbsp;&nbsp;
143
+                      {{getGoodFlush(scope.row.xt_good_stock,item.storehouse_id)}}
141
                     </td>
144
                     </td>
142
                   </tr>
145
                   </tr>
143
                 </span>
146
                 </span>
146
 
149
 
147
             <el-table-column label="总库存量" align="center">
150
             <el-table-column label="总库存量" align="center">
148
               <template slot-scope="scope">
151
               <template slot-scope="scope">
149
-                <span v-if="org_id == 3907 || org_id == 9583">
150
-                    {{getWareInfo(scope.row.xt_warehouse_info) - getAutoCount(scope.row.id) -getOutCount(scope.row.id) +getCancelCount(scope.row.id)}}
151
-                </span>
152
-                <span v-if="org_id != 3907 && org_id != 9583">
153
-                   <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) <= scope.row.stock_warn_count" style="color:red"> {{getOverFlushInfo(scope.row.xt_warehouse_info)}}</span>
154
-                   <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) > scope.row.stock_warn_count"> {{getOverFlushInfo(scope.row.xt_warehouse_info)}}</span>
152
+              
153
+                <span>
154
+                   <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) <= scope.row.stock_warn_count" style="color:red">
155
+                     {{getSumCount(scope.row.xt_good_stock,scope.row.id)}}
156
+                    </span>
157
+                   <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) > scope.row.stock_warn_count">
158
+                      {{getSumCount(scope.row.xt_good_stock,scope.row.id)}}
159
+                    </span>
155
                 </span>
160
                 </span>
156
                </template>
161
                </template>
157
             </el-table-column>
162
             </el-table-column>
237
           :class="signAndWeighBoxPatients"
242
           :class="signAndWeighBoxPatients"
238
           border
243
           border
239
           >
244
           >
245
+          <el-table-column label="序号" align="center">
246
+            <template slot-scope="scope">
247
+              {{scope.$index + 1}}
248
+            </template>
249
+          </el-table-column>
240
           <el-table-column label="单据编号" align="center">
250
           <el-table-column label="单据编号" align="center">
241
             <template slot-scope="scope">
251
             <template slot-scope="scope">
242
               {{scope.row.warehouse_out_order_number}}
252
               {{scope.row.warehouse_out_order_number}}
244
           </el-table-column>
254
           </el-table-column>
245
           <el-table-column label="操作时间" align="center">
255
           <el-table-column label="操作时间" align="center">
246
             <template slot-scope="scope">
256
             <template slot-scope="scope">
247
-              {{getTime(scope.row.ctime)}}
257
+              {{getTimeOne(scope.row.ctime)}}
248
             </template>
258
             </template>
249
           </el-table-column>
259
           </el-table-column>
250
           <el-table-column label="出库数量" align="center">
260
           <el-table-column label="出库数量" align="center">
251
               <template slot-scope="scope">
261
               <template slot-scope="scope">
252
-                {{scope.row.count}}
262
+                {{scope.row.count}}{{scope.row.GoodInfo.packing_unit}}
253
               </template>
263
               </template>
254
           </el-table-column>
264
           </el-table-column>
255
           <el-table-column label="库存数量" align="center">
265
           <el-table-column label="库存数量" align="center">
256
             <template slot-scope="scope">
266
             <template slot-scope="scope">
257
-               
267
+              {{scope.row.over_count}}
268
+              
258
             </template>
269
             </template>
259
           </el-table-column>
270
           </el-table-column>
260
           <el-table-column label="使用人" align="center">
271
           <el-table-column label="使用人" align="center">
289
   </div>
300
   </div>
290
 </template>
301
 </template>
291
 <script>
302
 <script>
292
-import { getStorehouseList,getGoodNewQuery,getGoodWarehouseOutInfoById } from "@/api/drug/drug"
303
+import { getStorehouseList,getGoodNewQuery,getGoodWarehouseOutInfoById,toSendGoodInfomation } from "@/api/drug/drug"
293
 import {
304
 import {
294
   getStockDrugCount
305
   getStockDrugCount
295
 } from "@/api/stock";
306
 } from "@/api/stock";
296
 import { uParseTime } from '@/utils/tools'
307
 import { uParseTime } from '@/utils/tools'
308
+const moment = require('moment')
297
 export default {
309
 export default {
298
 
310
 
299
   data(){
311
   data(){
325
      cancelCountList:[],
337
      cancelCountList:[],
326
      org_id:this.$store.getters.xt_user.org_id,
338
      org_id:this.$store.getters.xt_user.org_id,
327
      dialogVisible:false,
339
      dialogVisible:false,
328
-     start_first_time:"",
329
-     end_first_time:"",
340
+     start_first_time:moment().startOf('month').format("YYYY-MM-DD"),
341
+     end_first_time:moment().endOf('month').format("YYYY-MM-DD"),
330
      tableData:[],
342
      tableData:[],
331
      good_id:0,
343
      good_id:0,
332
      patientList:[],
344
      patientList:[],
333
      good_name:"",
345
      good_name:"",
334
      specification_name:"",
346
      specification_name:"",
335
      loading:false,
347
      loading:false,
348
+     warehouseInfoByList:[],
349
+     cancelStockInfoByList:[],
350
+     warehouseOutByList:[],
351
+     flushList:[],
352
+     type_name:0,
353
+     storehouseId:0
336
     }
354
     }
337
   
355
   
338
   },
356
   },
339
   methods:{
357
   methods:{
340
     changeStorehouseName(){
358
     changeStorehouseName(){
341
-
359
+      this.getlist()
342
     },
360
     },
343
     changeGoodName(){
361
     changeGoodName(){
344
       this.getlist()
362
       this.getlist()
401
         }
419
         }
402
       getGoodNewQuery(params).then(response=>{
420
       getGoodNewQuery(params).then(response=>{
403
          if(response.data.state == 1){
421
          if(response.data.state == 1){
404
-            var list = response.data.data.list
422
+            // var list = response.data.data.list
423
+            var list =  response.data.data.stockList
405
             this.loading = false
424
             this.loading = false
406
-            if(list.length > 0){
407
-              var arr = []
408
-              for(let i=0;i<list.length;i++){
409
-                if(list[i].xt_warehouse_info.length > 0){
410
-                  arr.push(list[i])
411
-                }
412
-              }
413
-              this.tableList = arr
414
-            }
425
+            this.tableList = list
415
             this.total = response.data.data.total
426
             this.total = response.data.data.total
416
            
427
            
417
          }
428
          }
436
     },
447
     },
437
     handleSizeChangeOne(val) {
448
     handleSizeChangeOne(val) {
438
       this.limitone = val;
449
       this.limitone = val;
439
-      this.toDialogClick(this.good_id,this.good_name,this.specification_name)
450
+      this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
440
     },
451
     },
441
     handleCurrentChangeOne(val) {
452
     handleCurrentChangeOne(val) {
442
       this.pageone = val;
453
       this.pageone = val;
443
-      this.toDialogClick(this.good_id,this.good_name,this.specification_name)
454
+      this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
444
     },
455
     },
445
    seach(){
456
    seach(){
446
     this.getlist()
457
     this.getlist()
465
    },
476
    },
466
    getWareInfoCount(val,storehouse_id){
477
    getWareInfoCount(val,storehouse_id){
467
      var count = 0
478
      var count = 0
468
-     if(val.length > 0){
479
+     if(val!=null&&val.length > 0){
469
        for(let i=0;i<val.length;i++){
480
        for(let i=0;i<val.length;i++){
470
          if(val[i].storehouse_id == storehouse_id){
481
          if(val[i].storehouse_id == storehouse_id){
471
              count +=val[i].warehousing_count
482
              count +=val[i].warehousing_count
497
     },
508
     },
498
     getWareInfoCountOne(val,storehouse_id){
509
     getWareInfoCountOne(val,storehouse_id){
499
      var count = 0
510
      var count = 0
500
-     if(val.length > 0){
511
+     if(val!=null&&val.length > 0){
501
        for(let i=0;i<val.length;i++){
512
        for(let i=0;i<val.length;i++){
502
          if(val[i].storehouse_id == storehouse_id){
513
          if(val[i].storehouse_id == storehouse_id){
503
              count +=val[i].stock_count
514
              count +=val[i].stock_count
539
    },
550
    },
540
    getCancelCountInfo(cancel_stock_info,storehouse_id){
551
    getCancelCountInfo(cancel_stock_info,storehouse_id){
541
      var count = 0 
552
      var count = 0 
542
-     if(cancel_stock_info.length >0){
553
+     if(cancel_stock_info!=null && cancel_stock_info.length >0){
543
         for(let i=0;i<cancel_stock_info.length;i++){
554
         for(let i=0;i<cancel_stock_info.length;i++){
544
-          if(storehouse_id ==  cancel_stock_info[i].storehouse_id){
555
+          if(cancel_stock_info[i].storehouse_id == storehouse_id){
545
               count += cancel_stock_info[i].count
556
               count += cancel_stock_info[i].count
546
           }
557
           }
547
         }
558
         }
550
    },
561
    },
551
    getWareOutInfoCount(warehouse_out_info,storehouse_id){
562
    getWareOutInfoCount(warehouse_out_info,storehouse_id){
552
      var count = 0
563
      var count = 0
553
-     if(warehouse_out_info.length > 0){
564
+     if(warehouse_out_info!=null && warehouse_out_info.length > 0){
554
        for(let i=0;i<warehouse_out_info.length;i++){
565
        for(let i=0;i<warehouse_out_info.length;i++){
555
          if(storehouse_id == warehouse_out_info[i].storehouse_id){
566
          if(storehouse_id == warehouse_out_info[i].storehouse_id){
556
             count +=warehouse_out_info[i].count
567
             count +=warehouse_out_info[i].count
639
    },
650
    },
640
    getOverFlushInfo(arr){
651
    getOverFlushInfo(arr){
641
      var total = 0
652
      var total = 0
642
-     if(arr.length >0){
653
+     if(arr!=null&&arr.length >0){
643
       for(let i=0;i<arr.length;i++){
654
       for(let i=0;i<arr.length;i++){
644
         total += arr[i].stock_count
655
         total += arr[i].stock_count
645
       }
656
       }
646
      }
657
      }
647
      return total
658
      return total
648
    },
659
    },
649
-   toDialogClick(id,good_name,specification_name){
660
+   toDialogClick(id,good_name,specification_name,storehouse_id){
661
+   
650
     this.good_id = id
662
     this.good_id = id
651
     this.good_name = good_name
663
     this.good_name = good_name
652
     this.specification_name = specification_name
664
     this.specification_name = specification_name
665
+    this.storehouseId = storehouse_id
653
      var params = {
666
      var params = {
654
        good_id:id,
667
        good_id:id,
655
        limit:this.limitone,
668
        limit:this.limitone,
656
        page:this.pageone,
669
        page:this.pageone,
657
        start_first_time:this.start_first_time,
670
        start_first_time:this.start_first_time,
658
        end_first_time:this.end_first_time,
671
        end_first_time:this.end_first_time,
672
+       storehouse_id:storehouse_id,
659
      }
673
      }
660
      getGoodWarehouseOutInfoById(params).then(response=>{
674
      getGoodWarehouseOutInfoById(params).then(response=>{
661
        if(response.data.state == 1){
675
        if(response.data.state == 1){
676
+         this.dialogVisible = true
662
          var list = response.data.data.list
677
          var list = response.data.data.list
663
-         console.log("list23233233232w",list)
664
          this.tableData = list
678
          this.tableData = list
665
          this.totalone = response.data.data.total
679
          this.totalone = response.data.data.total
666
-         this.dialogVisible = true
680
+      
681
+        //  this.flushList =  response.data.data.flushList
682
+        
667
        }
683
        }
668
      })
684
      })
669
    
685
    
670
    },
686
    },
671
    startFirstTimeChange(){
687
    startFirstTimeChange(){
672
-    
688
+    this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
673
    },
689
    },
674
    endEndTimeChange(){
690
    endEndTimeChange(){
675
-
691
+    this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
676
    },
692
    },
677
   getTime(val) {
693
   getTime(val) {
678
     if(val < 0){
694
     if(val < 0){
684
     return uParseTime(val, '{y}-{m}-{d}')
700
     return uParseTime(val, '{y}-{m}-{d}')
685
    }
701
    }
686
    },
702
    },
703
+   getTimeOne(val) {
704
+    if(val < 0){
705
+      return ""
706
+    }
707
+   if(val == ""){
708
+     return ""
709
+   }else {
710
+    return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
711
+   }
712
+   },
687
   getName(id){
713
   getName(id){
688
     var name = ""
714
     var name = ""
689
     for(let i=0;i<this.patientList.length;i++){
715
     for(let i=0;i<this.patientList.length;i++){
692
       }
718
       }
693
     }
719
     }
694
     return name
720
     return name
695
-  }
721
+  },
722
+  getCount(ctime){
723
+   var arr = []
724
+   var arrOut = []
725
+   var total_in = 0
726
+   var total_out = 0
727
+   for(let i=0;i<this.warehouseInfoByList.length;i++){
728
+      if(ctime >= this.warehouseInfoByList[i].ctime){
729
+         arr.push(this.warehouseInfoByList[i])
730
+      }
731
+   }
732
+   if(arr.length > 0){
733
+    for(let i=0;i<arr.length;i++){
734
+      total_in +=arr[i].warehousing_count
735
+    }
736
+   }
737
+   for(let i=0;i<this.warehouseOutByList.length;i++){
738
+     if(ctime <=this.warehouseOutByList[i].ctime){
739
+       arrOut.push(this.warehouseOutByList[i])
740
+     }
741
+   }
742
+   if(arrOut.length >0){
743
+    for(let i=0;i<arrOut.length;i++){
744
+      total_out +=arrOut[i].count
745
+    }
746
+   }
747
+   console.log("total23323223",total_in)
748
+   return total_in - total_out
749
+  },
750
+  getStockCountOne(warehouse_out_id,good_id,patient_id,sys_record_time){
751
+    var flush_count = 0
752
+    if(this.flushList!=null && this.flushList.length > 0){
753
+     for(let i=0;i<this.flushList.length;i++){
754
+      if(warehouse_out_id == this.flushList[i].warehouse_out_id && good_id == this.flushList[i].good_id && patient_id == this.flushList[i].patient_id && sys_record_time == this.flushList[i].system_time){
755
+         flush_count = this.flushList[i].flush_count
756
+      }
757
+     }
758
+    }
759
+    return flush_count
760
+  },
761
+   // 合并单元格样式
762
+  cellStyle({ row, column, rowIndex, columnIndex }) {
763
+    let arr = [5,6, 7, 8, 9,10,11];
764
+    if (arr.indexOf(columnIndex) > -1) {
765
+      return "spanClass";
766
+    }
767
+   },
768
+   exportList(){
769
+      import('@/vendor/Export2Excel').then(excel => {
770
+         console.log("table")
771
+         if(this.tableList!=null && this.tableList.length > 0){
772
+          for(let i=0;i<this.tableList.length;i++){
773
+            this.tableList[i].index = i+1
774
+            this.tableList[i].type_name =  this.getGoodTypeName(this.tableList[i].good_type_id)
775
+            this.tableList[i].spec = this.tableList[i].specification_name +"/"+ this.tableList[i].packing_unit
776
+            this.tableList[i].manufacturer = this.getManufacturName(this.tableList[i].manufacturer)
777
+            this.tableList[i].stock_in_count = this.GetExportStockInCount(this.tableList[i].xt_good_info,this.tableList[i].id)
778
+            this.tableList[i].stock_out_count =this.getExportStockOutCount(this.tableList[i].xt_good_info,this.tableList[i].id) 
779
+            this.tableList[i].stock_cancel_count = this.getExportCancelStockInfo(this.tableList[i].xt_good_info,this.tableList[i].id)
780
+            this.tableList[i].act_out_count  = this.getExportActStockOutCount(this.tableList[i].xt_good_info,this.tableList[i].id) 
781
+            this.tableList[i].over_count = this.getExportOverCount(this.tableList[i].xt_good_info,this.tableList[i].id) 
782
+            this.tableList[i].sum_count =  this.getOverCount(this.tableList[i].xt_warehouse_info) 
783
+
784
+          }
785
+         }
786
+         
787
+         const tHeader = ['序号','耗材类型', '耗材名称', '规格&单位','生产厂商','国家编码','入库数量','出库数量','退库数量','实际出库','剩余库存','总库存']
788
+         const filterVal = ['index','type_name', 'good_name', 'spec','manufacturer','social_security_directory_code','stock_in_count','stock_out_count','stock_cancel_count','act_out_count','over_count','sum_count']
789
+        
790
+         const data = this.formatJson(filterVal, this.tableList)
791
+         excel.export_json_to_excel({
792
+           header: tHeader,
793
+           data,
794
+           filename: '库存查询'
795
+         })
796
+          this.downloadLoading = false
797
+        })
798
+      },
799
+      formatJson(filterVal, jsonData) {
800
+        return jsonData.map(v => filterVal.map(j => v[j]));
801
+      },
802
+      toPrint(){
803
+        this.$router.push("/good/new/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keyword+"&storehouse_id="+this.storehouse_id+"&page="+this.page+"&limit="+this.limit+"&good_type="+this.good_type)
804
+      },
805
+      getCancelSotckInfo(arr){
806
+        var cancle_toal = 0
807
+        if(arr.length >0){
808
+         for(let z=0;z<arr.length;z++){
809
+           cancle_toal += arr[z].count
810
+         }
811
+        }
812
+        return cancle_toal
813
+      },
814
+     getStockOutFlow(arr,storehouse_id){
815
+       var count = 0
816
+       if(arr!=null && arr.length > 0){
817
+         for(let i=0;i<arr.length;i++){
818
+          if(arr[i].storehouse_id == storehouse_id){
819
+            count +=arr[i].count
820
+          }
821
+         
822
+         }
823
+       }
824
+       if(count > 0){
825
+          return count
826
+       }else{
827
+         return  0
828
+       }
829
+     },
830
+     GetStockInCount(val){
831
+       var count = 0
832
+       if(val!=null && val.length >0){
833
+        for(let i=0;i<val.length;i++){
834
+          count +=val[i].warehousing_count
835
+        }
836
+       }
837
+       if(count > 0){
838
+         return count
839
+       }else{
840
+         return  0
841
+       }
842
+
843
+     },
844
+     getStockOutCount(val){
845
+       var count = 0
846
+       if(val!=null && val.length >0){
847
+        for(let i=0;i<val.length;i++){
848
+          count +=val[i].count
849
+        }
850
+       }
851
+       if(count > 0){
852
+         return count
853
+       }else{
854
+         return  0
855
+       }
856
+     },
857
+     getCancelStockInfo(val){
858
+       var count = 0
859
+       if(val!=null && val.length >0){
860
+        for(let i=0;i<val.length;i++){
861
+          count +=val[i].count
862
+        }
863
+       }
864
+       if(count > 0){
865
+         return count
866
+       }else{
867
+         return  0
868
+       }
869
+     },
870
+     getOverCount(val){
871
+       var count = 0
872
+       if(val!=null && val.length >0){
873
+        for(let i=0;i<val.length;i++){
874
+          count +=val[i].stock_count
875
+        }
876
+       }
877
+       if(count > 0){
878
+         return count
879
+       }else{
880
+         return  0
881
+       }
882
+     },
883
+
884
+    //  修改后接口
885
+    getGoodIn(val,storehouse_id){
886
+      var sum_count = 0
887
+      if(val!=null && val!=undefined){
888
+        for(let i=0;i<val.length;i++){
889
+          if(storehouse_id == val[i].storehouse_id){
890
+             sum_count = val[i].stock_in_count
891
+          }
892
+        }
893
+      }
894
+      if(sum_count > 0){
895
+         return sum_count
896
+      }else{
897
+        return  0
898
+      }
899
+    },
900
+    getGoodOut(val,storehouse_id){
901
+      var sum_count = 0
902
+      if(val!=null && val!=undefined){
903
+        for(let i=0;i<val.length;i++){
904
+          if(storehouse_id == val[i].storehouse_id){
905
+             sum_count = val[i].stock_out_count
906
+          }
907
+        }
908
+      }
909
+      if(sum_count > 0){
910
+         return sum_count
911
+      }else{
912
+        return  0
913
+      }
914
+    },
915
+    getGoodCancel(val,storehouse_id){
916
+      var sum_count = 0
917
+      if(val!=null && val!=undefined){
918
+        for(let i=0;i<val.length;i++){
919
+          if(storehouse_id == val[i].storehouse_id){
920
+             sum_count = val[i].stock_cancel_count
921
+          }
922
+        }
923
+      }
924
+      if(sum_count > 0){
925
+         return sum_count
926
+      }else{
927
+        return  0
928
+      }
929
+    },
930
+    getGoodAct(val,storehouse_id){
931
+      var sum_count = 0
932
+      if(val!=null && val!=undefined){
933
+        for(let i=0;i<val.length;i++){
934
+          if(storehouse_id == val[i].storehouse_id){
935
+             sum_count = val[i].stock_act_out_count
936
+          }
937
+        }
938
+      }
939
+      if(sum_count > 0){
940
+         return sum_count
941
+      }else{
942
+        return  0
943
+      }
944
+    },
945
+    getGoodFlush(val,storehouse_id){
946
+      var sum_count = 0
947
+      if(val!=null && val!=undefined){
948
+        for(let i=0;i<val.length;i++){
949
+          if(storehouse_id == val[i].storehouse_id){
950
+             sum_count = val[i].flush_count
951
+          }
952
+        }
953
+      }
954
+      if(sum_count > 0){
955
+         return sum_count
956
+      }else{
957
+        return  0
958
+      }
959
+    },
960
+    getSumCount(val,good_id){
961
+      var sum_count = 0
962
+      var arr = []
963
+      if(val!=null && val!=undefined){
964
+        for(let i=0;i<val.length;i++){
965
+          if(good_id == val[i].good_id){
966
+            arr.push(val[i])
967
+          }
968
+        }
969
+      }
970
+      for(let i=0;i<arr.length;i++){
971
+        sum_count +=arr[i].flush_count
972
+      }
973
+      if(sum_count > 0){
974
+         return sum_count
975
+      }else{
976
+        return  0
977
+      }
978
+    },
979
+    toClickTwo(){
980
+      toSendGoodInfomation().then(response=>{
981
+        if(response.data.state == 1){
982
+          var msg = response.data.data.msg
983
+          console.log("脚本保存成功!")
984
+        }
985
+      })
986
+    },
987
+
988
+    //导出
989
+    GetExportStockInCount(val,id){
990
+      var sum_count = 0
991
+      var arr = []
992
+      if(val!=null && val.length > 0){
993
+        for(let i=0;i<val.length;i++){
994
+          if(val[i].good_id == id){
995
+              arr.push(val[i])
996
+          }
997
+        }
998
+      }
999
+      for(let i=0;i<arr.length;i++){
1000
+        sum_count +=arr[i].stock_in_count
1001
+      }
1002
+      if(sum_count > 0){
1003
+        return sum_count
1004
+      }else{
1005
+        return 0
1006
+      }
1007
+    },
1008
+    getExportStockOutCount(val,id){
1009
+      var sum_count = 0
1010
+      var arr = []
1011
+      if(val!=null && val.length > 0){
1012
+        for(let i=0;i<val.length;i++){
1013
+          if(val[i].good_id == id){
1014
+              arr.push(val[i])
1015
+          }
1016
+        }
1017
+      }
1018
+      for(let i=0;i<arr.length;i++){
1019
+        sum_count +=arr[i].stock_out_count
1020
+      }
1021
+      if(sum_count > 0){
1022
+        return sum_count
1023
+      }else{
1024
+        return 0
1025
+      }
1026
+    },
1027
+    getExportCancelStockInfo(val,id){
1028
+      var sum_count = 0
1029
+      var arr = []
1030
+      if(val!=null && val.length > 0){
1031
+        for(let i=0;i<val.length;i++){
1032
+          if(val[i].good_id == id){
1033
+              arr.push(val[i])
1034
+          }
1035
+        }
1036
+      }
1037
+      for(let i=0;i<arr.length;i++){
1038
+        sum_count +=arr[i].stock_cancel_count
1039
+      }
1040
+      if(sum_count > 0){
1041
+        return sum_count
1042
+      }else{
1043
+        return 0
1044
+      }
1045
+    },
1046
+    getExportActStockOutCount(val,id){
1047
+      var sum_count = 0
1048
+      var arr = []
1049
+      if(val!=null && val.length > 0){
1050
+        for(let i=0;i<val.length;i++){
1051
+          if(val[i].good_id == id){
1052
+              arr.push(val[i])
1053
+          }
1054
+        }
1055
+      }
1056
+      for(let i=0;i<arr.length;i++){
1057
+        sum_count +=arr[i].stock_act_out_count
1058
+      }
1059
+      if(sum_count > 0){
1060
+        return sum_count
1061
+      }else{
1062
+        return 0
1063
+      }
1064
+    },
1065
+    getExportOverCount(val,id){
1066
+     var sum_count = 0
1067
+      var arr = []
1068
+      if(val!=null && val.length > 0){
1069
+        for(let i=0;i<val.length;i++){
1070
+          if(val[i].good_id == id){
1071
+              arr.push(val[i])
1072
+          }
1073
+        }
1074
+      }
1075
+      for(let i=0;i<arr.length;i++){
1076
+        sum_count +=arr[i].flush_count
1077
+      }
1078
+      if(sum_count > 0){
1079
+        return sum_count
1080
+      }else{
1081
+        return 0
1082
+      }
1083
+    }
1084
+
696
   },
1085
   },
697
   created(){
1086
   created(){
1087
+    this.houseList = []
698
     this.getStorehouseList()
1088
     this.getStorehouseList()
699
     this.getlist()
1089
     this.getlist()
700
-    this.getStockDrugCount()
1090
+    
1091
+    var org_id = this.$store.getters.xt_user.org_id
1092
+    if(org_id == 9583 || org_id == 3907){
1093
+     this.getStockDrugCount()
1094
+    }
1095
+ 
701
   }
1096
   }
702
 }
1097
 }
703
 </script>
1098
 </script>
704
 
1099
 
1100
+<style>
1101
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
1102
+  font-size: 12px;
1103
+}
1104
+
1105
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
1106
+  background: #6fb5fa;
1107
+}
1108
+
1109
+.count {
1110
+  color: #bd2c00;
1111
+}
1112
+
1113
+.el-table td,
1114
+.el-table th.is-leaf,
1115
+.el-table--border,
1116
+.el-table--group {
1117
+  border-color: #d0d3da;
1118
+}
1119
+
1120
+.el-table--border::after,
1121
+.el-table--group::after,
1122
+.el-table::before {
1123
+  background-color: #d0d3da;
1124
+}
1125
+
1126
+/* 合并表格线样式 */
1127
+.spanClass .cell {
1128
+  padding: 0 !important;
1129
+}
1130
+
1131
+.spanClass .cell tr {
1132
+  display: inline-block;
1133
+  width: 100%;
1134
+}
1135
+
1136
+.spanClass .cell tr td {
1137
+  padding: 10px 0;
1138
+  border-bottom: 1px solid #ebeef5;
1139
+  display: block;
1140
+  width: 100%;
1141
+}
1142
+.spanClass .cell tr:last-of-type td {
1143
+  border-bottom: none;
1144
+}
1145
+</style>

+ 155 - 17
src/xt_pages/stock/query/patientQuery.vue ファイルの表示

1
 <template>
1
 <template>
2
     <div class="main-contain">
2
     <div class="main-contain">
3
-        <div class="app-container">
3
+        <div class="app-container"
4
+         v-loading="loading"
5
+        element-loading-text="拼命加载中">
4
          <el-container>
6
          <el-container>
5
                <div style="width:27%">
7
                <div style="width:27%">
6
                 <el-row>
8
                 <el-row>
77
                </div>
79
                </div>
78
 
80
 
79
                  <el-main>
81
                  <el-main>
82
+                 
83
+                
80
                   <div class="main newMain">
84
                   <div class="main newMain">
81
                       
85
                       
82
                         
86
                         
83
                   <el-tabs>
87
                   <el-tabs>
84
-
88
+                  
85
                    <el-tab-pane label="患者使用列表">
89
                    <el-tab-pane label="患者使用列表">
86
-                   
90
+                    <div style="float:right;margin-bottom:10px">
91
+                      <el-button type="primary" size="small" @click="toPrint">打印</el-button>
92
+                      <el-button type="primary" size="small" @click="exportList">导出</el-button>
93
+                    </div>
87
                      <el-table
94
                      <el-table
88
                           :data="tableList"
95
                           :data="tableList"
89
                           highlight-current-row
96
                           highlight-current-row
101
                       align="center"
108
                       align="center"
102
                       >
109
                       >
103
                       <template slot-scope="scope">
110
                       <template slot-scope="scope">
104
-                        {{scope.row.GoodInfo.good_name}}
111
+                        {{scope.row.good_name}}
105
                       </template>
112
                       </template>
106
                     </el-table-column>
113
                     </el-table-column>
107
                      <el-table-column
114
                      <el-table-column
109
                       label="生产厂家"
116
                       label="生产厂家"
110
                       align="center">
117
                       align="center">
111
                       <template slot-scope="scope">
118
                       <template slot-scope="scope">
112
-                        {{getManufacturName(scope.row.manufacturer)}}
119
+                       {{scope.row.manufacturer}}
113
                       </template>
120
                       </template>
114
                      </el-table-column>
121
                      </el-table-column>
115
                       <el-table-column
122
                       <el-table-column
117
                       label="规格&单位"
124
                       label="规格&单位"
118
                       align="center">
125
                       align="center">
119
                       <template slot-scope="scope">
126
                       <template slot-scope="scope">
120
-                        {{scope.row.GoodInfo.specification_name}}
127
+                        {{scope.row.specification_name}}/{{scope.row.packing_unit}}
121
                       </template>
128
                       </template>
122
                      </el-table-column>
129
                      </el-table-column>
123
                       <el-table-column
130
                       <el-table-column
125
                       label="数量"
132
                       label="数量"
126
                       align="center">
133
                       align="center">
127
                       <template slot-scope="scope">
134
                       <template slot-scope="scope">
128
-                        {{scope.row.count}}
135
+                        {{getCount(scope.row.child)}}{{scope.row.packing_unit}}
129
                       </template>
136
                       </template>
130
                      </el-table-column>
137
                      </el-table-column>
131
 
138
 
132
                      </el-table>
139
                      </el-table>
133
                       <el-pagination
140
                       <el-pagination
134
                         @size-change="handleSizeChange"
141
                         @size-change="handleSizeChange"
135
-                        @current-change="handleCurrentChange"
142
+                        @current-change="handleCurrentChangeOne"
136
                         :page-sizes="[10, 50, 100,200,500,1000]"
143
                         :page-sizes="[10, 50, 100,200,500,1000]"
137
                         :page-size="10"
144
                         :page-size="10"
138
                         background
145
                         background
175
       limit:10,
182
       limit:10,
176
       page:1,
183
       page:1,
177
       total:0,
184
       total:0,
185
+      loading:false,
178
     }
186
     }
179
   },
187
   },
180
   methods:{
188
   methods:{
182
       this.limit = val;
190
       this.limit = val;
183
       this.getWarehouseOutDetailByPatientId()
191
       this.getWarehouseOutDetailByPatientId()
184
     },
192
     },
185
-    handleCurrentChange(val) {
193
+    handleCurrentChangeOne(val) {
186
       this.page = val;
194
       this.page = val;
187
       this.getWarehouseOutDetailByPatientId()
195
       this.getWarehouseOutDetailByPatientId()
188
     },
196
     },
193
       this.handleCurrentChange(this.patient)
201
       this.handleCurrentChange(this.patient)
194
     },
202
     },
195
     getlist(){
203
     getlist(){
204
+       this.loading = true
196
         var params = {
205
         var params = {
197
           keyword:this.keyword,
206
           keyword:this.keyword,
198
         }
207
         }
199
       getGoodPatientList(params).then(response=>{
208
       getGoodPatientList(params).then(response=>{
200
         if(response.data.state == 1){
209
         if(response.data.state == 1){
210
+          this.loading = false
201
           var list = response.data.data.list
211
           var list = response.data.data.list
212
+          
202
           this.patientList = list
213
           this.patientList = list
203
           this.$refs.singleTable.setCurrentRow(this.patientList[0]);
214
           this.$refs.singleTable.setCurrentRow(this.patientList[0]);
204
           this.handleCurrentChange(this.patientList[0])
215
           this.handleCurrentChange(this.patientList[0])
209
      this.getlist()
220
      this.getlist()
210
    },
221
    },
211
    handleCurrentChange(val){
222
    handleCurrentChange(val){
223
+    
212
        this.patient = val
224
        this.patient = val
213
        var params = {
225
        var params = {
214
          patient_id:val.id,
226
          patient_id:val.id,
217
          limit:this.limit,
229
          limit:this.limit,
218
          page:this.page
230
          page:this.page
219
        }
231
        }
232
+      this.tableList = []
220
      getWarehouseOutDetailByPatientId(params).then(response=>{
233
      getWarehouseOutDetailByPatientId(params).then(response=>{
221
         if(response.data.state == 1){
234
         if(response.data.state == 1){
222
           var list = response.data.data.list
235
           var list = response.data.data.list
223
-          this.total = response.data.data.total
236
+          var outlist = response.data.data.outlist
224
           this.manufacturerList = response.data.data.manufacturerList
237
           this.manufacturerList = response.data.data.manufacturerList
225
-          this.tableList = list
238
+          console.log("list",list)
239
+          let dataInfo = {}
240
+          if(list!=null && list.length > 0){
241
+            list.forEach((item, index) => {
242
+            let { good_id } = item
243
+            if (!dataInfo[good_id]) {
244
+              dataInfo[good_id] = {
245
+                good_id,
246
+                child: [],
247
+                specification_name:item.GoodInfo.specification_name,
248
+                good_name:item.GoodInfo.good_name,
249
+                packing_unit:item.GoodInfo.packing_unit,
250
+                manufacturer:this.getManufacturName(item.manufacturer),
251
+              }
252
+            }
253
+          })
254
+          let arr = Object.values(dataInfo)
255
+          console.log("ar232323232",arr)
256
+          arr.forEach((item,index)=>{
257
+            for(let i=0;i<outlist.length;i++){
258
+               if(item.good_id == outlist[i].good_id){
259
+                 item.child.push(outlist[i])
260
+               }
261
+            }
262
+          }) 
263
+
264
+          this.tableList = arr
265
+         }
266
+          this.total = response.data.data.total
267
+         
268
+         
226
         }
269
         }
227
      })
270
      })
228
    },
271
    },
229
    getWarehouseOutDetailByPatientId(){
272
    getWarehouseOutDetailByPatientId(){
230
      var params = {
273
      var params = {
231
-        patient_id:this.patient,
274
+        patient_id:this.patient.id,
232
         start_time:this.start_time,
275
         start_time:this.start_time,
233
         end_time:this.end_time,
276
         end_time:this.end_time,
277
+        limit:this.limit,
278
+        page:this.page
234
       }
279
       }
235
     getWarehouseOutDetailByPatientId().then(response=>{
280
     getWarehouseOutDetailByPatientId().then(response=>{
236
        if(response.data.state == 1){
281
        if(response.data.state == 1){
237
-        var list = response.data.data.list
282
+         var list = response.data.data.list
283
+         var outlist = response.data.data.outlist
284
+         this.manufacturerList = response.data.data.manufacturerList
285
+            let dataInfo = {}
286
+          if(list!=null && list.length > 0){
287
+            list.forEach((item, index) => {
288
+            let { good_id } = item
289
+            if (!dataInfo[good_id]) {
290
+              dataInfo[good_id] = {
291
+                good_id,
292
+                child: [],
293
+                specification_name:item.GoodInfo.specification_name,
294
+                good_name:item.GoodInfo.good_name,
295
+                packing_unit:item.GoodInfo.packing_unit,
296
+                manufacturer:this.getManufacturName(item.manufacturer),
297
+              }
298
+            }
299
+          })
300
+          let arr = Object.values(dataInfo)
301
+          console.log("ar232323232",arr)
302
+          arr.forEach((item,index)=>{
303
+            for(let i=0;i<outlist.length;i++){
304
+               if(item.good_id == outlist[i].good_id){
305
+                 item.child.push(outlist[i])
306
+               }
307
+            }
308
+          }) 
309
+          this.tableList = arr
310
+         }
311
+       
238
         this.total = response.data.data.total
312
         this.total = response.data.data.total
239
-        this.manufacturerList = response.data.data.manufacturerList
240
-        this.tableList = list
313
+        
314
+       
241
        }
315
        }
242
     })
316
     })
243
    },
317
    },
249
         } 
323
         } 
250
      }
324
      }
251
      return manufacturer_name
325
      return manufacturer_name
252
-   }
326
+   },
327
+   open(){
328
+    this.getlist()
329
+   },
330
+   toPrint(){
331
+    var patient_name = ""
332
+
333
+    for(let i=0;i<this.patientList.length;i++){
334
+       if(this.patient.id == this.patientList[i].id){
335
+        patient_name = this.patientList[i].name
336
+       }
337
+    }
338
+
339
+    this.$router.push({path:"/patient/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&patient_id="+this.patient.id+"&patient_name="+patient_name})
340
+   },
341
+   exportList(){
342
+      for(let i=0;i<this.tableList.length;i++){
343
+        this.tableList[i].index = i+1
344
+        this.tableList[i].count_name = this.getCount(this.tableList[i].child) + this.tableList[i].packing_unit
345
+        this.tableList[i].specification_name = this.tableList[i].specification_name +"/"+ this.tableList[i].packing_unit
346
+        this.tableList[i].query_date = this.start_time + "~" + this.end_time
347
+        this.tableList[i].patient_name = ""
348
+        if(this.tableList[i].index == 1){
349
+          this.tableList[i].patient_name = this.getPatientName(this.patient.id)
350
+        }
351
+      }
352
+      import('@/vendor/Export2Excel').then(excel => {
353
+       
354
+        const tHeader = ['序号','患者姓名','查询日期','耗材名称','生产厂家','规格&单位','数量']
355
+        const filterVal = ['index','patient_name','query_date','good_name', 'manufacturer','specification_name','count_name']
356
+
357
+        const data = this.formatJson(filterVal,this.tableList)
358
+
359
+        excel.export_json_to_excel({
360
+          header: tHeader,
361
+          data,
362
+          filename: '患者耗材使用查询表'
363
+        })
364
+       })
365
+       },
366
+       formatJson(filterVal, jsonData) {
367
+        return jsonData.map(v => filterVal.map(j => v[j]))
368
+       },
369
+       getPatientName(id){
370
+         var patient_name = ""
371
+        for(let i=0;i<this.patientList.length;i++){
372
+          if(id == this.patientList[i].id){
373
+            patient_name = this.patientList[i].name
374
+          }
375
+        }
376
+        return patient_name
377
+       },
378
+       getCount(val){
379
+         var total_count = 0
380
+         if(val!=null && val.length > 0){
381
+           for(let i=0;i<val.length;i++){
382
+             total_count +=val[i].count
383
+           }
384
+         }
385
+         if(total_count > 0){
386
+           return total_count
387
+         }else{
388
+          return  0
389
+         }
390
+       }
253
   },
391
   },
254
   created(){
392
   created(){
255
     var nowDate = new Date();
393
     var nowDate = new Date();
272
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
410
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
273
       "-" +
411
       "-" +
274
       (nowDay < 10 ? "0" + nowDay : nowDay);
412
       (nowDay < 10 ? "0" + nowDay : nowDay);
275
-     this.getlist()
413
+     
276
   },
414
   },
277
   
415
   
278
 }
416
 }

+ 477 - 44
src/xt_pages/stock/query/purchaseStockQuery.vue ファイルの表示

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
-     <div class="app-container ">
3
+     <div class="app-container "
4
+       v-loading="loading"
5
+        element-loading-text="拼命加载中">
4
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
6
         <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
5
          <div>
7
          <div>
6
           <span>操作时间:</span>
8
           <span>操作时间:</span>
45
           <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
47
           <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
46
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
48
           <el-button  type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
47
          </div>
49
          </div>
50
+         <div>
51
+           <el-button type="primary" size="small" @click="toPrint">打印</el-button>
52
+           <el-button type="primary" size="small" @click="exportList">导出</el-button>
53
+         </div>
48
         </div>
54
         </div>
49
 
55
 
50
            <el-table
56
            <el-table
69
             </el-table-column>
75
             </el-table-column>
70
             <el-table-column label="规格&单位" align="center">
76
             <el-table-column label="规格&单位" align="center">
71
                 <template slot-scope="scope">
77
                 <template slot-scope="scope">
72
-                  {{scope.row.specification_name}}
78
+                  {{scope.row.specification_name}}/{{scope.row.packing_unit}}
73
                 </template>
79
                 </template>
74
             </el-table-column>
80
             </el-table-column>
75
             <el-table-column label="生产厂商" align="center">
81
             <el-table-column label="生产厂商" align="center">
83
                    
89
                    
84
                  </el-table-column>
90
                  </el-table-column>
85
               
91
               
86
-                <el-table-column prop="buy_price" label="进货金额" width="100">
92
+                <el-table-column prop="stock_in_price" label="进货金额" width="100">
87
                    
93
                    
88
                 </el-table-column>
94
                 </el-table-column>
89
                 <el-table-column prop="stockMoney" label="销售金额" width="100">
95
                 <el-table-column prop="stockMoney" label="销售金额" width="100">
97
                 
103
                 
98
                 </el-table-column>
104
                 </el-table-column>
99
              
105
              
100
-                <el-table-column prop="buy_price" label="进货金额" width="100">
106
+                <el-table-column prop="addStockMoney" label="进货金额" width="100">
101
                   
107
                   
102
                 </el-table-column>
108
                 </el-table-column>
103
-                <el-table-column  prop="addStockMoney" label="销售金额"  width="100">
109
+                <el-table-column  prop="saleStockMoney" label="销售金额"  width="100">
104
                 </el-table-column>
110
                 </el-table-column>
105
               
111
               
106
             </el-table-column>
112
             </el-table-column>
108
             <el-table-column label="本期减少" align="center">
114
             <el-table-column label="本期减少" align="center">
109
                <el-table-column prop="outStock" label="数量" width="100">
115
                <el-table-column prop="outStock" label="数量" width="100">
110
                 </el-table-column>
116
                 </el-table-column>
111
-                <el-table-column  prop="buy_price"  label="进货金额" width="100">
117
+                <el-table-column  prop="stockOutprice"  label="进货金额" width="100">
112
                 </el-table-column>
118
                 </el-table-column>
113
-                <el-table-column prop="stockOutMoney" label="销售金额" width="100">
119
+                <el-table-column prop="saleOutMoney" label="销售金额" width="100">
114
                 </el-table-column>
120
                 </el-table-column>
115
             </el-table-column>
121
             </el-table-column>
116
           
122
           
117
             <el-table-column label="期末结余" align="center">
123
             <el-table-column label="期末结余" align="center">
118
               <el-table-column prop="overStock" label="数量" width="100">
124
               <el-table-column prop="overStock" label="数量" width="100">
119
               </el-table-column>
125
               </el-table-column>
120
-              <el-table-column prop="buy_price" label="进货金额" width="100">
126
+              <el-table-column prop="overPrice" label="进货金额" width="100">
121
               </el-table-column>
127
               </el-table-column>
122
-              <el-table-column prop="oveMoney" label="销售金额" width="100">
128
+              <el-table-column prop="overMoney" label="销售金额" width="100">
123
               </el-table-column>
129
               </el-table-column>
124
             </el-table-column>
130
             </el-table-column>
125
 
131
 
151
   getStockDrugCount
157
   getStockDrugCount
152
 } from "@/api/stock";
158
 } from "@/api/stock";
153
 import { uParseTime } from '@/utils/tools'
159
 import { uParseTime } from '@/utils/tools'
160
+const moment = require('moment')
154
 export default {
161
 export default {
155
 
162
 
156
   data(){
163
   data(){
171
      total:0,
178
      total:0,
172
      keyword:"",
179
      keyword:"",
173
      goodTypeList:[],
180
      goodTypeList:[],
174
-     start_time:"",
175
-     end_time:"",
181
+     start_time:moment().startOf('month').format("YYYY-MM-DD"),
182
+     end_time:moment().endOf('month').format("YYYY-MM-DD"),
176
      countList:[],
183
      countList:[],
177
      outCountList:[],
184
      outCountList:[],
178
      autoCountList:[],
185
      autoCountList:[],
185
      good_id:0,
192
      good_id:0,
186
      patientList:[],
193
      patientList:[],
187
      good_name:"",
194
      good_name:"",
188
-     specification_name:""
195
+     specification_name:"",
196
+     loading:false,
189
     }
197
     }
190
   
198
   
191
   },
199
   },
217
       })
225
       })
218
     },
226
     },
219
     getlist(){
227
     getlist(){
228
+        this.loading = true
220
         var params = {
229
         var params = {
221
           good_type:this.good_type,
230
           good_type:this.good_type,
222
           keyword:this.keyword,
231
           keyword:this.keyword,
228
       getPurchaseStockQuery(params).then(response=>{
237
       getPurchaseStockQuery(params).then(response=>{
229
          if(response.data.state == 1){
238
          if(response.data.state == 1){
230
             var list = response.data.data.list
239
             var list = response.data.data.list
240
+            this.loading = false
231
             for(let i=0;i<list.length;i++){
241
             for(let i=0;i<list.length;i++){
232
-               list[i].stockIn = this.getWarehouseInfoStart(list[i].warehouse_info,list[i].warehouse_out_info)
233
-               list[i].stockMoney = (this.getWarehouseInfoStart(list[i].warehouse_info,list[i].warehouse_out_info) * list[i].buy_price).toFixed(2)
234
-               list[i].stockAdd = this.getWarehouseInfoOne(list[i].warehouse_info)
235
-               list[i].addStockMoney = (this.getWarehouseInfoOne(list[i].warehouse_info) *list[i].buy_price).toFixed(2)
236
-
237
-               list[i].outStock = this.getWarehouseOut(list[i].warehouse_out_info)
238
-               list[i].stockOutMoney = (this.getWarehouseOut(list[i].warehouse_out_info)*list[i].buy_price).toFixed(2)
242
+               
243
+              list[i].stockIn = this.getWarehouseInfoStart(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo) //期初结余
244
+              list[i].stock_in_price = this.getWarehouseInfoStartPrice(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo)
245
+              list[i].stockMoney = this.getWarehouseInfoStartMoney(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo)
246
+              
247
+              list[i].stockAdd = this.getWarehouseInfoOne(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)//期间增加
248
+              list[i].addStockMoney = (this.getAddStockMony(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)).toFixed(2)
249
+              list[i].saleStockMoney = (this.getSaleStockMony(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)).toFixed(2)
239
 
250
 
240
-               list[i].overStock = this.getWarehouseInfo(list[i].warehouse_info)
241
-               list[i].oveMoney = (this.getWarehouseInfo(list[i].warehouse_info)*list[i].buy_price).toFixed(2)
251
+              list[i].outStock = this.getWarehosueOutInfo(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)//本期减少
252
+              list[i].stockOutprice = (this.stockOutprice(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)).toFixed(2)
253
+              list[i].saleOutMoney = (this.saleOutprice(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)).toFixed(2)
254
+              
255
+              list[i].overStock= this.getEndWarehouseInfo(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
256
+              list[i].overPrice= this.getEndOverPrice(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
257
+              list[i].overMoney = this.getEndSalePrice(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
258
+             
242
             }
259
             }
243
             this.tableList = list
260
             this.tableList = list
244
             this.total = response.data.data.total
261
             this.total = response.data.data.total
274
       this.toDialogClick(this.good_id,this.good_name,this.specification_name)
291
       this.toDialogClick(this.good_id,this.good_name,this.specification_name)
275
     },
292
     },
276
    seach(){
293
    seach(){
294
+    this.goodTypeList = []
295
+    this.getStorehouseList()
277
     this.getlist()
296
     this.getlist()
278
    },
297
    },
279
    getGoodTypeName(id){
298
    getGoodTypeName(id){
504
     return name
523
     return name
505
   },
524
   },
506
   endTimeChange(){
525
   endTimeChange(){
507
-
526
+   this.getlist()
508
   },
527
   },
509
   startTimeChange(){
528
   startTimeChange(){
510
-
529
+    this.getlist()
511
   },
530
   },
512
-  getWarehouseInfoStart(arr1,arr2){
531
+  getWarehouseInfoStart(arr1,arr2,arr3,arr4,arr5){
513
     var count =0
532
     var count =0
514
-    var addCount = 0 
515
-    var outCount = 0
516
-    for(let i=0;i<arr1.length;i++){
517
-      addCount +=arr1[i].warehousing_count
533
+    var countOne =0 
534
+    var countTwo= 0
535
+    var countthree = 0 //期初
536
+    var countfour = 0
537
+    var countfive = 0
538
+    if(arr1!=null && arr1.length > 0){
539
+      for(let i=0;i<arr1.length;i++){
540
+       countOne +=arr1[i].count
541
+      }
518
     }
542
     }
519
-    for(let i=0;i<arr2.length;i++){
520
-      outCount +=arr2[i].count
543
+    if(arr2!=null && arr2.length > 0){
544
+      for(let i=0;i<arr2.length;i++){
545
+        countTwo +=arr2[i].count
546
+      }
547
+    }
548
+    if(arr3!=null && arr3.length > 0){
549
+      for(let i=0;i<arr3.length;i++){
550
+        countthree +=arr3[i].count
551
+      }
552
+    }
553
+    if(arr4!=null && arr4.length > 0){
554
+      for(let i=0;i<arr4.length;i++){
555
+        countfour +=arr4[i].count
556
+      }
557
+    }
558
+     if(arr5!=null && arr5.length > 0){
559
+      for(let i=0;i<arr5.length;i++){
560
+        countfive +=arr5[i].count
561
+      }
521
     }
562
     }
522
-    count = addCount - outCount
563
+    console.log("countOne",countOne)
564
+    console.log("countTwo",countTwo)
565
+    console.log("countthree",countthree)
566
+    console.log("countfour",countfour)
567
+    console.log("*********************")
568
+    count = countOne - countTwo + countthree - countfour + countfive
523
     if(count > 0 ){
569
     if(count > 0 ){
524
       return count
570
       return count
525
     }else{
571
     }else{
526
-      return count
572
+      return 0
527
     }
573
     }
528
   },
574
   },
529
   getWarehouseInfo(val){
575
   getWarehouseInfo(val){
534
     if(count > 0 ){
580
     if(count > 0 ){
535
       return count
581
       return count
536
     }else{
582
     }else{
537
-      return count
583
+      return 0
538
     }
584
     }
539
   },
585
   },
540
-  getWarehouseInfoOne(val){
586
+  getWarehouseInfoOne(val,val2){
541
     var count =0 
587
     var count =0 
542
-    for(let i=0;i<val.length;i++){
543
-      count +=val[i].warehousing_count
588
+    var countOne = 0
589
+    var all_count = 0
590
+    if(val!=null && val.length >0){
591
+     for(let i=0;i<val.length;i++){
592
+      count +=val[i].count
593
+     }
544
     }
594
     }
545
-    if(count > 0 ){
546
-      return count
595
+    if(val2!=null && val2.length > 0){
596
+     for(let i=0;i<val2.length;i++){
597
+       countOne +=val2[i].count
598
+     }
599
+    }
600
+    all_count = count + countOne
601
+    console.log("count2332323223232o2222222222wide",count)
602
+    console.log("countONE23232322323323223",countOne)
603
+    console.log("all_count9999999999999wode",all_count)
604
+    console.log("-------------------------------------------")
605
+    if(all_count > 0 ){
606
+      return all_count
547
     }else{
607
     }else{
548
-      return count
608
+      return 0
609
+    }
610
+  },
611
+  getAddStockMony(val,val2){
612
+    var total_price =0 
613
+    var total_price_one = 0
614
+    var all_price = 0
615
+    if(val!=null && val.length >0){
616
+     for(let i=0;i<val.length;i++){
617
+      total_price +=val[i].count * val[i].buy_price
618
+     }
619
+    }
620
+    if(val2!=null && val2.length > 0){
621
+      for(let i=0;i<val2.length;i++){
622
+       total_price_one +=val2[i].count * val2[i].price
623
+      }
624
+    }
625
+  all_price = total_price + total_price_one
626
+   if(all_price >0 ){
627
+    return total_price
628
+   }else{
629
+    return 0
630
+   }
631
+  },
632
+  getSaleStockMony(val,val2){
633
+    var total_price =0 
634
+    var total_price_one = 0
635
+    var all_price = 0
636
+    if(val!=null && val.length >0){
637
+     for(let i=0;i<val.length;i++){
638
+      total_price +=val[i].count * val[i].price
639
+     }
549
     }
640
     }
641
+   if(val2!=null && val2.length > 0){
642
+     for(let i=0;i<val2.length;i++){
643
+      total_price_one +=val2[i].count * val2[i].price
644
+     }
645
+   }
646
+   all_price = total_price + total_price_one
647
+   if(all_price >0 ){
648
+    return all_price
649
+   }else{
650
+    return 0
651
+   }
550
   },
652
   },
551
   getWarehouseOut(val){
653
   getWarehouseOut(val){
552
     var count = 0
654
     var count = 0
556
     if(count >0){
658
     if(count >0){
557
      return count
659
      return count
558
     }else{
660
     }else{
559
-      return count
661
+      return 0
560
     }
662
     }
561
-  }
562
-  },
563
-  created(){
663
+   },
664
+   open(){
665
+    this.houseList = []
666
+    this.goodTypeList= []
564
     this.getStorehouseList()
667
     this.getStorehouseList()
565
     this.getlist()
668
     this.getlist()
566
     this.getStockDrugCount()
669
     this.getStockDrugCount()
567
-  }
670
+   },
671
+   getWarehouseInfoStartPrice(arr,arr1,arr2,arr3,arr4){
672
+     var total_price = 0
673
+     var total_price_one = 0
674
+     var total_price_two = 0
675
+     var total_price_three = 0
676
+     var total_price_four = 0
677
+     var total_price_all = 0
678
+     if(arr!=null&&arr.length > 0){
679
+      for(let i=0;i<arr.length;i++){
680
+        total_price += arr[i].count * arr[i].buy_price
681
+      }
682
+     }
683
+     if(arr1!=null && arr1.length > 0){
684
+      for(let i=0;i<arr1.length;i++){
685
+        total_price_one +=arr1[i].count * arr1[i].buy_price
686
+      }
687
+      
688
+     }
689
+     if(arr2!=null && arr2.length > 0){
690
+      for(let i=0;i<arr2.length;i++){
691
+       total_price_two +=arr2[i].count * arr2[i].buy_price
692
+      }
693
+     
694
+     }
695
+    if(arr3!=null && arr3.length > 0){
696
+      for(let i=0;i<arr3.length;i++){
697
+        total_price_three +=arr3[i].count * arr3[i].buy_price
698
+      }
699
+     
700
+     }
701
+     if(arr4!=null && arr4.length > 0){
702
+      for(let i=0;i<arr4.length;i++){
703
+        total_price_three +=arr4[i].count * arr4[i].buy_price
704
+      }
705
+     
706
+     }
707
+     total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
708
+     if (total_price_all > 0) {
709
+       return total_price_all.toFixed(2)
710
+     }else{
711
+      return  0
712
+     }
713
+   },
714
+   getWarehouseInfoStartMoney(arr,arr1,arr2,arr3,arr4){
715
+     var total_price = 0
716
+     var total_price_one = 0
717
+     var total_price_two = 0
718
+     var total_price_three = 0
719
+     var total_price_four = 0
720
+     var total_price_all = 0
721
+     if(arr!=null && arr.length >0){
722
+       for(let i=0;i<arr.length;i++){
723
+         total_price +=arr[i].count * arr[i].price
724
+       }
725
+     }
726
+     if(arr1!=null && arr1.length > 0){
727
+      for(let i=0;i<arr1.length;i++){
728
+        total_price_one +=arr1[i].count * arr1[i].price
729
+      }
730
+      
731
+     }
732
+     if(arr2!=null && arr2.length > 0){
733
+      for(let i=0;i<arr2.length;i++){
734
+       total_price_two +=arr2[i].count * arr2[i].price
735
+      }
736
+     
737
+     }
738
+    if(arr3!=null && arr3.length > 0){
739
+      for(let i=0;i<arr3.length;i++){
740
+        total_price_three +=arr3[i].count * arr3[i].price
741
+      }
742
+     
743
+     }
744
+    if(arr4!=null && arr4.length > 0){
745
+      for(let i=0;i<arr4.length;i++){
746
+        total_price_four +=arr4[i].count * arr4[i].price
747
+      }
748
+     
749
+     }
750
+     total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
751
+    if (total_price_all > 0) {
752
+       return total_price_all.toFixed(2)
753
+     }else{
754
+      return  0
755
+     }
756
+   },
757
+   getWarehosueOutInfo(val,val2,val3){
758
+     var count = 0
759
+     var count_one = 0
760
+     var all_count = 0
761
+     var count_two = 0
762
+     if(val!=null && val.length >0){
763
+       for(let i=0;i<val.length;i++){
764
+         count +=val[i].count
765
+       }
766
+     }
767
+     if(val2!=null && val2.length > 0){
768
+      for(let i=0;i<val2.length;i++){
769
+        count_one +=val2[i].count
770
+      }
771
+     }
772
+     if(val3!=null && val3.length > 0){
773
+      for(let i=0;i<val3.length;i++){
774
+        count_two +=val3[i].count
775
+      }
776
+     }
777
+     all_count = count +count_one - count_two
778
+     if(all_count >0){
779
+       return all_count
780
+     }else{
781
+      return 0
782
+     }
783
+   },
784
+   stockOutprice(val,val2,val3){
785
+     var total_price = 0
786
+     var total_price_one = 0
787
+     var total_price_two = 0
788
+     var all_price = 0
789
+     if(val!=null && val.length >0){
790
+       for(let i=0;i<val.length;i++){
791
+         total_price +=val[i].count * val[i].buy_price
792
+       }
793
+     }
794
+     if(val2!=null && val2.length > 0){
795
+      for(let i=0;i<val2.length;i++){
796
+        total_price_one +=val2[i].count * val2[i].buy_price
797
+      }
798
+     }
799
+    if(val3!=null && val3.length > 0){
800
+      for(let i=0;i<val3.length;i++){
801
+        total_price_two +=val3[i].count * val3[i].buy_price
802
+      }
803
+     }
804
+     all_price = total_price + total_price_one - total_price_two
805
+     if(all_price >0){
806
+       return all_price
807
+     }else{
808
+      return 0
809
+     }
810
+   },
811
+  saleOutprice(val,val2,val3){
812
+     var total_price = 0
813
+     var total_price_one = 0
814
+     var all_price = 0
815
+     var total_price_two = 0
816
+     if(val!=null && val.length >0){
817
+       for(let i=0;i<val.length;i++){
818
+         total_price +=val[i].count * val[i].xt_warehouse_info.packing_price
819
+       }
820
+     }
821
+     if(val2!=null && val2.length > 0){
822
+       for(let i=0;i<val2.length;i++){
823
+         total_price_one +=val2[i].count * val2[i].price
824
+       }
825
+     }
826
+     if(val3!=null && val3.length > 0){
827
+       for(let i=0;i<val3.length;i++){
828
+         total_price_two +=val3[i].count * val3[i].price
829
+       }
830
+     }
831
+     all_price = total_price + total_price_one - total_price_two
832
+     if(all_price >0){
833
+       return total_price
834
+     }else{
835
+      return 0
836
+     }
837
+   },
838
+   getEndWarehouseInfo(val,val3,val1,val2,val4){
839
+     var count = 0
840
+     var count_one = 0
841
+     var count_two = 0
842
+     var count_three =0
843
+     var count_four = 0
844
+     var all_count = 0
845
+     if(val!=null && val.length >0){
846
+       for(let i=0;i<val.length;i++){
847
+         count +=val[i].count 
848
+       }
849
+     }
850
+     if(val1!=null&&val1.length >0){
851
+       for(let i=0;i<val1.length;i++){
852
+         count_one +=val1[i].count
853
+       }
854
+     }
855
+     if(val3!=null&& val3.length > 0){
856
+      for(let i=0;i<val3.length;i++){
857
+         count_three +=val3[i].count
858
+       }
859
+     }
860
+     if(val2!=null&&val2.length >0){
861
+       for(let i=0;i<val2.length;i++){
862
+         count_two +=val2[i].count
863
+       }
864
+     }
865
+     if(val4!=null&&val4.length >0){
866
+       for(let i=0;i<val4.length;i++){
867
+         count_four +=val4[i].count
868
+       }
869
+     }
870
+     all_count = count- count_three + count_one - count_two + count_four
871
+     if(all_count >0){
872
+       return all_count
873
+     }else{
874
+      return 0
875
+     }
876
+   },
877
+   getEndOverPrice(val,val3,val1,val2,val4){
878
+     var total_price = 0
879
+     var total_price_one = 0
880
+     var total_price_two = 0
881
+     var total_price_three = 0
882
+     var total_price_four =0
883
+     var all_price = 0
884
+     if(val!=null && val.length >0){
885
+       for(let i=0;i<val.length;i++){
886
+         total_price +=val[i].count * val[i].buy_price
887
+       }
888
+     }
889
+     if(val1!=null && val1.length > 0){
890
+       for(let i=0;i<val1.length;i++){
891
+         total_price_one +=val1[i].count * val1[i].buy_price
892
+       }
893
+     }
894
+     if(val3!=null && val3.length > 0){
895
+       for(let i=0;i<val3.length;i++){
896
+         total_price_three +=val3[i].count * val3[i].buy_price
897
+       }
898
+     }
899
+    if(val2!=null && val2.length > 0){
900
+       for(let i=0;i<val2.length;i++){
901
+         total_price_two +=val2[i].count * val2[i].buy_price
902
+       }
903
+     }
904
+      if(val4!=null && val4.length > 0){
905
+       for(let i=0;i<val4.length;i++){
906
+         total_price_four +=val4[i].count * val4[i].buy_price
907
+       }
908
+     }
909
+     console.log("total_price",total_price)
910
+     console.log("total_price_three",total_price_three)
911
+     console.log("total_price_two",total_price_two)
912
+     console.log("total_price_one",total_price_one)
913
+     console.log("total_price_four",total_price_four)
914
+     all_price = total_price- total_price_three +total_price_one - total_price_two + total_price_four
915
+     console.log("arrll_price",all_price)
916
+     if(all_price >0){
917
+       return all_price.toFixed(2)
918
+     }else{
919
+      return 0
920
+     }
921
+   },
922
+   getEndSalePrice(val,val3,val1,val2,val4){
923
+     var total_price = 0
924
+     var total_price_one = 0
925
+     var total_price_two = 0
926
+     var total_price_three = 0
927
+     var total_price_four = 0
928
+     var all_price= 0
929
+     if(val!=null && val.length >0){
930
+       for(let i=0;i<val.length;i++){
931
+         total_price +=val[i].count * val[i].price
932
+       }
933
+     }
934
+     if(val1!=null && val1.length >0){
935
+       for(let i=0;i<val1.length;i++){
936
+         total_price_one +=val1[i].count * val1[i].price
937
+       }
938
+     }
939
+    if(val3!=null && val3.length >0){
940
+       for(let i=0;i<val3.length;i++){
941
+         total_price_three +=val3[i].count * val3[i].price
942
+       }
943
+     }
944
+      if(val2!=null && val2.length >0){
945
+       for(let i=0;i<val2.length;i++){
946
+         total_price_two +=val2[i].count * val2[i].price
947
+       }
948
+     }
949
+       if(val4!=null && val4.length >0){
950
+       for(let i=0;i<val4.length;i++){
951
+         total_price_four +=val4[i].count * val4[i].price
952
+       }
953
+     }
954
+     var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
955
+     if(all_price >0){
956
+       return all_price.toFixed(2)
957
+     }else{
958
+      return 0
959
+     }
960
+   },
961
+   toPrint(){
962
+    this.$router.push({path:"/purchase/stock/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&good_type="+this.good_type})
963
+   },
964
+   exportList: function() {
965
+        for(let i=0;i<this.tableList.length;i++){
966
+          this.tableList[i].index = i+1
967
+          this.tableList[i].query_date = this.start_time+"~"+this.end_time
968
+          this.tableList[i].good_type = this.getGoodTypeName(this.tableList[i].good_type_id)
969
+          this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
970
+          this.tableList[i].specification_name = this.tableList[i].specification_name + "/"+this.tableList[i].packing_unit
971
+        }
972
+        import('@/vendor/Export2Excel').then(excel => {
973
+           const multiHeader = [['序号', '查询日期',' 耗材类型','耗材名称','规格&单位','生产产商', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
974
+           const header = ['', '','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
975
+           const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:I1', 'J1:L1', 'M1:O1', 'P1:R1']
976
+           const filterVal = ['index', 'query_date', 'good_type','good_name','specification_name','manufacturer_name','stockIn','stock_in_price','stockMoney','stockAdd','addStockMoney','saleStockMoney','outStock','stockOutprice','saleOutMoney','overStock','overPrice','overMoney']
977
+    
978
+           const data = this.formatJson(filterVal, this.tableList)
979
+           
980
+           const filename = '进销存查询'
981
+     
982
+          
983
+            excel.export_json_to_excel({
984
+              multiHeader,
985
+              header,
986
+              merges,
987
+              data,
988
+              filename
989
+            })
990
+        })
991
+      },
992
+      formatJson(filterVal, jsonData) {
993
+        return jsonData.map(v => filterVal.map(j => v[j]));
994
+      },
995
+  },
996
+  // created(){
997
+  //   this.getStorehouseList()
998
+  //   this.getlist()
999
+  //   this.getStockDrugCount()
1000
+  // }
568
 }
1001
 }
569
 </script>
1002
 </script>
570
 
1003
 

+ 40 - 4
src/xt_pages/stock/stockBatchNumber.vue ファイルの表示

11
         厂家:{{this.$route.query.manufacturer}} 
11
         厂家:{{this.$route.query.manufacturer}} 
12
       </div>
12
       </div>
13
       <div class="cell clearfix">
13
       <div class="cell clearfix">
14
-        <span>日期查询:</span>
14
+        <span>入库时间:</span>
15
         <el-date-picker
15
         <el-date-picker
16
             size="small"
16
             size="small"
17
             v-model="start_time"
17
             v-model="start_time"
38
               value-format="yyyy-MM-dd"
38
               value-format="yyyy-MM-dd"
39
               @change="endTimeChange"
39
               @change="endTimeChange"
40
           ></el-date-picker>
40
           ></el-date-picker>
41
-          
41
+          <span>有效期:</span>
42
+           <el-date-picker
43
+            size="small"
44
+            v-model="start_first_time"
45
+            prefix-icon="el-icon-date"
46
+            :editable="false"
47
+            style="width: 196px;"
48
+            type="date"
49
+            placeholder="选择日期时间"
50
+            align="right"
51
+            format="yyyy-MM-dd"
52
+            value-format="yyyy-MM-dd"
53
+            @change="startTimeFirstChange"
54
+           ></el-date-picker>-
55
+            <el-date-picker
56
+              size="small"
57
+              v-model="end_first_time"
58
+              prefix-icon="el-icon-date"
59
+              :editable="false"
60
+              style="width: 196px;margin-right:10px;"
61
+              type="date"
62
+              placeholder="选择日期时间"
63
+              align="right"
64
+              format="yyyy-MM-dd"
65
+              value-format="yyyy-MM-dd"
66
+              @change="endTimeFirstChange"
67
+          ></el-date-picker>
42
           
68
           
43
       </div>
69
       </div>
44
       
70
       
93
              <span v-if="scope.row.packing_price > 0"> {{scope.row.packing_price}}</span>
119
              <span v-if="scope.row.packing_price > 0"> {{scope.row.packing_price}}</span>
94
            </template>
120
            </template>
95
         </el-table-column>
121
         </el-table-column>
96
-        <!-- <el-table-column prop="drug_name" label="该批次剩余库存" align="center">
122
+        <el-table-column prop="drug_name" label="该批次剩余库存" align="center">
97
            <template slot-scope="scope">
123
            <template slot-scope="scope">
98
              <span> {{scope.row.stock_count}}</span>
124
              <span> {{scope.row.stock_count}}</span>
99
            </template>
125
            </template>
100
-        </el-table-column> -->
126
+        </el-table-column>
101
         <el-table-column prop="drug_name" label="备注" align="center">
127
         <el-table-column prop="drug_name" label="备注" align="center">
102
            <template slot-scope="scope">
128
            <template slot-scope="scope">
103
              <span>{{scope.row.remark}}</span>
129
              <span>{{scope.row.remark}}</span>
168
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
194
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
169
         start_time: '',
195
         start_time: '',
170
         end_time: '',
196
         end_time: '',
197
+        start_first_time:'',
198
+        end_first_time:'',
171
         page: 1,
199
         page: 1,
172
         limit: 10,
200
         limit: 10,
173
         goodType: [],
201
         goodType: [],
260
           id:this.$route.query.id,
288
           id:this.$route.query.id,
261
           start_time:this.start_time,
289
           start_time:this.start_time,
262
           end_time:this.end_time, 
290
           end_time:this.end_time, 
291
+          start_first_time:this.start_first_time,
292
+          end_first_time:this.end_first_time,
263
         } 
293
         } 
264
       getStockInList(params).then(response=>{
294
       getStockInList(params).then(response=>{
265
          if(response.data.state == 1){
295
          if(response.data.state == 1){
372
          specification_name = this.good.specification_name
402
          specification_name = this.good.specification_name
373
        }
403
        }
374
        return specification_name
404
        return specification_name
405
+     },
406
+     startTimeFirstChange(){
407
+       this.getlist()
408
+     },
409
+     endTimeFirstChange(){
410
+      this.getlist()
375
      }
411
      }
376
 
412
 
377
     }
413
     }

+ 3 - 2
src/xt_pages/stock/stockFlow.vue ファイルの表示

7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
        耗材名称:{{getGoodName(this.$route.query.id)}} &nbsp;
8
        耗材名称:{{getGoodName(this.$route.query.id)}} &nbsp;
9
        库存: {{this.$route.query.overCount}}{{packing_unit}} &nbsp;
9
        库存: {{this.$route.query.overCount}}{{packing_unit}} &nbsp;
10
-       规格:{{this.$route.query.specification_name}} &nbsp;
11
-       厂家:{{getSpecName(this.$route.query.id)}}
10
+       规格:{{getSpecName(this.$route.query.id)}} &nbsp;
11
+       厂家:{{this.$route.query.manufacturer}}
12
       </div>
12
       </div>
13
       <div class="cell clearfix">
13
       <div class="cell clearfix">
14
         <span>日期查询:</span>
14
         <span>日期查询:</span>
218
           {id:2,name:"手动出库"},
218
           {id:2,name:"手动出库"},
219
           {id:3,name:"自动出库"},
219
           {id:3,name:"自动出库"},
220
           {id:4,name:"手动退库"},
220
           {id:4,name:"手动退库"},
221
+          {id:7,name:"自动退库"},
221
           {id:10,name:"盘盈"},
222
           {id:10,name:"盘盈"},
222
           {id:11,name:"盘亏"},
223
           {id:11,name:"盘亏"},
223
           {id:12,name:"调拨出库"},
224
           {id:12,name:"调拨出库"},

+ 11 - 10
src/xt_pages/stock/stockInOrderAdd.vue ファイルの表示

7
 
7
 
8
       <div style="float:right;">
8
       <div style="float:right;">
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
-        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item"  v-loading="loading">保 存</el-button>
11
         <el-button size="small" type="primary" v-show="showCheck" @click="toCheck()" class="filter-item">审 核</el-button>
11
         <el-button size="small" type="primary" v-show="showCheck" @click="toCheck()" class="filter-item">审 核</el-button>
12
         <!-- <el-button size="small" type="primary" v-show="showReturnCheck" @click="toReturnCheck()" class="filter-item">反 审 核</el-button> -->
12
         <!-- <el-button size="small" type="primary" v-show="showReturnCheck" @click="toReturnCheck()" class="filter-item">反 审 核</el-button> -->
13
       </div>
13
       </div>
14
     </div>
14
     </div>
15
-    <div class="app-container" v-loading="loading">
15
+    <div class="app-container">
16
 
16
 
17
       <stock-in-dialog ref="dialog" :propForm="propForm"
17
       <stock-in-dialog ref="dialog" :propForm="propForm"
18
                        :visibility="isVisibility"
18
                        :visibility="isVisibility"
697
         this.$refs['tableForm'].validate((valid) => {
697
         this.$refs['tableForm'].validate((valid) => {
698
           if (valid) {
698
           if (valid) {
699
             this.loading = true
699
             this.loading = true
700
+            const loading = this.$loading({
701
+              lock: true,
702
+              text: 'Loading',
703
+              spinner: 'el-icon-loading',
704
+              background: 'rgba(0, 0, 0, 0.7)'
705
+            })
700
             const array = this.recordInfo.recordData
706
             const array = this.recordInfo.recordData
701
             if(this.storehouse_id == 0){
707
             if(this.storehouse_id == 0){
702
               this.$message.error("仓库不能为空!")
708
               this.$message.error("仓库不能为空!")
736
               }
742
               }
737
               this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString()
743
               this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString()
738
             }
744
             }
739
-            const loading = this.$loading({
740
-              lock: true,
741
-              text: 'Loading',
742
-              spinner: 'el-icon-loading',
743
-              background: 'rgba(0, 0, 0, 0.7)'
744
-            })
745
+        
745
             const params = {
746
             const params = {
746
               'stockIn': this.recordInfo.recordData
747
               'stockIn': this.recordInfo.recordData
747
             }
748
             }
765
                 this.warehousing_info_id  = info.id
766
                 this.warehousing_info_id  = info.id
766
                 for(let i=0;i<list.length;i++){
767
                 for(let i=0;i<list.length;i++){
767
                   for(let j=0;j<dealerList.length;j++){
768
                   for(let j=0;j<dealerList.length;j++){
768
-                     if(list[i].dealer == dealerList[i].id){
769
-                        list[i].dealer = dealerList[i].dealer_name
769
+                     if(list[i].dealer == dealerList[j].id){
770
+                        list[i].dealer = dealerList[j].dealer_name
770
                      }
771
                      }
771
                   }
772
                   }
772
                   for(let s=0;s<manufacturerList.length;s++){
773
                   for(let s=0;s<manufacturerList.length;s++){

+ 4 - 3
src/xt_pages/stock/stockInOrderEdit.vue ファイルの表示

20
           @click="submit()"
20
           @click="submit()"
21
           v-if="is_check == 2"
21
           v-if="is_check == 2"
22
           class="filter-item"
22
           class="filter-item"
23
+          v-loading="loading"
23
           >保 存</el-button
24
           >保 存</el-button
24
         >
25
         >
25
         <el-button
26
         <el-button
41
       </div>
42
       </div>
42
     </div>
43
     </div>
43
 
44
 
44
-    <div class="app-container" v-loading="loading">
45
+    <div class="app-container">
45
       <stock-in-dialog
46
       <stock-in-dialog
46
         ref="dialog"
47
         ref="dialog"
47
         :propForm="propForm"
48
         :propForm="propForm"
759
               var dealerList = response.data.data.dealerList
760
               var dealerList = response.data.data.dealerList
760
               for(let i=0;i<list.length;i++){
761
               for(let i=0;i<list.length;i++){
761
                 for(let j=0;j<dealerList.length;j++){
762
                 for(let j=0;j<dealerList.length;j++){
762
-                 if(list[i].dealer == dealerList[i].id){
763
-                    list[i].dealer = dealerList[i].dealer_name
763
+                 if(list[i].dealer == dealerList[j].id){
764
+                    list[i].dealer = dealerList[j].dealer_name
764
                   }
765
                   }
765
                 }
766
                 }
766
                 for(let s=0;s<manufacturerList.length;s++){
767
                 for(let s=0;s<manufacturerList.length;s++){

+ 13 - 5
src/xt_pages/stock/stockNewQuery.vue ファイルの表示

10
               <GoodNewQuery></GoodNewQuery>
10
               <GoodNewQuery></GoodNewQuery>
11
             </el-tab-pane>
11
             </el-tab-pane>
12
             <el-tab-pane label="进销存查询" name="second">
12
             <el-tab-pane label="进销存查询" name="second">
13
-               <PurchaseStockQuery></PurchaseStockQuery>
13
+               <PurchaseStockQuery ref="mychild"></PurchaseStockQuery>
14
            </el-tab-pane>
14
            </el-tab-pane>
15
             <el-tab-pane label="有效期查询" name="third">
15
             <el-tab-pane label="有效期查询" name="third">
16
-                <expiryDateQuery></expiryDateQuery>
16
+                <expiryDateQuery ref="mychildone"></expiryDateQuery>
17
             </el-tab-pane>
17
             </el-tab-pane>
18
             <el-tab-pane label="患者查询" name="fourth">
18
             <el-tab-pane label="患者查询" name="fourth">
19
-                <patientQuery></patientQuery>
19
+                <patientQuery ref="mychildtwo"></patientQuery>
20
             </el-tab-pane>
20
             </el-tab-pane>
21
         </el-tabs>
21
         </el-tabs>
22
      </div>
22
      </div>
51
     };
51
     };
52
   },
52
   },
53
   methods:{
53
   methods:{
54
-    handleClick(){
55
-        
54
+    handleClick(val){
55
+      if(val.name == "second"){
56
+         this.$refs.mychild.open();
57
+      }
58
+      if(val.name == "third"){
59
+        this.$refs.mychildone.open()
60
+      }
61
+      if(val.name =="fourth"){
62
+       this.$refs.mychildtwo.open()
63
+      }
56
     }
64
     }
57
   }
65
   }
58
 };
66
 };

+ 331 - 72
src/xt_pages/stock/stockOutOrder.vue ファイルの表示

249
             backgroundColor: 'rgb(245, 247, 250)',
249
             backgroundColor: 'rgb(245, 247, 250)',
250
             color: '#606266',
250
             color: '#606266',
251
           }"
251
           }"
252
+          :cell-class-name="cellStyle"
252
         >
253
         >
253
           <el-table-column label="耗材名称" align="center">
254
           <el-table-column label="耗材名称" align="center">
254
             <template slot-scope="scope">
255
             <template slot-scope="scope">
278
               <span>{{scope.row.stock_count}}</span>
279
               <span>{{scope.row.stock_count}}</span>
279
             </template>
280
             </template>
280
           </el-table-column> -->
281
           </el-table-column> -->
281
-
282
+       
282
           <el-table-column label="出库数量" align="center">
283
           <el-table-column label="出库数量" align="center">
283
             <template slot-scope="scope">
284
             <template slot-scope="scope">
284
-              <span v-if="scope.row.is_sys == 0"
285
-                >{{ scope.row.count }}{{ scope.row.packing_unit }}</span
286
-              >
287
-              <span v-if="scope.row.is_sys == 1"
288
-                >{{ getOutStockCount(scope.row.good_id)
289
-                }}{{ scope.row.packing_unit }}</span
290
-              >
285
+               <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
286
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
287
+                     {{getAllStockCount(scope.row.child,item.warehousing_id) - getCancelInfo(item.warehousing_id,item.good_id)}}
288
+                  </td>
289
+               </tr>
290
+             
291
             </template>
291
             </template>
292
           </el-table-column>
292
           </el-table-column>
293
-          <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
293
+          <el-table-column label="批次" align="center">
294
             <template slot-scope="scope">
294
             <template slot-scope="scope">
295
-              {{ getXuserName(scope.row.admin_user_id) }}
295
+               <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
296
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
297
+                     {{getNumber(scope.row.child,item.warehousing_id)}}
298
+                  </td>
299
+               </tr>
300
+             
296
             </template>
301
             </template>
297
           </el-table-column>
302
           </el-table-column>
298
-          <!-- <el-table-column label="进货价" align="center" v-if="is_sys== 0">
303
+          <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
299
             <template slot-scope="scope">
304
             <template slot-scope="scope">
300
-              <span>{{scope.row.buy_price}}</span>
305
+            
306
+              <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
307
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
308
+                    {{ getXuserName(scope.row.admin_user_id) }} 
309
+                  </td>
310
+               </tr>
301
             </template>
311
             </template>
302
-          </el-table-column> -->
312
+          </el-table-column>
313
+      
303
           <el-table-column label="出货价" align="center">
314
           <el-table-column label="出货价" align="center">
304
             <template slot-scope="scope">
315
             <template slot-scope="scope">
305
-              <span v-if="scope.row.price > 0">{{ scope.row.price }}</span>
306
-              <span v-if="scope.row.price == 0">{{
307
-                scope.row.packing_price
308
-              }}</span>
316
+          
317
+               <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
318
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
319
+                      {{getAllStockCountPrice(scope.row.child,item.warehousing_id)}}
320
+                  </td>
321
+               </tr>
309
             </template>
322
             </template>
310
           </el-table-column>
323
           </el-table-column>
311
           <el-table-column label="总价" align="center">
324
           <el-table-column label="总价" align="center">
312
             <template slot-scope="scope">
325
             <template slot-scope="scope">
313
-              <span v-if="scope.row.is_sys == 0">
314
-                <span v-if="scope.row.price > 0">
315
-                  {{ (scope.row.count * scope.row.price).toFixed(2) }}</span
316
-                >
317
-                <span v-if="scope.row.price == 0">
318
-                  {{
319
-                    (scope.row.count * scope.row.packing_price).toFixed(2)
320
-                  }}</span
321
-                >
322
-              </span>
323
-              <span v-if="scope.row.is_sys == 1">
324
-                <span v-if="scope.row.price > 0">
325
-                  {{
326
-                    (
327
-                      getOutStockCount(scope.row.good_id) * scope.row.price
328
-                    ).toFixed(2)
329
-                  }}</span
330
-                >
331
-                <span v-if="scope.row.price == 0">
332
-                  {{
333
-                    (
334
-                      getOutStockCount(scope.row.good_id) *
335
-                      scope.row.packing_price
336
-                    ).toFixed(2)
337
-                  }}</span
338
-                >
339
-              </span>
326
+               <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
327
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
328
+                      {{(getAllStockCount(scope.row.child,item.warehousing_id) * getAllStockCountPrice(scope.row.child,item.warehousing_id)).toFixed(2)}}
329
+                  </td>
330
+               </tr>
340
             </template>
331
             </template>
341
           </el-table-column>
332
           </el-table-column>
342
           <el-table-column label="生产厂家" align="center">
333
           <el-table-column label="生产厂家" align="center">
343
             <template slot-scope="scope">
334
             <template slot-scope="scope">
344
-              {{ getManufactuerName(scope.row.manufacturer) }}
335
+                <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
336
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
337
+                    {{getManufactuerNameSix(scope.row.child,item.warehousing_id)}} 
338
+                  </td>
339
+               </tr>
345
             </template>
340
             </template>
346
           </el-table-column>
341
           </el-table-column>
347
           <el-table-column label="经销商" align="center">
342
           <el-table-column label="经销商" align="center">
348
             <template slot-scope="scope">
343
             <template slot-scope="scope">
349
-              {{ getDealerName(scope.row.dealer) }}
344
+                <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
345
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
346
+                    {{getDealerNameSix(scope.row.child,item.warehousing_id)}} 
347
+                  </td>
348
+               </tr>
350
             </template>
349
             </template>
351
           </el-table-column>
350
           </el-table-column>
352
           <el-table-column label="生产日期" align="center">
351
           <el-table-column label="生产日期" align="center">
353
             <template slot-scope="scope">
352
             <template slot-scope="scope">
354
-              {{ getTime(scope.row.product_date, "{y}-{m}-{d}") }}
353
+              <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
354
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
355
+                     {{getProductDate(scope.row.child,item.warehousing_id)}}
356
+                  </td>
357
+               </tr>
358
+            
355
             </template>
359
             </template>
356
           </el-table-column>
360
           </el-table-column>
357
           <el-table-column label="有效期" align="center">
361
           <el-table-column label="有效期" align="center">
358
             <template slot-scope="scope">
362
             <template slot-scope="scope">
359
-              {{ getTime(scope.row.expiry_date, "{y}-{m}-{d}") }}
363
+               <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
364
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
365
+                    {{getExpiryDate(scope.row.child,item.warehousing_id)}}
366
+                  </td>
367
+               </tr>
360
             </template>
368
             </template>
361
           </el-table-column>
369
           </el-table-column>
362
-          <!-- <el-table-column label="批准文号" align="center">
363
-            <template slot-scope="scope">
364
-              {{ scope.row.license_number}}
365
-            </template>
366
-          </el-table-column> -->
370
+         
367
           <el-table-column label="注册编码" align="center">
371
           <el-table-column label="注册编码" align="center">
368
             <template slot-scope="scope">
372
             <template slot-scope="scope">
369
-              {{ scope.row.register_number }}
373
+             
374
+               <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
375
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
376
+                   {{getRegisterNumber(scope.row.child,item.warehousing_id)}}
377
+                  </td>
378
+               </tr>
370
             </template>
379
             </template>
371
           </el-table-column>
380
           </el-table-column>
372
           <el-table-column label="备注" align="center">
381
           <el-table-column label="备注" align="center">
373
             <template slot-scope="scope">
382
             <template slot-scope="scope">
374
-              {{ scope.row.remark }}
383
+                <tr style="background: none" v-for="(item,index) in scope.row.childOne" :key="index">
384
+                  <td style="border-right: none; border-inline-end: none;text-align: center">
385
+                   {{getRemark(scope.row.child,item.warehousing_id)}}
386
+                  </td>
387
+               </tr>
388
+             
375
             </template>
389
             </template>
376
           </el-table-column>
390
           </el-table-column>
377
           <el-table-column label="操作" align="center">
391
           <el-table-column label="操作" align="center">
542
     >
556
     >
543
       <span>
557
       <span>
544
         <div class="filter-container">
558
         <div class="filter-container">
545
-          <span style="font-size: 18px; color: #606266">商品使用明细</span>
559
+          <span style="font-size: 18px; color: #606266">耗材使用明细</span>
546
         </div>
560
         </div>
547
 
561
 
548
         <el-row :gutter="12" style="margin-top: 10px">
562
         <el-row :gutter="12" style="margin-top: 10px">
583
               </template>
597
               </template>
584
               <template slot-scope="scope">
598
               <template slot-scope="scope">
585
                 <span
599
                 <span
586
-                  >{{ scope.row.ctime | parseTime("{y}-{m}-{d} {h}:{i}") }}
600
+                  >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
587
                 </span>
601
                 </span>
588
               </template>
602
               </template>
589
             </el-table-column>
603
             </el-table-column>
825
                 </template>
839
                 </template>
826
                 <template slot-scope="scope">
840
                 <template slot-scope="scope">
827
                   <span v-if="scope.row.is_total == 0"
841
                   <span v-if="scope.row.is_total == 0"
828
-                    >{{ scope.row.count }}{{ scope.row.packing_unit }}</span
842
+                    >{{ scope.row.count - scope.row.cancel_count}}{{ scope.row.packing_unit }}</span
829
                   >
843
                   >
830
                   <span v-if="scope.row.is_total == 1"
844
                   <span v-if="scope.row.is_total == 1"
831
                     >{{ scope.row.total }}
845
                     >{{ scope.row.total }}
838
                 </template>
852
                 </template>
839
                 <template slot-scope="scope">
853
                 <template slot-scope="scope">
840
                   <span
854
                   <span
841
-                    >{{ scope.row.ctime | parseTime("{y}-{m}-{d} {h}:{i}") }}
855
+                    >{{ scope.row.ctime | parseTime("{y}-{m}-{d}") }}
842
                   </span>
856
                   </span>
843
                 </template>
857
                 </template>
844
               </el-table-column>
858
               </el-table-column>
1022
        {id:2,name:"未审核"},
1036
        {id:2,name:"未审核"},
1023
       ],
1037
       ],
1024
       check_id: 0,
1038
       check_id: 0,
1039
+      flowList:[],
1040
+      cancelInfoList:[],
1025
     };
1041
     };
1026
   },
1042
   },
1027
   methods: {
1043
   methods: {
1382
         if (response.data.state == 1) {
1398
         if (response.data.state == 1) {
1383
           this.tableShow = true;
1399
           this.tableShow = true;
1384
           var list = response.data.data.list;
1400
           var list = response.data.data.list;
1385
-
1401
+          this.flowList = response.data.data.stockFlowList
1402
+          this.stockFlowListGroup = response.data.data.stockFlowListGroup
1403
+          var cancelInfolist = response.data.data.cancelInfolist
1404
+          this.cancelInfoList = cancelInfolist
1405
+          console.log("退库数据2333333333333333333333",cancelInfolist)
1386
           this.tableList = [];
1406
           this.tableList = [];
1387
           for (let i = 0; i < list.length; i++) {
1407
           for (let i = 0; i < list.length; i++) {
1388
-            // if(list[i].dealer == 0){
1389
-            //   list[i].dealer = ""
1390
-            // }
1391
-            // if(list[i].manufacturer == 0){
1392
-            //   list[i].manufacturer = ""
1393
-            // }
1394
-            // list[i].good_name = list[i].info.good_name
1395
-            // list[i].specification_name = list[i].info.specification_name
1396
-            // list[i].packing_unit = list[i].info.packing_unit
1408
+            list[i].child= []
1409
+            list[i].childOne = []
1410
+            for(let z=0;z<this.stockFlowListGroup.length;z++){
1411
+              if(list[i].good_id == this.stockFlowListGroup[z].good_id){
1412
+                 list[i].childOne.push(this.stockFlowListGroup[z])
1413
+              }
1414
+            }
1415
+            for(let j=0;j<this.flowList.length;j++){
1416
+              if(list[i].good_id == this.flowList[j].good_id){
1417
+                list[i].child.push(this.flowList[j])
1418
+              }
1419
+            }
1420
+         
1397
             this.tableList.push(list[i]);
1421
             this.tableList.push(list[i]);
1398
           }
1422
           }
1423
+          console.log("hhhhhhwode ",this.tableList)
1399
         }
1424
         }
1400
       });
1425
       });
1401
     },
1426
     },
1584
       });
1609
       });
1585
     },
1610
     },
1586
     getTime(val, temp) {
1611
     getTime(val, temp) {
1587
-      if (val != 0) {
1612
+      if (val > 0) {
1588
         return uParseTime(val, temp);
1613
         return uParseTime(val, temp);
1589
       } else {
1614
       } else {
1590
         return "";
1615
         return "";
1814
           var stockflowlist = response.data.data.stockFlowList;
1839
           var stockflowlist = response.data.data.stockFlowList;
1815
 
1840
 
1816
           this.stockFlowList = stockflowlist;
1841
           this.stockFlowList = stockflowlist;
1817
-
1842
+            
1843
+          var cancelInfo = response.data.data.cancelInfo
1844
+          console.log("cancelInfowowoowowowowowowo",cancelInfo)
1845
+          for(let i=0;i<this.stockFlowList.length;i++){
1846
+            this.stockFlowList[i].cancel_count = 0
1847
+            for(let j=0;j<cancelInfo.length;j++){
1848
+              if(this.stockFlowList[i].patient_id == cancelInfo[j].patient_id){
1849
+                 this.stockFlowList[i].cancel_count  = cancelInfo[j].count
1850
+              }
1851
+            }
1852
+          }
1818
           for (let i = 0; i < this.stockFlowList.length; i++) {
1853
           for (let i = 0; i < this.stockFlowList.length; i++) {
1819
             var obj = this.stockFlowList[i];
1854
             var obj = this.stockFlowList[i];
1820
             obj["is_total"] = 0;
1855
             obj["is_total"] = 0;
1821
             this.userList.push(obj);
1856
             this.userList.push(obj);
1822
-            total = total + this.stockFlowList[i].count;
1857
+            if(this.stockFlowList[i].is_sys == 1){
1858
+              total = total + this.stockFlowList[i].count - this.stockFlowList[i].cancel_count;
1859
+            }else{
1860
+              total = total + this.stockFlowList[i].count;
1861
+            }
1862
+            
1823
           }
1863
           }
1824
           this.userList.push({
1864
           this.userList.push({
1825
             is_total: 1,
1865
             is_total: 1,
2038
     },
2078
     },
2039
     changeCheckType(){
2079
     changeCheckType(){
2040
       this.GetWarehouseOut()
2080
       this.GetWarehouseOut()
2081
+    },
2082
+    getAllStockCount(val,warehousing_id){
2083
+      var arr=[]
2084
+      var total_count = 0
2085
+     if(val!=null&&val.length > 0){
2086
+        for(let i=0;i<val.length;i++){
2087
+           if(val[i].warehousing_id == warehousing_id){
2088
+              arr.push(val[i])
2089
+           }
2090
+        }
2091
+     }
2092
+     if(arr.length > 0) {
2093
+       for(let j=0;j<arr.length;j++){
2094
+          total_count +=arr[j].count
2095
+       }
2096
+     }
2097
+     if(total_count > 0){
2098
+        return total_count
2099
+     }else{
2100
+      return total_count
2101
+     }
2102
+    },
2103
+    getAllStockCountPrice(val,warehousing_id){
2104
+     var price = 0
2105
+     var arr = []
2106
+     if(val!=null&&val.length > 0){
2107
+        for(let i=0;i<val.length;i++){
2108
+           if(val[i].warehousing_id == warehousing_id){
2109
+              arr.push(val[i])
2110
+           }
2111
+        }
2112
+     }
2113
+     if(arr.length > 0){
2114
+        return arr[0].price
2115
+      }else{
2116
+        return 0
2117
+      }
2118
+    },
2119
+    getManufactuerNameSix(val,warehousing_id){
2120
+      var manufacturer_name = ""
2121
+      var arr= []
2122
+      if(val!=null&&val.length > 0){
2123
+        for(let i=0;i<val.length;i++){
2124
+          if(val[i].warehousing_id == warehousing_id){
2125
+            arr.push(val[i])
2126
+          }
2127
+        }
2128
+      }
2129
+      if(arr.length > 0){
2130
+         manufacturer_name = this.getManufactuerName(arr[0].manufacturer)
2131
+      }
2132
+      return manufacturer_name
2133
+    },
2134
+    getDealerNameSix(val,warehousing_id){
2135
+     var dealer_name = ""
2136
+      var arr= []
2137
+      if(val!=null&&val.length > 0){
2138
+        for(let i=0;i<val.length;i++){
2139
+          if(val[i].warehousing_id == warehousing_id){
2140
+            arr.push(val[i])
2141
+          }
2142
+        }
2143
+      }
2144
+      if(arr.length > 0){
2145
+         dealer_name = this.getDealerName(arr[0].xt_warehouse_info.dealer)
2146
+      }
2147
+      return dealer_name
2148
+    },
2149
+    getProductDate(val,warehousing_id){
2150
+      var product_date = ""
2151
+      var arr= []
2152
+      if(val!=null&&val.length > 0){
2153
+        for(let i=0;i<val.length;i++){
2154
+          if(val[i].warehousing_id == warehousing_id){
2155
+            arr.push(val[i])
2156
+          }
2157
+        }
2158
+      }
2159
+      if(arr.length > 0){
2160
+        product_date = this.getTime(arr[0].product_date, "{y}-{m}-{d}") 
2161
+      }
2162
+      return product_date
2163
+    },
2164
+    getExpiryDate(val,warehousing_id){
2165
+     var expiry_date = ""
2166
+      var arr= []
2167
+      if(val!=null&&val.length > 0){
2168
+        for(let i=0;i<val.length;i++){
2169
+          if(val[i].warehousing_id == warehousing_id){
2170
+            arr.push(val[i])
2171
+          }
2172
+        }
2173
+      }
2174
+      if(arr.length > 0){
2175
+        expiry_date = this.getTime(arr[0].xt_warehouse_info.expiry_date, "{y}-{m}-{d}") 
2176
+      }
2177
+      return expiry_date
2178
+    },
2179
+    getRegisterNumber(val,warehousing_id){
2180
+      var register_number = ""
2181
+      var arr= []
2182
+      if(val!=null&&val.length > 0){
2183
+        for(let i=0;i<val.length;i++){
2184
+          if(val[i].warehousing_id == warehousing_id){
2185
+            arr.push(val[i])
2186
+          }
2187
+        }
2188
+      }
2189
+      if(arr.length > 0){
2190
+        register_number = arr[0].xt_warehouse_info.register_number
2191
+      }
2192
+      return register_number
2193
+    },
2194
+    getRemark(val,warehousing_id){
2195
+      var remark = ""
2196
+      var arr= []
2197
+      if(val!=null&&val.length > 0){
2198
+        for(let i=0;i<val.length;i++){
2199
+          if(val[i].warehousing_id == warehousing_id){
2200
+            arr.push(val[i])
2201
+          }
2202
+        }
2203
+      }
2204
+      if(arr.length > 0){
2205
+        remark = arr[0].xt_warehouse_info.remark
2206
+      }
2207
+      return remark
2208
+    },
2209
+    getNumber(val,warehousing_id){
2210
+      var number = ""
2211
+      var arr= []
2212
+      if(val!=null&&val.length > 0){
2213
+        for(let i=0;i<val.length;i++){
2214
+          if(val[i].warehousing_id == warehousing_id){
2215
+            arr.push(val[i])
2216
+          }
2217
+        }
2218
+      }
2219
+      if(arr.length > 0){
2220
+        number = arr[0].number
2221
+      }
2222
+      return number 
2223
+    },
2224
+    // 合并单元格样式
2225
+    cellStyle({ row, column, rowIndex, columnIndex }) {
2226
+      let arr = [4,5,6,7,8,9,10,11,12,13];
2227
+      if (arr.indexOf(columnIndex) > -1) {
2228
+        return "spanClass";
2229
+      }
2230
+    },
2231
+    getCancelInfo(warehousing_id,good_id){
2232
+    console.log("warehousing_id",warehousing_id)
2233
+    console.log("good_ud2323322332",good_id)
2234
+     var count =0
2235
+     var arr = []
2236
+     for(let i=0;i<this.cancelInfoList.length;i++){
2237
+       if(warehousing_id == this.cancelInfoList[i].warehousing_id && good_id == this.cancelInfoList[i].good_id){
2238
+          arr.push(this.cancelInfoList[i])
2239
+       }
2240
+     }
2241
+     if(arr.length > 0){
2242
+      for(let i=0;i<arr.length;i++){
2243
+        count += arr[i].count
2244
+      }
2245
+     }
2246
+     if(count > 0){
2247
+      return count
2248
+     }else{
2249
+      return 0 
2250
+     }
2251
+     
2252
+     
2041
     }
2253
     }
2042
   },
2254
   },
2043
 };
2255
 };
2108
   background-color: #d0d3da;
2320
   background-color: #d0d3da;
2109
 }
2321
 }
2110
 </style>
2322
 </style>
2323
+
2324
+<style>
2325
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
2326
+  font-size: 12px;
2327
+}
2328
+
2329
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
2330
+  background: #6fb5fa;
2331
+}
2332
+
2333
+.count {
2334
+  color: #bd2c00;
2335
+}
2336
+
2337
+.el-table td,
2338
+.el-table th.is-leaf,
2339
+.el-table--border,
2340
+.el-table--group {
2341
+  border-color: #d0d3da;
2342
+}
2343
+
2344
+.el-table--border::after,
2345
+.el-table--group::after,
2346
+.el-table::before {
2347
+  background-color: #d0d3da;
2348
+}
2349
+
2350
+/* 合并表格线样式 */
2351
+.spanClass .cell {
2352
+  padding: 0 !important;
2353
+}
2354
+
2355
+.spanClass .cell tr {
2356
+  display: inline-block;
2357
+  width: 100%;
2358
+}
2359
+
2360
+.spanClass .cell tr td {
2361
+  padding: 10px 0;
2362
+  border-bottom: 1px solid #ebeef5;
2363
+  display: block;
2364
+  width: 100%;
2365
+}
2366
+.spanClass .cell tr:last-of-type td {
2367
+  border-bottom: none;
2368
+}
2369
+</style>

+ 5 - 8
src/xt_pages/stock/stockOutOrderAdd.vue ファイルの表示

19
           type="primary"
19
           type="primary"
20
           @click="submit()"
20
           @click="submit()"
21
           class="filter-item"
21
           class="filter-item"
22
+           v-loading="loading"
22
           >保 存</el-button
23
           >保 存</el-button
23
         >
24
         >
24
         <el-button
25
         <el-button
29
           v-show="showCheck"
30
           v-show="showCheck"
30
           >审核</el-button
31
           >审核</el-button
31
         >
32
         >
32
-        <!-- <el-button
33
-          size="small"
34
-          type="primary"
35
-          @click="toReturnCheck()"
36
-          class="filter-item"
37
-          v-show="showReturnCheck"
38
-          >反审核</el-button
39
-        > -->
33
+
40
       </div>
34
       </div>
41
     </div>
35
     </div>
42
 
36
 
433
       warehouseOut:{},
427
       warehouseOut:{},
434
       warehouseOut_id:0,
428
       warehouseOut_id:0,
435
       is_check:0,
429
       is_check:0,
430
+      loading:false,
436
     };
431
     };
437
   },
432
   },
438
   methods: {
433
   methods: {
651
       this.$router.go(-1);
646
       this.$router.go(-1);
652
     },
647
     },
653
     submit() {
648
     submit() {
649
+      this.loading = true
654
       this.$refs["tableForm"].validate(valid => {
650
       this.$refs["tableForm"].validate(valid => {
655
         if (valid) {
651
         if (valid) {
656
           const array = this.recordInfo.recordData;
652
           const array = this.recordInfo.recordData;
743
               return false;
739
               return false;
744
             } else {
740
             } else {
745
                var msg = response.data.data.msg
741
                var msg = response.data.data.msg
742
+               this.loading = false
746
                var good_name = response.data.data.good_name
743
                var good_name = response.data.data.good_name
747
                var specification_name = response.data.data.specification_name
744
                var specification_name = response.data.data.specification_name
748
                var storehose_name = response.data.data.storehose_name
745
                var storehose_name = response.data.data.storehose_name

+ 4 - 2
src/xt_pages/stock/stockOutOrderEdit.vue ファイルの表示

7
 
7
 
8
       <div style="float:right;">
8
       <div style="float:right;">
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
-        <el-button size="small" type="primary" @click="submit()" class="filter-item" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0">保 存</el-button>
10
+        <el-button size="small" type="primary"   v-loading="loading" @click="submit()" class="filter-item" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0">保 存</el-button>
11
        <el-button size="small" type="primary" @click="toCheck()" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">审 核</el-button>
11
        <el-button size="small" type="primary" @click="toCheck()" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">审 核</el-button>
12
        <el-button size="small" type="primary" @click="toReturnCheck()" v-if="is_check == 1 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">反 审 核</el-button>
12
        <el-button size="small" type="primary" @click="toReturnCheck()" v-if="is_check == 1 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">反 审 核</el-button>
13
       </div>
13
       </div>
401
         doctorList:[],
401
         doctorList:[],
402
         showCheck:false,
402
         showCheck:false,
403
         showReturnCheck:false,
403
         showReturnCheck:false,
404
+        loading:false,
404
       }
405
       }
405
     },
406
     },
406
     methods: {
407
     methods: {
632
         this.$router.go(-1)
633
         this.$router.go(-1)
633
       },
634
       },
634
        submit() {
635
        submit() {
635
-
636
+        this.loading = true
636
         this.$refs['tableForm'].validate((valid) => {
637
         this.$refs['tableForm'].validate((valid) => {
637
           if (valid) {
638
           if (valid) {
638
             const array = this.recordInfo.recordData
639
             const array = this.recordInfo.recordData
708
                 loading.close()
709
                 loading.close()
709
                 return false
710
                 return false
710
               } else {
711
               } else {
712
+                this.loading = false
711
                 if(response.data.data.msg == 1){
713
                 if(response.data.data.msg == 1){
712
                   this.$message.success('保存成功')
714
                   this.$message.success('保存成功')
713
                   // this.$router.back(-1)
715
                   // this.$router.back(-1)

+ 353 - 90
src/xt_pages/user/dialysisSolution.vue ファイルの表示

3
     <patient-sidebar :id="patientID" defaultActive="2-1"></patient-sidebar>
3
     <patient-sidebar :id="patientID" defaultActive="2-1"></patient-sidebar>
4
     <div class="patient-app-container app-container">
4
     <div class="patient-app-container app-container">
5
       <div class="Total">
5
       <div class="Total">
6
-        <!-- <div class="plan" >透析计划</div> -->
7
-        <!-- <table-title title="长期透析处方"></table-title> -->
8
         <div class="sum">
6
         <div class="sum">
9
-          <!-- <span>透析总频率:<el-input :value="totalrate" disabled style="width:180px"></el-input></span> -->
10
           <el-button
7
           <el-button
11
             type="primary"
8
             type="primary"
12
             size="small"
9
             size="small"
42
           min-width="50"
39
           min-width="50"
43
         >
40
         >
44
           <template slot-scope="scope">
41
           <template slot-scope="scope">
45
-            {{ modeOptions[scope.row.mode_id]?modeOptions[scope.row.mode_id].name:'' }}
42
+            {{modeOptions[scope.row.mode_id]?modeOptions[scope.row.mode_id].name:''}}
46
           </template>
43
           </template>
47
         </el-table-column>
44
         </el-table-column>
48
         <el-table-column
45
         <el-table-column
56
             {{ scope.row.dialysis_duration_minute }} 分钟
53
             {{ scope.row.dialysis_duration_minute }} 分钟
57
           </template>
54
           </template>
58
         </el-table-column>
55
         </el-table-column>
59
-        <!-- <el-table-column
60
-          prop="period"
61
-          label="频率"
62
-          align="center"
63
-          min-width="50">
64
-          <template slot-scope="scope" >
65
-              <span v-if="scope.row.parent_id === 0" >{{scope.row.period}}{{scope.row.times}}</span>
66
-              <span v-else >--</span>
67
-          </template>
68
-        </el-table-column> -->
69
-        <!-- <el-table-column
70
-          prop="name"
71
-          label="处方名"
72
-          align="center"
73
-          min-width="50">
74
-          <template slot-scope="scope" >
75
-              <span >{{scope.row.name}}{{scope.row.sub_name}}</span>
76
-          </template>
77
-        </el-table-column> -->
56
+      
78
         <el-table-column
57
         <el-table-column
79
           prop="doctor"
58
           prop="doctor"
80
           label="医生"
59
           label="医生"
107
             <span>{{ scope.row.updated_time | parseTime("{y}-{m}-{d}") }}</span>
86
             <span>{{ scope.row.updated_time | parseTime("{y}-{m}-{d}") }}</span>
108
           </template>
87
           </template>
109
         </el-table-column>
88
         </el-table-column>
110
-        <!-- <el-table-column
111
-           prop="state"
112
-           label="状态"
113
-           align="center"
114
-           min-width="40">
115
-           <template slot-scope="scope" >
116
-               <span v-if="scope.row.initiate_mode==1">启用</span>
117
-               <span v-else-if="scope.row.initiate_mode==2">停用</span>
118
-               <span v-else>未知</span>
119
-             </template>
120
-        </el-table-column> -->
89
+
90
+        <el-table-column  align="center" label="状态" width="60">
91
+          <template slot-scope="scope">
92
+            <span v-if="scope.row.solution_status == 1">生效</span>
93
+            <span v-if="scope.row.solution_status == 2">失效</span>
94
+          </template>
95
+        </el-table-column>
121
         <el-table-column label="操作" align="center" min-width="140">
96
         <el-table-column label="操作" align="center" min-width="140">
122
           <template slot-scope="scope">
97
           <template slot-scope="scope">
123
             <el-tooltip
98
             <el-tooltip
133
                 @click="openEdit(scope.$index, scope.row)"
108
                 @click="openEdit(scope.$index, scope.row)"
134
               ></el-button>
109
               ></el-button>
135
             </el-tooltip>
110
             </el-tooltip>
136
-            <!--   <el-button
137
-                 size="mini"
138
-                 type="primary"
139
-                 @click="openChildEdit(scope.$index, scope.row)" v-else>编辑</el-button>
140
-
141
-               <el-button
142
-                 size="mini"
143
-                 type="success"
144
-                 @click="openNewChild(scope.$index, scope.row)" v-if="scope.row.parent_id===0">新增</el-button>
145
-               <el-button
146
-                 size="mini"
147
-                 type="danger"
148
-                 @click="handleDelete(scope.$index, scope.row)">删除</el-button>-->
111
+
112
+
113
+             <el-tooltip
114
+              class="item"
115
+              effect="dark"
116
+              content="查看更多"
117
+              placement="top"
118
+            >
119
+              <el-button
120
+                size="small"
121
+                type="primary"
122
+                @click="toClick(scope.row)">
123
+                查看更多
124
+              </el-button>
125
+            </el-tooltip>
126
+         
149
           </template>
127
           </template>
150
         </el-table-column>
128
         </el-table-column>
151
       </el-table>
129
       </el-table>
162
         :total="total"
140
         :total="total"
163
       >
141
       >
164
       </el-pagination>
142
       </el-pagination>
143
+      
144
+      <div v-show="startShow">
145
+        <el-row :gutter="20">
146
+          <el-col :span="6"><div class="grid-content bg-purple">透析模式:{{modeOptions[current_solution.mode_id]?modeOptions[current_solution.mode_id].name:''}}</div></el-col>
147
+        </el-row>
148
+         <el-row :gutter="20">
149
+          <el-col :span="6"><div class="grid-content bg-purple">透析时长:{{current_solution.dialysis_duration_hour}}小时{{current_solution.dialysis_duration_minute}}分钟</div></el-col>
150
+          <el-col :span="6"><div class="grid-content bg-purple">血流量(ml/min):{{current_solution.blood_flow_volume}}</div></el-col>
151
+          <el-col :span="6"><div class="grid-content bg-purple">透析液配方:{{getDialysateFormulation(current_solution.dialysate_formulation)}}</div></el-col>
152
+          <el-col :span="6"><div class="grid-content bg-purple">抗凝剂:{{getAnticoagulant(current_solution.anticoagulant)}}</div></el-col>
153
+        </el-row>
154
+
155
+         <el-row :gutter="20">
156
+          <el-col :span="6"><div class="grid-content bg-purple">首剂:
157
+            <span v-if="current_solution.anticoagulant == 6">(iu)</span>
158
+            <span v-if="current_solution.anticoagulant == 7">(iu)</span>
159
+            <span v-if="current_solution.anticoagulant == 5">(mg)</span>
160
+            <span v-if="current_solution.anticoagulant == 4">(mg)</span>
161
+            <span v-if="current_solution.anticoagulant == 3">(iu)</span>
162
+            <span v-if="current_solution.anticoagulant == 2">(mg)</span>
163
+            <span v-if="current_solution.anticoagulant == 1">(mg)</span>
164
+            {{current_solution.anticoagulant_shouji}}</div></el-col>
165
+          <el-col :span="6"><div class="grid-content bg-purple">维持:
166
+              <span v-if="current_solution.anticoagulant == 7">(iu/h)</span>
167
+              <span v-if="current_solution.anticoagulant == 6">(iu/h)</span>
168
+              <span v-if="current_solution.anticoagulant == 5">(ml/h)</span>
169
+              <span v-if="current_solution.anticoagulant == 4">(mg/h)</span>
170
+              <span v-if="current_solution.anticoagulant == 3">(iu/h)</span>
171
+              <span v-if="current_solution.anticoagulant == 2">(mg/h)</span>
172
+              <span v-if="current_solution.anticoagulant == 1">(mg/h)</span>
173
+            {{current_solution.anticoagulant_weichi}}</div></el-col>
174
+          <el-col :span="6"><div class="grid-content bg-purple">总量:
175
+            <span v-if="current_solution.anticoagulant == 5">(mg)</span>
176
+            <span v-if="current_solution.anticoagulant == 6">(iu)</span>
177
+            <span v-if="current_solution.anticoagulant == 7">(iu)</span>
178
+            <span v-if="current_solution.anticoagulant == 4">(mg)</span>
179
+            <span v-if="current_solution.anticoagulant == 3">(iu)</span>
180
+            <span v-if="current_solution.anticoagulant == 2">(mg)</span>
181
+            <span v-if="current_solution.anticoagulant == 1">(mg)</span>
182
+            {{current_solution.anticoagulant_zongliang}}</div></el-col>
183
+          <el-col :span="6"><div class="grid-content bg-purple">钾(mmol/L):{{current_solution.kalium}}</div></el-col>
184
+        </el-row>
185
+
186
+       <el-row :gutter="20">
187
+          <el-col :span="6"><div class="grid-content bg-purple">钠(mmol/L):{{current_solution.sodium}}</div></el-col>
188
+          <el-col :span="6"><div class="grid-content bg-purple">钙:(mmol/L){{current_solution.calcium}}</div></el-col>
189
+          <el-col :span="6"><div class="grid-content bg-purple">透析器/灌流器:{{current_solution.dialyzer_perfusion_apparatus}}</div></el-col>
190
+        </el-row>
191
+
192
+          <el-row :gutter="20">
193
+            <el-col :span="6"><div class="grid-content bg-purple">透析器:{{current_solution.dialysis_dialyszers}}</div></el-col>
194
+            <el-col :span="6"><div class="grid-content bg-purple">灌流器:{{current_solution.dialysis_irrigation}}</div></el-col>
195
+            <el-col :span="6"><div class="grid-content bg-purple">碳酸氢盐(mmol/L):{{current_solution.bicarbonate}}</div></el-col>
196
+            <el-col :span="6"><div class="grid-content bg-purple">葡萄糖(mmol/L):{{current_solution.glucose}}</div></el-col>
197
+         </el-row>
198
+
199
+            <el-row :gutter="20">
200
+            <el-col :span="6"><div class="grid-content bg-purple">透析液流量(ml/min):{{current_solution.dialysate_flow}}</div></el-col>
201
+            <el-col :span="6"><div class="grid-content bg-purple">透析液温度(℃):{{current_solution.dialysate_temperature}}</div></el-col>
202
+            <el-col :span="6"><div class="grid-content bg-purple">电导度(mS/cm):{{current_solution.conductivity}}</div></el-col>
203
+            <el-col :span="6"><div class="grid-content bg-purple">体液过多症状:{{getBodyFluid(current_solution.body_fluid)}}</div></el-col>
204
+         </el-row>
205
+
206
+           <el-row :gutter="20">
207
+            <el-col :span="6"><div class="grid-content bg-purple">体液过多其他症状:{{current_solution.body_fluid_other}}</div></el-col>
208
+            <el-col :span="6"><div class="grid-content bg-purple">透析前使用特殊药物:{{current_solution.special_medicine}}</div></el-col>
209
+            <el-col :span="6"><div class="grid-content bg-purple">使用其他特殊药物:{{current_solution.special_medicine_other}}</div></el-col>
210
+            <el-col :span="6"><div class="grid-content bg-purple">血管通路:{{getBloodAccess(current_solution.blood_access)}}</div></el-col>
211
+         </el-row>
212
+
213
+           <el-row :gutter="20">
214
+            <el-col :span="6"><div class="grid-content bg-purple">血浆分离器:{{current_solution.plasma_separator}}</div></el-col>
215
+            <el-col :span="6"><div class="grid-content bg-purple">透析管路:{{getHemodialysisPipelines(current_solution.hemodialysis_pipelines)}}</div></el-col>
216
+            <el-col :span="6"><div class="grid-content bg-purple">透析管路支数:{{current_solution.hemodialysis_pipelines_count}}</div></el-col>
217
+            <el-col :span="6"><div class="grid-content bg-purple">穿刺针:{{current_solution.puncture_needle}}</div></el-col>
218
+         </el-row>
219
+
220
+           <el-row :gutter="20">
221
+            <el-col :span="6"><div class="grid-content bg-purple">穿刺针支数:{{current_solution.puncture_needle_count}}</div></el-col>
222
+            <el-col :span="6"><div class="grid-content bg-purple">促红素:{{current_solution.epo_count}}</div></el-col>
223
+            <el-col :span="6"><div class="grid-content bg-purple">促红素支数:{{current_solution.epo_count}}</div></el-col>
224
+            <el-col :span="6"><div class="grid-content bg-purple">最大超滤率(ml/h):{{current_solution.max_ultrafiltration_rate}}</div></el-col>
225
+         </el-row>
226
+           <el-row :gutter="20">
227
+            <el-col :span="6"><div class="grid-content bg-purple">备注:{{current_solution.remark}}</div></el-col>
228
+         </el-row>
229
+      </div>
230
+
165
     </div>
231
     </div>
166
 
232
 
233
+   
234
+
235
+
167
     <el-dialog
236
     <el-dialog
168
       :title="isEdit ? '编辑透析处方' : '新增透析处方'"
237
       :title="isEdit ? '编辑透析处方' : '新增透析处方'"
169
       :visible.sync="dialogVisible"
238
       :visible.sync="dialogVisible"
537
               </el-select>
606
               </el-select>
538
             </el-form-item>
607
             </el-form-item>
539
 
608
 
540
-            <!-- <el-form-item
541
-              label="置换方式:"
542
-              v-if="
543
-                isShows('置换液')   && (addPlan.mode == 2 || addPlan.mode == 5 || addPlan.mode == 12)
544
-              "
545
-            >
546
-              <el-select
547
-                v-model="addPlan.displace_liqui_part"
548
-                placeholder="请选择"
549
-              >
550
-                <el-option :key="0" label="请选择" :value="0"></el-option>
551
-                <el-option
552
-                  v-for="(option, index) in displace_liqui_part_option"
553
-                  :key="index"
554
-                  :label="option.name"
555
-                  :value="option.id"
556
-                ></el-option>
557
-              </el-select>
558
-            </el-form-item> -->
559
           </el-col>
609
           </el-col>
560
 
610
 
561
           <el-col :span="8" v-if="isShows('置换液总量')  && (addPlan.mode == 2 || addPlan.mode == 5 || addPlan.mode == 12)">
611
           <el-col :span="8" v-if="isShows('置换液总量')  && (addPlan.mode == 2 || addPlan.mode == 5 || addPlan.mode == 12)">
579
             </el-form-item>
629
             </el-form-item>
580
           </el-col>
630
           </el-col>
581
 
631
 
582
-          <!-- </el-row>
583
-          <el-row :gutter="20" > -->
584
           <el-col :span="8" v-if="isShows('实际超滤量')">
632
           <el-col :span="8" v-if="isShows('实际超滤量')">
585
             <el-form-item label="实际超滤量(L)">
633
             <el-form-item label="实际超滤量(L)">
586
               <el-input v-model="addPlan.ultrafiltration"></el-input>
634
               <el-input v-model="addPlan.ultrafiltration"></el-input>
729
       v-on:dialog-comfirm="innerDialogComfirm"
777
       v-on:dialog-comfirm="innerDialogComfirm"
730
       v-on:dialog-cancle="innerDialogCancle">
778
       v-on:dialog-cancle="innerDialogCancle">
731
     </multi-select-box>
779
     </multi-select-box>
780
+     
781
+
782
+
783
+
784
+    <el-dialog
785
+      :visible.sync="startDialogVisible"
786
+      width="1010px"
787
+    >
788
+      <el-table
789
+        ref="solutionTable"
790
+        :data="tableList"
791
+        border
792
+        fit
793
+        highlight-current-row
794
+        :header-cell-style="{
795
+          backgroundColor: 'rgb(245, 247, 250)',
796
+          color: '#606266'
797
+        }"
798
+        :row-style="{ color: '#303133' }"
799
+        style="width: 100%"
800
+      >
801
+        <el-table-column type="index" align="center" label="序号" width="60">
802
+        </el-table-column>
803
+        <el-table-column
804
+          prop="mode_name"
805
+          align="center"
806
+          label="透析模式"
807
+          min-width="50"
808
+        >
809
+          <template slot-scope="scope">
810
+            {{modeOptions[scope.row.mode_id]?modeOptions[scope.row.mode_id].name:''}}
811
+          </template>
812
+        </el-table-column>
813
+        <el-table-column
814
+          prop="dialysis_duration"
815
+          align="center"
816
+          label="透析时长"
817
+          min-width="50"
818
+        >
819
+          <template slot-scope="scope">
820
+            {{ scope.row.dialysis_duration_hour }} 小时
821
+            {{ scope.row.dialysis_duration_minute }} 分钟
822
+          </template>
823
+        </el-table-column>
824
+      
825
+        <el-table-column
826
+          prop="doctor"
827
+          label="医生"
828
+          align="center"
829
+          min-width="110"
830
+        >
831
+          <template slot-scope="scope">
832
+            <span>{{ getAdminUserName(scope.row.registrars_id) }}</span>
833
+          </template>
834
+        </el-table-column>
732
 
835
 
836
+        <el-table-column
837
+          prop="created_time"
838
+          align="center"
839
+          label="创建日期"
840
+          min-width="60"
841
+        >
842
+          <template slot-scope="scope">
843
+            <span>{{ scope.row.created_time | parseTime("{y}-{m}-{d}") }}</span>
844
+          </template>
845
+        </el-table-column>
846
+
847
+        <el-table-column
848
+          prop="updated_time"
849
+          align="center"
850
+          label="更新日期"
851
+          min-width="60"
852
+        >
853
+          <template slot-scope="scope">
854
+            <span>{{ scope.row.updated_time | parseTime("{y}-{m}-{d}") }}</span>
855
+          </template>
856
+        </el-table-column>
857
+        <el-table-column  align="center" label="状态" width="60">
858
+          <template slot-scope="scope">
859
+            <span v-if="scope.row.solution_status == 1">生效</span>
860
+            <span v-if="scope.row.solution_status == 2">失效</span>
861
+          </template>
862
+        </el-table-column>
863
+      </el-table>
864
+      <el-pagination
865
+        align="right"
866
+        @size-change="handleSizeChangeOne"
867
+        @current-change="handleCurrentChangeOne"
868
+        :current-page="pageOne"
869
+        :page-sizes="[10, 20, 50, 100]"
870
+        :page-size="10"
871
+        background
872
+        style="margin-top:20px;"
873
+        layout="total, sizes, prev, pager, next, jumper"
874
+        :total="totalOne"
875
+      >
876
+      </el-pagination>
877
+      <span slot="footer" class="dialog-footer">
878
+        <el-button
879
+          type="primary"
880
+          @click="startDialogVisible = false"
881
+          >取消</el-button
882
+        >
883
+        <el-button
884
+          type="primary"
885
+          @click="startDialogVisible = false"
886
+         
887
+          >确定</el-button
888
+        >
889
+      </span>
890
+    </el-dialog>
733
 
891
 
734
   </div>
892
   </div>
735
 </template>
893
 </template>
745
   editChildPatientDialysisSolution,
903
   editChildPatientDialysisSolution,
746
   editDialysisSolutionDetail,
904
   editDialysisSolutionDetail,
747
   editPatientDialysisSolution,
905
   editPatientDialysisSolution,
748
-  fetchPatientDialysisSolutions
906
+  findePatientDialysisLongSolutions,
907
+  getDialysisSolutionDetailList
749
 } from '@/api/patient'
908
 } from '@/api/patient'
750
 
909
 
751
 import { getSystemPrescription } from '@/api/config'
910
 import { getSystemPrescription } from '@/api/config'
1031
       {id:2,name:"无"}
1190
       {id:2,name:"无"}
1032
      ],
1191
      ],
1033
      oxygenShow:false,
1192
      oxygenShow:false,
1193
+     startDialogVisible:false,
1194
+     tableList:[],
1195
+     totalOne:0,
1196
+     pageOne:1,
1197
+     limitOne:10,
1198
+     startShow:false,
1034
     }
1199
     }
1035
   },
1200
   },
1036
   watch: {
1201
   watch: {
1196
     },
1361
     },
1197
 
1362
 
1198
     tableCurrentChange(current) {
1363
     tableCurrentChange(current) {
1364
+      console.log("current",current)
1365
+      this.startShow = true
1199
       if (typeof current === 'undefined' || current == null) {
1366
       if (typeof current === 'undefined' || current == null) {
1200
         this.current_solution = {
1367
         this.current_solution = {
1201
           id: 0,
1368
           id: 0,
1320
               duration: 2000
1487
               duration: 2000
1321
             })
1488
             })
1322
             this.tableData.splice(index, 1)
1489
             this.tableData.splice(index, 1)
1323
-            // if (row.parent_id>0) {
1324
-            //   this.tableData.splice(index,1);
1325
-            // }else {
1326
-            //     var resetTableData = this.tableData;
1327
-            //     this.tableData = [];
1328
-            //     var that = this;
1329
-            //     resetTableData.forEach(function(item, itemindex){
1330
-            //         if (item.id != row.id && item.parent_id != row.id) {
1331
-            //             that.tableData.push(item);
1332
-            //         }
1333
-            //     });
1334
-            // }
1490
+           
1335
           }
1491
           }
1336
         })
1492
         })
1337
       })
1493
       })
1511
               // this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time;
1667
               // this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time;
1512
 
1668
 
1513
               this.current_index = -1
1669
               this.current_index = -1
1514
-              this.fetchPatientDialysisSolutions()
1670
+              this.FindePatientDialysisLongSolutions()
1515
               return false
1671
               return false
1516
             }
1672
             }
1517
           })
1673
           })
1550
               }
1706
               }
1551
               this.total += 1
1707
               this.total += 1
1552
               // this.$refs[formName].resetFields()
1708
               // this.$refs[formName].resetFields()
1553
-              this.fetchPatientDialysisSolutions()
1709
+              this.FindePatientDialysisLongSolutions()
1554
               return false
1710
               return false
1555
             }
1711
             }
1556
           })
1712
           })
1562
     },
1718
     },
1563
     handleSizeChange(val) {
1719
     handleSizeChange(val) {
1564
       this.queryParams.limit = val
1720
       this.queryParams.limit = val
1565
-      this.fetchPatientDialysisSolutions()
1721
+      this.FindePatientDialysisLongSolutions()
1722
+    },
1723
+    handleCurrentChange(val) {
1724
+      this.queryParams.page = val
1725
+      this.FindePatientDialysisLongSolutions()
1726
+    },
1727
+   handleSizeChangeOne(val) {
1728
+      this.queryParams.limit = val
1729
+      this.FindePatientDialysisLongSolutions()
1566
     },
1730
     },
1567
     handleCurrentChange(val) {
1731
     handleCurrentChange(val) {
1568
       this.queryParams.page = val
1732
       this.queryParams.page = val
1569
-      this.fetchPatientDialysisSolutions()
1733
+      this.FindePatientDialysisLongSolutions()
1734
+    },
1735
+     handleCurrentChangeOne(val) {
1736
+      this.queryParams.page = val
1737
+      this.FindePatientDialysisLongSolutions()
1570
     },
1738
     },
1571
     openEdit(index, row) {
1739
     openEdit(index, row) {
1572
       console.log("ro2333333",row)
1740
       console.log("ro2333333",row)
1874
         }
2042
         }
1875
       })
2043
       })
1876
     },
2044
     },
1877
-    fetchPatientDialysisSolutions() {
1878
-      fetchPatientDialysisSolutions(this.queryParams).then(response => {
2045
+    FindePatientDialysisLongSolutions() {
2046
+      findePatientDialysisLongSolutions(this.queryParams).then(response => {
1879
         if (response.data.state == 1) {
2047
         if (response.data.state == 1) {
1880
           this.tableData = response.data.data.solutions
2048
           this.tableData = response.data.data.solutions
1881
           this.total = response.data.data.total
2049
           this.total = response.data.data.total
1964
       ) {
2132
       ) {
1965
         return false
2133
         return false
1966
       }
2134
       }
1967
-      // this.current_model = this.modeOptions[thismode];
1968
       this.addPlan.mode_name = this.modeOptions[thismode].name
2135
       this.addPlan.mode_name = this.modeOptions[thismode].name
1969
       const params = {
2136
       const params = {
1970
         id: thismode
2137
         id: thismode
1971
       }
2138
       }
1972
-
1973
       getSystemPrescription(params).then(response => {
2139
       getSystemPrescription(params).then(response => {
1974
         if (response.data.state == 1) {
2140
         if (response.data.state == 1) {
1975
            var prescription =   response.data.data.prescription
2141
            var prescription =   response.data.data.prescription
2153
       this.addPlan.oxygen_time = ""
2319
       this.addPlan.oxygen_time = ""
2154
      }
2320
      }
2155
     },
2321
     },
2322
+    toClick(val){
2323
+      var params = {
2324
+        mode_id:val.mode_id,
2325
+        patient_id:val.patient_id,
2326
+        page:this.pageOne,
2327
+        limit:this.limitOne,
2328
+      }
2329
+      getDialysisSolutionDetailList(params).then(response=>{
2330
+        if(response.data.state == 1){
2331
+          this.startDialogVisible = true
2332
+          var list = response.data.data.list
2333
+          this.totalOne = response.data.data.total
2334
+          this.tableList = list
2335
+        }
2336
+      })
2337
+    },
2338
+
2339
+    //修改
2340
+    getDialysateFormulation(id){
2341
+      var name = ""
2342
+      for(let i=0;i<this.dialysate_formulation.length;i++){
2343
+        if(id == this.dialysate_formulation[i].id){
2344
+          name = this.dialysate_formulation[i].name
2345
+        }
2346
+      }
2347
+      return name
2348
+    },
2349
+    getAnticoagulant(id){
2350
+      var name = ""
2351
+      if(id == 1){
2352
+         name = "无肝素"
2353
+      }
2354
+      if(id == 2){
2355
+        name = "普通肝素"
2356
+      }
2357
+      if(id == 3){
2358
+        name = "低分子肝素"
2359
+      }
2360
+      if(id == 4){
2361
+        name = "阿加曲班"
2362
+      }
2363
+      if(id == 5){
2364
+         name ="枸橼酸钠"
2365
+      }
2366
+      if(id == 6){
2367
+        name = "低分子肝素钙"
2368
+      }
2369
+      if(id == 7){
2370
+        name = "低分子肝素钠"
2371
+      }
2372
+      if(id ==8){
2373
+        name = "依诺肝素"
2374
+      }
2375
+      if(id ==9){
2376
+        name = "达肝素"
2377
+      }
2378
+      if(id ==10){
2379
+        name = "体外抗凝"
2380
+      }
2381
+      if(id ==11){
2382
+        name = "那曲肝素"
2383
+      }
2384
+      if(id ==12){
2385
+        name = "无抗凝剂"
2386
+      }
2387
+     if(id ==13){
2388
+        name = "那曲肝素钙"
2389
+      }
2390
+      return name
2391
+    },
2392
+    getBodyFluid(id){
2393
+     var name = ""
2394
+     for(let i=0;i<this.body_fluid_option.length;i++){
2395
+       if(id == this.body_fluid_option[i].id){
2396
+          name = this.body_fluid_option[i].name
2397
+       }
2398
+     }
2399
+     return name
2400
+    },
2401
+    getBloodAccess(id){
2402
+      var name = ""
2403
+      for(let i=0;i<this.blood_access_option.length;i++){
2404
+        if(id == this.blood_access_option[i].id){
2405
+           name = this.blood_access_option[i].name
2406
+        }
2407
+      }
2408
+      return name
2409
+    },
2410
+    getHemodialysisPipelines(id){
2411
+      var name = ""
2412
+      for(let i=0;i<this.hemodialysisPipelinesOptions.length;i++){
2413
+        if(id == this.hemodialysisPipelinesOptions[i].id){
2414
+            name = this.hemodialysisPipelinesOptions[i].name
2415
+        }
2416
+      }
2417
+      return name
2418
+    }
2156
   },
2419
   },
2157
   created() {
2420
   created() {
2158
     const id = this.$route.params && this.$route.params.id
2421
     const id = this.$route.params && this.$route.params.id
2170
 
2433
 
2171
     this.GetDeviceData()
2434
     this.GetDeviceData()
2172
     this.fetchAllAdminUsers()
2435
     this.fetchAllAdminUsers()
2173
-    this.fetchPatientDialysisSolutions()
2436
+    this.FindePatientDialysisLongSolutions()
2174
     this.modeOptions = this.$store.getters.treatment_mode
2437
     this.modeOptions = this.$store.getters.treatment_mode
2175
     this.anticoagulantsSet = this.$store.getters.anticoagulants_set
2438
     this.anticoagulantsSet = this.$store.getters.anticoagulants_set
2176
     this.replacementWays = this.$store.getters.replacement_ways
2439
     this.replacementWays = this.$store.getters.replacement_ways

+ 77 - 9
src/xt_pages/workforce/components/template_table.vue ファイルの表示

31
         }"
31
         }"
32
         :row-style="{ color: '#303133' }"
32
         :row-style="{ color: '#303133' }"
33
         style="width: 100%"
33
         style="width: 100%"
34
+        
34
         border
35
         border
35
       >
36
       >
36
         <el-table-column label="姓名" width="120">
37
         <el-table-column label="姓名" width="120">
95
     <div id="table_data">
96
     <div id="table_data">
96
       <el-table :height="tableContainHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" ref="table"
97
       <el-table :height="tableContainHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" ref="table"
97
                 :data="opera_device_numbers" :span-method="spanMethod"
98
                 :data="opera_device_numbers" :span-method="spanMethod"
98
-                row-class-name="table-row-new-class schedule-table-row" @cell-click="itemClick">
99
+                show-summary
100
+                :summary-method="getSummaries"
101
+                row-class-name="table-row-new-class schedule-table-row" @cell-click="itemClick"
102
+                sum-text="总数"
103
+                >
99
         <el-table-column label="分区" width="80" align="center" fixed
104
         <el-table-column label="分区" width="80" align="center" fixed
100
                          style="width: 100px; background-color: red; display: block;">
105
                          style="width: 100px; background-color: red; display: block;">
101
           <template slot-scope="scope">
106
           <template slot-scope="scope">
301
     },
306
     },
302
     watch: {
307
     watch: {
303
       'device_numbers': function() {
308
       'device_numbers': function() {
304
-        console.log("中国人民2333232333323322332",this.device_numbers)
305
         this.opera_device_numbers = this.makeDeviceNumbers(this.device_numbers)
309
         this.opera_device_numbers = this.makeDeviceNumbers(this.device_numbers)
310
+
306
         this.origin_device_numbers = this.makeDeviceNumbers(this.device_numbers)
311
         this.origin_device_numbers = this.makeDeviceNumbers(this.device_numbers)
307
       },
312
       },
308
       'template.items': function() {
313
       'template.items': function() {
462
       //     }
467
       //     }
463
       // },
468
       // },
464
       makeDeviceNumbers: function(device_numbers) {
469
       makeDeviceNumbers: function(device_numbers) {
465
-        
470
+        console.log("device_numbers",device_numbers)
471
+        var arr = []
472
+        for(let i=0;i<device_numbers.length;i++){
473
+          arr.push(device_numbers[i])
474
+        }
475
+        arr.sort(this.arraySort('sort'))
476
+        console.log("Arr2332232332",arr)
466
         var maked_device_numbers = []
477
         var maked_device_numbers = []
467
         var weekdays = [1, 2, 3, 4, 5, 6, 7] // 周一-周日
478
         var weekdays = [1, 2, 3, 4, 5, 6, 7] // 周一-周日
468
         var time_types = [1, 2, 3] // 上下晚
479
         var time_types = [1, 2, 3] // 上下晚
469
-        for (let index = 0; index < device_numbers.length; index++) {
470
-          const device_number = device_numbers[index]
480
+        for (let index = 0; index < arr.length; index++) {
481
+          const device_number = arr[index]
471
           if(device_number.zone!=null){
482
           if(device_number.zone!=null){
472
             var zone = {
483
             var zone = {
473
               id: device_number.zone.id,
484
               id: device_number.zone.id,
474
               name: device_number.zone.name,
485
               name: device_number.zone.name,
475
-              type: device_number.zone.type
486
+              type: device_number.zone.type,
487
+              sort:device_number.sort
476
             }
488
             }
477
             var device = {
489
             var device = {
478
               id: device_number.id,
490
               id: device_number.id,
479
               number: device_number.number,
491
               number: device_number.number,
480
               group_id: device_number.group_id,
492
               group_id: device_number.group_id,
481
               zone_id: device_number.zone_id,
493
               zone_id: device_number.zone_id,
482
-              zone: zone
494
+              zone: zone,
495
+              sort:device_number.sort
483
             }
496
             }
484
           }
497
           }
485
          
498
          
503
 
516
 
504
           maked_device_numbers.push(device)
517
           maked_device_numbers.push(device)
505
         }
518
         }
506
-
507
-        console.log(maked_device_numbers)
519
+        maked_device_numbers.sort(this.arraySort('sort'))
520
+        console.log("数据源23232233223232322323我",maked_device_numbers)
508
         return maked_device_numbers
521
         return maked_device_numbers
509
       },
522
       },
510
       spanMethod({ row, column, rowIndex, columnIndex }) {
523
       spanMethod({ row, column, rowIndex, columnIndex }) {
770
           this.saving = false
783
           this.saving = false
771
           this.is_editing = false
784
           this.is_editing = false
772
         })
785
         })
786
+      },
787
+     getSummaries(param) {
788
+      
789
+      const { columns, data } = param;
790
+      const sums = [];
791
+      columns.forEach((column, index) => {
792
+        if (index === 0 || index === 25) {
793
+          sums[index] = "总数";
794
+          return;
795
+        }
796
+        if (index === 1 || index === 24) {
797
+          sums[index] = data.length;
798
+          return;
799
+        }
800
+
801
+        const values = data.map(item => item[column.property]);
802
+
803
+        if (index === 23) {
804
+          sums[index] = values.reduce((prev, curr) => {
805
+            const value = Number(curr);
806
+            if (!isNaN(value)) {
807
+              return prev + curr;
808
+            } else {
809
+              return prev;
810
+            }
811
+          }, 0);
812
+          sums[index];
813
+          return;
814
+        }
815
+
816
+        sums[index] = values.reduce((prev, curr) => {
817
+          if (typeof curr["treat_mode_id"] === "undefined") {
818
+            return prev;
819
+          }
820
+          const value = Number(curr["treat_mode_id"]);
821
+          if (!isNaN(value) && value > 0) {
822
+            return prev + 1;
823
+          } else {
824
+            return prev;
825
+          }
826
+        }, 0);
827
+        sums[index];
828
+      });
829
+      this.$nextTick(() => {
830
+        this.$refs.table.doLayout();
831
+      });
832
+
833
+      return sums;
834
+    },
835
+    arraySort(property) {
836
+      return function (a, b) {
837
+          var value1 = a[property]
838
+          var value2 = b[property]
839
+          return value1 - value2
773
       }
840
       }
841
+     }
774
     }
842
     }
775
   }
843
   }
776
 </script>
844
 </script>