Bläddra i källkod

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 år sedan
förälder
incheckning
c0a45ff1df

+ 12 - 2
src/api/data.js Visa fil

@@ -148,15 +148,23 @@ export function getBaseDrugLibList(params) {
148 148
 
149 149
 
150 150
 
151
-export function createMedicineInsurancePercent(params) {
151
+export function createMedicineInsurancePercent(params,module) {
152 152
   return request({
153
-    url: '/api/medicineinsurancepercent/create',
153
+    url: '/api/medicineinsurancepercent/create?module='+module,
154 154
     method: 'post',
155 155
     data: params
156 156
   })
157 157
 }
158 158
 
159 159
 
160
+export function getMedicineInsurancePercent(type_id,module) {
161
+  return request({
162
+    url: '/api/medicineinsurancepercent/get?type_id='+type_id+"&module="+module,
163
+    method: 'get',
164
+  })
165
+}
166
+
167
+
160 168
 export function createDrugUnitSafeguard(params) {
161 169
   return request({
162 170
     url: '/api/drugunitsafeguard/create',
@@ -167,3 +175,5 @@ export function createDrugUnitSafeguard(params) {
167 175
 
168 176
 
169 177
 
178
+
179
+

+ 27 - 1
src/api/drug/drug_stock.js Visa fil

@@ -42,7 +42,7 @@ export function getDrugWarehouseInfo(params) {
42 42
 
43 43
 export function getDrugSalesReturnList(params) {
44 44
   return request({
45
-    url: '/api/salesreturn/list',
45
+    url: '/api/drugsalesreturn/list',
46 46
     method: 'get',
47 47
     params: params
48 48
   })
@@ -355,6 +355,7 @@ export function getPrintStockGood(params) {
355 355
 }
356 356
 
357 357
 
358
+
358 359
 export function getWarehouseOutUser(params) {
359 360
   return request({
360 361
     url: '/api/drugwarehouseout/user',
@@ -362,3 +363,28 @@ export function getWarehouseOutUser(params) {
362 363
     params: params
363 364
   })
364 365
 }
366
+
367
+
368
+export function createDrugStockAutomaticReduceConfig(is_open) {
369
+  return request({
370
+    url: '/api/drugstock/automaticreduce/isopen?is_open='+is_open,
371
+    method: 'post',
372
+  })
373
+}
374
+
375
+export function getDrugStockAutomaticReduceConfig() {
376
+  return request({
377
+    url: '/api/drugstockautomaticreduce/get',
378
+    method: 'get',
379
+  })
380
+}
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+

+ 46 - 38
src/router/modules/stock.js Visa fil

@@ -201,6 +201,13 @@ export default {
201 201
       hidden: true,
202 202
       is_menu: false,
203 203
       meta: { title: 'salesReturnDetail', noCache: true }
204
+    }, {
205
+      path: '/drugstock/return/detail',
206
+      component: () => import('@/xt_pages/stock/drugs/drugSalesReturnDetail'),
207
+      name: 'drugSalesReturnDetail',
208
+      hidden: true,
209
+      is_menu: false,
210
+      meta: { title: 'drugSalesReturnDetail', noCache: true }
204 211
     },
205 212
     {
206 213
       path: '/stock/return/add',
@@ -364,6 +371,7 @@ export default {
364 371
         noCache: true
365 372
       }
366 373
     },
374
+
367 375
     {
368 376
       path: '/stock/drugs/stock/in',
369 377
       component: () => import('@/xt_pages/stock/drugs/drugStockInOrder'),
@@ -394,30 +402,30 @@ export default {
394 402
     {
395 403
       path: '/stock/drugs/stock/cancel',
396 404
       component: () => import('@/xt_pages/stock/drugs/cancelDrugStockOrder'),
397
-      name: 'cancelDrugStockOrder',
398
-      hidden: true,
399
-      is_menu: false,
400
-      num: 3,
401
-      meta: { title: 'cancelDrugStockOrder', noCache: true }
402
-    },
403
-    {
404
-      path: '/stock/drugs/stock/adjustPrice',
405
-      component: () => import('@/xt_pages/stock/drugs/adjustPrice'),
406
-      name: 'drugsAdjustPrice',
407
-      hidden: true,
408
-      is_menu: false,
409
-      num: 3,
410
-      meta: { title: 'drugsAdjustPrice', noCache: true }
411
-    },
412
-    {
413
-      path: '/stock/drugs/stock/reportLoss',
414
-      component: () => import('@/xt_pages/stock/drugs/reportLoss'),
415
-      name: 'drugsReportLoss',
405
+      name: 'drugsStockCancel',
416 406
       hidden: true,
417 407
       is_menu: false,
418 408
       num: 3,
419
-      meta: { title: 'drugsReportLoss', noCache: true }
409
+      meta: { title: 'drugsStockCancel', noCache: true }
420 410
     },
411
+    // {
412
+    //   path: '/stock/drugs/stock/adjustPrice',
413
+    //   component: () => import('@/xt_pages/stock/drugs/adjustPrice'),
414
+    //   name: 'drugsAdjustPrice',
415
+    //   hidden: true,
416
+    //   is_menu: false,
417
+    //   num: 3,
418
+    //   meta: { title: 'drugsAdjustPrice', noCache: true }
419
+    // },
420
+    // {
421
+    //   path: '/stock/drugs/stock/reportLoss',
422
+    //   component: () => import('@/xt_pages/stock/drugs/reportLoss'),
423
+    //   name: 'drugsReportLoss',
424
+    //   hidden: true,
425
+    //   is_menu: false,
426
+    //   num: 3,
427
+    //   meta: { title: 'drugsReportLoss', noCache: true }
428
+    // },
421 429
     {
422 430
       path: '/stock/drugs/stock/query',
423 431
       component: () => import('@/xt_pages/stock/drugs/query'),
@@ -427,23 +435,23 @@ export default {
427 435
       num: 3,
428 436
       meta: { title: 'drugsQuery', noCache: true }
429 437
     },
430
-    {
431
-      path: '/stock/drugs/stock/drugsSurplus',
432
-      component: () => import('@/xt_pages/stock/drugs/drugsSurplus'),
433
-      name: 'drugsSurplus',
434
-      hidden: true,
435
-      is_menu: false,
436
-      num: 3,
437
-      meta: { title: 'drugsSurplus', noCache: true }
438
-    },
439
-    {
440
-      path: '/stock/drugs/stock/drugsExpiryDate',
441
-      component: () => import('@/xt_pages/stock/drugs/drugsExpiryDate'),
442
-      name: 'drugsExpiryDate',
443
-      hidden: true,
444
-      is_menu: false,
445
-      num: 3,
446
-      meta: { title: 'drugsExpiryDate', noCache: true }
447
-    },
438
+    // {
439
+    //   path: '/stock/drugs/stock/drugsSurplus',
440
+    //   component: () => import('@/xt_pages/stock/drugs/drugsSurplus'),
441
+    //   name: 'drugsSurplus',
442
+    //   hidden: true,
443
+    //   is_menu: false,
444
+    //   num: 3,
445
+    //   meta: { title: 'drugsSurplus', noCache: true }
446
+    // },
447
+    // {
448
+    //   path: '/stock/drugs/stock/drugsExpiryDate',
449
+    //   component: () => import('@/xt_pages/stock/drugs/drugsExpiryDate'),
450
+    //   name: 'drugsExpiryDate',
451
+    //   hidden: true,
452
+    //   is_menu: false,
453
+    //   num: 3,
454
+    //   meta: { title: 'drugsExpiryDate', noCache: true }
455
+    // },
448 456
   ]
449 457
 }

+ 4 - 4
src/xt_pages/data/components/configure.vue Visa fil

@@ -1,10 +1,10 @@
1 1
 <template>
2 2
     <div class="page_configure">
3 3
         <div style="width:50%;padding-right:10px;">
4
-            <div class="cell clearfix" style='margin-bottom:10px;'>
5
-                <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
6
-                <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
7
-            </div>
4
+            <!--<div class="cell clearfix" style='margin-bottom:10px;'>-->
5
+                <!--<el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>-->
6
+                <!--<el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>-->
7
+            <!--</div>-->
8 8
             <!--<el-table :data="drugList" border style="width: 100%" :row-style="{ color: '#303133' }" -->
9 9
              <!--:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" -->
10 10
               <!--highlight-current-row-->

+ 97 - 53
src/xt_pages/data/components/consumables.vue Visa fil

@@ -2,13 +2,13 @@
2 2
   <div class="page_consumables">
3 3
     <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
4 4
       <div class="cell clearfix" style="margin-bottom:0;">
5
-        <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
5
+        <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model="keywords"
6 6
                   class="filter-item"/>
7 7
         <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
8 8
                    @click="searchAction">搜索
9 9
         </el-button>
10 10
         <label class="title"><span class="name">是否启用</span> : </label>
11
-        <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择">
11
+        <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
12 12
           <el-option
13 13
             v-for="item in options"
14 14
             :key="item.value"
@@ -17,7 +17,7 @@
17 17
           </el-option>
18 18
         </el-select>
19 19
         <label class="title"><span class="name">是否收费</span> : </label>
20
-        <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择">
20
+        <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeCharge">
21 21
           <el-option
22 22
             v-for="item in options"
23 23
             :key="item.value"
@@ -26,7 +26,7 @@
26 26
           </el-option>
27 27
         </el-select>
28 28
         <span style="color: #909399;font-size:14px;">耗材种类 : &nbsp;</span>
29
-        <el-select v-model="good_kind" style="width:140px;margin-right:10px;" placeholder="请选择">
29
+        <el-select v-model="good_kind" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeKind">
30 30
           <el-option
31 31
             v-for="item,index in  getDictionaryDataConfig('system','good_kind')"
32 32
             :key="index"
@@ -50,33 +50,47 @@
50 50
       </el-table-column>
51 51
       <el-table-column label="名称" align="center">
52 52
         <template slot-scope="scope">
53
-          {{ scope.row.specification_name }}
53
+          {{ scope.row.good_name }}
54 54
         </template>
55 55
       </el-table-column>
56 56
       <el-table-column prop="date" label="规格型号" align="center">
57
+        <template slot-scope="scope">
58
+        {{ scope.row.specification_name }}
59
+        </template>
57 60
 
58 61
       </el-table-column>
59 62
       <el-table-column prop="date" label="耗材种类" width="140" align="center">
60
-
63
+        <template slot-scope="scope">
64
+          {{ getGoodKind(scope.row.good_kind) }}
65
+        </template>
61 66
       </el-table-column>
62 67
       <el-table-column label="耗材编码" width="140" align="center">
63
-
68
+        <template slot-scope="scope">
69
+          {{ scope.row.good_code }}
70
+        </template>
64 71
       </el-table-column>
65 72
 
66 73
       <el-table-column label="最小单位" width="60" align="center">
67
-
74
+        <template slot-scope="scope">
75
+          {{ getGoodUnit(scope.row.good_unit) }}
76
+        </template>
68 77
       </el-table-column>
69 78
       <el-table-column label="零售价" width="60" align="center">
70
-
79
+        <template slot-scope="scope">
80
+          {{ scope.row.retail_price }}
81
+        </template>
71 82
       </el-table-column>
72 83
       <el-table-column label="状态" width="60" align="center">
84
+        <template slot-scope="scope">
85
+        {{ scope.row.good_status}}
86
+        </template>
73 87
 
74 88
       </el-table-column>
75 89
 
76 90
       <el-table-column prop="date" label="操作" width="300" align="center">
77 91
         <template slot-scope="scope">
78 92
           <el-button @click="handleGoodInfoEdit(scope.$index, scope.row)" type="primary" size="small">编辑</el-button>
79
-          <!--<el-button type="primary" size="small" @click="clickSelfPayment">自付比例</el-button>-->
93
+          <el-button type="primary" size="small" @click="clickSelfPayment(scope.row.id)">自付比例</el-button>
80 94
           <el-button type="danger" size="small" @click="handleGoodInfoDelete(scope.$index, scope.row)">删除</el-button>
81 95
         </template>
82 96
       </el-table-column>
@@ -94,8 +108,6 @@
94 108
       :total="total"
95 109
     >
96 110
     </el-pagination>
97
-
98
-    <!--<add-consumable ref="addConsumable"></add-consumable>-->
99 111
     <good-info-dailog ref="addConsumable"
100 112
                       :titles="goodInfo.goodInfoDialog.goodInfoTitle"
101 113
                       :formValue="goodInfo.goodInfoDialog.formValue"
@@ -104,12 +116,15 @@
104 116
                       v-on:dialog-comfirm="goodInfoDialogComfirm"
105 117
                       v-on:dialog-cancle="goodInfoDialogCancle"
106 118
     ></good-info-dailog>
119
+    <self-payment ref='selfPayment'></self-payment>
120
+
107 121
   </div>
108 122
 </template>
109 123
 
110 124
 <script>
111 125
   import GoodInfoDailog from '../../stock/Dialog/goodInfoDailog'
112 126
   import { getDictionaryDataConfig } from "@/utils/data";
127
+  import selfPayment from './selfPayment'
113 128
 
114 129
   import {
115 130
     createGoodInfo,
@@ -125,6 +140,7 @@
125 140
   export default {
126 141
     components: {
127 142
       GoodInfoDailog,
143
+      selfPayment
128 144
     },
129 145
     data() {
130 146
       return {
@@ -203,6 +219,39 @@
203 219
       }
204 220
     },
205 221
     methods: {
222
+      changeKind(val){
223
+        this.getList()
224
+
225
+      },
226
+      changeCharge(val){
227
+        this.getList()
228
+
229
+      },
230
+      changeUser(val){
231
+        this.getList()
232
+
233
+
234
+      },
235
+      getGoodUnit(id){
236
+        for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
237
+          if(id == this.$store.getters.good_unit[i].id){
238
+
239
+            return this.$store.getters.good_unit[i].name
240
+          }
241
+        }
242
+        return ""
243
+      },
244
+      getGoodKind(id){
245
+        var data = this.getDictionaryDataConfig('system','good_kind')
246
+        var name = ""
247
+        for(let i = 0; i < data.length; i++){
248
+          if(id == data[i].id){
249
+            name = data[i].name
250
+          }
251
+
252
+        }
253
+        return name
254
+      },
206 255
       getDictionaryDataConfig(module,filed_name){
207 256
         return getDictionaryDataConfig(module,filed_name)
208 257
 
@@ -408,7 +457,7 @@
408 457
 
409 458
 
410 459
 
411
-            this.$refs.addConsumable.show()
460
+            this.$refs.addConsumable.show(row.id, this.goodInfo.goodInfoDialog.formValue)
412 461
           }
413 462
         })
414 463
       },
@@ -480,9 +529,11 @@
480 529
             return false
481 530
           } else {
482 531
             this.goodInfo.loading = false
483
-            for (let i = 0; i < response.data.data.list.length; i++) {
484
-              this.goodInfo.goodInfoData.push(response.data.data.list[i])
485
-            }
532
+            this.getList()
533
+
534
+            // for (let i = 0; i < response.data.data.list.length; i++) {
535
+            //   this.goodInfo.goodInfoData.push(response.data.data.list[i])
536
+            // }
486 537
           }
487 538
         })
488 539
       },
@@ -498,25 +549,25 @@
498 549
               return false
499 550
             } else {
500 551
               this.$refs.addConsumable.hide()
501
-
502
-              this.goodInfo.goodInfoData[
503
-                this.goodInfo.editGoodIndex
504
-                ].specification_name =
505
-                response.data.data.goodInfo.specification_name
506
-              this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit =
507
-                response.data.data.goodInfo.good_unit
508
-              this.goodInfo.goodInfoData[
509
-                this.goodInfo.editGoodIndex
510
-                ].buy_price = response.data.data.goodInfo.buy_price.toString()
511
-              this.goodInfo.goodInfoData[
512
-                this.goodInfo.editGoodIndex
513
-                ].sell_price = response.data.data.goodInfo.sell_price.toString()
514
-              this.goodInfo.goodInfoData[
515
-                this.goodInfo.editGoodIndex
516
-                ].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
517
-              this.goodInfo.goodInfoData[
518
-                this.goodInfo.editGoodIndex
519
-                ].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
552
+              this.getList()
553
+              // this.goodInfo.goodInfoData[
554
+              //   this.goodInfo.editGoodIndex
555
+              //   ].specification_name =
556
+              //   response.data.data.goodInfo.specification_name
557
+              // this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit =
558
+              //   response.data.data.goodInfo.good_unit
559
+              // this.goodInfo.goodInfoData[
560
+              //   this.goodInfo.editGoodIndex
561
+              //   ].buy_price = response.data.data.goodInfo.buy_price.toString()
562
+              // this.goodInfo.goodInfoData[
563
+              //   this.goodInfo.editGoodIndex
564
+              //   ].sell_price = response.data.data.goodInfo.sell_price.toString()
565
+              // this.goodInfo.goodInfoData[
566
+              //   this.goodInfo.editGoodIndex
567
+              //   ].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
568
+              // this.goodInfo.goodInfoData[
569
+              //   this.goodInfo.editGoodIndex
570
+              //   ].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
520 571
 
521 572
               this.$message.success('修改成功')
522 573
             }
@@ -529,9 +580,8 @@
529 580
               return false
530 581
             } else {
531 582
               this.$refs.addConsumable.hide()
532
-
533
-              this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
534
-
583
+              this.getList()
584
+              // this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
535 585
               this.$message.success('新增成功')
536 586
             }
537 587
           })
@@ -541,7 +591,6 @@
541 591
         this.$refs.addConsumable.hide()
542 592
       },
543 593
       showInfoDialog: function() {
544
-        this.$refs.addConsumable.show()
545 594
         this.getAllDealer()
546 595
         this.getAllManufacturer()
547 596
         this.goodInfo.goodInfoDialog.formValue.goodType = []
@@ -567,17 +616,8 @@
567 616
             }
568 617
           }
569 618
         })
570
-        this.goodInfo.goodInfoDialog.formValue.good_id = ''
571
-        this.goodInfo.goodInfoDialog.formValue.specification_name = ''
572
-        this.goodInfo.goodInfoDialog.formValue.buy_price = ''
573
-        this.goodInfo.goodInfoDialog.formValue.sell_price = ''
574
-        this.goodInfo.goodInfoDialog.formValue.remark = ''
575
-        this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
576
-        this.goodInfo.goodInfoDialog.formValue.good_type_id = ''
577
-        this.goodInfo.goodInfoDialog.formValue.dealer = ''
578
-        this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
579
-        this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
580
-        this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
619
+        this.$refs.addConsumable.show()
620
+
581 621
       },
582 622
       getAllDealer: function() {
583 623
         this.goodInfo.goodInfoDialog.formValue.dealers = []
@@ -636,8 +676,12 @@
636 676
         this.getList()
637 677
       },
638 678
       searchAction() {
639
-      },clickSelfPayment(){
640
-
679
+        this.is_use = ""
680
+        this.is_charge = ""
681
+        this.good_kind = ""
682
+        this.getList()
683
+      },clickSelfPayment(id){
684
+      this.$refs.selfPayment.show(id,2)
641 685
       },
642 686
       openForm() {
643 687
 
@@ -699,7 +743,7 @@
699 743
         this.goodInfo.goodInfoDialog.formValue.agent = ''
700 744
         this.goodInfo.goodInfoDialog.formValue.good_number = ''
701 745
 
702
-        this.$refs.addConsumable.show()
746
+        this.$refs.addConsumable.show(0)
703 747
       }
704 748
     }, created() {
705 749
       this.getList()

+ 3 - 3
src/xt_pages/data/components/drugs.vue Visa fil

@@ -80,7 +80,7 @@
80 80
       <el-table-column prop="date" label="操作" width="400" align="center">
81 81
         <template slot-scope="scope">
82 82
           <el-button @click="openForm(scope.row.id)" type="primary" size="small">编辑</el-button>
83
-          <!--<el-button type="primary" size="small" @click="clickSelfPayment">自付比例</el-button>-->
83
+          <el-button type="primary" size="small" @click="clickSelfPayment(scope.row.id)">自付比例</el-button>
84 84
           <!--<el-button type="primary" size="small" @click="clickMainTain">单位维护</el-button>-->
85 85
           <!--<el-button type="danger" size="small">删除</el-button>-->
86 86
         </template>
@@ -339,8 +339,8 @@
339 339
       searchAction() {
340 340
         this.getList()
341 341
       },
342
-      clickSelfPayment() {
343
-        this.$refs.selfPayment.show()
342
+      clickSelfPayment(drug_id) {
343
+        this.$refs.selfPayment.show(drug_id,1)
344 344
       },
345 345
       clickMainTain() {
346 346
         // this.$refs.maintain.show();

+ 168 - 40
src/xt_pages/data/components/selfPayment.vue Visa fil

@@ -1,19 +1,20 @@
1 1
 <template>
2
-    <el-dialog
2
+  <el-dialog
3 3
     title="自付比例"
4 4
     width="660px"
5 5
     :visible.sync="visible"
6 6
     :before-close="_close"
7 7
   >
8
-    <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}">
9
-        <el-table-column prop="name" label="医保类型" align="center"></el-table-column>
10
-        <el-table-column label="自付比例(%)" align="center">
11
-            <template slot-scope="scope">
12
-                <el-input v-model="input" placeholder="请输入内容"></el-input>
13
-            </template>
14
-        </el-table-column>
8
+    <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }"
9
+              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}">
10
+      <el-table-column prop="name" label="医保类型" align="center"></el-table-column>
11
+      <el-table-column label="自付比例(%)" align="center">
12
+        <template slot-scope="scope">
13
+          <el-input v-model="scope.row.percent" placeholder="请输入内容"></el-input>
14
+        </template>
15
+      </el-table-column>
15 16
     </el-table>
16
-    
17
+
17 18
     <div slot="footer" class="dialog-footer">
18 19
       <el-button @click="hide">取 消</el-button>
19 20
       <el-button type="primary" :loading="submitLoading" @click="submitAction()">保 存</el-button>
@@ -23,45 +24,172 @@
23 24
 
24 25
 
25 26
 <script>
26
-export default {
27
-    data(){
28
-        return{
29
-            visible: false,
30
-            tableData:[
27
+  import { createMedicineInsurancePercent, getMedicineInsurancePercent } from '@/api/data'
28
+
29
+  export default {
30
+    data() {
31
+      return {
32
+        visible: false,
33
+        module:0,
34
+        tableData: [
35
+          {
36
+            name: '深圳医保1档',
37
+            medicine_insurance_type: 1,
38
+            percent: '',
39
+            type_id: 0
40
+          },
41
+          {
42
+            name: '深圳医保2档',
43
+            medicine_insurance_type: 2,
44
+            type_id: 0,
45
+            percent: ''
46
+          },
47
+          {
48
+            name: '深圳医保3档',
49
+            medicine_insurance_type: 3,
50
+            type_id: 0,
51
+            percent: ''
52
+          },
53
+          {
54
+            name: '外地医保',
55
+            medicine_insurance_type: 4,
56
+            type_id: 0,
57
+            percent: ''
58
+          },
59
+          {
60
+            name: '自费',
61
+            medicine_insurance_type: 5,
62
+            percent: '',
63
+            type_id: 0
64
+          }
65
+        ]
66
+      }
67
+    },
68
+    methods: {
69
+
70
+      submitAction: function() {
71
+        let params = {
72
+          'mip': this.tableData
73
+        }
74
+        createMedicineInsurancePercent(params,this.module).then(response => {
75
+          if (response.data.state == 0) {
76
+            this.$message.error(response.data.msg)
77
+            return false
78
+          } else {
79
+            this.hide()
80
+          }
81
+
82
+        })
83
+
84
+      },
85
+      _close: function(done) {
86
+        done()
87
+      },
88
+      show(id,module) {
89
+        this.module = module
90
+        this.tableData = []
91
+        getMedicineInsurancePercent(id,module).then(response => {
92
+            if (response.data.state == 0) {
93
+              this.$message.error(response.data.msg)
94
+              return false
95
+            } else {
96
+              var temptableData = [
31 97
                 {
32
-                    name:'深圳医保1档',
33
-                    scale:0
98
+                  name: '深圳医保1档',
99
+                  medicine_insurance_type: 1,
100
+                  percent: '',
101
+                  type_id: id
34 102
                 },
35 103
                 {
36
-                    name:'深圳医保2档',
37
-                    scale:0
104
+                  name: '深圳医保2档',
105
+                  medicine_insurance_type: 2,
106
+                  type_id: id,
107
+                  percent: ''
38 108
                 },
39 109
                 {
40
-                    name:'深圳医保3档',
41
-                    scale:0
110
+                  name: '深圳医保3档',
111
+                  medicine_insurance_type: 3,
112
+                  type_id: id,
113
+                  percent: ''
42 114
                 },
43 115
                 {
44
-                    name:'外地医保',
45
-                    scale:0
116
+                  name: '外地医保',
117
+                  medicine_insurance_type: 4,
118
+                  type_id: id,
119
+                  percent: ''
46 120
                 },
47 121
                 {
48
-                    name:'自费',
49
-                    scale:0
50
-                },
51
-            ]
52
-        }
53
-    },
54
-    methods:{
55
-        _close: function(done) {
56
-            done()
57
-        },
58
-        show() {
59
-            this.visible = true
60
-        },
61
-        hide() {
62
-            // this.clear()
63
-            this.visible = false
64
-        },
122
+                  name: '自费',
123
+                  medicine_insurance_type: 5,
124
+                  percent: '',
125
+                  type_id: id
126
+                }
127
+              ]
128
+              this.tableData = temptableData
129
+
130
+              this.visible = true
131
+              for (let i = 0; i < this.tableData.length; i++) {
132
+                this.tableData[i].type_id = id
133
+              }
134
+              if (response.data.data.mip != null && response.data.data.mip.length > 0) {
135
+
136
+                for (let i = 0; i < response.data.data.mip.length; i++) {
137
+                  for (let a = 0; a < this.tableData.length; a++) {
138
+                    if (response.data.data.mip[i].medicine_insurance_type == this.tableData[a].medicine_insurance_type) {
139
+                      this.tableData[a].percent = response.data.data.mip[i].percent.toString()
140
+                    }
141
+                  }
142
+                }
143
+
144
+              }else{
145
+               var temptableData = [
146
+                  {
147
+                    name: '深圳医保1档',
148
+                    medicine_insurance_type: 1,
149
+                    percent: '',
150
+                    type_id: id
151
+                  },
152
+                  {
153
+                    name: '深圳医保2档',
154
+                    medicine_insurance_type: 2,
155
+                    type_id: id,
156
+                    percent: ''
157
+                  },
158
+                  {
159
+                    name: '深圳医保3档',
160
+                    medicine_insurance_type: 3,
161
+                    type_id: id,
162
+                    percent: ''
163
+                  },
164
+                  {
165
+                    name: '外地医保',
166
+                    medicine_insurance_type: 4,
167
+                    type_id: id,
168
+                    percent: ''
169
+                  },
170
+                  {
171
+                    name: '自费',
172
+                    medicine_insurance_type: 5,
173
+                    percent: '',
174
+                    type_id: id
175
+                  }
176
+                ]
177
+                this.tableData = temptableData
178
+
179
+
180
+
181
+              }
182
+
183
+            }
184
+
185
+          }
186
+        )
187
+
188
+      },
189
+      hide() {
190
+        // this.clear()
191
+        this.visible = false
192
+      }
65 193
     }
66
-}
194
+  }
67 195
 </script>

+ 111 - 56
src/xt_pages/stock/Dialog/goodInfoDailog.vue Visa fil

@@ -5,11 +5,12 @@
5 5
              :close-on-click-modal="isClose"
6 6
              :close-on-press-escape="isClose">
7 7
 
8
-    <el-tabs v-model="activeName" >
8
+    <el-tabs v-model="activeName">
9 9
       <el-tab-pane label="基础数据" name="first">
10 10
         <div>
11 11
           <!--:rules="rules"-->
12
-          <el-form :model="form"  ref="form" :rules="rules" label-width="100px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
12
+          <el-form :model="form" ref="form" :rules="rules" label-width="100px"
13
+                   style="display: flex;flex-wrap: wrap;justify-content: space-between;">
13 14
             <el-form-item label="耗材名称 : " prop="good_name" style="width:100%">
14 15
               <el-input v-model="form.good_name" placeholder="" maxlength="30"></el-input>
15 16
             </el-form-item>
@@ -52,7 +53,7 @@
52 53
             <el-form-item label="规格型号 : " prop="specification_name" style="width:100%">
53 54
               <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
54 55
             </el-form-item>
55
-            <el-form-item label="生产厂商 : " prop="manufacturer"  style="width:100%">
56
+            <el-form-item label="生产厂商 : " prop="manufacturer" style="width:100%">
56 57
               <el-select v-model="form.manufacturer" style="width:100%" placeholder="请选择">
57 58
                 <el-option
58 59
                   v-for="item,index in form.manufacturers"
@@ -82,7 +83,8 @@
82 83
               <el-input v-model="form.stock_warn_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
83 84
             </el-form-item>
84 85
             <el-form-item label="医保编码 : " prop="medical_insurance_number">
85
-              <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
86
+              <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder=""
87
+                        maxlength="30"></el-input>
86 88
             </el-form-item>
87 89
             <el-form-item label="是否特病目录:" prop="is_special_diseases">
88 90
               <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
@@ -115,17 +117,23 @@
115 117
               </el-select>
116 118
             </el-form-item>
117 119
             <!--<el-form-item label="代理商 : " prop="name" style="visibility: hidden;">-->
118
-              <!--<el-input style="width:160px;" v-model="form.agent" placeholder="" maxlength="30"></el-input>-->
120
+            <!--<el-input style="width:160px;" v-model="form.agent" placeholder="" maxlength="30"></el-input>-->
119 121
             <!--</el-form-item>-->
120 122
 
121 123
 
122
-
123 124
             <el-form-item label="状态 : " prop="good_status">
124
-              <el-radio-group v-model="form.good_status">
125
-                <el-radio :label="1">停用</el-radio>
126
-                <el-radio :label="2">收费</el-radio>
127
-              </el-radio-group>
125
+              <!--<el-radio-group v-model="form.good_status">-->
126
+              <!--<el-radio :label="1">停用</el-radio>-->
127
+              <!--<el-radio :label="2">收费</el-radio>-->
128
+              <!--</el-radio-group>-->
129
+
130
+              <el-checkbox-group v-model="good_status">
131
+                <el-checkbox label="停用">停用</el-checkbox>
132
+                <el-checkbox label="收费">收费</el-checkbox>
133
+              </el-checkbox-group>
128 134
             </el-form-item>
135
+
136
+
129 137
             <el-form-item label="备注 : " prop="name" style="width:100%;">
130 138
               <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="form.remark"></el-input>
131 139
             </el-form-item>
@@ -133,7 +141,8 @@
133 141
         </div>
134 142
       </el-tab-pane>
135 143
       <el-tab-pane label="扩展数据" name="second">
136
-        <el-form :model="form"    label-width="120px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
144
+        <el-form :model="form" label-width="120px"
145
+                 style="display: flex;flex-wrap: wrap;justify-content: space-between;">
137 146
           <el-form-item label="默认使用数量:" prop="name">
138 147
             <el-input v-model="form.default_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
139 148
           </el-form-item>
@@ -215,10 +224,8 @@
215 224
     </el-tabs>
216 225
 
217 226
 
218
-
219
-
220 227
     <span slot="footer" class="dialog-footer">
221
-    <el-button  @click="cancle('form')">取 消</el-button>
228
+    <el-button @click="cancle('form')">取 消</el-button>
222 229
     <el-button type="primary" @click="comfirm('form')">保 存</el-button>
223 230
   </span>
224 231
   </el-dialog>
@@ -227,15 +234,15 @@
227 234
 
228 235
 
229 236
 <script>
230
-  import { getDictionaryDataConfig } from "@/utils/data";
237
+  import { getDictionaryDataConfig } from '@/utils/data'
231 238
 
232 239
   export default {
233 240
     name: 'goodInfoDailog',
234 241
     data() {
235 242
       return {
236
-        visible:false,
237
-        formTitle:'',
238
-        activeName:'first',
243
+        visible: false,
244
+        formTitle: '',
245
+        activeName: 'first',
239 246
         options: [{
240 247
           value: '1',
241 248
           label: '是'
@@ -245,8 +252,9 @@
245 252
         }],
246 253
         good_unit: '',
247 254
         isClose: false,
255
+        good_status: [],
248 256
         size: 11,
249
-        visibility:false,
257
+        visibility: false,
250 258
         form: {
251 259
           good_id: '',
252 260
           specification_name: '',
@@ -259,28 +267,28 @@
259 267
           expiry_date_warn_day_count: '',
260 268
           stock_warn_count: '',
261 269
           is_reuse: '2',
262
-          good_name:'',
263
-          pinyin:"",
264
-          wubi:"",
265
-          good_kind:'',
266
-          medical_insurance_level:'',
267
-          good_unit:'',
268
-          retail_price:'',
269
-          medical_insurance_number:'',
270
-          is_special_diseases:'',
271
-          is_record:'',
272
-          statistics_category:'',
273
-          agent:'',
274
-          good_status:'',
275
-          default_count:'',
276
-          sign:'',
277
-          is_default:'',
278
-          is_charge_use:'',
279
-          is_charge_predict:'',
280
-          is_statistics_work:'',
281
-          sort:'',
282
-          is_doctor_use:'',
283
-          good_number:'',
270
+          good_name: '',
271
+          pinyin: '',
272
+          wubi: '',
273
+          good_kind: '',
274
+          medical_insurance_level: '',
275
+          good_unit: '',
276
+          retail_price: '',
277
+          medical_insurance_number: '',
278
+          is_special_diseases: '',
279
+          is_record: '',
280
+          statistics_category: '',
281
+          agent: '',
282
+          good_status: '',
283
+          default_count: '',
284
+          sign: '',
285
+          is_default: '',
286
+          is_charge_use: '',
287
+          is_charge_predict: '',
288
+          is_statistics_work: '',
289
+          sort: '',
290
+          is_doctor_use: '',
291
+          good_number: ''
284 292
         },
285 293
 
286 294
         rules: {
@@ -305,18 +313,16 @@
305 313
           medical_insurance_level: [
306 314
             { required: true, message: '请输入医保等级', trigger: 'blur' }
307 315
           ],
308
-          manufacturer:[
316
+          manufacturer: [
309 317
             { required: true, message: '请选择生产厂商', trigger: 'blur' }
310
-          ],good_unit:[
318
+          ], good_unit: [
311 319
             { required: true, message: '请选择单位', trigger: 'blur' }
312
-          ],retail_price:[
320
+          ], retail_price: [
313 321
             { required: true, message: '请输入零价', trigger: 'blur' }
314
-          ],stock_warn_count:[
322
+          ], stock_warn_count: [
315 323
             { required: true, message: '请输入库存警戒', trigger: 'blur' }
316 324
           ]
317 325
 
318
-
319
-
320 326
         }
321 327
       }
322 328
     },
@@ -337,15 +343,66 @@
337 343
 
338 344
     },
339 345
     methods: {
340
-      getDictionaryDataConfig(module,filed_name){
341
-       return getDictionaryDataConfig(module,filed_name)
346
+      getDictionaryDataConfig(module, filed_name) {
347
+        return getDictionaryDataConfig(module, filed_name)
342 348
 
343 349
       },
344
-      show() {
350
+      show(id,form) {
345 351
         this.visible = true
346
-        console.log(this.getDictionaryDataConfig("system","drug_type"))
352
+        this.good_status =[]
353
+        if (id == 0) {
347 354
 
348
-      },  hide() {
355
+          var tempform = {
356
+              good_id: '',
357
+              specification_name: '',
358
+              buy_price: '',
359
+              sell_price: '',
360
+              remark: '',
361
+              manufacturer: '',
362
+              good_type_id: '',
363
+              dealer: '',
364
+              expiry_date_warn_day_count: '',
365
+              stock_warn_count: '',
366
+              is_reuse: '2',
367
+              good_name: '',
368
+              pinyin: '',
369
+              wubi: '',
370
+              good_kind: '',
371
+              medical_insurance_level: '',
372
+              good_unit: '',
373
+              retail_price: '',
374
+              medical_insurance_number: '',
375
+              is_special_diseases: '',
376
+              is_record: '',
377
+              statistics_category: '',
378
+              agent: '',
379
+              good_status: '',
380
+              default_count: '',
381
+              sign: '',
382
+              is_default: '',
383
+              is_charge_use: '',
384
+              is_charge_predict: '',
385
+              is_statistics_work: '',
386
+              sort: '',
387
+              is_doctor_use: '',
388
+              good_number: ''
389
+            }
390
+          this.good_status = []
391
+          for (let key in tempform) {
392
+            this.form[key] = tempform[key]
393
+          }
394
+        } else {
395
+          for (let key in form) {
396
+            this.form[key] = form[key]
397
+          }
398
+          if (this.form.good_status.length > 0) {
399
+            for (let i = 0; i < this.form.good_status.split(",").length; i++) {
400
+              this.good_status.push(this.form.good_status.split(',')[i])
401
+            }
402
+          }
403
+        }
404
+
405
+      }, hide() {
349 406
         this.visible = false
350 407
       },
351 408
       cancle: function(formName) {
@@ -383,7 +440,7 @@
383 440
         form['is_special_diseases'] = this.form.is_special_diseases
384 441
         form['is_record'] = this.form.is_record
385 442
         form['statistics_category'] = this.form.statistics_category
386
-        form['good_status'] = this.form.good_status
443
+        // form['good_status'] = this.form.good_status
387 444
         form['default_count'] = this.form.default_count
388 445
         form['sign'] = this.form.sign
389 446
         form['is_default'] = this.form.is_default
@@ -394,9 +451,7 @@
394 451
         form['is_doctor_use'] = this.form.is_doctor_use
395 452
         form['agent'] = this.form.agent
396 453
         form['good_number'] = this.form.good_number
397
-
398
-
399
-
454
+        form['good_status'] = this.good_status.join(',')
400 455
 
401 456
         return form
402 457
       }, changeSelected: function(val) {

+ 2 - 2
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue Visa fil

@@ -264,7 +264,7 @@ export default {
264 264
     },
265 265
     AddNewOrder: function() {
266 266
       this.$router.push({
267
-        name: "cancelStockOrderAdd",
267
+        name: "cancelDrugStockOrderAdd",
268 268
         query: { type: this.type }
269 269
       });
270 270
     },
@@ -390,7 +390,7 @@ export default {
390 390
     },
391 391
     handleEdit: function(index, row) {
392 392
       this.$router.push({
393
-        name: "cancelStockDetail",
393
+        name: "cancelDrugStockDetail",
394 394
         query: { id: row.id, type: this.type }
395 395
       });
396 396
     },

+ 59 - 11
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue Visa fil

@@ -120,9 +120,9 @@
120 120
 
121 121
               <el-form-item style="padding-top: 15px">
122 122
                 <el-input
123
-                  placeholder="请输入商品类型"
124
-                  v-model="scope.row.good_type_id"
125
-                  :value="typeName(scope.row.good_type_id)"
123
+                  placeholder="请输入药品名称"
124
+                  v-model="scope.row.drug_id"
125
+                  :value="typeName(scope.row.drug_id)"
126 126
                   @focus="showDialog(scope.$index, scope.row)"
127 127
                 ></el-input>
128 128
               </el-form-item>
@@ -136,14 +136,35 @@
136 136
               <el-form-item style="padding-top: 15px">
137 137
                 <el-input
138 138
                   placeholder="请输入规格名称"
139
-                  v-model="scope.row.good_id"
140
-                  :value="specificationName(scope.row.good_id)"
139
+                  v-model="scope.row.drug_id"
140
+                  :value="specificationName(scope.row.drug_id)"
141 141
                   @focus="showDialog(scope.$index, scope.row)"
142 142
                 ></el-input>
143 143
               </el-form-item>
144 144
             </template>
145 145
           </el-table-column>
146 146
 
147
+          <el-table-column align="center" width="150">
148
+            <template slot="header" slot-scope="scope">
149
+              <span>进价<span style="color: red">*</span></span>
150
+            </template>
151
+            <template slot-scope="scope">
152
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
153
+              <el-form-item
154
+                :prop="'recordData.' + scope.$index + '.price'"
155
+                :rules="tableRules.price"
156
+                style="padding-top: 17px"
157
+              >
158
+                <el-input
159
+                  placeholder="请输入单价"
160
+                  type="number"
161
+                  v-model="scope.row.price"
162
+                ></el-input>
163
+              </el-form-item>
164
+            </template>
165
+          </el-table-column>
166
+
167
+
147 168
           <el-table-column min-width="23" align="center">
148 169
             <template slot="header" slot-scope="scope">
149 170
               <span>退库数量<span style="color: red">*</span></span>
@@ -162,6 +183,25 @@
162 183
               </el-form-item>
163 184
             </template>
164 185
           </el-table-column>
186
+
187
+          <el-table-column label="进价总价" align="center" width="150">
188
+            <template slot-scope="scope">
189
+              {{ calculate(scope.row.price * scope.row.return_count) }}
190
+            </template>
191
+          </el-table-column>
192
+
193
+
194
+          <el-table-column label="零价" align="center" width="150">
195
+            <template slot-scope="scope">
196
+              {{ scope.row.retail_price }}
197
+            </template>
198
+          </el-table-column>
199
+
200
+          <el-table-column label="零价总价" align="center" width="150">
201
+            <template slot-scope="scope">
202
+              {{ calculate(scope.row.retail_price * scope.row.return_count) }}
203
+            </template>
204
+          </el-table-column>
165 205
           <el-table-column label="操作" align="center" min-width="20">
166 206
             <template slot-scope="scope">
167 207
               <el-tooltip
@@ -270,19 +310,20 @@ export default {
270 310
       if (val.selectedGoodInfo.length > 0) {
271 311
         for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
272 312
           if (i == 0) {
273
-            this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
274
-            this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
275
-
313
+            this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
314
+            this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString();
315
+            this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString();
276 316
           } else {
277 317
             const tempForm = {}
278 318
             tempForm['drug_id'] = val.selectedGoodInfo[i].id
279 319
             tempForm["return_count"] = "";
320
+            tempForm["price"] = val.selectedGoodInfo[i].last_price.toString();
321
+            tempForm["retail_price"] =  val.selectedGoodInfo[i].retail_price.toString();
280 322
             this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
281 323
           }
282 324
         }
283 325
       }
284 326
       this.currentIndex = -1
285
-
286 327
     },
287 328
 
288 329
     cancle: function() {
@@ -322,7 +363,7 @@ export default {
322 363
 
323 364
     },
324 365
 
325
-    typeName: function(good_type_id) {
366
+    typeName: function(drug_id) {
326 367
       let name = "";
327 368
       for (let i = 0; i < this.goodInfo.length; i++) {
328 369
         if (this.goodInfo[i].id == drug_id) {
@@ -332,7 +373,7 @@ export default {
332 373
       }
333 374
       return name;
334 375
     },
335
-    specificationName: function(good_info_id) {
376
+    specificationName: function(drug_id) {
336 377
       let name = "";
337 378
       for (let i = 0; i < this.goodInfo.length; i++) {
338 379
         if (this.goodInfo[i].id == drug_id) {
@@ -345,6 +386,9 @@ export default {
345 386
       const tempObj = {};
346 387
       tempObj["drug_id"] = 0;
347 388
       tempObj["return_count"] = "";
389
+      tempObj["price"] = "";
390
+      tempObj["retail_price"] = "";
391
+
348 392
       this.recordInfo.recordData.push(tempObj);
349 393
     },
350 394
     handleDelete: function(index, row) {
@@ -495,6 +539,10 @@ export default {
495 539
     tempObj["good_type_id"] = 0;
496 540
     tempObj["good_id"] = 0;
497 541
     tempObj["return_count"] = "";
542
+    tempObj["price"] = "";
543
+    tempObj["retail_price"] = "";
544
+
545
+
498 546
     this.recordInfo.recordData.push(tempObj);
499 547
     this.GetConfigInfo();
500 548
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 65 - 7
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue Visa fil

@@ -73,8 +73,8 @@
73 73
 
74 74
             <template slot-scope="scope">
75 75
               <el-form-item style="padding-top: 15px">
76
-                <el-input placeholder="请输入药品类型" v-model="scope.row.good_type_id"
77
-                          :value="typeName(scope.row.good_type_id)"
76
+                <el-input placeholder="请输入药品类型" v-model="scope.row.drug_id"
77
+                          :value="typeName(scope.row.drug_id)"
78 78
                           @focus="showDialog(scope.$index, scope.row)"></el-input>
79 79
               </el-form-item>
80 80
             </template>
@@ -86,14 +86,34 @@
86 86
             <template slot-scope="scope">
87 87
 
88 88
               <el-form-item style="padding-top: 15px">
89
-                <el-input placeholder="请输入药品规格名称" v-model="scope.row.good_id"
90
-                          :value="specificationName(scope.row.good_id)"
89
+                <el-input placeholder="请输入药品规格名称" v-model="scope.row.drug_id"
90
+                          :value="specificationName(scope.row.drug_id)"
91 91
                           @focus="showDialog(scope.$index, scope.row)"></el-input>
92 92
               </el-form-item>
93 93
 
94 94
             </template>
95 95
           </el-table-column>
96 96
 
97
+          <el-table-column align="center" width="150">
98
+            <template slot="header" slot-scope="scope">
99
+              <span>进价<span style="color: red">*</span></span>
100
+            </template>
101
+            <template slot-scope="scope">
102
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
103
+              <el-form-item
104
+                :prop="'recordData.' + scope.$index + '.price'"
105
+                :rules="tableRules.price"
106
+                style="padding-top: 17px"
107
+              >
108
+                <el-input
109
+                  placeholder="请输入单价"
110
+                  type="number"
111
+                  v-model="scope.row.price"
112
+                ></el-input>
113
+              </el-form-item>
114
+            </template>
115
+          </el-table-column>
116
+
97 117
 
98 118
           <el-table-column min-width="23" align="center">
99 119
             <template slot="header" slot-scope="scope">
@@ -107,6 +127,25 @@
107 127
             </template>
108 128
           </el-table-column>
109 129
 
130
+          <el-table-column label="进价总价" align="center" width="150">
131
+            <template slot-scope="scope">
132
+              {{ calculate(scope.row.price * scope.row.count) }}
133
+            </template>
134
+          </el-table-column>
135
+
136
+
137
+          <el-table-column label="零价" align="center" width="150">
138
+            <template slot-scope="scope">
139
+              {{ scope.row.retail_price }}
140
+            </template>
141
+          </el-table-column>
142
+
143
+          <el-table-column label="零价总价" align="center" width="150">
144
+            <template slot-scope="scope">
145
+              {{ calculate(scope.row.retail_price * scope.row.count) }}
146
+            </template>
147
+          </el-table-column>
148
+
110 149
           <el-table-column label="操作" align="center" min-width="20">
111 150
             <template slot-scope="scope">
112 151
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
@@ -155,7 +194,7 @@
155 194
       return {
156 195
         crumbs: [
157 196
           { path: false, name: '库存管理' },
158
-          { path: false, name: '耗材退库单' },
197
+          { path: false, name: '药品退库单' },
159 198
           { path: false, name: '编辑退库单' }
160 199
         ],
161 200
 
@@ -220,12 +259,18 @@
220 259
         if (val.selectedGoodInfo.length > 0) {
221 260
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
222 261
             if (i == 0) {
262
+
223 263
               this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
264
+              this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
265
+              this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
266
+
224 267
             } else {
225 268
               const tempForm = {}
226 269
               tempForm['id'] = 0
227 270
               tempForm['drug_id'] = val.selectedGoodInfo[i].id
228 271
               tempForm['count'] = ''
272
+              tempForm['price'] = val.selectedGoodInfo[i].last_price.toString()
273
+              tempForm['retail_price'] =  val.selectedGoodInfo[i].retail_price.toString()
229 274
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
230 275
             }
231 276
           }
@@ -234,6 +279,11 @@
234 279
         this.currentIndex = -1
235 280
       }, cancle: function() {
236 281
         this.$refs.dialog.hide()
282
+      },calculate: function(val) {
283
+        if (val == 0) {
284
+          return ''
285
+        }
286
+        return Math.round(parseFloat(val) * 100) / 100
237 287
       },
238 288
       GetConfigInfo: function() {
239 289
         const loading = this.$loading({
@@ -266,7 +316,7 @@
266 316
 
267 317
       },
268 318
 
269
-      typeName: function(good_type_id) {
319
+      typeName: function(drug_id) {
270 320
         let name = "";
271 321
         for (let i = 0; i < this.goodInfo.length; i++) {
272 322
           if (this.goodInfo[i].id == drug_id) {
@@ -275,7 +325,7 @@
275 325
           }
276 326
         }
277 327
         return name;
278
-      },  specificationName: function(good_info_id) {
328
+      },  specificationName: function(drug_id) {
279 329
         console.log(this.goodInfo)
280 330
         let name = "";
281 331
         for (let i = 0; i < this.goodInfo.length; i++) {
@@ -289,6 +339,10 @@
289 339
         tempObj['id'] = 0
290 340
         tempObj['drug_id'] = 0
291 341
         tempObj['count'] = ''
342
+        tempObj['price'] = ''
343
+        tempObj['retail_price'] = ''
344
+
345
+
292 346
         this.recordInfo.recordData.push(tempObj)
293 347
       }, handleDelete: function(index, row) {
294 348
         if (row.id == 0) {
@@ -413,6 +467,8 @@
413 467
           } else {
414 468
             for (let i = 0; i < response.data.data.list.length; i++) {
415 469
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
470
+              response.data.data.list[i].price = response.data.data.list[i].price.toString()
471
+              response.data.data.list[i].retail_price = response.data.data.list[i].retail_price.toString()
416 472
               this.recordInfo.recordData.push(response.data.data.list[i])
417 473
             }
418 474
             this.cancelStock = response.data.data.info
@@ -425,6 +481,8 @@
425 481
             tempObj['id'] = 0
426 482
             tempObj['drug_id'] = 0
427 483
             tempObj['count'] = ''
484
+            tempObj['price'] = ''
485
+            tempObj['retail_price'] = ''
428 486
             this.recordInfo.recordData.push(tempObj)
429 487
           }
430 488
         })

+ 61 - 2
src/xt_pages/stock/drugs/drugSalesReturnEdit.vue Visa fil

@@ -106,6 +106,33 @@
106 106
               </template>
107 107
             </el-table-column>
108 108
 
109
+            <el-table-column align="center" width="150">
110
+              <template slot="header" slot-scope="scope">
111
+                <span>进价<span style="color: red">*</span></span>
112
+              </template>
113
+              <template slot-scope="scope">
114
+                <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
115
+                <el-form-item
116
+                  :prop="'recordData.' + scope.$index + '.price'"
117
+                  :rules="tableRules.price"
118
+                  style="padding-top: 17px"
119
+                >
120
+                  <el-input
121
+                    placeholder="请输入进价"
122
+                    type="number"
123
+                    v-model="scope.row.price"
124
+                  ></el-input>
125
+                </el-form-item>
126
+              </template>
127
+            </el-table-column>
128
+
129
+            <el-table-column label="进货总价" align="center" width="80">
130
+              <template slot-scope="scope">
131
+                {{ calculate(scope.row.price * scope.row.count) }}
132
+              </template>
133
+            </el-table-column>
134
+
135
+
109 136
 
110 137
             <el-table-column min-width="23" align="center">
111 138
               <template slot="header" slot-scope="scope">
@@ -119,6 +146,19 @@
119 146
               </template>
120 147
             </el-table-column>
121 148
 
149
+            <el-table-column label="零价" align="center" width="80">
150
+              <template slot-scope="scope">
151
+                {{ scope.row.retail_price }}
152
+              </template>
153
+            </el-table-column>
154
+
155
+            <el-table-column label="零价总价" align="center" width="80">
156
+              <template slot-scope="scope">
157
+                {{ calculate(scope.row.retail_price * scope.row.count) }}
158
+              </template>
159
+            </el-table-column>
160
+
161
+
122 162
             <el-table-column label="操作" align="center" min-width="20">
123 163
               <template slot-scope="scope">
124 164
                 <el-tooltip class="item" effect="dark" content="新增" placement="top">
@@ -227,12 +267,16 @@
227 267
           for (let i = val.selectedGoodInfo.length -1; i >= 0 ; i--) {
228 268
             if (i == 0) {
229 269
               this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
270
+              this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
271
+              this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
272
+
230 273
             } else {
231 274
               const tempForm = {}
232 275
               tempForm['id'] = 0
233 276
               tempForm['drug_id'] = val.selectedGoodInfo[i].id
234
-              tempForm['return_count'] = ''
235
-              tempForm['price'] = ''
277
+              tempForm['count'] = ''
278
+              tempForm['price'] = val.selectedGoodInfo[i].last_price.toString()
279
+              tempForm['retail_price'] = val.selectedGoodInfo[i].retail_price.toString()
236 280
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
237 281
             }
238 282
           }
@@ -295,6 +339,8 @@
295 339
         tempObj['id'] = 0
296 340
         tempObj['drug_id'] = 0
297 341
         tempObj['count'] = ''
342
+        tempObj['price'] = ''
343
+        tempObj['retail_price'] = ''
298 344
         this.recordInfo.recordData.push(tempObj)
299 345
       }, handleDelete: function(index, row) {
300 346
         console.log(row.id)
@@ -327,6 +373,12 @@
327 373
         } else {
328 374
           return ''
329 375
         }
376
+      },calculate: function(val) {
377
+        if (val == 0) {
378
+          return ''
379
+        }
380
+
381
+        return Math.round(parseFloat(val) * 100) / 100
330 382
       },
331 383
       showDialog(index, row) {
332 384
         this.currentIndex = index;
@@ -418,6 +470,9 @@
418 470
           } else {
419 471
             for (let i = 0; i < response.data.data.list.length; i++) {
420 472
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
473
+              response.data.data.list[i].price = response.data.data.list[i].price.toString()
474
+              response.data.data.list[i].retail_price = response.data.data.list[i].retail_price.toString()
475
+
421 476
               this.recordInfo.recordData.push(response.data.data.list[i])
422 477
             }
423 478
             this.salesReturn = response.data.data.salesReturn
@@ -431,6 +486,10 @@
431 486
             tempObj['id'] = 0
432 487
             tempObj['drug_id'] = 0
433 488
             tempObj['count'] = ''
489
+            tempObj['price'] = ''
490
+            tempObj['retail_price'] = ''
491
+
492
+
434 493
             this.recordInfo.recordData.push(tempObj)
435 494
           }
436 495
         })

+ 2 - 2
src/xt_pages/stock/drugs/drugSalesReturnOrder.vue Visa fil

@@ -260,7 +260,7 @@ export default {
260 260
     },
261 261
     AddNewOrder: function() {
262 262
       this.$router.push({
263
-        name: "salesReturnOrderAdd",
263
+        name: "drugSalesReturnOrderAdd",
264 264
         query: { type: this.type }
265 265
       });
266 266
     },
@@ -387,7 +387,7 @@ export default {
387 387
     },
388 388
     handleEdit: function(index, row) {
389 389
       this.$router.push({
390
-        name: "salesReturnDetail",
390
+        name: "drugSalesReturnDetail",
391 391
         query: { id: row.id, type: this.type }
392 392
       });
393 393
     },

+ 68 - 7
src/xt_pages/stock/drugs/drugSalesReturnOrderAdd.vue Visa fil

@@ -96,7 +96,34 @@
96 96
             </template>
97 97
           </el-table-column>
98 98
 
99
-          <el-table-column min-width="23" align="center">
99
+          <el-table-column align="center" width="150">
100
+            <template slot="header" slot-scope="scope">
101
+              <span>进价<span style="color: red">*</span></span>
102
+            </template>
103
+            <template slot-scope="scope">
104
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
105
+              <el-form-item
106
+                :prop="'recordData.' + scope.$index + '.price'"
107
+                :rules="tableRules.price"
108
+                style="padding-top: 17px"
109
+              >
110
+                <el-input
111
+                  placeholder="请输入进价"
112
+                  type="number"
113
+                  v-model="scope.row.price"
114
+                ></el-input>
115
+              </el-form-item>
116
+            </template>
117
+          </el-table-column>
118
+
119
+          <el-table-column label="进货总价" align="center" width="80">
120
+            <template slot-scope="scope">
121
+              {{ calculate(scope.row.price * scope.row.return_count) }}
122
+            </template>
123
+          </el-table-column>
124
+
125
+
126
+          <el-table-column align="center"  width="150">
100 127
             <template slot="header" slot-scope="scope">
101 128
               <span>退货数量<span style="color: red">*</span></span>
102 129
             </template>
@@ -108,7 +135,21 @@
108 135
             </template>
109 136
           </el-table-column>
110 137
 
111
-          <el-table-column label="操作" align="center" min-width="20">
138
+          <el-table-column label="零价" align="center" width="80">
139
+            <template slot-scope="scope">
140
+              {{ scope.row.retail_price }}
141
+            </template>
142
+          </el-table-column>
143
+
144
+          <el-table-column label="零价总价" align="center" width="80">
145
+            <template slot-scope="scope">
146
+              {{ calculate(scope.row.retail_price * scope.row.return_count) }}
147
+            </template>
148
+          </el-table-column>
149
+
150
+
151
+
152
+          <el-table-column label="操作" align="center" min-width="60">
112 153
             <template slot-scope="scope">
113 154
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
114 155
 
@@ -155,7 +196,7 @@
155 196
       return {
156 197
         crumbs: [
157 198
           { path: false, name: '库存管理' },
158
-          { path: false, name: '耗材退货单' },
199
+          { path: false, name: '药品退货单' },
159 200
           { path: false, name: '新增退货单' }
160 201
         ],
161 202
         crumbs2: [
@@ -198,7 +239,8 @@
198 239
         manufacturer: [],
199 240
         dealer: [],
200 241
         goodType: [],
201
-        goodInfo:[]
242
+        goodInfo:[],
243
+        numbers:[],
202 244
 
203 245
       }
204 246
     },
@@ -208,13 +250,16 @@
208 250
         if (val.selectedGoodInfo.length > 0) {
209 251
           for (let i = val.selectedGoodInfo.length -1; i >= 0 ; i--) {
210 252
               if (i == 0) {
211
-                this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
212
-                this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
253
+                this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
254
+                this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
255
+                this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
256
+
213 257
               } else {
214 258
                 const tempForm = {}
215 259
                 tempForm['drug_id'] = val.selectedGoodInfo[i].id
216 260
                 tempForm['return_count'] = ''
217
-                tempForm['price'] = ''
261
+                tempForm['retail_price'] = val.selectedGoodInfo[i].retail_price.toString()
262
+                tempForm['price'] =val.selectedGoodInfo[i].last_price.toString()
218 263
                 this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
219 264
               }
220 265
           }
@@ -249,6 +294,11 @@
249 294
                 }
250 295
               }
251 296
             }
297
+            // for (let i = 0; i < response.data.data.numbers.length; i++){
298
+            //   if( response.data.data.numbers[i].number.length > 0) {
299
+            //     this.numbers.push(response.data.data.numbers[i])
300
+            //   }
301
+            // }
252 302
             this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
253 303
             this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
254 304
 
@@ -296,6 +346,15 @@
296 346
         } else {
297 347
           return ''
298 348
         }
349
+      },handleEdit: function(index, row) {
350
+        const tempObj = {}
351
+        tempObj['id'] = 0
352
+        tempObj['drug_id'] = 0
353
+        tempObj['return_count'] = ''
354
+        tempObj['retail_price'] = ''
355
+        tempObj['price'] = ''
356
+        tempObj['remark'] = ''
357
+        this.recordInfo.recordData.push(tempObj)
299 358
       },
300 359
       showDialog(index, row) {
301 360
         const loading = this.$loading({
@@ -410,6 +469,8 @@
410 469
       const tempObj = {}
411 470
       tempObj['drug_id'] = 0
412 471
       tempObj['return_count'] = ''
472
+      tempObj['number'] = ''
473
+      tempObj['retail_price'] = ''
413 474
       tempObj['price'] = ''
414 475
       this.recordInfo.recordData.push(tempObj)
415 476
       console.log(this.recordInfo.recordData)

+ 1 - 1
src/xt_pages/stock/drugs/drugSalesReturnOrderDetail.vue Visa fil

@@ -92,7 +92,7 @@
92 92
       return {
93 93
         crumbs: [
94 94
           { path: false, name: '库存管理' },
95
-          { path: false, name: '耗材退货单' },
95
+          { path: false, name: '退货药品单' },
96 96
           { path: false, name: '退货单详情' }
97 97
         ],
98 98
         crumbs2: [

+ 11 - 5
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Visa fil

@@ -149,13 +149,13 @@
149 149
 
150 150
           <el-table-column label="零价" align="center" width="150">
151 151
             <template slot-scope="scope">
152
-              <!--{{ // calculate(scope.row.price * scope.row.warehousing_count) }}-->
152
+              {{ scope.row.retail_price }}
153 153
             </template>
154 154
           </el-table-column>
155 155
 
156 156
           <el-table-column label="零价总价" align="center" width="150">
157 157
             <template slot-scope="scope">
158
-              <!--{{ calculate(scope.row.price * scope.row.warehousing_count) }}-->
158
+              {{ calculate(scope.row.retail_price * scope.row.warehousing_count) }}
159 159
             </template>
160 160
           </el-table-column>
161 161
           <el-table-column align="center" width="150">
@@ -279,8 +279,8 @@
279 279
       return {
280 280
         crumbs: [
281 281
           { path: false, name: '库存管理' },
282
-          { path: false, name: '耗材入库单' },
283
-          { path: false, name: '新增入库单' }
282
+          { path: false, name: "药品入库单" },
283
+          { path: false, name: "新增入库单" }
284 284
         ],
285 285
         crumbs2: [
286 286
           { path: false, name: '库存管理' },
@@ -397,6 +397,8 @@
397 397
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
398 398
             if (i == 0) {
399 399
               this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
400
+              this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
401
+              this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
400 402
 
401 403
             } else {
402 404
               const tempForm = {}
@@ -406,7 +408,8 @@
406 408
               tempForm['product_date'] = ''
407 409
               tempForm['expiry_date'] = ''
408 410
               tempForm['warehousing_count'] = ''
409
-              tempForm['price'] = ''
411
+              tempForm['retail_price'] = val.selectedGoodInfo[i].retail_price.toString()
412
+              tempForm['price'] =  val.selectedGoodInfo[i].last_price.toString()
410 413
               tempForm['remark'] = ''
411 414
               tempForm['dealer'] = ''
412 415
               tempForm['manufacturer'] = ''
@@ -474,6 +477,7 @@
474 477
         tempObj['product_date'] = ''
475 478
         tempObj['expiry_date'] = ''
476 479
         tempObj['warehousing_count'] = ''
480
+        tempObj['retail_price'] = ''
477 481
         tempObj['price'] = ''
478 482
         tempObj['remark'] = ''
479 483
         tempObj['dealer'] = ''
@@ -598,6 +602,7 @@
598 602
         this.$refs['tableForm'].validate((valid) => {
599 603
           if (valid) {
600 604
             const array = this.recordInfo.recordData
605
+            console.log(array)
601 606
             for (let i = 0; i < array.length; i++) {
602 607
 
603 608
               if (array[i].drug_id == 0) {
@@ -654,6 +659,7 @@
654 659
       tempObj['product_date'] = ''
655 660
       tempObj['expiry_date'] = ''
656 661
       tempObj['warehousing_count'] = ''
662
+      tempObj['retail_price'] = ''
657 663
       tempObj['price'] = ''
658 664
       tempObj['remark'] = ''
659 665
       tempObj['dealer'] = ''

+ 22 - 5
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Visa fil

@@ -186,13 +186,13 @@
186 186
 
187 187
           <el-table-column label="零价" align="center" width="150">
188 188
             <template slot-scope="scope">
189
-              <!--{{ // calculate(scope.row.price * scope.row.warehousing_count) }}-->
189
+              {{ scope.row.retail_price }}
190 190
             </template>
191 191
           </el-table-column>
192 192
 
193 193
           <el-table-column label="零价总价" align="center" width="150">
194 194
             <template slot-scope="scope">
195
-              <!--{{ calculate(scope.row.price * scope.row.warehousing_count) }}-->
195
+              {{ calculate(scope.row.retail_price * scope.row.warehousing_count) }}
196 196
             </template>
197 197
           </el-table-column>
198 198
           <el-table-column align="center" width="150">
@@ -318,8 +318,8 @@ export default {
318 318
     return {
319 319
       crumbs: [
320 320
         { path: false, name: "库存管理" },
321
-        { path: false, name: "耗材入库单" },
322
-        { path: false, name: "编辑入库单" }
321
+        { path: false, name: "药品入库单" },
322
+        { path: false, name: "药品入库单" }
323 323
       ],
324 324
       crumbs2: [
325 325
         { path: false, name: "库存管理" },
@@ -380,6 +380,11 @@ export default {
380 380
           if (i == 0) {
381 381
             this.recordInfo.recordData[this.currentIndex].drug_id =
382 382
               val.selectedGoodInfo[i].id;
383
+            this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
384
+            this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
385
+
386
+
387
+
383 388
           } else {
384 389
 
385 390
             const tempForm = {};
@@ -389,10 +394,12 @@ export default {
389 394
             tempForm["product_date"] = "";
390 395
             tempForm["expiry_date"] = "";
391 396
             tempForm["warehousing_count"] = "";
392
-            tempForm["price"] = "";
397
+            tempForm["price"] = val.selectedGoodInfo[i].last_price.toString();
393 398
             tempForm["remark"] = "";
394 399
             tempForm["dealer"] = "";
395 400
             tempForm["manufacturer"] = "";
401
+            tempForm["retail_price"] = val.selectedGoodInfo[i].retail_price.toString();
402
+
396 403
             this.recordInfo.recordData.splice(
397 404
               this.currentIndex + 1,
398 405
               0,
@@ -472,6 +479,9 @@ export default {
472 479
       tempObj["remark"] = "";
473 480
       tempObj["dealer"] = "";
474 481
       tempObj["manufacturer"] = "";
482
+      tempObj['retail_price'] = ""
483
+
484
+
475 485
       this.recordInfo.recordData.push(tempObj);
476 486
     },
477 487
     handleDelete: function(index, row) {
@@ -623,6 +633,11 @@ export default {
623 633
             response.data.data.info[i].price = response.data.data.info[
624 634
               i
625 635
             ].price.toString();
636
+
637
+            response.data.data.info[i].retail_price = response.data.data.info[
638
+              i
639
+              ].retail_price.toString();
640
+
626 641
             response.data.data.info[
627 642
               i
628 643
             ].warehousing_count = response.data.data.info[
@@ -653,6 +668,8 @@ export default {
653 668
             tempObj["remark"] = "";
654 669
             tempObj["dealer"] = "";
655 670
             tempObj["manufacturer"] = "";
671
+            tempObj['retail_price'] = ""
672
+
656 673
             this.recordInfo.recordData.push(tempObj);
657 674
           }
658 675
         }

+ 1 - 1
src/xt_pages/stock/drugs/drugStockOutOrder.vue Visa fil

@@ -373,7 +373,7 @@ export default {
373 373
 
374 374
     handleEdit: function(index, row) {
375 375
       this.$router.push({
376
-        name: "stockOutDetail",
376
+        name: "drugStockOutDetail",
377 377
         query: { id: row.id, type: this.type }
378 378
       });
379 379
     },

+ 27 - 12
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Visa fil

@@ -138,7 +138,7 @@
138 138
 
139 139
           <el-table-column min-width="23" align="center">
140 140
             <template slot="header" slot-scope="scope">
141
-              <span>价<span style="color: red">*</span></span>
141
+              <span>价<span style="color: red">*</span></span>
142 142
             </template>
143 143
             <template slot-scope="scope">
144 144
               <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
@@ -148,7 +148,7 @@
148 148
                 style="padding-top: 17px"
149 149
               >
150 150
                 <el-input
151
-                  placeholder="请输入价"
151
+                  placeholder="请输入价"
152 152
                   type="number"
153 153
                   v-model="scope.row.price"
154 154
                 ></el-input>
@@ -175,11 +175,26 @@
175 175
             </template>
176 176
           </el-table-column>
177 177
 
178
-          <el-table-column label="总价" min-width="20" align="center">
178
+          <el-table-column label="进价总价" min-width="20" align="center">
179 179
             <template slot-scope="scope">
180 180
               {{ calculate(scope.row.price * scope.row.count) }}
181 181
             </template>
182 182
           </el-table-column>
183
+
184
+
185
+          <el-table-column label="零价" align="center" width="150">
186
+            <template slot-scope="scope">
187
+              {{ scope.row.retail_price }}
188
+            </template>
189
+          </el-table-column>
190
+
191
+          <el-table-column label="零价总价" align="center" width="150">
192
+            <template slot-scope="scope">
193
+              {{ calculate(scope.row.retail_price * scope.row.count) }}
194
+            </template>
195
+          </el-table-column>
196
+
197
+
183 198
           <el-table-column label="备注" min-width="20" align="center">
184 199
             <template slot-scope="scope">
185 200
               <el-input v-model="scope.row.remark"></el-input>
@@ -239,7 +254,7 @@ export default {
239 254
     return {
240 255
       crumbs: [
241 256
         { path: false, name: "库存管理" },
242
-        { path: false, name: "耗材出库单" },
257
+        { path: false, name: "药品出库单" },
243 258
         { path: false, name: "新增出库单" }
244 259
       ],
245 260
       crumbs2: [
@@ -295,12 +310,15 @@ export default {
295 310
         for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
296 311
           if (i == 0) {
297 312
             this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
313
+            this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
314
+            this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
298 315
 
299 316
           } else {
300 317
             const tempForm = {}
301 318
             tempForm['drug_id'] = val.selectedGoodInfo[i].id
319
+            tempForm['retail_price'] = val.selectedGoodInfo[i].retail_price.toString()
320
+            tempForm['price'] =  val.selectedGoodInfo[i].last_price.toString()
302 321
             tempForm['count'] = ''
303
-            tempForm['price'] = ''
304 322
             tempForm['remark'] = ''
305 323
             this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
306 324
           }
@@ -400,6 +418,7 @@ export default {
400 418
       tempObj["drug_id"] = 0;
401 419
       tempObj["count"] = "";
402 420
       tempObj["price"] = "";
421
+      tempObj["retail_price"] = "";
403 422
       tempObj["remark"] = "";
404 423
 
405 424
       this.recordInfo.recordData.push(tempObj);
@@ -492,12 +511,8 @@ export default {
492 511
           const array = this.recordInfo.recordData;
493 512
           let total = 0;
494 513
           for (let i = 0; i < array.length; i++) {
495
-            if (array[i].good_type_id == 0) {
496
-              this.$message.error("商品类型不能为空");
497
-              return;
498
-            }
499
-            if (array[i].good_id == 0) {
500
-              this.$message.error("规格名称不能为空");
514
+            if (array[i].drug_id == 0) {
515
+              this.$message.error("药品名称或者药品规格名称不能为空");
501 516
               return;
502 517
             }
503 518
             total = total + array[i].price * array[i].return_count;
@@ -510,7 +525,6 @@ export default {
510 525
           const params = {
511 526
             stockOut: this.recordInfo.recordData
512 527
           };
513
-          console.log(this.form.dealer);
514 528
 
515 529
           postDrugWarehouseOut(
516 530
             params,
@@ -557,6 +571,7 @@ export default {
557 571
     tempObj["price"] = "";
558 572
     tempObj["remark"] = "";
559 573
 
574
+
560 575
     this.recordInfo.recordData.push(tempObj);
561 576
     this.GetConfigInfo();
562 577
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 3 - 3
src/xt_pages/stock/drugs/drugStockOutOrderDetail.vue Visa fil

@@ -114,7 +114,7 @@
114 114
     components: { BreadCrumb },
115 115
     created() {
116 116
       const order_id = this.$route.query.id
117
-      this.GetConfigInfo()
117
+      // this.GetConfigInfo()
118 118
       this.GetOrderDetail(order_id)
119 119
     },
120 120
     data() {
@@ -225,7 +225,7 @@
225 225
             this.pos = 0
226 226
           } else {
227 227
             // 判断当前元素与上一个元素是否相同
228
-            if (this.warehousingOutInfo.warehousingOutData[i].good_type_id === this.warehousingOutInfo.warehousingOutData[i - 1].good_type_id) {
228
+            if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
229 229
               this.tempArr[this.pos] += 1
230 230
               this.tempArr.push(0)
231 231
             } else {
@@ -241,7 +241,7 @@
241 241
           if (index === 0) {
242 242
             sameRowArr.push([index])
243 243
           } else {
244
-            if (item.good_type_id === this.warehousingOutInfo.warehousingOutData[index - 1].good_type_id) {
244
+            if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
245 245
               sameRowArr[sIdx].push(index)
246 246
             } else {
247 247
               sIdx = sIdx + 1

+ 34 - 6
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Visa fil

@@ -113,7 +113,7 @@
113 113
 
114 114
           <el-table-column min-width="23" align="center">
115 115
             <template slot="header" slot-scope="scope">
116
-              <span>价<span style="color: red">*</span></span>
116
+              <span>价<span style="color: red">*</span></span>
117 117
             </template>
118 118
             <template slot-scope="scope">
119 119
               <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
@@ -138,11 +138,26 @@
138 138
             </template>
139 139
           </el-table-column>
140 140
 
141
-          <el-table-column label="总价" min-width="20" align="center">
141
+          <el-table-column label="进价总价" min-width="20" align="center">
142 142
             <template slot-scope="scope">
143 143
               {{calculate(scope.row.price*scope.row.count)}}
144 144
             </template>
145 145
           </el-table-column>
146
+
147
+
148
+          <el-table-column label="零价" align="center" width="150">
149
+            <template slot-scope="scope">
150
+              {{ scope.row.retail_price }}
151
+            </template>
152
+          </el-table-column>
153
+
154
+          <el-table-column label="零价总价" align="center" width="150">
155
+            <template slot-scope="scope">
156
+              {{ calculate(scope.row.retail_price * scope.row.count) }}
157
+            </template>
158
+          </el-table-column>
159
+
160
+
146 161
           <el-table-column label="备注" min-width="20" align="center">
147 162
             <template slot-scope="scope">
148 163
               <el-input v-model="scope.row.remark"></el-input>
@@ -194,7 +209,7 @@
194 209
       return {
195 210
         crumbs: [
196 211
           { path: false, name: '库存管理' },
197
-          { path: false, name: '耗材出库单' },
212
+          { path: false, name: '药品出库单' },
198 213
           { path: false, name: '编辑出库单' }
199 214
         ],
200 215
         crumbs2: [
@@ -258,18 +273,26 @@
258 273
         this.propForm.goods = [];
259 274
 
260 275
         if (val.selectedGoodInfo.length > 0) {
261
-          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
276
+          for (let i = val.selectedGoodInfo.length - 1;i >= 0 ; i--) {
262 277
             if (i == 0) {
263 278
 
264 279
               this.recordInfo.recordData[this.currentIndex].drug_id =
265 280
                 val.selectedGoodInfo[i].id;
266 281
 
282
+              this.recordInfo.recordData[this.currentIndex].price =
283
+                val.selectedGoodInfo[i].last_price.toString();
284
+
285
+              this.recordInfo.recordData[this.currentIndex].retail_price =
286
+                val.selectedGoodInfo[i].retail_price.toString();
287
+
267 288
             } else {
268 289
               const tempForm = {};
269 290
               tempForm["id"] = 0;
270 291
               tempForm["drug_id"] = val.selectedGoodInfo[i].id;
292
+              tempForm["retail_price"] = val.selectedGoodInfo[i].retail_price.toString();
293
+
271 294
               tempForm["count"] = "";
272
-              tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
295
+              tempForm["price"] = val.selectedGoodInfo[i].last_price.toString();
273 296
               tempForm["remark"] = "";
274 297
               this.recordInfo.recordData.splice(
275 298
                 this.currentIndex + 1,
@@ -336,6 +359,8 @@
336 359
         const tempObj = {}
337 360
         tempObj['id'] = 0
338 361
         tempObj['drug_id'] = 0
362
+        tempObj['retail_price'] = ''
363
+
339 364
         tempObj['count'] = ''
340 365
         tempObj['price'] = ''
341 366
         tempObj['remark'] = ''
@@ -390,7 +415,7 @@
390 415
             this.$message.error(response.data.msg);
391 416
             return false;
392 417
           } else {
393
-            if (response.data.data.goodInfo.length <= 0) {
418
+            if (response.data.data.drugs.length <= 0) {
394 419
               this.$message.error("该厂商或经销商没有药品信息");
395 420
               return;
396 421
             }
@@ -460,6 +485,7 @@
460 485
           } else {
461 486
             for (let i = 0; i < response.data.data.list.length; i++) {
462 487
               response.data.data.list[i].price = response.data.data.list[i].price.toString()
488
+              response.data.data.list[i].retail_price = response.data.data.list[i].retail_price.toString()
463 489
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
464 490
               this.recordInfo.recordData.push(response.data.data.list[i])
465 491
             }
@@ -474,6 +500,8 @@
474 500
             const tempObj = {}
475 501
             tempObj['id'] = 0
476 502
             tempObj['drug_id'] = 0
503
+            tempObj['retail_price'] = ''
504
+
477 505
             tempObj['count'] = ''
478 506
             tempObj['price'] = ''
479 507
             tempObj['remark'] = ''

+ 16 - 5
src/xt_pages/stock/drugs/drugsStockDialog/index.vue Visa fil

@@ -54,23 +54,34 @@
54 54
             property="drug_spec"
55 55
             style="word-break: keep-all;white-space:nowrap;"
56 56
           ></el-table-column>
57
+          <!--<el-table-column-->
58
+            <!--align="center"-->
59
+            <!--label="单位"-->
60
+            <!--property="good_unit"-->
61
+          <!--&gt;-->
62
+            <!--<template slot-scope="scope">-->
63
+              <!--&lt;!&ndash;<span>{{getName(scope.row.good_unit)}}</span>&ndash;&gt;-->
64
+            <!--</template>-->
65
+          <!--</el-table-column>-->
66
+
57 67
           <el-table-column
58 68
             align="center"
59
-            label="单位"
60
-            property="good_unit"
69
+            label="上次进货价"
70
+            property="buy_price"
61 71
           >
62 72
             <template slot-scope="scope">
63
-              <!--<span>{{getName(scope.row.good_unit)}}</span>-->
73
+              <span>{{scope.row.last_price}}</span>
64 74
             </template>
65 75
           </el-table-column>
66 76
 
77
+
67 78
           <el-table-column
68 79
             align="center"
69
-            label="价"
80
+            label="零售价"
70 81
             property="buy_price"
71 82
           >
72 83
             <template slot-scope="scope">
73
-              <!--<span>{{scope.row.buy_price}}</span>-->
84
+              <span>{{scope.row.retail_price}}</span>
74 85
             </template>
75 86
           </el-table-column>
76 87
 

+ 375 - 166
src/xt_pages/stock/drugs/query.vue Visa fil

@@ -1,193 +1,402 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
6
-      <el-button
7
-        size="small"
8
-        @click="handleWarehouse"
9
-        class="filter-item"
10
-        style="float:right;"
11
-        type="primary"
12
-        icon="el-icon-circle-plus-outline"
13
-        >新增</el-button
14
-      >
15 5
     </div>
6
+    <div class="app-container ">
7
+      <div class="cell clearfix">
8
+        <el-input
9
+          size="small"
10
+          style="width: 400px;"
11
+          class="filter-item"
12
+          v-model.trim="keywords"
13
+          placeholder="商品名称/规格名称"
14
+        />
15
+        <el-button
16
+          size="small"
17
+          class="filter-item"
18
+          type="primary"
19
+          icon="el-icon-search"
20
+          @click="search"
21
+        >搜索</el-button
22
+        >
23
+      </div>
16 24
 
17
-    <div class="app-container">
18
-        <div class="cell clearfix">
19
-            <el-input
20
-            size="small"
21
-            style="width: 400px;"
22
-            v-model.trim="searchKey"
23
-            class="filter-item"
24
-            placeholder="单据编码/制单人/厂商"
25
-            />
26
-            <el-button
27
-            style="margin-right:10px;"
28
-            size="small"
29
-            class="filter-item"
30
-            type="primary"
31
-            icon="el-icon-search"
32
-            @click="search"
33
-            >搜索</el-button
34
-            >
35
-            <label class="title"><span class="name">报损日期</span> : </label>
36
-            <el-date-picker
37
-            size="small"
38
-            v-model="start_time"
39
-            prefix-icon="el-icon-date"
40
-            :editable="false"
41
-            style="width: 196px;"
42
-            type="date"
43
-            placeholder="选择日期时间"
44
-            align="right"
45
-            format="yyyy-MM-dd"
46
-            value-format="yyyy-MM-dd"
47
-            @change="startTimeChange"
48
-            ></el-date-picker>
49
-            <span class="cellLine"> - </span>
50
-            <el-date-picker
51
-            size="small"
52
-            v-model="end_time"
53
-            prefix-icon="el-icon-date"
54
-            :editable="false"
55
-            style="width: 196px;"
56
-            type="date"
57
-            placeholder="选择日期时间"
58
-            align="right"
59
-            format="yyyy-MM-dd"
60
-            value-format="yyyy-MM-dd"
61
-            @change="endTimeChange"
62
-            ></el-date-picker>
63
-        </div>
64
-
65
-        <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
66
-            <el-table-column align="center" prop="dialysis_no" label="单据编码">
67
-                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
68
-            </el-table-column>
69
-            <el-table-column align="center" prop="name" label="药品名称">
70
-                <template slot-scope="scope">{{ scope.row.name }}</template>
71
-            </el-table-column>
72
-            <el-table-column align="center" prop="dialysis_no" label="规格名称">
73
-                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
74
-            </el-table-column>
75
-            <el-table-column align="center" prop="name" label="批号">
76
-                <template slot-scope="scope">{{ scope.row.name }}</template>
77
-            </el-table-column>
78
-            <el-table-column align="center" prop="name" label="数量">
79
-                <template slot-scope="scope">{{ scope.row.name }}</template>
80
-            </el-table-column>
81
-            <el-table-column align="center" prop="name" label="原零价">
82
-                <template slot-scope="scope">{{ scope.row.name }}</template>
83
-            </el-table-column>
84
-            <el-table-column align="center" prop="name" label="现零价">
85
-                <template slot-scope="scope">{{ scope.row.name }}</template>
86
-            </el-table-column>
87
-            <el-table-column align="center" prop="name" label="操作人">
88
-                <template slot-scope="scope">{{ scope.row.name }}</template>
89
-            </el-table-column>
90
-        </el-table>
91
-
92
-
93
-      
94
-
95
-        <el-pagination
96
-            @size-change="handleSizeChange"
97
-            @current-change="handleCurrentChange"
98
-            :page-sizes="[10, 50, 100]"
99
-            :page-size="10"
100
-            background
101
-            style="margin-top:20px;float: right"
102
-            layout="total, sizes, prev, pager, next, jumper"
103
-            :total="total"
25
+      <div class="cell clearfix">
26
+        <el-button
27
+          size="small"
28
+          class="filter-item"
29
+          type="primary"
30
+          icon="el-icon-search"
31
+          @click="setting"
32
+        >设置</el-button
104 33
         >
105
-        </el-pagination>
34
+      </div>
35
+
36
+      <el-table
37
+        :row-style="{ color: '#303133' }"
38
+        :header-cell-style="{
39
+          backgroundColor: 'rgb(245, 247, 250)',
40
+          color: '#606266'
41
+        }"
42
+        :data="WarehouseInfo.warehouseInfoDate"
43
+        :class="signAndWeighBoxPatients"
44
+        border
45
+        v-loading="WarehouseInfo.loading"
46
+        :span-method="merge"
47
+
48
+      >
49
+        <el-table-column label="药品名称" align="center">
50
+          <template slot-scope="scope">
51
+            {{ scope.row.drug_name }}
52
+          </template>
53
+        </el-table-column>
54
+        <el-table-column label="规格名称" align="center">
55
+          <template slot-scope="scope">
56
+            <span>{{ scope.row.drug_spec }}</span>
57
+          </template>
58
+        </el-table-column>
59
+        <el-table-column label="入库数量" align="center">
60
+          <template slot-scope="scope">
61
+            <span
62
+              @click="showStockInDetailDialog(scope.row.drug_id)"
63
+            >{{ stockInCount(scope.row) }}</span
64
+            >
65
+          </template>
66
+        </el-table-column>
67
+        <el-table-column label="入库退货" align="center">
68
+          <template slot-scope="scope">
69
+            <span
70
+              @click="showSaleReturnDetailDialog(scope.row)"
71
+            >{{ salesReturnCount(scope.row) }}</span
72
+            >
73
+          </template>
74
+        </el-table-column>
75
+        <el-table-column label="实际入库" align="center">
76
+          <template slot-scope="scope">
77
+            {{ stockInCount(scope.row) - salesReturnCount(scope.row) }}
78
+          </template>
79
+        </el-table-column>
80
+        <el-table-column label="出库数量" align="center">
81
+          <template slot-scope="scope">
82
+            <span
83
+              @click="showStockOutDetailDialog(scope.row.drug_id)"
84
+            >{{ stockOutCount(scope.row) }}</span
85
+            >
86
+          </template>
87
+        </el-table-column>
88
+        <el-table-column label="出库退库" align="center">
89
+          <template slot-scope="scope">
90
+            <span
91
+              @click="showCancelStockDetailDialog(scope.row)"
92
+            >{{ cancelStockCount(scope.row) }}</span
93
+            >
94
+          </template>
95
+        </el-table-column>
96
+        <el-table-column label="实际出库" align="center">
97
+          <template slot-scope="scope">
98
+            {{ stockOutCount(scope.row) - cancelStockCount(scope.row) }}
99
+          </template>
100
+        </el-table-column>
101
+
102
+        <el-table-column label="剩余库存" align="center">
103
+          <template slot-scope="scope">
104
+            <span>{{
105
+              stockInCount(scope.row) -
106
+                salesReturnCount(scope.row) -
107
+                stockOutCount(scope.row) +
108
+                cancelStockCount(scope.row)
109
+            }}</span>
110
+          </template>
111
+        </el-table-column>
112
+      </el-table>
113
+      <el-pagination
114
+        @size-change="handleSizeChange"
115
+        @current-change="handleCurrentChange"
116
+        :page-sizes="[10, 50, 100]"
117
+        :page-size="10"
118
+        background
119
+        align="right"
120
+        style="margin-top:20px;"
121
+        layout="total, sizes, prev, pager, next, jumper"
122
+        :total="total"
123
+      >
124
+      </el-pagination>
106 125
     </div>
126
+
127
+    <setting-dialog
128
+      ref="dialog"
129
+    ></setting-dialog>
130
+
107 131
   </div>
108 132
 </template>
109 133
 
110 134
 <script>
111
-import BreadCrumb from "../../components/bread-crumb";
112
-
113
-export default {
114
-  name: "stockIn",
115
-  components: { BreadCrumb },
116
-  created() {
117
-    
118
-  },
119
-  data() {
120
-    return {
135
+  import { uParseTime } from '@/utils/tools'
136
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
137
+  import { getAllDrugStockQueryList } from '@/api/drug/drug_stock'
138
+  import SettingDialog from './settingDialog/index'
139
+
140
+  export default {
141
+    name: "stockIn",
142
+    created() {
143
+      this.GetAllDrugStockQueryList();
144
+    },
145
+    components: {
146
+      SettingDialog,
147
+      BreadCrumb
148
+    },
149
+    data() {
150
+      return {
121 151
         crumbs: [
122
-            { path: false, name: "库存管理" },
123
-            { path: false, name: "入库单" }
152
+          { path: false, name: "库存管理" },
153
+          { path: "/stock/drugs/stock/query", name: "药品库存查询" }
124 154
         ],
125
-        searchKey: "",
126
-        tableData: [{
127
-            date: '2016-05-02',
128
-            name: '王小虎',
129
-            address: '上海市普陀区金沙江路 1518 弄'
130
-            }, {
131
-            date: '2016-05-04',
132
-            name: '王小虎',
133
-            address: '上海市普陀区金沙江路 1517 弄'
134
-            }, {
135
-            date: '2016-05-01',
136
-            name: '王小虎',
137
-            address: '上海市普陀区金沙江路 1519 弄'
138
-            }, {
139
-            date: '2016-05-03',
140
-            name: '王小虎',
141
-            address: '上海市普陀区金沙江路 1516 弄'
142
-        }]
143
-      
144
-    };
145
-  },
146
-  methods: {
147
-    
148
-  }
149
-};
155
+        keywords: "",
156
+        total: 0,
157
+        multipleSelection: [],
158
+        signAndWeighBoxPatients: "sign-and-weigh-box-patients",
159
+        start_time: "",
160
+        end_time: "",
161
+        page: 1,
162
+        limit: 10,
163
+        goodType: [],
164
+        goodInfo: [],
165
+        tempArr:[],
166
+        sameRowArr: [],
167
+        WarehouseInfo: {
168
+          loading: false,
169
+          warehouseInfoDate: []
170
+        }
171
+      };
172
+    },
173
+    methods: {
174
+      handleSpanTempArr(){
175
+        this.tempArr = []
176
+
177
+        for (let i = 0; i < this.WarehouseInfo.warehouseInfoDate.length; i++) {
178
+          if (i === 0) {
179
+            this.tempArr.push(1)
180
+            this.pos = 0
181
+          } else {
182
+            // 判断当前元素与上一个元素是否相同
183
+            if (this.WarehouseInfo.warehouseInfoDate[i].drug_name === this.WarehouseInfo.warehouseInfoDate[i - 1].drug_name) {
184
+              this.tempArr[this.pos] += 1
185
+              this.tempArr.push(0)
186
+            } else {
187
+              this.tempArr.push(1)
188
+              this.pos = i
189
+            }
190
+          }
191
+        }
192
+
193
+        let sameRowArr = [], sIdx = 0
194
+        this.WarehouseInfo.warehouseInfoDate.forEach((item, index) => {
195
+          item.index = index
196
+          if (index === 0) {
197
+            sameRowArr.push([index])
198
+          } else {
199
+            if (item.drug_name === this.WarehouseInfo.warehouseInfoDate[index - 1].drug_name) {
200
+              sameRowArr[sIdx].push(index)
201
+            } else {
202
+              sIdx = sIdx + 1
203
+              sameRowArr.push([index])
204
+            }
205
+          }
206
+        })
207
+        this.sameRowArr = sameRowArr
208
+
209
+
210
+
211
+      },
212
+      merge({ row, column, rowIndex, columnIndex }) {
213
+        if (columnIndex === 0) {
214
+          const _row = this.tempArr[rowIndex]
215
+          const _col = _row > 0 ? 1 : 0
216
+          return {
217
+            rowspan: _row,
218
+            colspan: _col
219
+          }
220
+        }
221
+      },
222
+      GetAllDrugStockQueryList: function() {
223
+        console.log(this.keywords);
224
+        const Params = {
225
+          page: this.page,
226
+          limit: this.limit,
227
+          keyword: this.keywords
228
+        };
229
+        this.WarehouseInfo.loading = true;
230
+        this.WarehouseInfo.warehouseInfoDate = [];
231
+        getAllDrugStockQueryList(Params).then(response => {
232
+          if (response.data.state == 0) {
233
+            this.WarehouseInfo.loading = false;
234
+            this.$message.error(response.data.msg);
235
+            return false;
236
+          } else {
237
+            this.WarehouseInfo.loading = false;
238
+            this.total = response.data.data.total;
239
+            for (let i = 0; i < response.data.data.list.length; i++) {
240
+
241
+              this.WarehouseInfo.warehouseInfoDate.push(
242
+                response.data.data.list[i]
243
+              );
244
+            }
245
+            this.handleSpanTempArr()
246
+          }
247
+        });
248
+      },
249
+      getSpecificationName: function(id) {
250
+        let name = "";
251
+        for (let i = 0; i < this.goodInfo.length; i++) {
252
+          if (this.goodInfo[i].id == id) {
253
+            name = this.goodInfo[i].specification_name;
254
+          }
255
+        }
256
+        return name;
257
+      },
258
+      getTypeName: function(id) {
259
+        let name = "";
260
+        for (let i = 0; i < this.goodType.length; i++) {
261
+          if (this.goodType[i].id == id) {
262
+            name = this.goodType[i].type_name;
263
+          }
264
+        }
265
+        return name;
266
+      },
267
+      GetAllGoodType: function() {
268
+        GetAllGoodType().then(response => {
269
+          if (response.data.state == 0) {
270
+            this.$message.error(response.data.msg);
271
+            return false;
272
+          } else {
273
+            for (let i = 0; i < response.data.data.goodType.length; i++) {
274
+              this.goodType.push(response.data.data.goodType[i]);
275
+            }
276
+          }
277
+        });
278
+      },
279
+      GetAllGoodInfo: function() {
280
+        GetAllGoodInfo().then(response => {
281
+          if (response.data.state == 0) {
282
+            this.$message.error(response.data.msg);
283
+            return false;
284
+          } else {
285
+            for (let i = 0; i < response.data.data.goodInfo.length; i++) {
286
+              this.goodInfo.push(response.data.data.goodInfo[i]);
287
+            }
288
+          }
289
+        });
290
+      },
291
+      handleBack: function() {
292
+        this.$router.go(-1);
293
+      },
294
+      handleSizeChange(val) {
295
+        this.limit = val;
296
+        this.GetAllStockQuery();
297
+      },
298
+      handleCurrentChange(val) {
299
+        this.page = val;
300
+        this.GetAllStockQuery();
301
+      },
302
+      calculate: function(val) {
303
+        return Math.round(parseFloat(val) * 100) / 100;
304
+      },
305
+      startTimeChange: function() {
306
+        this.GetAllStockQuery();
307
+      },
308
+      endTimeChange: function() {
309
+        this.GetAllStockQuery();
310
+      },
311
+      stockInCount: function(row) {
312
+        let total = 0;
313
+        for (let i = 0; i < row.query_drug_warehousing_info.length; i++) {
314
+          total = total + row.query_drug_warehousing_info[i].warehousing_count;
315
+        }
316
+        return total;
317
+      },
318
+      salesReturnCount: function(row) {
319
+        let total = 0;
320
+        for (let i = 0; i < row.query_drug_sales_return_info.length; i++) {
321
+          total = total + row.query_drug_sales_return_info[i].count;
322
+        }
323
+        return total;
324
+      },
325
+      stockOutCount: function(row) {
326
+        let total = 0;
327
+        for (let i = 0; i < row.query_drug_warehouseout_info.length; i++) {
328
+          total = total + row.query_drug_warehouseout_info[i].count;
329
+        }
330
+        return total;
331
+      },
332
+      cancelStockCount: function(row) {
333
+        let total = 0;
334
+        for (let i = 0; i < row.query_drug_cancel_stock_info.length; i++) {
335
+          total = total + row.query_drug_cancel_stock_info[i].count;
336
+        }
337
+        return total;
338
+      },
339
+      showStockInDetailDialog: function(val) {},
340
+      showSaleReturnDetailDialog: function() {},
341
+      showStockOutDetailDialog: function() {},
342
+      showCancelStockDetailDialog: function() {},
343
+      search: function() {
344
+        this.GetAllStockQuery();
345
+      },setting:function() {
346
+        this.$refs.dialog.show()
347
+      }
348
+    }
349
+  };
150 350
 </script>
151 351
 
152 352
 <style rel="stylesheet/css" lang="scss" scoped>
153
-.information {
154
-  border: 1px #dcdfe6 solid;
155
-  padding: 30px 20px 30px 20px;
353
+  .information {
354
+    border: 1px #dcdfe6 solid;
355
+    padding: 30px 20px 30px 20px;
156 356
 
157 357
   .border {
158 358
     border-bottom: 1px #dcdfe6 solid;
159 359
     margin: 0px 0 20px 0;
160 360
   }
161
-}
361
+  }
362
+
363
+  .title {
364
+    background: #409eff;
365
+    height: 44px;
366
+    line-height: 44px;
367
+    padding: 0 0 0 10px;
368
+    color: #fff;
369
+    margin: 0 0 10px 0;
370
+  }
162 371
 
163
-.edit_separater {
164
-  border-top: 1px solid rgb(233, 233, 233);
165
-  margin-top: 15px;
166
-  margin-bottom: 15px;
167
-}
372
+  .edit_separater {
373
+    border-top: 1px solid rgb(233, 233, 233);
374
+    margin-top: 15px;
375
+    margin-bottom: 15px;
376
+  }
168 377
 </style>
169 378
 
170 379
 <style>
171
-.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
172
-  font-size: 12px;
173
-}
174
-
175
-.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
176
-  background: #6fb5fa;
177
-}
178
-
179
-.count {
180
-  color: #bd2c00;
181
-}
182
-.el-table td,
183
-.el-table th.is-leaf,
184
-.el-table--border,
185
-.el-table--group {
186
-  border-color: #d0d3da;
187
-}
188
-.el-table--border::after,
189
-.el-table--group::after,
190
-.el-table::before {
191
-  background-color: #d0d3da;
192
-}
380
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
381
+    font-size: 12px;
382
+  }
383
+
384
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
385
+    background: #6fb5fa;
386
+  }
387
+
388
+  .count {
389
+    color: #bd2c00;
390
+  }
391
+  .el-table td,
392
+  .el-table th.is-leaf,
393
+  .el-table--border,
394
+  .el-table--group {
395
+    border-color: #d0d3da;
396
+  }
397
+  .el-table--border::after,
398
+  .el-table--group::after,
399
+  .el-table::before {
400
+    background-color: #d0d3da;
401
+  }
193 402
 </style>

+ 107 - 0
src/xt_pages/stock/drugs/settingDialog/index.vue Visa fil

@@ -0,0 +1,107 @@
1
+<template>
2
+  <el-dialog title="设置" :visible.sync="visibility" :close-on-click-modal="isClose"
3
+             :close-on-press-escape="isClose">
4
+    <div style="text-align: center;">
5
+
6
+      <div>
7
+        <el-button type="primary" v-if="!is_open" @click="changeOpen(1)">启用自动扣减</el-button>
8
+        <el-button type="danger" v-if="is_open" @click="changeOpen(2)">关闭自动扣减</el-button>
9
+        <div style="margin-top: 40px;"><p style="color:#909399;text-align: center;">
10
+          启用“药品管理”后,在开透析医嘱时,医生可以选择药品后将自动产生出库单</p></div>
11
+      </div>
12
+    </div>
13
+
14
+    <span slot="footer" class="dialog-footer">
15
+    <el-button @click="hide()">取 消</el-button>
16
+  </span>
17
+  </el-dialog>
18
+
19
+</template>
20
+
21
+<script>
22
+  import { createDrugStockAutomaticReduceConfig, getDrugStockAutomaticReduceConfig } from '@/api/drug/drug_stock'
23
+
24
+  export default {
25
+    name: 'settingDialog',
26
+    data() {
27
+      return {
28
+        is_open: false,
29
+        visibility: false,
30
+        isClose: false
31
+      }
32
+    },
33
+    props: {
34
+      propForm: {
35
+        type: Object
36
+      }
37
+    },
38
+    methods: {
39
+      hide: function() {
40
+        this.visibility = false
41
+      },
42
+      show: function() {
43
+        this.getConfig()
44
+        this.visibility = true
45
+
46
+      }, changeOpen(val) {
47
+        var message = ''
48
+        if (val == 1) {
49
+          message = '启用药品自动扣减功能'
50
+        } else {
51
+          message = '关闭药品自动扣减功能'
52
+        }
53
+
54
+        this.$confirm(message, '提示', {
55
+          confirmButtonText: '确定',
56
+          cancelButtonText: '取消',
57
+          type: 'info'
58
+        }).then(() => {
59
+          createDrugStockAutomaticReduceConfig(val).then(response => {
60
+            if (response.data.state == 0) {
61
+              this.$message.error(response.data.msg)
62
+              return false
63
+            } else {
64
+              if (response.data.data.is_open == 1) {
65
+                this.is_open = true
66
+                this.$message({
67
+                  type: 'success',
68
+                  message: '已启用'
69
+                })
70
+              } else {
71
+                this.is_open = false
72
+                this.$message({
73
+                  type: 'success',
74
+                  message: '已关闭'
75
+                })
76
+              }
77
+            }
78
+          })
79
+        }).catch(() => {
80
+
81
+        })
82
+
83
+      },
84
+      getConfig() {
85
+        getDrugStockAutomaticReduceConfig().then(response => {
86
+          if (response.data.state == 0) {
87
+            this.$message.error(response.data.msg)
88
+            return false
89
+          } else {
90
+            var config = response.data.data.config
91
+            if (config.is_open == 1) {
92
+              this.is_open = true
93
+            } else {
94
+              this.is_open = false
95
+            }
96
+          }
97
+        })
98
+      }
99
+    }
100
+
101
+  }
102
+
103
+</script>
104
+
105
+<style scoped>
106
+
107
+</style>