Selaa lähdekoodia

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx 3 vuotta sitten
vanhempi
commit
0f83e42369
39 muutettua tiedostoa jossa 3550 lisäystä ja 748 poistoa
  1. 16 0
      src/api/drug/drug_stock.js
  2. 24 0
      src/api/stock.js
  3. 12 0
      src/router/modules/dialysis.js
  4. 1 0
      src/xt_pages/data/components/addDrugs.vue
  5. 2 2
      src/xt_pages/data/components/consumables.vue
  6. 2010 0
      src/xt_pages/dialysis/batch_print/batch_print_order_forty.vue
  7. 12 0
      src/xt_pages/dialysis/bloodPresssWatch.vue
  8. 2 2
      src/xt_pages/dialysis/dialysisDoctorAdvice.vue
  9. 3 3
      src/xt_pages/dialysis/template/DialysisPrintOrderForty.vue
  10. 1 1
      src/xt_pages/dialysis/template/DialysisPrintOrderThirtyFive.vue
  11. 1 1
      src/xt_pages/dialysis/template/DialysisPrintOrderThirtyNine.vue
  12. 1 3
      src/xt_pages/management/components/QualityForm.vue
  13. 4 2
      src/xt_pages/outpatientDoctorStation/doctorDesk.vue
  14. 18 23
      src/xt_pages/stock/Dialog/goodInfoDailog.vue
  15. 128 8
      src/xt_pages/stock/drugs/drugBatchNumber.vue
  16. 177 43
      src/xt_pages/stock/drugs/drugQueryPrint.vue
  17. 109 37
      src/xt_pages/stock/drugs/drugStockFlow.vue
  18. 12 22
      src/xt_pages/stock/drugs/drugStockInOrder.vue
  19. 1 1
      src/xt_pages/stock/drugs/drugStockInOrderAdd.vue
  20. 57 26
      src/xt_pages/stock/drugs/drugStockInOrderDetailPrint.vue
  21. 10 3
      src/xt_pages/stock/drugs/drugStockInOrderEdit.vue
  22. 9 161
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  23. 1 1
      src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue
  24. 56 14
      src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue
  25. 10 3
      src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue
  26. 126 29
      src/xt_pages/stock/drugs/query.vue
  27. 52 27
      src/xt_pages/stock/stockBatchNumber.vue
  28. 70 23
      src/xt_pages/stock/stockFlow.vue
  29. 99 42
      src/xt_pages/stock/stockInOrder.vue
  30. 2 2
      src/xt_pages/stock/stockInOrderAdd.vue
  31. 31 16
      src/xt_pages/stock/stockInOrderDetailPrint.vue
  32. 33 12
      src/xt_pages/stock/stockInOrderEdit.vue
  33. 89 72
      src/xt_pages/stock/stockOutOrder.vue
  34. 48 12
      src/xt_pages/stock/stockOutOrderAdd.vue
  35. 61 54
      src/xt_pages/stock/stockOutOrderDetailPrint.vue
  36. 92 35
      src/xt_pages/stock/stockOutOrderEdit.vue
  37. 118 52
      src/xt_pages/stock/stockPrint.vue
  38. 32 15
      src/xt_pages/stock/stockQuery.vue
  39. 20 1
      src/xt_pages/user/inspection.vue

+ 16 - 0
src/api/drug/drug_stock.js Näytä tiedosto

@@ -493,3 +493,19 @@ export function getAutoDrugDetail(params) {
493 493
     params: params
494 494
   })
495 495
 }
496
+
497
+export function getDrugOrderInPrint(params) {
498
+  return request({
499
+    url: '/api/drug/getdrugorderinprint',
500
+    method: 'get',
501
+    params: params
502
+  })
503
+}
504
+
505
+export function getDrugOutOrderDetailPrint(params) {
506
+  return request({
507
+    url: '/api/drug/getdrugoutorderdetailprint',
508
+    method: 'get',
509
+    params: params
510
+  })
511
+}

+ 24 - 0
src/api/stock.js Näytä tiedosto

@@ -649,3 +649,27 @@ export function getOrderDetailById(params) {
649 649
     params: params
650 650
   })
651 651
 }
652
+
653
+export function getSingleOutOrderDetail(params) {
654
+  return request({
655
+    url: '/api/good/getsingleoutorderdetail',
656
+    method: 'get',
657
+    params: params
658
+  })
659
+}
660
+
661
+export function getExportStockList(params) {
662
+  return request({
663
+    url: '/api/stock/getexportstocklist',
664
+    method: 'get',
665
+    params: params
666
+  })
667
+}
668
+
669
+export function getOutExportList(params) {
670
+  return request({
671
+    url: '/api/stock/getoutexprotlist',
672
+    method: 'get',
673
+    params: params
674
+  })
675
+}

+ 12 - 0
src/router/modules/dialysis.js Näytä tiedosto

@@ -411,6 +411,18 @@ export default {
411 411
         noCache: true
412 412
       }
413 413
     },
414
+    {
415
+      path: '/dialysis/print/batch/forty',
416
+      component: () =>
417
+        import('@/xt_pages/dialysis/batch_print/batch_print_order_forty'),
418
+      hidden: true,
419
+      is_menu: false,
420
+      name: 'batch_print_order_forty',
421
+      meta: {
422
+        title: '批量打印',
423
+        noCache: true
424
+      }
425
+    },
414 426
     {
415 427
       path: '/dialysis/print/batch/thirtyThree_one',
416 428
       component: () =>

+ 1 - 0
src/xt_pages/data/components/addDrugs.vue Näytä tiedosto

@@ -800,6 +800,7 @@
800 800
         this.form.max_unit = ""
801 801
         this.form.min_price = ""
802 802
         this.form.prescribing_number_unit = ""
803
+        this.dosageShow = false
803 804
         this.visible = false
804 805
       },
805 806
       getValue: function() {

+ 2 - 2
src/xt_pages/data/components/consumables.vue Näytä tiedosto

@@ -105,9 +105,9 @@
105 105
           {{ getGoodUnit(scope.row.good_unit) }}
106 106
         </template>
107 107
       </el-table-column> -->
108
-      <el-table-column label="零售价" width="100" align="center">
108
+      <el-table-column label="包装零售价" width="100" align="center">
109 109
         <template slot-scope="scope">
110
-          {{ scope.row.retail_price }}
110
+          {{ scope.row.packing_price }}
111 111
         </template>
112 112
       </el-table-column>
113 113
        <el-table-column label="社保目录编码" width="110" align="center">

File diff suppressed because it is too large
+ 2010 - 0
src/xt_pages/dialysis/batch_print/batch_print_order_forty.vue


+ 12 - 0
src/xt_pages/dialysis/bloodPresssWatch.vue Näytä tiedosto

@@ -259,6 +259,16 @@
259 259
           >批量打印</el-button
260 260
         >
261 261
       </template>
262
+      <template v-if="this.template_id == 40">
263
+        <el-button
264
+          size="small"
265
+          icon="el-icon-printer"
266
+          :disabled="selecting_schs.length == 0"
267
+          @click="batchPrintAction"
268
+          type="primary"
269
+          >批量打印</el-button
270
+        >
271
+      </template>
262 272
     </div>
263 273
     <div class="app-container">
264 274
       <!-- <div class="filter-container">
@@ -839,6 +849,8 @@ export default {
839 849
         this.$router.push({ path: "/dialysis/print/batch/thirtyThree" });
840 850
       } else if (this.template_id == 39) {
841 851
         this.$router.push({ path: "/dialysis/print/batch/thirtyNine" });
852
+      } else if (this.template_id == 40) {
853
+        this.$router.push({ path: "/dialysis/print/batch/forty" });
842 854
       }
843 855
     },
844 856
     batchPrintActionOne: function() {

+ 2 - 2
src/xt_pages/dialysis/dialysisDoctorAdvice.vue Näytä tiedosto

@@ -513,7 +513,7 @@ export default {
513 513
             var config = resp.data.config
514 514
             console.log("config222222",config.is_open)
515 515
             let project_config = resp.data.project_config
516
-            console.log('project_config',resp.data.hisAdvices)
516
+            console.log('project_config',)
517 517
             if(project_config.is_open == 1){
518 518
               this.project = resp.data.project
519 519
               resp.data.hisAdvices.map((item,index) => {
@@ -618,7 +618,7 @@ export default {
618 618
              this.show = false
619 619
              this.showOne  = true
620 620
             var schedules =  resp.data.hisAdvices
621
-          
621
+            console.log("hhhhhhhh22323232323232",schedules)
622 622
             let arr = []
623 623
             let newArr = []
624 624
             let newSchedules = []

+ 3 - 3
src/xt_pages/dialysis/template/DialysisPrintOrderForty.vue Näytä tiedosto

@@ -542,7 +542,7 @@
542 542
                 </td>
543 543
                 <td width="10">(</td>
544 544
                 <td width="35">首剂</td>
545
-                <td width="40">
545
+                <td width="50">
546 546
                     <div class="under-line">&nbsp;
547 547
                     <span v-if="prescription.anticoagulant==2">{{prescription.anticoagulant_shouji}}</span>
548 548
                     </div>
@@ -550,14 +550,14 @@
550 550
                 <td width="20">mg</td>
551 551
                 <td width="10"></td>
552 552
                 <td width="35">追加</td>
553
-                <td width="40">
553
+                <td width="50">
554 554
                     <div class="under-line">&nbsp;
555 555
                     <span v-if="prescription.anticoagulant==2">{{prescription.anticoagulant_weichi}}</span>
556 556
                     </div>
557 557
                 </td>
558 558
                 <td width="40">mg/h</td>
559 559
                 <td width="35">总量</td>
560
-                <td width="40">
560
+                <td width="50">
561 561
                     <div class="under-line">&nbsp;
562 562
                     <span v-if="prescription.anticoagulant==2">{{prescription.anticoagulant_zongliang}}</span>
563 563
                     </div>

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderThirtyFive.vue Näytä tiedosto

@@ -1383,7 +1383,7 @@ export default {
1383 1383
             this.patientInfo.first_dialysis_date = "";
1384 1384
           }
1385 1385
           this.check = response.data.data.check;
1386
-          console.log("核对信息", this.check);
1386
+          // console.log("核对信息", this.check);
1387 1387
           this.predialysis = response.data.data.PredialysisEvaluation;
1388 1388
           console.log("透前评估", this.predialysis);
1389 1389
           this.predialysis.blood_access_part_opera_name = this.bloodAccessParOperaName(

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderThirtyNine.vue Näytä tiedosto

@@ -318,7 +318,7 @@
318 318
                         <td width="80">VP<br>mmHg</td>
319 319
                         <td width="80">TMP<br>mmHg</td>
320 320
                         <td width="80">Na<br>mmol/L</td>
321
-                        <td width="80">UF<br>ml</td>
321
+                        <td width="80">UF<br>L</td>
322 322
                         <td width="80">体温</td>
323 323
                         <td width="">备注</td>
324 324
                         <td width="80">签名</td>

+ 1 - 3
src/xt_pages/management/components/QualityForm.vue Näytä tiedosto

@@ -58,9 +58,7 @@
58 58
     </el-row>
59 59
     <el-row style="display: flex;align-items: center;">
60 60
       <el-col :span="2">
61
-        <el-checkbox v-model="checkAllStatus" @change="changeCheck"
62
-          >全选</el-checkbox
63
-        >
61
+        <el-checkbox v-model="checkAllStatus" @change="changeCheck">全选</el-checkbox>
64 62
       </el-col>
65 63
       <el-col :span="3">
66 64
         <el-button size="small" @click="BatchDelete" v-show="show"

+ 4 - 2
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Näytä tiedosto

@@ -3573,8 +3573,10 @@
3573 3573
         }
3574 3574
       },
3575 3575
       currentChange(currentRow, oldCurrentRow) {
3576
-        this.newPatientId = oldCurrentRow.id;
3577
-        this.patientid = oldCurrentRow.id;
3576
+        if(oldCurrentRow){
3577
+          this.newPatientId = oldCurrentRow.id;
3578
+          this.patientid = oldCurrentRow.id;
3579
+        }
3578 3580
         let isShowDailog = false
3579 3581
         for (let i = 0; i < this.prescriptions.length; i++) {
3580 3582
           if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {

+ 18 - 23
src/xt_pages/stock/Dialog/goodInfoDailog.vue Näytä tiedosto

@@ -9,7 +9,6 @@
9 9
     <el-tabs v-model="activeName">
10 10
       <el-tab-pane label="基础数据" name="first">
11 11
         <div>
12
-          <!--:rules="rules"-->
13 12
           <el-form :model="form" ref="form" :rules="rules" label-width="100px"
14 13
                    style="display: flex;flex-wrap: wrap;justify-content: space-between;">
15 14
             <el-form-item label="耗材名称 : " prop="good_name" style="width:100%">
@@ -46,28 +45,21 @@
46 45
               </el-select>
47 46
             </el-form-item>
48 47
 
49
-           <div style="width:100%;">
50
-              <div><span style="color:red;">*</span>单位&规格: <span style="color:#999">例如:FX80 * 60盒</span></div>
51
-          </div>
52
-          <div style="width:100%;display:flex;align-items:center;">
53
-               <el-form-item label="规格型号 : " prop="specification_name" style="width:200px">
54
-                 <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
55
-               </el-form-item>
56
-                *
57
-                <el-form-item prop="min_number" class="noMargin">
58
-                  <el-input v-model="form.min_number" :disabled="showMinNumber" style="width:100px" type="number" placeholder="拆零"> </el-input>
59
-                </el-form-item>
60
-                <el-form-item prop="packing_unit" class="noMargin">
61
-                  <el-select v-model="form.packing_unit" style="width:160px;" placeholder="包装单位" @change="changePackingUnit">
62
-                    <el-option
63
-                      v-for="(item,index) in getDataConfig('hemodialysis','units')"
64
-                      :key="index"
65
-                      :label="item.name"
66
-                      :value="item.name">
67
-                    </el-option>
68
-                  </el-select>
69
-                </el-form-item>
70
-            </div>
48
+           
49
+        
50
+            <el-form-item label="规格型号 : " prop="specification_name">
51
+              <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
52
+            </el-form-item>
53
+            <el-form-item prop="packing_unit"  label="包装单位:">
54
+              <el-select v-model="form.packing_unit" style="width:160px;" placeholder="包装单位" @change="changePackingUnit">
55
+                <el-option
56
+                  v-for="(item,index) in getDataConfig('hemodialysis','units')"
57
+                  :key="index"
58
+                  :label="item.name"
59
+                  :value="item.name">
60
+                </el-option>
61
+              </el-select>
62
+            </el-form-item>
71 63
 
72 64
             <el-form-item label="生产厂商 : " prop="manufacturer" style="width:100%">
73 65
 
@@ -379,6 +371,9 @@
379 371
           good_name: [
380 372
             { required: true, message: '请输入耗材名称', trigger: 'blur' }
381 373
           ],
374
+          packing_unit:[
375
+            {required:true,message:"请输入包装单位",trigger:'blur'}
376
+          ],
382 377
           good_kind: [
383 378
             { required: true, message: '请选择耗材种类', trigger: 'change' }
384 379
           ],

+ 128 - 8
src/xt_pages/stock/drugs/drugBatchNumber.vue Näytä tiedosto

@@ -5,9 +5,10 @@
5 5
     </div>
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8
-       药品名称:
9
-       库存:
10
-       厂家:
8
+       药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
9
+       库存:{{getCountTwo(this.$route.query.drug_id,this.$route.query.min_number,this.$route.query.max_unit,this.$route.query.min_unit)}}&nbsp;
10
+       规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
+       厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
11 12
       </div>
12 13
       <div class="cell clearfix">
13 14
         <span>日期查询:</span>
@@ -60,7 +61,7 @@
60 61
         </el-table-column>
61 62
         <el-table-column prop="drug_name" label="有效期" align="center">
62 63
            <template slot-scope="scope">
63
-              {{getTime(scope.row.expiry_date)}}
64
+              {{getTime(scope.row.expiry_date,"{y}-{m}-{d}")}}
64 65
            </template>
65 66
         </el-table-column>
66 67
          <el-table-column prop="drug_name" label="批号" align="center">
@@ -104,7 +105,7 @@
104 105
 <script>
105 106
   import { uParseTime } from '@/utils/tools'
106 107
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
107
-  import { getBatchOrderDetail } from '@/api/drug/drug_stock'
108
+  import { getBatchOrderDetail,getDrugCountList } from '@/api/drug/drug_stock'
108 109
   import SettingDialog from './settingDialog/index'
109 110
   import { getDictionaryDataConfig } from "@/utils/data";
110 111
   export default {
@@ -113,7 +114,8 @@
113 114
       var drugCategory = getDictionaryDataConfig('system','drug_category')
114 115
       this.drugCategory.push(...drugCategory)
115 116
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
116
-       this.getlist()
117
+      this.getlist()
118
+      this.getDrugCountList()
117 119
     },
118 120
     components: {
119 121
       SettingDialog,
@@ -149,7 +151,12 @@
149 151
         ],
150 152
         drugTypeList:[],
151 153
         tableList:[],
152
-        manufacturerList:[]
154
+        manufacturerList:[],
155
+        countList:[],
156
+        outCountList:[],
157
+        autoCountList:[],
158
+        minCount:[],
159
+        drugOutList:[],
153 160
       }
154 161
     },
155 162
     methods:{
@@ -166,6 +173,7 @@
166 173
               this.tableList = detail
167 174
               var total = response.data.data.total
168 175
               console.log("total",total)
176
+              this.total = total
169 177
            }
170 178
         })
171 179
       },
@@ -194,7 +202,119 @@
194 202
     endTimeChange(val){
195 203
       this.end_time = val
196 204
       this.getlist()
197
-    }
205
+    },
206
+     getDrugCountList(){
207
+         var params = {
208
+          keyword: this.keywords,
209
+          start_time:this.start_time,
210
+          end_time:this.end_time,
211
+         }
212
+      getDrugCountList(params).then(response=>{
213
+          if(response.data.state == 1){
214
+            var countlist =  response.data.data.countList
215
+            console.log("入库数据",countlist)
216
+            this.countList = countlist
217
+            var outcountlist = response.data.data.outCountList
218
+            console.log("出库数据",outcountlist)
219
+            this.outCountList = outcountlist
220
+            var aucountlist = response.data.data.auCountList
221
+            console.log("自动数据",aucountlist)
222
+            this.autoCountList = aucountlist
223
+             var minCount = response.data.data.minCount
224
+            console.log("minCount",minCount)
225
+            this.minCount = minCount
226
+            var info = response.data.data.info
227
+            for(let i=0;i<info.length;i++){
228
+              if(info[i].count_unit == info[i].max_unit){
229
+                 info[i].count = info[i].count * info[i].min_number
230
+              }
231
+            }
232
+            console.log("info2222222",info)
233
+            this.drugOutList = info
234
+          }
235
+        })
236
+      },
237
+      getInCount(id){
238
+        var count = ""
239
+        for(let i=0;i<this.countList.length;i++){
240
+           if(id == this.countList[i].drug_id){
241
+             count = this.countList[i].count
242
+           }
243
+        }
244
+        return count
245
+      },
246
+
247
+      getOutCount(id){
248
+        var count = ""
249
+        for(let i=0;i<this.outCountList.length;i++){
250
+           if(id == this.outCountList[i].drug_id){
251
+               count = this.outCountList[i].count
252
+           }
253
+        }
254
+        return count
255
+      },
256
+      getAutoCount(id){
257
+        var count= ""
258
+        for(let i=0;i<this.autoCountList.length;i++){
259
+          if(id == this.autoCountList[i].drug_id){
260
+            count = this.autoCountList[i].count
261
+          }
262
+        }
263
+        return count
264
+      },
265
+         getMinCount(id){
266
+        var count=""
267
+        for(let i=0;i<this.minCount.length;i++){
268
+          if(id == this.minCount[i].drug_id){
269
+            count = this.minCount[i].count
270
+          }
271
+        }
272
+        return count
273
+      },
274
+      getCount(drug_id,min_number,max_unit,min_unit){
275
+        var count= 0
276
+        var str = ""
277
+        var min_str = ""
278
+        for(let i=0;i<this.drugOutList.length;i++){
279
+          if(drug_id == this.drugOutList[i].drug_id){
280
+             count += parseInt(this.drugOutList[i].count)
281
+          }
282
+        }
283
+        if(parseInt(count/min_number)!=0){
284
+          str = parseInt(count/min_number)+ max_unit
285
+        }
286
+        if((count%min_number)!=0){
287
+          min_str =  count%min_number + min_unit
288
+        }
289
+        return str + min_str
290
+      },
291
+
292
+      getCountOne(drug_id){
293
+        var count= 0
294
+        for(let i=0;i<this.drugOutList.length;i++){
295
+          if(drug_id == this.drugOutList[i].drug_id){
296
+             count += parseInt(this.drugOutList[i].count)
297
+          }
298
+        }
299
+        return count
300
+      },
301
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
302
+       var total_count = 0
303
+       var out_count = 0
304
+       var count = 0
305
+       var str = ""
306
+       var str_min = ""
307
+       total_count = this.getInCount(drug_id) * min_number
308
+       out_count = this.getCountOne(drug_id)
309
+       count = total_count-out_count
310
+       if(parseInt(count/min_number)!=0){
311
+         str = parseInt(count/min_number) + max_unit
312
+       }
313
+       if((count%min_number)!=0){
314
+         str_min = count%min_number + min_unit
315
+       }
316
+       return str+str_min
317
+     }
198 318
     }
199 319
   }
200 320
 </script>

+ 177 - 43
src/xt_pages/stock/drugs/drugQueryPrint.vue Näytä tiedosto

@@ -15,46 +15,41 @@
15 15
             <tbody>
16 16
             <tr>
17 17
               <td style="line-height: 50px" width="50">序号</td>
18
-              <td style="line-height: 50px" width="250">药品名称</td>
19
-              <td style="line-height: 50px" width="250">规格型号</td>
20
-              <td style="line-height: 50px" width="50">单位</td>
18
+              <td style="line-height: 50px" width="100">药品类型</td>
19
+              <td style="line-height: 50px" width="150">药品名称</td>
20
+              <td style="line-height: 50px" width="150">规格型号&单位</td>
21
+              <td style="line-height: 50px" width="50">进货单价</td>
22
+              <td  style="line-height: 50px" width="50">厂家</td>
21 23
               <td style="line-height: 50px" width="80">入库数量</td>
22 24
               <td style="line-height: 50px" width="80">出库数量</td>
23
-              <td style="line-height: 50px" width="80">入库退货</td>
24
-              <td style="line-height: 50px" width="80">出库退库</td>
25
-              <td style="line-height: 50px" width="80">剩余库存</td>
26
-              <td style="line-height:50px" width="80">单价</td>
27
-           
25
+              <td style="line-height:50px" width="80">剩余库存量</td>    
28 26
             </tr>
29 27
 
30
-            <tr v-for="(item,index) in WarehouseInfo.warehouseInfoDate" :key="item.id">
28
+            <tr v-for="(item,index) in tableList" :key="item.id">
31 29
               <td style="line-height: 50px">&nbsp;
32 30
                 {{index+1}}
33 31
               </td>
34 32
               <td style="line-height: 50px">
35
-                <span> {{ item.drug_name }}</span>
33
+                <span> {{getDrugType(item.drug_type)}}</span>
36 34
               </td>
37 35
               <td style="line-height: 50px">
38
-                   <span>{{ item.drug_spec }}</span>
36
+                <span> {{ item.drug_name }}</span>
39 37
               </td>
40 38
               <td style="line-height: 50px">
41
-                <span>{{getUnit(item.id)}}</span>
39
+                   <span> {{item.dose + item.dose_unit +"*"+item.min_number+item.min_unit+"/"+item.max_unit}}</span>
42 40
               </td>
43
-            
41
+             
44 42
               <td style="line-height: 50px">
45
-                  <span>{{ stockInCount(item) }}</span>
43
+                  <span>{{item.last_price }}</span>
46 44
               </td>
47 45
               <td style="line-height: 50px">
48
-                  <span>{{ stockOutCount(item) }}</span>
46
+                <span> {{getManufacturerList(item.manufacturer)}}</span>
49 47
               </td>
50
-              <td> <span>{{ salesReturnCount(item) }}</span ></td>
51
-              <td> <span>{{ cancelStockCount(item) }}</span></td>
48
+              <td><span>{{getInCount(item.drug_id)}}{{item.max_unit}}</span ></td>
49
+              <td><span>{{getCount(item.drug_id,item.min_number,item.max_unit,item.min_unit)}}</span></td>
52 50
               <td>
53
-                <span>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</span>
51
+                <span>{{getCountTwo(item.drug_id,item.min_number,item.max_unit,item.min_unit)}}</span>
54 52
              </td> 
55
-              <td style="line-height:50px">
56
-                  {{item.last_price}}
57
-              </td>
58 53
             </tr>
59 54
             </tbody>
60 55
           </table>
@@ -72,7 +67,7 @@
72 67
   import { jsGetAge, uParseTime } from '@/utils/tools'
73 68
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
74 69
   import print from 'print-js'
75
-  import { getAllDrugStockQueryList } from '@/api/drug/drug_stock'
70
+  import { getAllDrugStockQueryList,getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
76 71
   import { getDictionaryDataConfig } from "@/utils/data";
77 72
   import {getBaseDrugLibList} from '@/api/data'
78 73
   export default {
@@ -113,6 +108,15 @@
113 108
         is_use:"",
114 109
         is_charge:"",
115 110
         is_inject:"",
111
+        tableList:[],
112
+        manufacturerList:[],
113
+        loading:false,
114
+        drugType:[],
115
+        countList:[],
116
+        outCountList:[],
117
+        autoCountList:[],
118
+        minCount:[],
119
+        drugOutList:[],
116 120
       }
117 121
     },
118 122
     methods: {
@@ -230,35 +234,165 @@
230 234
       getDictionaryDataConfig(module, filed_name) {
231 235
         return getDictionaryDataConfig(module, filed_name)
232 236
       },
233
-      getList() {
234
-        let params = {
235
-          page: this.page,
236
-          limit: this.limit,
237
-          keyword: this.keywords,
238
-          is_use: this.is_use,
239
-          is_charge: this.is_charge,
240
-          is_inject: this.is_inject
237
+      getlist(){
238
+        const params = {
239
+          page: this.$route.query.page,
240
+          limit:this.$route.query.limit,
241
+          keyword: this.$route.query.keyword,
242
+          drug_type:this.$route.drug_type,
243
+          start_time:this.$route.start_time,
244
+          end_time:this.$route.end_time,
241 245
         }
242
-        getBaseDrugLibList(params).then(response => {
243
-          if (response.data.state == 0) {
244
-            this.$message.error(response.data.msg)
245
-            return false
246
-          } else {
247
-            this.total = response.data.data.total
248
-            this.list = []
249
-            for (let i = 0; i < response.data.data.list.length; i++) {
250
-              this.list.push(response.data.data.list[i])
246
+        console.log("parasm222222",params)
247
+        getDrugStockList(params).then(response=>{
248
+          if(response.data.state == 1){
249
+             var list = response.data.data.list
250
+             console.log("list99999",list)
251
+             this.tableList = list
252
+             this.manufacturerList = response.data.data.manufacturerList
253
+             this.loading = false
254
+           }
255
+        })
256
+      },
257
+      getManufacturerList(id){
258
+        var name = ""
259
+        for(let i=0;i<this.manufacturerList.length;i++){
260
+          if(id == this.manufacturerList[i].id){
261
+             name = this.manufacturerList[i].manufacturer_name
262
+          }
263
+        }
264
+        return name
265
+      },
266
+      getDrugCountList(){
267
+         var params = {
268
+          keyword: this.$route.query.keywords,
269
+          start_time:this.$route.query.start_time,
270
+          end_time:this.$route.query.end_time,
271
+         }
272
+        getDrugCountList(params).then(response=>{
273
+          if(response.data.state == 1){
274
+            var countlist =  response.data.data.countList
275
+            console.log("入库数据",countlist)
276
+            this.countList = countlist
277
+            var outcountlist = response.data.data.outCountList
278
+            console.log("出库数据",outcountlist)
279
+            this.outCountList = outcountlist
280
+            var aucountlist = response.data.data.auCountList
281
+            console.log("自动数据",aucountlist)
282
+            this.autoCountList = aucountlist
283
+            var minCount = response.data.data.minCount
284
+            console.log("minCount",minCount)
285
+            this.minCount = minCount
286
+            var info = response.data.data.info
287
+            for(let i=0;i<info.length;i++){
288
+              if(info[i].count_unit == info[i].max_unit){
289
+                 info[i].count = info[i].count * info[i].min_number
290
+              }
251 291
             }
252
-            console.log("list222222",this.list)
292
+            console.log("info2222222",info)
293
+            this.drugOutList = info
253 294
           }
254 295
         })
255 296
       },
297
+     getInCount(id){
298
+        var count = ""
299
+        for(let i=0;i<this.countList.length;i++){
300
+           if(id == this.countList[i].drug_id){
301
+             count = this.countList[i].count
302
+           }
303
+        }
304
+        return count
305
+      },
306
+
307
+      getOutCount(id){
308
+        var count = ""
309
+        for(let i=0;i<this.outCountList.length;i++){
310
+           if(id == this.outCountList[i].drug_id){
311
+               count = this.outCountList[i].count
312
+           }
313
+        }
314
+        return count
315
+      },
316
+      getAutoCount(id){
317
+        var count= ""
318
+        for(let i=0;i<this.autoCountList.length;i++){
319
+          if(id == this.autoCountList[i].drug_id){
320
+            count = this.autoCountList[i].count
321
+          }
322
+        }
323
+        return count
324
+      },
325
+      getMinCount(id){
326
+        var count=""
327
+        for(let i=0;i<this.minCount.length;i++){
328
+          if(id == this.minCount[i].drug_id){
329
+            count = this.minCount[i].count
330
+          }
331
+        }
332
+        return count
333
+      },
334
+      getCount(drug_id,min_number,max_unit,min_unit){
335
+        var count= 0
336
+        var str = ""
337
+        var min_str = ""
338
+        for(let i=0;i<this.drugOutList.length;i++){
339
+          if(drug_id == this.drugOutList[i].drug_id){
340
+             count += parseInt(this.drugOutList[i].count)
341
+          }
342
+        }
343
+        if(parseInt(count/min_number)!=0){
344
+          str = parseInt(count/min_number)+ max_unit
345
+        }
346
+        if((count%min_number)!=0){
347
+          min_str =  count%min_number + min_unit
348
+        }
349
+        return str + min_str
350
+      },
351
+
352
+      getCountOne(drug_id){
353
+        var count= 0
354
+        for(let i=0;i<this.drugOutList.length;i++){
355
+          if(drug_id == this.drugOutList[i].drug_id){
356
+             count += parseInt(this.drugOutList[i].count)
357
+          }
358
+        }
359
+        return count
360
+      },
361
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
362
+       var total_count = 0
363
+       var out_count = 0
364
+       var count = 0
365
+       var str = ""
366
+       var str_min = ""
367
+       total_count = this.getInCount(drug_id) * min_number
368
+       out_count = this.getCountOne(drug_id)
369
+       count = total_count-out_count
370
+       if(parseInt(count/min_number)!=0){
371
+         str = parseInt(count/min_number) + max_unit
372
+       }
373
+       if((count%min_number)!=0){
374
+         str_min = count%min_number + min_unit
375
+       }
376
+       return str+str_min
377
+     },
378
+     getDrugType(id){
379
+       var name = ""
380
+       for(let i=0;i<this.drugType.length;i++){
381
+         if(id == this.drugType[i].id){
382
+            name = this.drugType[i].name
383
+         }
384
+       }
385
+       return name
386
+     }
256 387
     },
257 388
     created() {
258
-      this.GetAllDrugStockQueryList()
389
+      // this.GetAllDrugStockQueryList()
259 390
       var drugCategory = getDictionaryDataConfig('system','drug_category')
260
-      this.drugCategory.push(...drugCategory)
261
-      this.getList()
391
+      var drugType = getDictionaryDataConfig('system','drug_type')
392
+      console.log("222343",drugType)
393
+      this.drugType.push(...drugType)
394
+      this.getlist()
395
+      this.getDrugCountList()
262 396
     }
263 397
 
264 398
   }

+ 109 - 37
src/xt_pages/stock/drugs/drugStockFlow.vue Näytä tiedosto

@@ -5,9 +5,11 @@
5 5
     </div>
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8
-       药品名称:<span v-if="list.length>0">{{list[0].drug_name}}</span>
9
-       库存:
10
-       厂家:<span v-if="list.length>0">{{getManufacturer(list[0].manufacturer)}}</span>
8
+       药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
9
+       库存: {{getCountTwo(this.$route.query.drug_id,this.$route.query.min_number,this.$route.query.max_unit,this.$route.query.min_unit)}}
10
+       规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
+       厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12
+
11 13
       </div>
12 14
       <div class="cell clearfix">
13 15
         <span>日期查询:</span>
@@ -62,13 +64,14 @@
62 64
         </el-table-column>
63 65
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
64 66
            <template slot-scope="scope">
65
-             <span v-if="scope.row.drug_way == 4">手动入库</span>
66
-             <span v-if="scope.row.drug_way == 2">手动出库</span>
67
+             <span v-if="scope.row.drug_way == 4">采购入库</span>
68
+             <span v-if="scope.row.drug_way == 2">自动出库</span>
69
+             <span v-if="scope.row.drug_way == 1">手动出库</span>
67 70
            </template>
68 71
         </el-table-column>
69 72
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
70 73
            <template slot-scope="scope">
71
-             <span v-if="scope.row.drug_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
74
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way ==1"> {{scope.row.warehouse_out_order_number}}</span>
72 75
              <span v-if="scope.row.drug_way == 4">{{scope.row.warehousing_order}}</span>
73 76
             
74 77
            </template>
@@ -80,40 +83,39 @@
80 83
         </el-table-column>
81 84
          <el-table-column prop="drug_name" label="出入库数量" align="center">
82 85
            <template slot-scope="scope">
83
-             <span v-if="scope.row.drug_way == 4"> {{scope.row.warehousing_count}}</span>
84
-             <span v-if="scope.row.drug_way == 2">{{scope.row.count}}</span>
86
+             <span v-if="scope.row.drug_way == 4"> {{scope.row.warehousing_count}}{{scope.row.max_unit}}</span>
87
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{scope.row.count}}{{scope.row.max_unit}}</span>
85 88
            </template>
86 89
         </el-table-column>
87 90
          <el-table-column prop="drug_name" label="剩余库存量" align="center">
88 91
            <template slot-scope="scope">
89
-             <!-- <span v-if="scope.row.drug_way == 4"> {{scope.row.stock_max_numbe}}{{scope.row.max_unit}}{{scope.row.stock_min_number}}{{scope.row.min_unit}}</span>
90
-             <span v-if="scope.row.drug_way == 2">{{scope.row.count}}</span> -->
91
-              {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}}
92
+               {{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
93
+              <!-- {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}} -->
92 94
              <span></span>
93 95
            </template>
94 96
         </el-table-column>
95 97
         <el-table-column prop="drug_name" label="进/出货单价" align="center">
96 98
            <template slot-scope="scope">
97 99
              <span v-if="scope.row.drug_way == 4"> {{scope.row.price}}</span>
98
-             <span v-if="scope.row.drug_way == 2">{{scope.row.price}}</span>
100
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{scope.row.price}}</span>
99 101
            </template>
100 102
         </el-table-column>
101 103
          <el-table-column prop="drug_name" label="有效期" align="center">
102 104
            <template slot-scope="scope">
103
-             <span v-if="scope.row.drug_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
104
-             <span v-if="scope.row.drug_way == 2">{{getTime(scope.row.expiry_date)}}</span>
105
+             <span v-if="scope.row.drug_way == 4"> {{getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}</span>
106
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}</span>
105 107
            </template>
106 108
         </el-table-column>
107 109
         <el-table-column prop="drug_name" label="批号" align="center">
108 110
            <template slot-scope="scope">
109
-             <span v-if="scope.row.drug_way == 2"> {{scope.row.number}}</span>
111
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way ==1"> {{scope.row.number}}</span>
110 112
              <span v-if="scope.row.drug_way == 4">{{scope.row.number}}</span>
111 113
            </template>
112 114
         </el-table-column>
113 115
         <el-table-column prop="drug_name" label="生产商" align="center">
114 116
            <template slot-scope="scope">
115 117
              <span v-if="scope.row.drug_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
116
-             <span v-if="scope.row.drug_way == 2">{{getManufacturer(scope.row.manufacturer)}}</span>
118
+             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{getManufacturer(scope.row.manufacturer)}}</span>
117 119
            </template>
118 120
         </el-table-column>
119 121
        </el-table>
@@ -196,13 +198,15 @@
196 198
           {id:0,name:"全部"},
197 199
           {id:1,name:"手动出库"},
198 200
           {id:2,name:"自动出库"},
199
-          {id:3,name:"手动入库"},
201
+          {id:3,name:"采购入库"},
200 202
 
201 203
         ],
202 204
         outList:[],
203 205
         countList:[],
204 206
         outCountList:[],
205 207
         autoCountList:[],
208
+        drugOutList:[],
209
+        total:0,
206 210
       }
207 211
     },
208 212
     methods:{
@@ -224,7 +228,6 @@
224 228
                list[i].drug_way = 4
225 229
                this.tableList.push(list[i])
226 230
             }
227
-           
228 231
             var total = response.data.data.total
229 232
             this.total = total
230 233
             var manufacturerList = response.data.data.manufacturerList
@@ -243,24 +246,35 @@
243 246
              stock_type:this.stock_type,  
244 247
            }
245 248
           console.log("出库数据",params)
249
+
246 250
          getOutDrugStockFlow(params).then(response=>{
247 251
             if(response.data.state == 1){
248 252
                var outList = response.data.data.outList
249
-               for(let i=0;i<outList.length;i++){
253
+               console.log("outlist",outList)
254
+
255
+              for(let i=0;i<outList.length;i++){
256
+                if(outList[i].is_sys == 1){
250 257
                   outList[i].drug_way = 2
251
-                  this.tableList.push(outList[i])
252
-               }
253
-              console.log("列表数据",this.tableList)
258
+                }
259
+                if(outList.is_sys == 0){
260
+                  outList[i].drug_way = 1
261
+                }
262
+                this.tableList.push(outList[i])
263
+              }
264
+              this.total = response.data.data.total
265
+              console.log("出库列表数据",this.tableList)
254 266
             }
255 267
          })
256 268
        },
257 269
        handleSizeChange(val) {
258 270
         this.limit = val
259 271
         this.getlist()
272
+        this.getOutList()
260 273
       },
261 274
       handleCurrentChange(val) {
262 275
         this.page = val
263 276
         this.getlist()
277
+        this.getOutList()
264 278
       },
265 279
         
266 280
     startTimeChange: function(val) {
@@ -280,6 +294,7 @@
280 294
         this.end_time = "";
281 295
       } else {
282 296
         this.getlist();
297
+        this.getOutList()
283 298
       }
284 299
      },
285 300
      getManufacturer(id){
@@ -318,6 +333,17 @@
318 333
             var aucountlist = response.data.data.auCountList
319 334
             console.log("自动数据",aucountlist)
320 335
             this.autoCountList = aucountlist
336
+             var minCount = response.data.data.minCount
337
+            console.log("minCount",minCount)
338
+            this.minCount = minCount
339
+            var info = response.data.data.info
340
+            for(let i=0;i<info.length;i++){
341
+              if(info[i].count_unit == info[i].max_unit){
342
+                 info[i].count = info[i].count * info[i].min_number
343
+              }
344
+            }
345
+            console.log("info2222222",info)
346
+            this.drugOutList = info
321 347
           }
322 348
         })
323 349
       },
@@ -353,26 +379,72 @@
353 379
         return (new Date(time)).getTime() / 1000
354 380
       },
355 381
       changeDrug(val){
356
-        
357
-        var arr = []
382
+       this.tableList = []
383
+        if(val == 0){
384
+         this.getlist()
385
+         this.getOutList()
386
+        }
358 387
         if(val == 3){
359
-          for(let i=0;i<this.tableList.length;i++){
360
-            if(this.tableList[i].drug_way == 4){
361
-
362
-              arr.push(this.tableList[i])
363
-            }
388
+          this.getlist()
389
+        }
390
+        if(val ==1 || val == 2){
391
+           this.getOutList()
392
+        }
393
+       
394
+      },
395
+      getMinCount(id){
396
+        var count=""
397
+        for(let i=0;i<this.minCount.length;i++){
398
+          if(id == this.minCount[i].drug_id){
399
+            count = this.minCount[i].count
364 400
           }
365
-          this.tableList = arr
366 401
         }
367
-        if(val == 1){
368
-          for(let i=0;i<this.tableList.length;i++){
369
-            if(this.tableList[i].drug_way == 2){
370
-              arr.push(this.tableList[i])
371
-            }
402
+        return count
403
+      },
404
+      getCount(drug_id,min_number,max_unit,min_unit){
405
+        var count= 0
406
+        var str = ""
407
+        var min_str = ""
408
+        for(let i=0;i<this.drugOutList.length;i++){
409
+          if(drug_id == this.drugOutList[i].drug_id){
410
+             count += parseInt(this.drugOutList[i].count)
372 411
           }
373
-          this.tableList = arr
374 412
         }
375
-      }
413
+        if(parseInt(count/min_number)!=0){
414
+          str = parseInt(count/min_number)+ max_unit
415
+        }
416
+        if((count%min_number)!=0){
417
+          min_str =  count%min_number + min_unit
418
+        }
419
+        return str + min_str
420
+      },
421
+
422
+     getCountOne(drug_id){
423
+        var count= 0
424
+        for(let i=0;i<this.drugOutList.length;i++){
425
+          if(drug_id == this.drugOutList[i].drug_id){
426
+             count += parseInt(this.drugOutList[i].count)
427
+          }
428
+        }
429
+        return count
430
+      },
431
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
432
+       var total_count = 0
433
+       var out_count = 0
434
+       var count = 0
435
+       var str = ""
436
+       var str_min = ""
437
+       total_count = this.getInCount(drug_id) * min_number
438
+       out_count = this.getCountOne(drug_id)
439
+       count = total_count-out_count
440
+       if(parseInt(count/min_number)!=0){
441
+         str = parseInt(count/min_number) + max_unit
442
+       }
443
+       if((count%min_number)!=0){
444
+         str_min = count%min_number + min_unit
445
+       }
446
+       return str+str_min
447
+     }
376 448
     }
377 449
   }
378 450
 </script>

+ 12 - 22
src/xt_pages/stock/drugs/drugStockInOrder.vue Näytä tiedosto

@@ -192,7 +192,7 @@
192 192
         border
193 193
         highlight-current-row
194 194
         v-loading="Warehouse.loading"
195
-        ref="multipleTable"
195
+        ref="multipleTableOne"
196 196
         @selection-change="select"
197 197
         :row-style="{ color: '#303133' }"
198 198
         :header-cell-style="{
@@ -359,22 +359,6 @@
359 359
       </span>
360 360
     </el-dialog>
361 361
 
362
-    
363
-
364
-
365
-      
366
-
367
-      <!-- <el-pagination
368
-        @size-change="handleSizeChange"
369
-        @current-change="handleCurrentChange"
370
-        :page-sizes="[10, 50, 100]"
371
-        :page-size="10"
372
-        background
373
-        style="margin-top:20px;float: right"
374
-        layout="total, sizes, prev, pager, next, jumper"
375
-        :total="total"
376
-      >
377
-      </el-pagination> -->
378 362
 
379 363
   </div>
380 364
 </template>
@@ -653,15 +637,16 @@ export default {
653 637
       const params = {
654 638
         id: order_id
655 639
       };
656
-   
640
+      console.log("parasm222222222",params)
641
+      this.WarehouseInfo.warehouseInfoDate = []
657 642
       getDrugWarehouseInfoList(params).then(response => {
658 643
         if (response.data.state == 0) {
659 644
           this.$message.error(response.data.msg);
660 645
           return false;
661 646
         } else {
647
+          console.log("hhhhhhhhhh",response.data.data.info)
662 648
           for (let i = 0; i < response.data.data.info.length; i++) {
663 649
             this.showOne = true
664
-            this.WarehouseInfo.warehouseInfoDate = []
665 650
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
666 651
             console.log("列表详情",this.WarehouseInfo.warehouseInfoDate)
667 652
           }
@@ -716,8 +701,13 @@ export default {
716 701
       }
717 702
     },
718 703
     select(selection) {
719
-      console.log("selection",selection)
720
-      this.order_id = selection[0].id
704
+      // console.log("selection",selection)
705
+      // this.order_id = selection[0].id
706
+      var ids=[]
707
+      for(let i=0;i<selection.length;i++){
708
+         ids.push(selection[i].id)
709
+      }
710
+      this.order_id = ids.join(",")
721 711
       this.selectedTableData = selection;
722 712
     },
723 713
     batchDelete() {
@@ -807,7 +797,7 @@ export default {
807 797
         return getDictionaryDataConfig(module, filed_name)
808 798
       },
809 799
     drugPrint(){
810
-      if(this.order_id == 0){
800
+      if(this.order_id == ""){
811 801
          this.$message.error("请选择入库单")
812 802
       }else{
813 803
         this.$router.push({path:"/stock/drugStockInOrderDetailPrint?id="+this.order_id})

+ 1 - 1
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Näytä tiedosto

@@ -87,7 +87,7 @@
87 87
                   >
88 88
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
89 89
                   <template slot-scope="{ item }">
90
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit}}</div>
90
+                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
91 91
                   </template>
92 92
                  </el-autocomplete>
93 93
               </el-form-item>

+ 57 - 26
src/xt_pages/stock/drugs/drugStockInOrderDetailPrint.vue Näytä tiedosto

@@ -7,10 +7,11 @@
7 7
     </div>
8 8
     <div class="app-container ">
9 9
       <div id="dialysis-print-box">
10
-        <div class="dialysis-print-order">
10
+        <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11 11
           <div style="font-size:22px;font-weight:bold;text-align:center;">{{ orgName }}</div>
12 12
           <div class="order-title" style="font-size:18px;padding-top:0;">药品入库登记表</div>
13 13
 
14
+          <div style="float: left;margin-bottom: 1px;">单据编号:{{it.warehousing_order}}</div>
14 15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
15 16
 
16 17
           <table class="print-table" border="1">
@@ -18,7 +19,7 @@
18 19
             <tr>
19 20
               <td width="80">药品名称</td>
20 21
               <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
21
-              <td style="line-height:18px;" width="80">规格<br>型号</td>
22
+              <td style="line-height:18px;" width="100">规格<br>型号</td>
22 23
               <td style="line-height:18px;" width="80">生产<br>厂商</td>
23 24
               <td style="line-height:18px;" width="80">单位</td>
24 25
               <td style="line-height:18px;" width="80">进货价</td>
@@ -31,18 +32,17 @@
31 32
               <td style="line-height:18px;" width="60">验收<br>结论</td>
32 33
             </tr>
33 34
 
34
-            <tr v-for="(item,index) in WarehouseInfo.warehouseInfoDate" :key="item.id">
35
+            <tr v-for="(item,i) in it.child" :key="i">
35 36
               <td style="line-height: 18px">
36
-                 <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
37
+                 <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
37 38
               </td>
38 39
               <td style="line-height: 18px">{{ item.remark }}</td>
39 40
               <td style="line-height: 18px">
40
-                 <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
41
+                 <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
41 42
               </td>
42
-              <!-- <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td> -->
43
-              <td style="line-height: 18px">{{ getManufacturer(item.drug.id) }}</td>
43
+              <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td>
44 44
               <td style="line-height: 18px">
45
-                <span>{{getUnit(item.drug_id)}}</span>
45
+                <span>{{item.max_unit}}</span>
46 46
               </td>
47 47
               <td style="line-height:18px">
48 48
                   {{item.price}}
@@ -62,7 +62,7 @@
62 62
             </tr>
63 63
             <tr>
64 64
               <td>合计</td>
65
-              <td colspan="12" style="text-align:right;">{{allPrice.toFixed(2)}}</td>
65
+              <td colspan="12" style="text-align:right;">{{getAllPrince(it.id).toFixed(2)}}</td>
66 66
             </tr>
67 67
             </tbody>
68 68
           </table>
@@ -71,13 +71,13 @@
71 71
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
72 72
             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
73 73
             <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
74
-            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(this.WarehouseInfo.warehouse.creater) }}</div>
74
+            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
75 75
           </div>
76 76
           <div style="display:flex;margin-top:1px;float:right;" v-if="orgId !=10024">
77 77
             <div style="width:50px;">审批:</div><div style="width:100px;"></div>
78 78
             <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
79 79
             <div style="width:50px;">会计:</div><div style="width:100px;"></div>
80
-            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(this.WarehouseInfo.warehouse.creater) }}</div>
80
+            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
81 81
           </div>
82 82
         </div>
83 83
 
@@ -94,7 +94,7 @@
94 94
   import { jsGetAge, uParseTime } from '@/utils/tools'
95 95
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
96 96
   import print from 'print-js'
97
-  import {getDrugWarehouseInfoList} from "@/api/drug/drug_stock";
97
+  import {getDrugWarehouseInfoList,getDrugOrderInPrint} from "@/api/drug/drug_stock";
98 98
   import {getBaseDrugLibList} from '@/api/data'
99 99
   import { fetchAllAdminUsers } from "@/api/doctor";
100 100
   export default {
@@ -139,7 +139,10 @@
139 139
         keywords:"",
140 140
         orgName:'',
141 141
         orgId:'',
142
-        adminUserOptions:[]
142
+        adminUserOptions:[],
143
+        tableList:[],
144
+        manufacturerList:[],
145
+        warehouseList:[]
143 146
       }
144 147
     },
145 148
     methods: {
@@ -260,20 +263,12 @@
260 263
         }
261 264
         return name
262 265
       },
263
-      // getManufacturer(id){
264
-      //   let name = ''
265
-      //   this.manufacturer.map(item => {
266
-      //     if(item.id == id){
267
-      //       name = item.manufacturer_name
268
-      //     }
269
-      //   })
270
-      //   return name
271
-      // },
266
+      
272 267
       getManufacturer(id){
273 268
         let name = ""
274
-        for(let i=0;i<this.list.length;i++){
275
-           if(id == this.list[i].id){
276
-              name = this.list[i].manufacturer_name
269
+        for(let i=0;i<this.manufacturerList.length;i++){
270
+           if(id == this.manufacturerList[i].id){
271
+              name = this.manufacturerList[i].manufacturer_name
277 272
            }
278 273
         }
279 274
         return name
@@ -326,6 +321,42 @@
326 321
         }
327 322
         return name;
328 323
       },
324
+      getDrugOrderInPrint(order_id){
325
+          const params = {
326
+            id:order_id
327
+          };
328
+        getDrugOrderInPrint(params).then(response=>{
329
+          if(response.data.state == 1){
330
+           var info = response.data.data.info
331
+           console.log("info22233444444",info)
332
+           var warehousing =  response.data.data.warehousing
333
+           console.log("hhhhshdfh",warehousing)
334
+           this.warehouseList = warehousing
335
+           for(let i=0;i<info.length;i++){
336
+             info[i].child = []
337
+             for(let j=0;j<warehousing.length;j++){
338
+               if(info[i].id == warehousing[j].warehousing_id){
339
+                 info[i].child.push(warehousing[j])
340
+               }
341
+             }
342
+           }
343
+           console.log("infor2222",info)
344
+           this.tableList = info
345
+           var manufacturerList = response.data.data.manufacturerList
346
+           console.log("manufacturerList",manufacturerList)
347
+           this.manufacturerList = manufacturerList
348
+          }
349
+        })
350
+      },
351
+     getAllPrince(id){
352
+        var count = 0
353
+        for(let i=0;i<this.warehouseList.length;i++){
354
+          if(id == this.warehouseList[i].warehousing_id){
355
+             count +=this.warehouseList[i].warehousing_count * this.warehouseList[i].last_price
356
+          }
357
+        }
358
+        return count
359
+      }
329 360
     },
330 361
     created() {
331 362
       this.orgName = this.$store.getters.xt_user.org.org_name;
@@ -333,8 +364,8 @@
333 364
       this.fetchAllAdminUsers()
334 365
       this.GetConfigInfo()
335 366
       const order_id = this.$route.query.id;
336
-      this.GetOrderDetail(order_id);
337 367
       this.getList()
368
+      this.getDrugOrderInPrint(order_id)
338 369
 
339 370
     }
340 371
 

+ 10 - 3
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Näytä tiedosto

@@ -128,7 +128,7 @@
128 128
                   >
129 129
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
130 130
                   <template slot-scope="{ item }">
131
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit}}</div>
131
+                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
132 132
                   </template>
133 133
                  </el-autocomplete>
134 134
               </el-form-item>
@@ -629,8 +629,14 @@ export default {
629 629
                this.recordInfo.recordData[i].manufacturer = 0
630 630
              }
631 631
 
632
-             this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].drug.last_price.toString()
633
-             this.recordInfo.recordData[i].manufacturer = this.recordInfo.recordData[i].drug.manufacturer
632
+             this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].last_price.toString()
633
+            //  this.recordInfo.recordData[i].manufacturer = this.recordInfo.recordData[i].drug.manufacturer
634
+            
635
+            for(let j=0;j<this.manufacturerList.length;j++){
636
+              if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
637
+                 this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
638
+               }
639
+            }
634 640
             
635 641
           }
636 642
           const params = {
@@ -764,6 +770,7 @@ export default {
764 770
         this.currentIndex = val
765 771
       },
766 772
       handleSelect(val){
773
+        console.log("val2222",val)
767 774
         for(let i=0;i<this.recordInfo.recordData.length;i++){
768 775
            if(i == this.currentIndex){
769 776
              this.recordInfo.recordData[i].drug_id = val.id

+ 9 - 161
src/xt_pages/stock/drugs/drugStockOutOrder.vue Näytä tiedosto

@@ -200,7 +200,7 @@
200 200
           style="width: 100%"
201 201
           border
202 202
           highlight-current-row
203
-          ref="multipleTable"
203
+          ref="multipleTableOne"
204 204
           @selection-change="select"
205 205
           :row-style="{ color: '#303133' }"
206 206
           :header-cell-style="{
@@ -279,163 +279,6 @@
279 279
     </div>
280 280
 
281 281
 
282
-
283
-
284
-
285
-    <el-dialog
286
-      title="出库详细"
287
-      :visible.sync="dialogVisible"
288
-      width="60%"
289
-     >
290
-      <span>
291
-        <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
292
-                  border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
293
-                  :span-method="merge"
294
-        >
295
-          <el-table-column min-width="35" align="center">
296
-            <template slot="header" slot-scope="scope">
297
-              <span>药品名称</span>
298
-            </template>
299
-
300
-            <template slot-scope="scope">
301
-              <span v-if="scope.row.drug_id != 0">{{
302
-                scope.row.drug.drug_name
303
-              }}</span>
304
-            </template>
305
-          </el-table-column>
306
-          <el-table-column min-width="35" align="center">
307
-            <template slot="header" slot-scope="scope">
308
-              <span>规格名称</span>
309
-            </template>
310
-            <template slot-scope="scope">
311
-              <span v-if="scope.row.drug_id != 0">{{
312
-                scope.row.drug?scope.row.drug.drug_spec:''
313
-              }}</span>
314
-            </template>
315
-          </el-table-column>
316
-
317
-          <el-table-column min-width="23" align="center">
318
-            <template slot="header" slot-scope="scope">
319
-              <span>单价</span>
320
-            </template>
321
-            <template slot-scope="scope">
322
-              <!-- <span>{{scope.row.price}}</span> -->
323
-              <span>{{getRetailPrice(scope.row.drug_id)}}</span>
324
-            </template>
325
-          </el-table-column>
326
-
327
-          <el-table-column min-width="23" align="center">
328
-            <template slot="header" slot-scope="scope">
329
-              <span>出库数量</span>
330
-            </template>
331
-            <template slot-scope="scope">
332
-              <span v-if="drugConfig.is_open == 0 || drugConfig.is_open ==2 ">{{scope.row.count}}</span>
333
-              <span v-if="drugConfig.is_open ==1">{{getDrugCount(scope.row.drug_id)}}</span>
334
-            </template>
335
-          </el-table-column>
336
-          <el-table-column label="总价" min-width="20" align="center">
337
-            <template slot-scope="scope">
338
-              <span v-if="drugConfig.is_open == 0 || drugConfig.is_open == 2">{{(scope.row.count * getRetailPrice(scope.row.drug_id)).toFixed(2)}}</span>
339
-              <span v-if="drugConfig.is_open == 1">{{(getRetailPrice(scope.row.drug_id) * getDrugCount(scope.row.drug_id)).toFixed(2)}}</span>
340
-            </template>
341
-          </el-table-column>
342
-
343
-          <el-table-column label="备注" min-width="20" align="center">
344
-            <template slot-scope="scope">
345
-              <el-popover placement="top-start" width="250" trigger="hover">
346
-                <div>{{scope.row.remark}}</div>
347
-                <span slot="reference"
348
-                      v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
349
-                <span slot="reference" v-else>{{ scope.row.remark}}</span>
350
-              </el-popover>
351
-
352
-            </template>
353
-          </el-table-column>
354
-
355
-          <el-table-column label="" align="center"  >
356
-            <template slot-scope="scope" v-if="scope.row.is_sys == 1">
357
-             <div style="color: #589ff8" @click="jump(scope.row.id)">使用明细</div>
358
-            </template>
359
-          </el-table-column>
360
-        </el-table>
361
-      </span>
362
-      <span slot="footer" class="dialog-footer">
363
-        <el-button @click="dialogVisible = false">取 消</el-button>
364
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
365
-      </span>
366
-    </el-dialog>
367
-
368
-
369
-    <el-dialog
370
-      title="出库明细"
371
-      :visible.sync="dialogVisibleTwo"
372
-      width="60%">
373
-      <span>
374
-         <div class="app-container">
375
-
376
-      <div class="filter-container">
377
-        <span style="font-size: 18px;color: #606266">商品使用明细</span>
378
-      </div>
379
-
380
-      <div class="cell clearfix">
381
-        <span style="width: 300px;color: #606266" v-if="userList.length>0">商品类型: {{userList[0].drug.drug_name}} </span>
382
-        <span style="width: 300px;color: #606266" v-if="userList.length>0">规格名称: {{userList[0].drug.drug_spec}}</span>
383
-      </div>
384
-
385
-      <el-row :gutter="12" style="margin-top: 10px">
386
-        <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
387
-                  border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
388
-        >
389
-          <el-table-column min-width="35" align="center">
390
-            <template slot="header" slot-scope="scope">
391
-              <span>序号</span>
392
-            </template>
393
-            <template slot-scope="scope">
394
-              <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
395
-              <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
396
-            </template>
397
-          </el-table-column>
398
-
399
-          <el-table-column min-width="35" align="center">
400
-            <template slot="header" slot-scope="scope">
401
-              <span>使用人</span>
402
-            </template>
403
-            <template slot-scope="scope">
404
-              <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
405
-              <span v-if="scope.row.is_total == 1"></span>
406
-            </template>
407
-          </el-table-column>
408
-          <el-table-column min-width="35" align="center">
409
-            <template slot="header" slot-scope="scope">
410
-              <span>使用数量</span>
411
-            </template>
412
-            <template slot-scope="scope">
413
-              <span >{{scope.row.count}}</span>
414
-            </template>
415
-          </el-table-column>
416
-
417
-          <el-table-column min-width="35" align="center">
418
-            <template slot="header" slot-scope="scope">
419
-              <span>使用时间</span>
420
-            </template>
421
-            <template slot-scope="scope">
422
-              <span  v-if="scope.row.is_total == 0">{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
423
-              <span  v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
424
-            </template>
425
-          </el-table-column>
426
-
427
-        </el-table>
428
-      </el-row>
429
-    </div>
430
-      </span>
431
-      <span slot="footer" class="dialog-footer">
432
-        <el-button @click="dialogVisibleTwo = false">取 消</el-button>
433
-        <el-button type="primary" @click="dialogVisibleTwo = false">确 定</el-button>
434
-      </span>
435
-    </el-dialog>
436
-
437
-
438
-   
439 282
     <el-dialog
440 283
       title="提示"
441 284
       :visible.sync="drugDialogVisible"
@@ -534,7 +377,7 @@ export default {
534 377
       (nowDay < 10 ? "0" + nowDay : nowDay);
535 378
     this.GetWarehouseOut();
536 379
     this.GetConfigInfo();
537
-    this.fetchAllAdminUsers();
380
+    // this.fetchAllAdminUsers();
538 381
   },
539 382
   data() {
540 383
     return {
@@ -736,7 +579,7 @@ export default {
736 579
        this.getInitializtion()
737 580
        this.getSinleOrderDetail(val.id)
738 581
        this.list = []
739
-       this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
582
+      //  this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
740 583
 
741 584
     },
742 585
     GetOrderDetail(order_id) {
@@ -811,7 +654,12 @@ export default {
811 654
       }
812 655
     },
813 656
     select(selection) {
814
-      this.order_id = selection[0].id
657
+     
658
+      var ids= []
659
+      for(let i=0;i<selection.length;i++){
660
+         ids.push(selection[i].id)
661
+      }
662
+      this.order_id =  ids.join(",")
815 663
       this.selectedTableData = selection;
816 664
     },
817 665
     batchDelete() {

+ 1 - 1
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Näytä tiedosto

@@ -120,7 +120,7 @@
120 120
                   >
121 121
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
122 122
                   <template slot-scope="{ item }">
123
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit}}</div>
123
+                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + " " + item.manufacturer}}</div>
124 124
                   </template>
125 125
                  </el-autocomplete>
126 126
               </el-form-item>

+ 56 - 14
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue Näytä tiedosto

@@ -7,10 +7,11 @@
7 7
     </div>
8 8
     <div class="app-container ">
9 9
       <div id="dialysis-print-box">
10
-        <div class="dialysis-print-order">
10
+        <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11 11
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;">{{orgName}}</div>
12 12
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
13 13
 
14
+          <div style="float: left;margin-bottom: 1px;">单据编号:{{it.warehouse_out_order_number}}</div>
14 15
           <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
15 16
 
16 17
           <table class="print-table" border="1">
@@ -27,25 +28,25 @@
27 28
               <td style="line-height: 50px" width="">有效日期</td>
28 29
             </tr>
29 30
 
30
-            <tr v-for="(item,index) in warehousingOutInfo.warehousingOutData" :key="item.id">
31
+            <tr v-for="(item,i) in it.child" :key="i">
31 32
               <td style="line-height: 50px">
32
-                <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
33
+                <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
33 34
               </td>
34 35
               <td style="line-height: 50px">
35
-                  <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
36
+                  <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
36 37
               </td>
37 38
               <td style="line-height: 50px">
38
-                <span>{{getUnit(item.drug_id)}}</span>
39
+                <span>{{item.max_unit}}</span>
39 40
               </td>
40 41
 
41 42
               <td style="line-height: 50px">
42 43
                   {{item.count}}
43 44
               </td>
44 45
               <td style="line-height:50px">
45
-                  {{item.price}}
46
+                  {{item.last_price}}
46 47
               </td>
47 48
              <td  style="line-height:50px">
48
-                {{(item.count * item.price).toFixed(2)}}
49
+                {{(item.count * item.last_price).toFixed(2)}}
49 50
              </td>
50 51
              <td>{{getNumber(item.drug_id)}}</td>
51 52
              <td>{{getProductDate(item.drug_id)}}</td>
@@ -54,7 +55,7 @@
54 55
              <tr>
55 56
                <td style="line-height:50px">合计</td>
56 57
                <td colspan="7"></td>
57
-               <td>{{allPrice.toFixed(2)}}</td>
58
+               <td>{{getAllPrince(it.id).toFixed(2)}}</td>
58 59
              </tr>
59 60
             </tbody>
60 61
           </table>
@@ -90,7 +91,7 @@
90 91
   import { jsGetAge, uParseTime } from '@/utils/tools'
91 92
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
92 93
   import print from 'print-js'
93
-  import {  getDrugWarehouseOutInfo,getDrugWarehouseOrderInfo } from '@/api/drug/drug_stock'
94
+  import {  getDrugWarehouseOutInfo,getDrugWarehouseOrderInfo,getDrugOutOrderDetailPrint } from '@/api/drug/drug_stock'
94 95
   import {getBaseDrugLibList} from '@/api/data'
95 96
   export default {
96 97
     name: 'dialysisPrintOrder',
@@ -129,7 +130,11 @@
129 130
         keywords:"",
130 131
         orgId:'',
131 132
         orgName:"",
132
-        drugOrderList:[]
133
+        drugOrderList:[],
134
+        manufactureList:[],
135
+        tableList:[],
136
+        loading:false,
137
+        warehouseList:[]
133 138
       }
134 139
     },
135 140
     methods: {
@@ -303,14 +308,51 @@
303 308
           return uParseTime(val, '{y}-{m}-{d}')
304 309
          }
305 310
       },
311
+
312
+      getDrugOutOrderDetailPrint(order_id){
313
+        var params = {
314
+          id:order_id
315
+        }
316
+        getDrugOutOrderDetailPrint(params).then(response=>{
317
+          if(response.data.state ==1){
318
+             var info = response.data.data.info
319
+             console.log("info",info)
320
+            var warehousing = response.data.data.warehousing
321
+            console.log("ware2232",warehousing)
322
+            this.warehouseList = warehousing
323
+            for(let i=0;i<info.length;i++){
324
+               info[i].child = []
325
+              for(let j=0;j<warehousing.length;j++){
326
+                if(info[i].id == warehousing[j].warehouse_out_id){
327
+                    info[i].child.push(warehousing[j])
328
+                }
329
+              }
330
+            }
331
+            
332
+            var manufacturerList = response.data.data.manufacturerList
333
+            console.log("manufacturelist",manufacturerList)
334
+            this.manufactureList = manufacturerList
335
+            console.log("列表",info)
336
+            this.tableList = info
337
+            this.loading = false
338
+          }
339
+        })
340
+      },
341
+      getAllPrince(id){
342
+        var count = 0
343
+        for(let i=0;i<this.warehouseList.length;i++){
344
+          if(id == this.warehouseList[i].warehouse_out_id){
345
+             count +=this.warehouseList[i].count * this.warehouseList[i].last_price
346
+          }
347
+        }
348
+        return count
349
+      }
306 350
     },
307 351
     created() {
308 352
       this.orgName = this.$store.getters.xt_user.org.org_name;
309 353
       const order_id = this.$route.query.id;
310
-      this.orgId = this.$store.getters.xt_user.org.id;
311
-      this.GetOrderDetail(order_id);
312
-      this.getList()
313
-      this.getDrugWarehouseOrderInfo()
354
+      this.orgId = this.$store.getters.xt_user.org.id;  
355
+      this.getDrugOutOrderDetailPrint(order_id)
314 356
     }
315 357
 
316 358
   }

+ 10 - 3
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Näytä tiedosto

@@ -98,7 +98,7 @@
98 98
                   >
99 99
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
100 100
                   <template slot-scope="{ item }">
101
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit}}</div>
101
+                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
102 102
                   </template>
103 103
                  </el-autocomplete>
104 104
               </el-form-item>
@@ -544,7 +544,13 @@
544 544
                 return;
545 545
               }
546 546
             }
547
-
547
+            for(let i=0;i<this.recordInfo.recordData.length;i++){
548
+               for(let j=0;j<this.manufacturerList.length;j++){
549
+                 if(this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].manufacturer_name){
550
+                    this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
551
+                 }
552
+               }
553
+            }
548 554
             const params = {
549 555
               'stockOut': this.recordInfo.recordData
550 556
             }
@@ -613,7 +619,8 @@
613 619
             this.recordInfo.recordData.push(tempObj)
614 620
           }
615 621
         })
616
-      }, calculate: function(val) {
622
+      },
623
+       calculate: function(val) {
617 624
         if (val == 0) {
618 625
           return ''
619 626
         }

+ 126 - 29
src/xt_pages/stock/drugs/query.vue Näytä tiedosto

@@ -32,9 +32,9 @@
32 32
     </div>
33 33
     <div class="app-container ">
34 34
       <div class="cell clearfix">
35
-         <el-select v-model="drug_category" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
35
+         <el-select v-model="drug_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
36 36
             <el-option
37
-              v-for="(item,index) in drugCategory"
37
+              v-for="(item,index) in drugTypeList"
38 38
               :key="index"
39 39
               :label="item.name"
40 40
               :value="item.id">
@@ -113,31 +113,34 @@
113 113
         </el-table-column>
114 114
         <el-table-column prop="drug_name" label="入库数量" align="center">
115 115
            <template slot-scope="scope">
116
-              {{getInCount(scope.row.drug_id)}}
116
+             <!-- {{getInCount(scope.row.drug_id)}} -->
117
+              {{getInCount(scope.row.drug_id)}}{{scope.row.max_unit}}
117 118
            </template>
118 119
         </el-table-column>
119 120
         <el-table-column prop="drug_name" label="出库数量" align="center">
120 121
            <template slot-scope="scope">
121
-             {{getOutCount(scope.row.drug_id) + getAutoCount(scope.row.drug_id)}}
122
+             <!-- {{getOutCount(scope.row.drug_id) + getAutoCount(scope.row.drug_id)}} -->
123
+             {{getCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
122 124
            </template>
123 125
         </el-table-column>
124 126
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
125 127
            <template slot-scope="scope">
126
-            {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}}
128
+            <!-- {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}} -->
129
+            {{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
127 130
            </template>
128 131
         </el-table-column>
129
-        <el-table-column prop="drug_name" label="操作" align="center">
132
+        <el-table-column prop="drug_name" label="操作" align="center" width="200px">
130 133
           <template slot-scope="scope">
131 134
             <el-button
132 135
               size="small"
133 136
               type="primary"
134
-              @click="handleDetail(scope.row.drug_id)"
137
+              @click="handleDetail(scope.row)"
135 138
             >库存流水
136 139
             </el-button>
137 140
             <el-button
138 141
               size="small"
139 142
               type="primary"
140
-              @click="handleBatch(scope.row.drug_id)"
143
+              @click="handleBatch(scope.row)"
141 144
             >批次
142 145
             </el-button>
143 146
           </template>
@@ -171,13 +174,14 @@
171 174
   import { getAllDrugStockQueryList,getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
172 175
   import SettingDialog from './settingDialog/index'
173 176
   import { getDictionaryDataConfig } from "@/utils/data";
177
+import { min } from 'moment'
174 178
   export default {
175 179
     name: 'stockIn',
176 180
     created() {
177 181
       var drugCategory = getDictionaryDataConfig('system','drug_category')
178 182
       this.drugCategory.push(...drugCategory)
179
-      this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
180
-  
183
+      var drugTypeList = getDictionaryDataConfig('system','drug_type') 
184
+      this.drugTypeList.push(...drugTypeList)
181 185
       this.getlist()
182 186
       this.getDrugCountList()
183 187
     },
@@ -212,13 +216,19 @@
212 216
         drugCategory:[
213 217
           {id:0,name:"全部"}
214 218
         ],
215
-        drugTypeList:[],
219
+        drugTypeList:[
220
+          {id:0,name:"全部"}
221
+        ],
216 222
         tableList:[],
217 223
         manufacturerList:[],
218 224
         countList:[],
219 225
         outCountList:[],
220 226
         autoCountList:[],
221 227
         keyword:"",
228
+        drug_type:0,
229
+        minCount:[],
230
+        drugOutList:[],
231
+        
222 232
       }
223 233
     },
224 234
     methods: {
@@ -333,12 +343,12 @@
333 343
       },
334 344
       handleSizeChange(val) {
335 345
         this.limit = val
336
-        // this.GetAllDrugStockQueryList()
346
+     
337 347
         this.getlist()
338 348
       },
339 349
       handleCurrentChange(val) {
340 350
         this.page = val
341
-        // this.GetAllDrugStockQueryList()
351
+       
342 352
         this.getlist()
343 353
       },
344 354
       calculate: function(val) {
@@ -352,7 +362,7 @@
352 362
         this.$message.error("开始时间不能大于结束时间");
353 363
         this.start_time = "";
354 364
       } else {
355
-        // this.GetAllDrugStockQueryList();
365
+     
356 366
         this.getlist()
357 367
       }
358 368
     },
@@ -412,14 +422,24 @@
412 422
         this.$refs.dialog.show()
413 423
       },
414 424
        exportStock(){
425
+
426
+         for(let i=0;i<this.tableList.length;i++){
427
+           this.tableList[i].index = i+1
428
+           this.tableList[i].drug_type_name = this.getDrugType(this.tableList[i].drug_type)
429
+           this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number+this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
430
+           this.tableList[i].manufacturer_name = this.getManufacturerList(this.tableList[i].manufacturer)
431
+           this.tableList[i].inCount =  this.getInCount(this.tableList[i].drug_id) + this.tableList[i].max_unit
432
+           this.tableList[i].outCount = this.getCount(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
433
+           this.tableList[i].overplusCount = this.getCountTwo(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
434
+         }
435
+       
436
+         console.log("2322323232",this.tableList)
415 437
          import('@/vendor/Export2Excel').then(excel => {
416
-         const tHeader = ['药品名称', '规格名称', '入库数量','单价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
417
-         const filterVal = ['drug_name', 'drug_spec', 'stockInCount','last_price','salesReturnCount','reactCount','stockOutCount','cancelStockCount','reactOutCount','overplusCount']
438
+         const tHeader = ['序号', '药品类型', '药品名称','规格型号&单位','进货单价','厂家','入库数量','出库数量','剩余库存量']
439
+         const filterVal = ['index', 'drug_type_name', 'drug_name','unit','last_price','manufacturer_name','inCount','outCount','overplusCount']
418 440
        
419 441
         
420
-         const data = this.formatJson(filterVal, this.tableData)
421
-        //  console.log("data",data)
422
-        
442
+         const data = this.formatJson(filterVal, this.tableList)
423 443
          excel.export_json_to_excel({
424 444
            header: tHeader,
425 445
            data,
@@ -438,13 +458,12 @@
438 458
         return (new Date(time)).getTime() / 1000
439 459
       },
440 460
       changeDrug(){
441
-     
442
-      this.getlist()
461
+        this.getlist()
443 462
       },
444 463
       printOrder(){
445 464
         this.$router.push({
446 465
           name: "drugQueryPrint",
447
-          query: {drug_category:this.drug_category,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
466
+          query: {drug_type:this.drug_type,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
448 467
         });
449 468
       },
450 469
  
@@ -454,11 +473,11 @@
454 473
           page: this.page,
455 474
           limit: this.limit,
456 475
           keyword: this.keywords,
457
-          drug_category:this.drug_category,
476
+          drug_type:this.drug_type,
458 477
           start_time:this.start_time,
459 478
           end_time:this.end_time,
460 479
         }
461
-         
480
+        console.log("parasm222222",params)
462 481
         getDrugStockList(params).then(response=>{
463 482
           if(response.data.state == 1){
464 483
              var list = response.data.data.list
@@ -493,11 +512,25 @@
493 512
         }
494 513
         return name
495 514
       },
496
-      handleDetail(id){
497
-        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+id})
515
+      handleDetail(val){
516
+        var manufacturer_name = ""
517
+        for(let i=0;i<this.manufacturerList.length;i++){
518
+         if(val.manufacturer == this.manufacturerList[i].id){
519
+           manufacturer_name = this.manufacturerList[i].manufacturer_name
520
+         }
521
+        }
522
+        var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
523
+        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
498 524
       },
499
-      handleBatch(id){
500
-        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+id})
525
+      handleBatch(val){
526
+        var manufacturer_name = ""
527
+        for(let i=0;i<this.manufacturerList.length;i++){
528
+         if(val.manufacturer == this.manufacturerList[i].id){
529
+           manufacturer_name = this.manufacturerList[i].manufacturer_name
530
+         }
531
+        }
532
+        var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
533
+        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
501 534
       },
502 535
       getDrugCountList(){
503 536
          var params = {
@@ -516,6 +549,17 @@
516 549
             var aucountlist = response.data.data.auCountList
517 550
             console.log("自动数据",aucountlist)
518 551
             this.autoCountList = aucountlist
552
+            var minCount = response.data.data.minCount
553
+            console.log("minCount",minCount)
554
+            this.minCount = minCount
555
+            var info = response.data.data.info
556
+            for(let i=0;i<info.length;i++){
557
+              if(info[i].count_unit == info[i].max_unit){
558
+                 info[i].count = info[i].count * info[i].min_number
559
+              }
560
+            }
561
+            console.log("info2222222",info)
562
+            this.drugOutList = info
519 563
           }
520 564
         })
521 565
       },
@@ -546,7 +590,60 @@
546 590
           }
547 591
         }
548 592
         return count
549
-      }
593
+      },
594
+      getMinCount(id){
595
+        var count=""
596
+        for(let i=0;i<this.minCount.length;i++){
597
+          if(id == this.minCount[i].drug_id){
598
+            count = this.minCount[i].count
599
+          }
600
+        }
601
+        return count
602
+      },
603
+      getCount(drug_id,min_number,max_unit,min_unit){
604
+        var count= 0
605
+        var str = ""
606
+        var min_str = ""
607
+        for(let i=0;i<this.drugOutList.length;i++){
608
+          if(drug_id == this.drugOutList[i].drug_id){
609
+             count += parseInt(this.drugOutList[i].count)
610
+          }
611
+        }
612
+        if(parseInt(count/min_number)!=0){
613
+          str = parseInt(count/min_number)+ max_unit
614
+        }
615
+        if((count%min_number)!=0){
616
+          min_str =  count%min_number + min_unit
617
+        }
618
+        return str + min_str
619
+      },
620
+
621
+      getCountOne(drug_id){
622
+        var count= 0
623
+        for(let i=0;i<this.drugOutList.length;i++){
624
+          if(drug_id == this.drugOutList[i].drug_id){
625
+             count += parseInt(this.drugOutList[i].count)
626
+          }
627
+        }
628
+        return count
629
+      },
630
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
631
+       var total_count = 0
632
+       var out_count = 0
633
+       var count = 0
634
+       var str = ""
635
+       var str_min = ""
636
+       total_count = this.getInCount(drug_id) * min_number
637
+       out_count = this.getCountOne(drug_id)
638
+       count = total_count-out_count
639
+       if(parseInt(count/min_number)!=0){
640
+         str = parseInt(count/min_number) + max_unit
641
+       }
642
+       if((count%min_number)!=0){
643
+         str_min = count%min_number + min_unit
644
+       }
645
+       return str+str_min
646
+     }
550 647
     }
551 648
   }
552 649
 </script>

+ 52 - 27
src/xt_pages/stock/stockBatchNumber.vue Näytä tiedosto

@@ -5,9 +5,10 @@
5 5
     </div>
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8
-       耗材名称:{{this.$route.query.good_name}}
9
-       <!-- 库存:
10
-       厂家: -->
8
+        耗材名称:{{this.$route.query.good_name}} &nbsp;
9
+        库存:{{getInCount(this.$route.query.id)}} &nbsp;
10
+        规格:{{this.$route.query.specification_name}} &nbsp;
11
+        厂家:{{this.$route.query.manufacturer}} 
11 12
       </div>
12 13
       <div class="cell clearfix">
13 14
         <span>日期查询:</span>
@@ -62,8 +63,7 @@
62 63
         </el-table-column>
63 64
         <el-table-column prop="drug_name" label="入库单据编码" align="center">
64 65
            <template slot-scope="scope" >
65
-             <span v-if="scope.row.stock_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
66
-             <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
66
+             <span >{{scope.row.warehousing_order}}</span>
67 67
            </template>
68 68
         </el-table-column>
69 69
         <el-table-column prop="drug_name" label="操作日期" align="center">
@@ -73,25 +73,24 @@
73 73
         </el-table-column>
74 74
          <el-table-column prop="drug_name" label="有效期" align="center">
75 75
            <template slot-scope="scope">
76
-             <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
77
-             <span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
76
+             <span> {{getTime(scope.row.expiry_date)}}</span>
77
+          
78 78
            </template>
79 79
         </el-table-column>
80 80
          <el-table-column prop="drug_name" label="批号" align="center">
81 81
            <template slot-scope="scope" >
82
-             <span v-if="scope.row.stock_way == 4">{{scope.row.number}} </span>
82
+             <span>{{scope.row.number}} </span>
83 83
            </template>
84 84
         </el-table-column>
85 85
         <el-table-column prop="drug_name" label="入库数量" align="center">
86 86
            <template slot-scope="scope">
87
-             <span v-if="scope.row.stock_way == 4"> {{scope.row.warehousing_count}}</span>
88
-             <span v-if="scope.row.stock_way == 2">{{scope.row.count}}</span>
87
+             <span> {{scope.row.warehousing_count}}{{packing_unit}}</span>
88
+           
89 89
            </template>
90 90
         </el-table-column>
91 91
          <el-table-column prop="drug_name" label="进货价" align="center">
92 92
            <template slot-scope="scope">
93
-             <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
94
-             <span v-if="scope.row.stock_way == 2">{{scope.row.price}}</span>
93
+             <span> {{scope.row.price}}</span>
95 94
            </template>
96 95
         </el-table-column>
97 96
        </el-table>
@@ -115,11 +114,13 @@
115 114
   import { uParseTime } from '@/utils/tools'
116 115
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
117 116
   import {getStockInList} from "@/api/drug/drug_stock";
117
+  import {getStockDrugCount} from "@/api/stock"
118 118
   export default {
119 119
     name: 'stockIn',
120 120
     created() {
121 121
       this.getlist()
122
-    //   this.getOutList()
122
+      this.getStockDrugCount()
123
+      this.packing_unit = this.$route.query.packing_unit
123 124
     },
124 125
     components: {
125 126
       BreadCrumb
@@ -162,7 +163,11 @@
162 163
           {id:2,name:"自动出库"},
163 164
           {id:3,name:"入库"},
164 165
         ],
165
-      
166
+        countList:[],
167
+        outCountList:[],
168
+        autoCountList:[],
169
+        keywords:"",
170
+        packing_unit:""
166 171
       }
167 172
     },
168 173
     methods:{
@@ -227,32 +232,52 @@
227 232
          if(response.data.state == 1){
228 233
            var list = response.data.data.list
229 234
            console.log("入库数据",list)
230
-           for(let i=0;i<list.length;i++){
231
-             list[i].stock_way = 4
232
-           }
235
+          //  for(let i=0;i<list.length;i++){
236
+          //    list[i].stock_way = 4
237
+          //  }
233 238
            this.tableList = list
234 239
            var total = response.data.data.total
235 240
            this.total = total
236 241
            console.log("入库数据",this.tableList)
237 242
            var manufacturerList = response.data.data.manufacturerList
238 243
            this.manufacturerList = manufacturerList
239
-
240
-          // var outlist =  response.data.data.outList
241
-          // console.log("outlist",outlist)
242
-          // for(let i=0;i<outlist.length;i++){
243
-          //     outlist[i].stock_way = 2
244
-          //     this.tableList.push(outlist[i])
245
-          // }
246
-          
247
-           
248 244
          }
249 245
       })
250 246
      },
247
+    getInCount(id){
248
+      var count= ""
249
+      for(let i=0;i<this.countList.length;i++){
250
+          if(id == this.countList[i].good_id){
251
+              count = this.countList[i].count
252
+          }
253
+        }
254
+        return count
255
+     },
251 256
      getTimestamp(time) {
252 257
       // 把时间日期转成时间戳
253 258
       return new Date(time).getTime() / 1000;
254 259
      },
255
-     
260
+    getStockDrugCount(){
261
+        var params ={
262
+          keywords: this.keywords,
263
+          start_time:this.start_time,
264
+          end_time:this.end_time,
265
+        }
266
+      getStockDrugCount(params).then(response=>{
267
+         if(response.data.state == 1){
268
+           var count = response.data.data.count
269
+           console.log("详情入库统计",count)
270
+           this.countList = count
271
+           var outlist = response.data.data.outList
272
+           console.log("详情出库数量",outlist)
273
+          
274
+           this.outCountList = outlist
275
+           var autoCount = response.data.data.autoCount
276
+           console.log("详情自动出库",autoCount)
277
+           this.autoCountList = autoCount
278
+         }
279
+      })
280
+    },
256 281
 
257 282
     }
258 283
   }

+ 70 - 23
src/xt_pages/stock/stockFlow.vue Näytä tiedosto

@@ -5,10 +5,10 @@
5 5
     </div>
6 6
     <div class="app-container ">
7 7
       <div class="cell clearfix">
8
-       耗材名称:{{this.$route.query.good_name}}
9
-       库存:{{getInCount(this.$route.query.id)}}
10
-       <!-- 厂家:{{this.$route.query.manufacturer}}
11
-       规格: -->
8
+       耗材名称:{{this.$route.query.good_name}} &nbsp;
9
+       库存:{{getInCount(this.$route.query.id)}} &nbsp;
10
+       规格:{{this.$route.query.specification_name}} &nbsp;
11
+       厂家:{{this.$route.query.manufacturer}} 
12 12
       </div>
13 13
       <div class="cell clearfix">
14 14
         <span>日期查询:</span>
@@ -39,15 +39,15 @@
39 39
               @change="endTimeChange"
40 40
           ></el-date-picker>
41 41
 
42
-        <!-- <span>出入库方式:</span> -->
43
-        <!-- <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
42
+        <span>出入库方式:</span>
43
+         <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
44 44
             <el-option
45 45
               v-for="(item,index) in stockType"
46 46
               :key="index"
47 47
               :label="item.name"
48 48
               :value="item.id">
49 49
             </el-option>
50
-        </el-select> -->
50
+        </el-select>
51 51
         
52 52
         
53 53
       </div>
@@ -63,13 +63,14 @@
63 63
         </el-table-column>
64 64
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
65 65
            <template slot-scope="scope">
66
-             <span v-if="scope.row.stock_way == 4">入库</span>
67
-             <span v-if="scope.row.stock_way == 2">出库</span>
66
+             <span v-if="scope.row.stock_way == 4">采购入库</span>
67
+             <span v-if="scope.row.stock_way == 3">手动出库</span>
68
+             <span v-if="scope.row.stock_way == 2">自动出库</span>
68 69
            </template>
69 70
         </el-table-column>
70 71
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
71 72
            <template slot-scope="scope">
72
-             <span v-if="scope.row.stock_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
73
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3"> {{scope.row.warehouse_out_order_number}}</span>
73 74
              <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
74 75
             
75 76
            </template>
@@ -79,40 +80,40 @@
79 80
              {{getTime(scope.row.ctime)}}
80 81
            </template>
81 82
         </el-table-column>
82
-         <el-table-column prop="drug_name" label="入库数量"  align="center">
83
+         <el-table-column prop="drug_name" label="入库数量"  align="center">
83 84
            <template slot-scope="scope">
84
-             <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
85
-             <span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
85
+             <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}{{packing_unit}}</span>
86
+             <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}{{packing_unit}}</span>
86 87
            </template>
87 88
         </el-table-column>
88 89
          <el-table-column prop="drug_name" label="剩余库存量"  align="center">
89 90
            <template slot-scope="scope">
90 91
              <!-- <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span> -->
91
-              {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}
92
+              {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}{{packing_unit}}
92 93
            </template>
93 94
         </el-table-column>
94 95
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
95 96
            <template slot-scope="scope">
96 97
              <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
97
-             <span v-if="scope.row.stock_way == 2">{{scope.row.price}}</span>
98
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{scope.row.price}}</span>
98 99
            </template>
99 100
         </el-table-column>
100 101
          <el-table-column prop="drug_name" label="有效期" align="center">
101 102
            <template slot-scope="scope" >
102 103
              <span v-if="scope.row.stock_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
103
-             <span v-if="scope.row.stock_way == 2">{{getTime(scope.row.expiry_date)}}</span>
104
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getTime(scope.row.expiry_date)}}</span>
104 105
            </template>
105 106
         </el-table-column>
106 107
         <el-table-column prop="drug_name" label="批号" align="center">
107 108
            <template slot-scope="scope" >
108 109
              <span v-if="scope.row.stock_way == 2"> {{scope.row.number}}</span>
109
-             <span v-if="scope.row.stock_way == 4">{{scope.row.number}}</span>
110
+             <span v-if="scope.row.stock_way == 4 || scope.row.stock_way == 3">{{scope.row.number}}</span>
110 111
            </template>
111 112
         </el-table-column>
112 113
         <el-table-column prop="drug_name" label="生产商" align="center">
113 114
            <template slot-scope="scope">
114 115
              <span v-if="scope.row.stock_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
115
-             <span v-if="scope.row.stock_way == 2">{{getManufacturer(scope.row.manufacturer)}}</span>
116
+             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getManufacturer(scope.row.manufacturer)}}</span>
116 117
            </template>
117 118
         </el-table-column>
118 119
        </el-table>
@@ -135,7 +136,7 @@
135 136
 <script>
136 137
   import { uParseTime } from '@/utils/tools'
137 138
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
138
-  import {getStockInList} from "@/api/drug/drug_stock";
139
+  import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
139 140
   import {getStockDrugCount} from "@/api/stock"
140 141
   export default {
141 142
     name: 'stockIn',
@@ -143,7 +144,8 @@
143 144
      
144 145
       this.getlist()
145 146
       this.getStockDrugCount()
146
-
147
+      this.getStockOutList()
148
+      this.packing_unit = this.$route.query.packing_unit
147 149
     },
148 150
     components: {
149 151
       BreadCrumb
@@ -182,15 +184,16 @@
182 184
         manufacturerList:[],
183 185
         stockType:[
184 186
           {id:0,name:"全部"},
185
-          {id:1,name:"手动出库"},
187
+          {id:3,name:"手动出库"},
186 188
           {id:2,name:"自动出库"},
187
-          {id:3,name:"入库"},
189
+          {id:4,name:"采购入库"},
188 190
         ],
189 191
         countList:[],
190 192
         outCountList:[],
191 193
         autoCountList:[],
192 194
         keywords:"",
193 195
         obj:{},
196
+        packing_unit:""
194 197
       }
195 198
     },
196 199
     methods:{
@@ -199,10 +202,12 @@
199 202
        handleSizeChange(val) {
200 203
         this.limit = val
201 204
         this.getlist()
205
+        this.getStockOutList()
202 206
       },
203 207
       handleCurrentChange(val) {
204 208
         this.page = val
205 209
         this.getlist()
210
+        this.getStockOutList()
206 211
       },
207 212
         
208 213
     startTimeChange: function(val) {
@@ -213,6 +218,7 @@
213 218
         this.start_time = "";
214 219
       } else {
215 220
         this.getlist()
221
+        this.getStockOutList()
216 222
       }
217 223
     },
218 224
     endTimeChange: function(val) {
@@ -222,6 +228,7 @@
222 228
         this.end_time = "";
223 229
       } else {
224 230
        this.getlist()
231
+       this.getStockOutList()
225 232
       }
226 233
      },
227 234
      getManufacturer(id){
@@ -250,7 +257,8 @@
250 257
           page:this.page,
251 258
           id:this.$route.query.id,
252 259
           start_time:this.start_time,
253
-          end_time:this.end_time, 
260
+          end_time:this.end_time,
261
+          is_sys:this.stockType 
254 262
         } 
255 263
       getStockInList(params).then(response=>{
256 264
          if(response.data.state == 1){
@@ -267,6 +275,33 @@
267 275
          }
268 276
       })
269 277
      },
278
+    getStockOutList(){
279
+       var params= {
280
+          limit:this.limit,
281
+          page:this.page,
282
+          id:this.$route.query.id,
283
+          start_time:this.start_time,
284
+          end_time:this.end_time, 
285
+          is_sys:this.stock_type 
286
+        } 
287
+      getStockOutList(params).then(response=>{
288
+        if(response.data.state == 1){
289
+          var outList = response.data.data.outList
290
+          console.log("outList990-0000990",outList)
291
+           for(let i=0;i<outList.length;i++){
292
+             if(outList[i].is_sys == 0){
293
+                outList[i].stock_way = 3
294
+             }
295
+             if(outList[i].is_sys == 1){
296
+                outList[i].stock_way = 2
297
+             }
298
+             this.tableList.push(outList[i])
299
+           }
300
+          var total = response.data.data.total
301
+          this.total = total
302
+        }  
303
+      })
304
+    },
270 305
     getStockDrugCount(){
271 306
         var params ={
272 307
           keywords: this.keywords,
@@ -280,6 +315,7 @@
280 315
            this.countList = count
281 316
            var outlist = response.data.data.outList
282 317
            console.log("详情出库数量",outlist)
318
+          
283 319
            this.outCountList = outlist
284 320
            var autoCount = response.data.data.autoCount
285 321
            console.log("详情自动出库",autoCount)
@@ -319,6 +355,17 @@
319 355
       // 把时间日期转成时间戳
320 356
       return new Date(time).getTime() / 1000;
321 357
      },
358
+     changeDrug(val){
359
+       this.tableList= []
360
+       if(val == 4 || val == 0){
361
+        this.getlist()
362
+       }
363
+       if(val == 2 || val == 3 || val == 0){
364
+        this.getStockOutList()
365
+       }
366
+      
367
+      
368
+     }
322 369
     }
323 370
   }
324 371
 </script>

+ 99 - 42
src/xt_pages/stock/stockInOrder.vue Näytä tiedosto

@@ -21,7 +21,7 @@
21 21
           style="width: 400px;"
22 22
           v-model.trim="searchKey"
23 23
           class="filter-item"
24
-          placeholder="单据编码/制单人/厂商"
24
+          placeholder="单据编码/制单人/耗材名称"
25 25
         />
26 26
         <el-button
27 27
           size="small"
@@ -67,23 +67,25 @@
67 67
       <div class="cell clearfix">
68 68
         <el-checkbox
69 69
           style="width: 70px"
70
-          v-model="checked"
71
-          @change="changeAllSelected"
70
+          v-model="checkAllStatus"
71
+          @change="changeCheck"
72 72
           >全选</el-checkbox
73 73
         >
74 74
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
75 75
 
76 76
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
77
+
78
+        <el-button size="small" type="primary" @click="toExport">导出</el-button>
77 79
       </div>
78 80
 
79 81
       <el-table
82
+        ref="multipleTable"
80 83
         :data="Warehouse.warehouseDate"
81 84
         :class="signAndWeighBoxPatients"
82 85
         style="width: 100%"
83 86
         border
84 87
         highlight-current-row
85 88
         v-loading="Warehouse.loading"
86
-        ref="multipleTable"
87 89
         @selection-change="select"
88 90
         :row-style="{ color: '#303133' }"
89 91
         :header-cell-style="{
@@ -115,20 +117,6 @@
115 117
 
116 118
         <el-table-column label="操作" align="center" width="260px">
117 119
           <template slot-scope="scope">
118
-            <!-- <el-tooltip
119
-              class="item"
120
-              effect="dark"
121
-              content="详情"
122
-              placement="top"
123
-            >
124
-              <el-button
125
-                size="small"
126
-                type="warning"
127
-                icon="el-icon-document"
128
-                @click="handleSearch(scope.row.id)"
129
-              >
130
-              </el-button>
131
-            </el-tooltip> -->
132 120
             <el-tooltip
133 121
               class="item"
134 122
               effect="dark"
@@ -181,13 +169,13 @@
181 169
           border
182 170
           highlight-current-row
183 171
           v-loading="Warehouse.loading"
184
-          ref="multipleTable"
185 172
           @selection-change="select"
186 173
           :row-style="{ color: '#303133' }"
187 174
           :header-cell-style="{
188 175
             backgroundColor: 'rgb(245, 247, 250)',
189 176
             color: '#606266'
190 177
           }"
178
+          fit
191 179
         >
192 180
         <el-table-column label="耗材名称" align="center">
193 181
           <template slot-scope="scope">
@@ -231,12 +219,12 @@
231 219
         </el-table-column>
232 220
         <el-table-column label="生产日期" align="center">
233 221
           <template slot-scope="scope">
234
-            {{ getTime(scope.row.product_date)}}
222
+            {{ getTime(scope.row.product_date,"{y}-{m}-{d}")}}
235 223
           </template>
236 224
         </el-table-column>
237 225
         <el-table-column label="有效期" align="center">
238 226
           <template slot-scope="scope">
239
-            {{ getTime(scope.row.expiry_date)}}
227
+            {{ getTime(scope.row.expiry_date,"{y}-{m}-{d}")}}
240 228
           </template>
241 229
         </el-table-column>
242 230
         <el-table-column label="备注" align="center">
@@ -628,7 +616,8 @@ import {
628 616
   getWarehouseList,
629 617
   DeleteWarehouseInfoItem,
630 618
   GetAllGoodInfoByID,
631
-  EditWarehouse
619
+  EditWarehouse,
620
+  getExportStockList
632 621
 } from "@/api/stock";
633 622
 
634 623
 import { GetAllDrugInfoByID,postDrugWarehouse} from "@/api/drug/drug_stock";
@@ -638,7 +627,6 @@ export default {
638 627
   name: "stockIn",
639 628
   components: { BreadCrumb, stockInDialog },
640 629
   created() {
641
-
642 630
     var nowDate = new Date();
643 631
     var nowYear = nowDate.getFullYear();
644 632
     var nowMonth = nowDate.getMonth() + 1;
@@ -665,6 +653,8 @@ export default {
665 653
     this.fetchAllAdminUsers();
666 654
     this.GetAllGoodType()
667 655
     this.GetAllGoodInfo()
656
+
657
+    
668 658
   },
669 659
   data() {
670 660
 
@@ -752,20 +742,28 @@ export default {
752 742
         dealer: '',
753 743
         manufacturer: ''
754 744
       },
755
-        isCreated: 1,
756
-        isVisibility: false,
757
-        drug_id:1,
745
+      isCreated: 1,
746
+      isVisibility: false,
747
+      drug_id:1,
758 748
       },
759 749
       drug_id:1,
760 750
       tableShow:false,
761 751
       tableList:[],
762 752
       isVisibility:false,
763 753
       order_id:0,
754
+      exportList:[],
755
+      checkAllStatus:false,
764 756
     };
765 757
     
766 758
   
767 759
   },
768 760
   methods: {
761
+     changeCheck() {
762
+      this.$refs.multipleTable.clearSelection();
763
+      if (this.checkAllStatus) {
764
+        this.$refs.multipleTable.toggleAllSelection();
765
+      }
766
+    },
769 767
     search: function() {
770 768
       const Params = {
771 769
         page: this.page,
@@ -983,6 +981,7 @@ export default {
983 981
       } else {
984 982
         this.startTime = this.getTimestamp(val);
985 983
         this.GetWarehouse();
984
+        this.getlist()
986 985
       }
987 986
     },
988 987
     endTimeChange(val) {
@@ -992,6 +991,7 @@ export default {
992 991
         this.end_time = "";
993 992
       } else {
994 993
         this.GetWarehouse();
994
+        this.getlist()
995 995
       }
996 996
     },
997 997
     getTimestamp(time) {
@@ -1016,9 +1016,9 @@ export default {
1016 1016
         } else {
1017 1017
           this.manufacturer = response.data.data.manufacturer;
1018 1018
           this.dealer = response.data.data.dealer;
1019
-          this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
1020
-          this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
1021
-         
1019
+          // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
1020
+          // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
1021
+          this.getlist()
1022 1022
         }
1023 1023
       });
1024 1024
     },
@@ -1081,18 +1081,17 @@ export default {
1081 1081
         })
1082 1082
         .catch(() => {});
1083 1083
     },
1084
-    changeAllSelected: function(val) {
1085
-      if (val) {
1086
-        this.$refs.multipleTable.toggleAllSelection();
1087
-      } else {
1088
-        this.$refs.multipleTable.clearSelection();
1089
-      }
1090
-    },
1084
+   
1091 1085
     select(selection) {
1092
-      this.order_id = selection[0].id
1093 1086
       console.log("selection",selection)
1087
+      var ids= []
1088
+      for(let i=0;i<selection.length;i++){
1089
+        ids.push(selection[i].id)
1090
+      }
1091
+      var str = ids.join(",")
1092
+      this.order_id = str
1094 1093
       this.selectedTableData = selection;
1095
-
1094
+      this.getlist()
1096 1095
     },
1097 1096
     batchDelete() {
1098 1097
       if (this.selectedTableData.length <= 0) {
@@ -1164,8 +1163,6 @@ export default {
1164 1163
           this.tableShow = true
1165 1164
           for (let i = 0; i < response.data.data.info.length; i++) {
1166 1165
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
1167
-            // response.data.data.info[i].product_date = this.getTime(response.data.data.info[i].product_date,"{y}-{m}-{d}");
1168
-            // response.data.data.info[i].expiry_date = this.getTime(response.data.data.info[i].expiry_date,"{y}-{m}-{d}");
1169 1166
             response.data.data.info[i].price = response.data.data.info[i].price.toString();
1170 1167
             response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
1171 1168
 
@@ -1439,12 +1436,72 @@ export default {
1439 1436
       this.propForm.goodType = [];
1440 1437
     },
1441 1438
     toPrint(){
1442
-      if(this.order_id == 0){
1439
+      if(this.order_id == ""){
1443 1440
         this.$message.error("请勾选入库单")
1444 1441
       }else{
1445 1442
         this.$router.push("/stock/in/detail/print?id="+this.order_id)
1446 1443
       }
1447
-    }
1444
+    },
1445
+    getlist(){
1446
+      var params = {
1447
+        id:this.order_id,
1448
+        start_time:this.start_time,
1449
+        end_time:this.end_time,
1450
+      }
1451
+      console.log("params",params)
1452
+      getExportStockList(params).then(response=>{
1453
+        if(response.data.state == 1){
1454
+           var list = response.data.data.list
1455
+           console.log("l类型",this.manufacturer)
1456
+           for(let i=0;i<this.goodType.length;i++){
1457
+             for(let j=0;j<list.length;j++){
1458
+               if(this.goodType[i].id == list[j].good_type_id){
1459
+                 list[j].good_type_name = this.goodType[i].type_name
1460
+               }
1461
+             }
1462
+           }
1463
+          for(let i=0;i<list.length;i++){
1464
+            list[i].unit = list[i].specification_name + list[i].packing_unit
1465
+            list[i].total_price = (list[i].total_count * list[i].price).toFixed(2)
1466
+            list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}")
1467
+            list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}")
1468
+            for(let j=0;j<this.manufacturer.length;j++){
1469
+               if(list[i].manufacturer == this.manufacturer[j].id){
1470
+                  list[i].manufacturer = this.manufacturer[j].manufacturer_name
1471
+               }
1472
+            }
1473
+
1474
+           for(let z=0;z<this.dealer.length;z++){
1475
+               if(list[i].dealer = this.dealer[z].id){
1476
+                 list[i].dealer = this.dealer[z].dealer_name
1477
+               }
1478
+            }
1479
+          }
1480
+         
1481
+          this.exportList = list
1482
+        }
1483
+      })
1484
+    },
1485
+    toExport(){
1486
+       console.log("列表22222222222",this.exportList)
1487
+      import('@/vendor/Export2Excel').then(excel => {
1488
+
1489
+      const tHeader = ['耗材类型', '耗材名称', '规格&单位','批号','入库数量','进货价','总价','生产厂家','生产日期','有效日期','经销商','备注']
1490
+      const filterVal = ['good_type_name', 'good_name', 'unit','number','total_count','price','total_price','manufacturer','product_date','expiry_date','dealer','remark']
1491
+
1492
+      console.log("table",this.exportList)
1493
+      const data = this.formatJson(filterVal, this.exportList)
1494
+      excel.export_json_to_excel({
1495
+        header: tHeader,
1496
+        data,
1497
+        filename: '耗材入库单详情'
1498
+      })
1499
+      this.downloadLoading = false
1500
+    })
1501
+    },
1502
+    formatJson(filterVal, jsonData) {
1503
+    return jsonData.map(v => filterVal.map(j => v[j]));
1504
+   },
1448 1505
   }
1449 1506
 };
1450 1507
 </script>

+ 2 - 2
src/xt_pages/stock/stockInOrderAdd.vue Näytä tiedosto

@@ -76,7 +76,7 @@
76 76
                   >
77 77
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
78 78
                   <template slot-scope="{ item }">
79
-                    <div class="name">{{ item.good_name +"  " +item.specification_name }}</div>
79
+                    <div class="name">{{ item.good_name +"  " +item.specification_name + "  "+item.manufacturer }}</div>
80 80
                   </template>
81 81
                  </el-autocomplete>
82 82
             </template>
@@ -752,7 +752,7 @@
752 752
               this.recordInfo.recordData[i].good_type_id = val.id
753 753
               this.recordInfo.recordData[i].good_name = val.good_name
754 754
               this.recordInfo.recordData[i].good_type_id = val.good_type_id
755
-              this.recordInfo.recordData[i].name = val.specification_name + "*" + val.min_number+val.packing_unit
755
+              this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
756 756
               this.recordInfo.recordData[i].number =  val.number
757 757
               this.recordInfo.recordData[i].manufacturer = val.manufacturer
758 758
               this.recordInfo.recordData[i].remark = val.remark

+ 31 - 16
src/xt_pages/stock/stockInOrderDetailPrint.vue Näytä tiedosto

@@ -10,14 +10,20 @@
10 10
         </div>
11 11
         <div class="app-container" style="background-color: white;">
12 12
             <div id="print_content">
13
-                <div class="print_main_content">
13
+                <div class="print_main_content" v-for="(it,index) in warehousingInfo" :key="index">
14 14
                     <div class="order_title_panl">
15 15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16 16
                         <span style="font-weight:500;font-size:18px;">耗材入库登记单</span>
17 17
                     </div>
18
-                    <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
19
-                      打印时间:{{time_now}}
18
+                    <div style="display:flex;justify-content: space-between;">
19
+                      <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
+                        单据编号:{{it.warehousing_order}}
21
+                      </div>
22
+                      <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
23
+                        打印时间:{{time_now}}
24
+                      </div>
20 25
                     </div>
26
+                    
21 27
                     <div class="table_panel">
22 28
                         <table class="table">
23 29
                             <thead>
@@ -38,12 +44,12 @@
38 44
                                 </tr>
39 45
                             </thead>
40 46
                             <tbody>
41
-                                <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
47
+                                <tr v-for='(item,index) in it.child' :key="index">
42 48
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
43 49
                                     <td style="line-height:18px;">{{ item.remark }}</td>
44 50
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
45 51
                                     <td style="line-height:18px;">{{ getManufacturer(item.good_id) }}</td>
46
-                                    <td style="line-height:18px;"><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
52
+                                    <td style="line-height:18px;"><span v-if="item.good_id!=0">{{item.GoodInfo.packing_unit}}</span></td>
47 53
                                     <td style="line-height:18px;">{{item.price}}</td>
48 54
                                     <td style="line-height:18px;">{{item.warehousing_count}}</td> 
49 55
                                     <td style="line-height:18px;">{{(item.warehousing_count*item.price).toFixed(2)}}</td>
@@ -65,7 +71,7 @@
65 71
                             <div style="width:80px;" v-if='orgId != 10024'>药材主任:</div><div style="width:100px;"></div>
66 72
                             <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
67 73
                             <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
68
-                            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(this.WarehouseInfo.warehouse.creater) }}</div>
74
+                            <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
69 75
                        </div>
70 76
                     </div>
71 77
                 </div>
@@ -125,7 +131,8 @@ export default {
125 131
             list:[],
126 132
             orgName:'',
127 133
             orgId:'',
128
-            adminUserOptions:[]
134
+            adminUserOptions:[],
135
+            warehousingInfo:[]
129 136
         }
130 137
     },
131 138
     methods:{
@@ -178,6 +185,7 @@ export default {
178 185
         },
179 186
        
180 187
      GetOrderDetail: function(order_id) {
188
+
181 189
         const params = {
182 190
             id: order_id
183 191
         };
@@ -186,18 +194,24 @@ export default {
186 194
             this.$message.error(response.data.msg);
187 195
             return false;
188 196
             } else {
189
-             var obj = ""
190
-            for (let i = 0; i < response.data.data.info.length; i++) {
191
-                this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
192
-            }
193
-            this.WarehouseInfo.warehouse = response.data.data.warehousing;
197
+             var info = response.data.data.info
198
+             console.log("info2222",info)
199
+             var warehousing = response.data.data.warehousing
200
+             console.log("warehousing",warehousing)
201
+             for(let i=0;i<warehousing.length;i++){
202
+                warehousing[i].child = []
203
+              for(let j=0;j<info.length;j++){
204
+                if(warehousing[i].id == info[j].warehousing_id){
205
+                   warehousing[i].child.push(info[j])
206
+                }
207
+              }
208
+             }
209
+             this.warehousingInfo = warehousing
194 210
             var total_price = 0
195
-            for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
196
-               total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price   
211
+            for(let i=0;i<info.length;i++){
212
+               total_price += info[i].warehousing_count * info[i].price   
197 213
             }
198 214
             this.allPrice = total_price
199
-            console.log("total_price",total_price)
200
-            console.log("数据222222222",this.WarehouseInfo.warehouseInfoDate)
201 215
             }
202 216
         });
203 217
        },
@@ -331,6 +345,7 @@ export default {
331 345
       this.orgName = this.$store.getters.xt_user.org.org_name;
332 346
       this.orgId = this.$store.getters.xt_user.org.id;
333 347
       const order_id = this.$route.query.id;
348
+
334 349
       this.fetchAllAdminUsers()
335 350
       this.GetConfigInfo();
336 351
       this.GetOrderDetail(order_id);

+ 33 - 12
src/xt_pages/stock/stockInOrderEdit.vue Näytä tiedosto

@@ -117,7 +117,7 @@
117 117
                   >
118 118
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
119 119
                   <template slot-scope="{ item }">
120
-                    <div class="name">{{ item.good_name +" " + item.specification_name}}</div>
120
+                    <div class="name">{{ item.good_name +" " + item.specification_name + "  "+ item.manufacturer}}</div>
121 121
                   </template>
122 122
                  </el-autocomplete>
123 123
             </template>
@@ -405,7 +405,8 @@ export default {
405 405
       manufacturer: [],
406 406
       dealerList: [],
407 407
       goodType: [],
408
-      manufacturerList:[]
408
+      manufacturerList:[],
409
+      numberList:[]
409 410
     };
410 411
   },
411 412
   methods: {
@@ -509,6 +510,7 @@ export default {
509 510
       tempObj["remark"] = "";
510 511
       tempObj["dealer"] = "";
511 512
       tempObj["manufacturer"] = "";
513
+      tempObj["number"] = ""
512 514
       this.recordInfo.recordData.push(tempObj);
513 515
     },
514 516
     handleDelete: function(index, row) {
@@ -632,9 +634,17 @@ export default {
632 634
               return;
633 635
             }
634 636
           }
637
+          console.log("昌吉",this.manufacturerList)
635 638
           for(let i=0;i<this.recordInfo.recordData.length;i++){
636 639
             this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
640
+
641
+          for(let j=0;j<this.manufacturerList.length;j++){
642
+              if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
643
+                  this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
644
+                 }
645
+              }
637 646
           }
647
+         
638 648
           const params = {
639 649
             stockIn: this.recordInfo.recordData
640 650
           };
@@ -685,7 +695,7 @@ export default {
685 695
             response.data.data.info[i].price = response.data.data.info[i].price.toString();
686 696
             response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
687 697
             response.data.data.info[i].good_name = response.data.data.info[i].GoodInfo.good_name
688
-            response.data.data.info[i].name = response.data.data.info[i].GoodInfo.specification_name + "*" + response.data.data.info[i].GoodInfo.min_number+response.data.data.info[i].GoodInfo.packing_unit
698
+            response.data.data.info[i].name = response.data.data.info[i].GoodInfo.specification_name + "/"+response.data.data.info[i].GoodInfo.packing_unit
689 699
             response.data.data.info[i].packing_unit = response.data.data.info[i].GoodInfo.packing_unit
690 700
             
691 701
            
@@ -731,16 +741,16 @@ export default {
731 741
           
732 742
             var list = response.data.data.list
733 743
             this.goodList = list
734
-            // var manufacturerList = response.data.data.manufacturerList
744
+            var manufacturerList = response.data.data.manufacturerList
745
+            this.manufacturerList = manufacturerList
735 746
             // this.dealerList = response.data.data.dealerList
736
-            // this.manufacturerList = manufacturerList
737
-            // for(let i=0;i<this.goodList.length;i++){
738
-            //     for(let j=0;j<this.manufacturerList.length;j++){
739
-            //       if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
740
-            //         this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
741
-            //       }
742
-            //     }
743
-            // }
747
+            for(let i=0;i<this.goodList.length;i++){
748
+                for(let j=0;j<manufacturerList.length;j++){
749
+                  if(this.goodList[i].manufacturer == manufacturerList[j].id){
750
+                    this.goodList[i].manufacturer = manufacturerList[j].manufacturer_name
751
+                  }
752
+                }
753
+            }
744 754
             // for(let i=0;i<this.goodList.length;i++){
745 755
             //    for(let j=0;j<this.dealerList.length;j++){
746 756
             //       if(this.goodList[i].dealer == this.dealerList[j].id){
@@ -774,7 +784,18 @@ export default {
774 784
             this.recordInfo.recordData[i].packing_unit = val.packing_unit
775 785
             this.recordInfo.recordData[i].dealer = val.dealer
776 786
           }
787
+         
788
+         if(val.xt_warehouse_info.length > 0){
789
+           
790
+          for(let j=0;j<val.xt_warehouse_info.length;j++){
791
+              this.numberList.push(val.xt_warehouse_info[j])
792
+            }
793
+            this.recordInfo.recordData[i].number = val.xt_warehouse_info[0].number
794
+          }else{
795
+            this.recordInfo.recordData[i].number = ""
796
+          }
777 797
         }
798
+     
778 799
     }
779 800
   },
780 801
   created() {

+ 89 - 72
src/xt_pages/stock/stockOutOrder.vue Näytä tiedosto

@@ -71,6 +71,7 @@
71 71
         >
72 72
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
73 73
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
74
+        <el-button size="small" type="primary" @click="toExport">导出</el-button>
74 75
       </div>
75 76
 
76 77
       <el-table
@@ -112,21 +113,6 @@
112 113
         <el-table-column label="操作" align="center" width="300px">
113 114
           <template slot-scope="scope">
114 115
            
115
-            <!-- <el-tooltip
116
-              class="item"
117
-              effect="dark"
118
-              content="详情"
119
-              placement="top"
120
-            >
121
-              <el-button
122
-                size="small"
123
-                type="warning"
124
-                icon="el-icon-document"
125
-                @click="handleSearch(scope.row.id,scope.row)"
126
-              >
127
-              </el-button>
128
-            </el-tooltip> -->
129
-
130 116
             <el-tooltip
131 117
               class="item"
132 118
               effect="dark"
@@ -178,7 +164,7 @@
178 164
             style="width: 100%"
179 165
             border
180 166
             highlight-current-row
181
-            ref="multipleTable"
167
+            ref="multipleTableOne"
182 168
             @selection-change="select"
183 169
             :row-style="{ color: '#303133' }"
184 170
             :header-cell-style="{
@@ -201,11 +187,11 @@
201 187
               {{ scope.row.specification_name}} * {{scope.row.min_number}}{{scope.row.min_unit}}
202 188
             </template>
203 189
           </el-table-column>
204
-          <!-- <el-table-column label="批号" align="center">
190
+          <el-table-column label="批号" align="center">
205 191
             <template slot-scope="scope">
206 192
               {{ scope.row.number}}
207 193
             </template>
208
-          </el-table-column> -->
194
+          </el-table-column>
209 195
           <el-table-column label="出库数量" align="center">
210 196
             <template slot-scope="scope">
211 197
               <span v-if="scope.row.is_sys == 0">{{ scope.row.count}}</span> 
@@ -380,11 +366,6 @@
380 366
         <span style="font-size: 18px;color: #606266">商品使用明细</span>
381 367
       </div>
382 368
      
383
-      <!-- <div class="cell clearfix">
384
-        <span style="width: 300px;color: #606266">商品类型: {{type_name}} </span>
385
-        <span style="width: 300px;color: #606266">规格名称: {{specification_name}}</span>
386
-      </div> -->
387
-
388 369
        <el-row :gutter="12" style="margin-top: 10px">
389 370
         <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 80%"
390 371
                   border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
@@ -669,7 +650,8 @@ import {
669 650
   GetAllGoodInfoByID,
670 651
   editWarehouseoutInfo,
671 652
   getOrderDetailByOrderId,
672
-  getOrderDetailById
653
+  getOrderDetailById,
654
+  getOutExportList
673 655
 } from "@/api/stock";
674 656
 import BreadCrumb from "../components/bread-crumb";
675 657
 import StockInDialog from './Dialog/stockInDialog'
@@ -701,9 +683,9 @@ export default {
701 683
       (nowDay < 10 ? "0" + nowDay : nowDay);
702 684
     this.GetConfigInfo();
703 685
     this.GetWarehouseOut();
704
-   
705 686
     this.fetchAllAdminUsers();
706 687
     
688
+    
707 689
   },
708 690
   data() {
709 691
      var checkGoodId = (rule, value, callback) => {
@@ -787,8 +769,9 @@ export default {
787 769
       userList:[],
788 770
       editdialogVisibleTwo:false,
789 771
       editdialogVisibleThree:false,
790
-      order_id:0,
772
+      order_id:"",
791 773
       warehouse_out_time:"",
774
+      exportList:[]
792 775
     };
793 776
   },
794 777
   methods: {
@@ -887,10 +870,12 @@ export default {
887 870
     handleSizeChange(val) {
888 871
       this.limit = val;
889 872
       this.GetWarehouseOut();
873
+      
890 874
     },
891 875
     handleCurrentChange(val) {
892 876
       this.page = val;
893 877
       this.GetWarehouseOut();
878
+     
894 879
     },
895 880
     startTimeChange(val) {
896 881
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
@@ -899,6 +884,7 @@ export default {
899 884
         this.start_time = "";
900 885
       } else {
901 886
         this.GetWarehouseOut();
887
+        this.getlist()
902 888
       }
903 889
      
904 890
     },
@@ -909,6 +895,7 @@ export default {
909 895
         this.end_time = "";
910 896
       } else {
911 897
         this.GetWarehouseOut();
898
+        this.getlist()
912 899
       }
913 900
     },
914 901
     getTimestamp(time) {
@@ -930,6 +917,7 @@ export default {
930 917
           this.goodType = response.data.data.goodType
931 918
           this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
932 919
           this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
920
+          this.getlist()
933 921
         }
934 922
       });
935 923
     },
@@ -1001,10 +989,15 @@ export default {
1001 989
       }
1002 990
     },
1003 991
     select(selection) {
1004
-      console.log("selection",selection)
1005
-      this.order_id = selection[0].id
992
+      var ids = []
993
+      for(let i=0;i<selection.length;i++){
994
+        ids.push(selection[i].id)
995
+      }
996
+      console.log("ids",ids)
997
+      this.order_id = ids.join(",")
1006 998
       this.warehouse_out_time = selection[0].warehouse_out_time
1007 999
       this.selectedTableData = selection;
1000
+      this.getlist()
1008 1001
     },
1009 1002
     batchDelete() {
1010 1003
       if (this.selectedTableData.length <= 0) {
@@ -1053,15 +1046,7 @@ export default {
1053 1046
  
1054 1047
 
1055 1048
     
1056
-    //新增
1057
-    // handleSearch(id,row){ 
1058
-      
1059
-    //   this.warehousingOutInfo.info = []
1060
-    //   this.warehousingOutInfo.warehousingOutData = []
1061
-    //   this.GetOrderDetailOne(id)
1062
-    //   this.GetTotalCount(row.warehouse_out_time)
1063
-      
1064
-    // },
1049
+  
1065 1050
 
1066 1051
     handleSearch(val){
1067 1052
       this.tableList = []
@@ -1071,43 +1056,21 @@ export default {
1071 1056
       this.GetTotalCount(val.warehouse_out_time)
1072 1057
     },
1073 1058
   
1074
-    //获取出库单详情数据
1075
-    // GetOrderDetailOne(id) {
1076
-    //     const params = {
1077
-    //       'id': id
1078
-    //     }
1079
-    //     console.log("#3333333",id)
1080
-    //   getWarehouseOutInfo(params).then(response => {
1081
-    //       if (response.data.state == 0) {
1082
-
1083
-    //         this.$message.error(response.data.msg)
1084
-    //         return false
1085
-    //       } else {
1086
-    //         this.tableShow = true
1087
-    //         for (let i = 0; i < response.data.data.list.length; i++) {
1088
-    //           this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
1089
-    //           console.log("表格00000000",this.tableList)
1090
-    //           this.tableList.push(response.data.data.list[i])
1091
-    //         }
1092
-    //         this.warehousingOutInfo.info = response.data.data.info
1093
-    //       }
1094
-    //     })
1095
-    //  }, 
1096
-     GetOrderDetailOne(id){
1059
+      GetOrderDetailOne(id){
1097 1060
         const params = {
1098 1061
           'id': id
1099 1062
         }
1100 1063
         getOrderDetailByOrderId(params).then(response=>{
1101
-           if(response.data.state == 1){
1102
-             this.tableShow = true
1103
-             var list = response.data.data.list
1104
-             console.log("list22222222",list)
1105
-             for(let i=0;i<list.length;i++){
1106
-               this.tableList.push(list[i])
1107
-             }
1108
-           }
1064
+            if(response.data.state == 1){
1065
+              this.tableShow = true
1066
+              var list = response.data.data.list
1067
+              console.log("list22222222",list)
1068
+              for(let i=0;i<list.length;i++){
1069
+                this.tableList.push(list[i])
1070
+              }
1071
+            }
1109 1072
         })
1110
-     },
1073
+      },
1111 1074
 
1112 1075
       getTypeName: function(id) {
1113 1076
         let name = ''
@@ -1527,13 +1490,67 @@ export default {
1527 1490
          })
1528 1491
       },
1529 1492
       toPrint(){
1530
-        if(this.order_id == 0){
1493
+        if(this.order_id == ""){
1531 1494
           this.$message.error("请选择出库单")
1532 1495
         }else{
1533 1496
             this.$router.push({path:"/stock/out/detail/print?id="+this.order_id+"&warehouse_out_time="+this.warehouse_out_time})
1534 1497
         }
1535
-      
1536
-      }
1498
+      },
1499
+      getlist(){
1500
+         var params = {
1501
+           'id': this.order_id,
1502
+           "start_time":this.start_time,
1503
+           "end_time":this.end_time,
1504
+         }
1505
+        console.log('parasm22',params)
1506
+       getOutExportList(params).then(response=>{
1507
+          if(response.data.state == 1){
1508
+            var list = response.data.data.list
1509
+            var outCount = response.data.data.outCount
1510
+            console.log("outCount",outCount)
1511
+            for(let i=0;i<list.length;i++){
1512
+              for(let j=0;j<this.manufacturer.length;j++){
1513
+                if(list[i].manufacturer == this.manufacturer[j].id){
1514
+                  list[i].manufacturer = this.manufacturer[j].manufacturer_name
1515
+                }
1516
+              }
1517
+              for(let z=0;z<this.dealer.length;z++){
1518
+                 if(list[i].dealer == this.dealer[z].id){
1519
+                   list[i].dealer = this.dealer[z].dealer_name
1520
+                 }
1521
+              }
1522
+              for(let a=0;a<this.goodType.length;a++){
1523
+                 if(list[i].good_type_id == this.goodType[a].id){
1524
+                    list[i].good_type_id = this.goodType[a].type_name
1525
+                 }
1526
+              } 
1527
+            }
1528
+            console.log("导出list222222",list)
1529
+            this.exportList = list
1530
+          }
1531
+        })
1532
+      },
1533
+      toExport(){
1534
+       console.log("列表22222222222",this.exportList)
1535
+        import('@/vendor/Export2Excel').then(excel => {
1536
+        for(let i=0;i<this.exportList.length;i++){
1537
+          this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
1538
+        }
1539
+        const tHeader = ['耗材名称', '规格型号', '单位','出库数量','出库价格','总价','批号','生产日期','有效日期']
1540
+        const filterVal = ['good_name', 'specification_name', 'packing_unit','count','price','total_price','number','product_date','expiry_date']
1541
+        console.log("table",this.exportList)
1542
+        const data = this.formatJson(filterVal, this.exportList)
1543
+        excel.export_json_to_excel({
1544
+          header: tHeader,
1545
+          data,
1546
+          filename: '耗材出库单详情'
1547
+        })
1548
+        this.downloadLoading = false
1549
+     })
1550
+    },
1551
+    formatJson(filterVal, jsonData) {
1552
+    return jsonData.map(v => filterVal.map(j => v[j]));
1553
+   },
1537 1554
   }
1538 1555
 };
1539 1556
 </script>

+ 48 - 12
src/xt_pages/stock/stockOutOrderAdd.vue Näytä tiedosto

@@ -123,7 +123,7 @@
123 123
                   >
124 124
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
125 125
                   <template slot-scope="{ item }">
126
-                    <div class="name">{{ item.good_name }}</div>
126
+                    <div class="name">{{item.good_name +"  " +item.specification_name + "  "+  item.manufacturer}}</div>
127 127
                   </template>
128 128
                  </el-autocomplete>
129 129
               </el-form-item>
@@ -139,7 +139,7 @@
139 139
 
140 140
               <el-form-item style="padding-top: 20px">
141 141
                 <el-input
142
-                  placeholder="请输入商品类型"
142
+                  placeholder="请输入耗材类型"
143 143
                   v-model="scope.row.good_type_id"
144 144
                   :value="typeName(scope.row.good_type_id)"
145 145
                 ></el-input>
@@ -150,7 +150,7 @@
150 150
           
151 151
           <el-table-column width="140" align="center">
152 152
             <template slot="header" slot-scope="scope">
153
-              <span>规格&&单位<span style="color: red">*</span></span>
153
+              <span>规格&单位<span style="color: red">*</span></span>
154 154
             </template>
155 155
             <template slot-scope="scope">
156 156
               <el-form-item style="padding-top: 20px">
@@ -159,14 +159,22 @@
159 159
             </template>
160 160
           </el-table-column>
161 161
           
162
-          <!-- <el-table-column  width="150" align="center">
162
+          <el-table-column  width="150" align="center">
163 163
              <template slot="header" slot-scope="scope">
164 164
               <span>批号<span style="color: red"></span></span>
165 165
             </template>
166 166
             <template slot-scope="scope">
167
-               <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
167
+               <!-- <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input> -->
168
+                <el-select v-model="scope.row.number" filterable placeholder="请选择">
169
+                  <el-option
170
+                    v-for="(item,index) in numberList"
171
+                    :key="index"
172
+                    :label="item.number"
173
+                    :value="item.number">
174
+                  </el-option>
175
+                </el-select>
168 176
             </template>
169
-          </el-table-column> -->
177
+          </el-table-column>
170 178
 
171 179
          <el-table-column  width="150" align="center">
172 180
             <template slot="header" slot-scope="scope">
@@ -227,7 +235,7 @@
227 235
             </template>   
228 236
           </el-table-column>
229 237
 
230
-         <!-- <el-table-column label="生产日期"  width="150" align="center">
238
+         <el-table-column label="生产日期"  width="150" align="center">
231 239
            <template slot-scope="scope">
232 240
               <el-date-picker
233 241
                 prefix-icon="el-icon-date"
@@ -253,7 +261,22 @@
253 261
                 value-format="yyyy-MM-dd"
254 262
               ></el-date-picker>
255 263
             </template>
256
-          </el-table-column> -->
264
+          </el-table-column>
265
+         
266
+
267
+          <el-table-column label="经销商"  width="150" align="center">
268
+            <template slot-scope="scope">
269
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
270
+                <el-option
271
+                  v-for="(option, index) in manufacturerList"
272
+                  :key="index"
273
+                  :label="option.manufacturer_name"
274
+                  :value="option.id">
275
+                </el-option>
276
+               </el-select>
277
+            </template>   
278
+          </el-table-column>
279
+
257 280
 
258 281
 
259 282
           <el-table-column label="备注"  width="150" align="center">
@@ -262,7 +285,7 @@
262 285
             </template>
263 286
           </el-table-column>
264 287
 
265
-          <el-table-column label="操作" align="center" min-width="150">
288
+          <el-table-column label="操作" align="center" min-width="150" fixed="right">
266 289
             <template slot-scope="scope">
267 290
               <el-tooltip
268 291
                 class="item"
@@ -359,7 +382,8 @@ export default {
359 382
       goodType: [],
360 383
       goodInfo:[],
361 384
       goodList:[],
362
-      manufacturerList:[]
385
+      manufacturerList:[],
386
+      numberList:[],
363 387
     };
364 388
   },
365 389
   methods: {
@@ -463,6 +487,7 @@ export default {
463 487
       tempObj["good_unit"] = "";
464 488
       tempObj["number"] = ""
465 489
       tempObj["specification_name"] = ""
490
+      tempObj["number"] = ""
466 491
       this.recordInfo.recordData.push(tempObj);
467 492
     },
468 493
     handleDelete: function(index, row) {
@@ -590,7 +615,7 @@ export default {
590 615
             stockOut: this.recordInfo.recordData
591 616
           };
592 617
           console.log("2323223223",this.recordInfo.recordData);
593
-        
618
+         
594 619
           postWarehouseOut(
595 620
             params,
596 621
             this.warehouse_out_time,
@@ -628,6 +653,7 @@ export default {
628 653
         if (response.data.state == 1) {
629 654
           
630 655
             var list = response.data.data.list
656
+            console.log("33334445555",list)
631 657
             this.goodList = list
632 658
             var manufacturerList = response.data.data.manufacturerList
633 659
             this.manufacturerList = manufacturerList
@@ -655,7 +681,7 @@ export default {
655 681
             this.recordInfo.recordData[i].good_type_id = val.id
656 682
             this.recordInfo.recordData[i].good_name = val.good_name
657 683
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
658
-            this.recordInfo.recordData[i].name = val.specification_name + "*" + val.min_number+val.min_unit +"/"+val.packing_unit
684
+            this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
659 685
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
660 686
             this.recordInfo.recordData[i].remark = val.remark
661 687
             this.recordInfo.recordData[i].price = val.buy_price
@@ -663,6 +689,15 @@ export default {
663 689
             this.recordInfo.recordData[i].good_id = val.id
664 690
          }
665 691
       }
692
+
693
+       if(val.xt_warehouse_info.length > 0){
694
+           var obj = {id:"",name:""}
695
+          for(let j=0;j<val.xt_warehouse_info.length;j++){
696
+            this.numberList.push(val.xt_warehouse_info[j])
697
+          }
698
+          
699
+        }
700
+        console.log("9999999",this.numberList)
666 701
     }
667 702
   },
668 703
   created() {
@@ -685,6 +720,7 @@ export default {
685 720
     tempObj["good_unit"] = ""
686 721
     tempObj["number"] = ""
687 722
     tempObj["specification_name"] = ""
723
+    tempObj["number"] = ""
688 724
     this.recordInfo.recordData.push(tempObj);
689 725
     this.GetConfigInfo();
690 726
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 61 - 54
src/xt_pages/stock/stockOutOrderDetailPrint.vue Näytä tiedosto

@@ -10,13 +10,18 @@
10 10
         </div>
11 11
         <div class="app-container" style="background-color: white;">
12 12
             <div id="print_content">
13
-                <div class="print_main_content">
13
+                <div class="print_main_content" v-for="(it,index) in tableList" :key="index">
14 14
                     <div class="order_title_panl">
15 15
                         <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16 16
                         <span class="main_title">耗材出库登记单</span>
17 17
                     </div>
18
-                    <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
19
-                      打印日期:{{time_now}}
18
+                    <div style="display:flex;justify-content: space-between;">
19
+                      <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
+                        单据编号: {{it.warehouse_out_order_number}}
21
+                      </div>
22
+                      <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
23
+                        打印日期:{{time_now}}
24
+                      </div>
20 25
                     </div>
21 26
                     <div class="table_panel">
22 27
                         <table class="table">
@@ -25,7 +30,7 @@
25 30
                                     <td width="80">耗材名称</td>
26 31
                                     <td width="80">规格型号</td>
27 32
                                     <td width="80">单位</td>
28
-                                    <td width="80">出数量</td>
33
+                                    <td width="80">出数量</td>
29 34
                                     <td width="80">出库价格</td>
30 35
                                     <td width="80">总价</td>
31 36
                                     <td width="80">批号</td>
@@ -34,16 +39,16 @@
34 39
                                 </tr>
35 40
                             </thead>
36 41
                             <tbody>
37
-                                <tr v-for='(item,index) in warehousingOutInfo.warehousingOutData' :key="index">
38
-                                    <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
39
-                                    <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
40
-                                    <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
42
+                                <tr v-for='(item,index) in it.child' :key="index">
43
+                                    <td><span v-if="item.good_id != 0">{{item.good_name}}</span></td>
44
+                                    <td><span v-if="item.good_id != 0">{{item.specification_name}}</span></td>
45
+                                    <td><span v-if="item.good_id!=0">{{item.packing_unit}}</span></td>
41 46
                                     <td>{{getOutStockCount(item.good_id) + getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id)}}</td>
42 47
                                     <td>{{item.price}}</td>
43 48
                                     <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
44 49
                                     <td>{{getNumber(item.good_id)}}</td>
45
-                                    <td>{{getProductDate(item.good_id)}}</td>
46
-                                    <td>{{getExpiryDate(item.good_id)}}</td>
50
+                                    <td>{{getTime(item.product_date)}}</td>
51
+                                    <td>{{getTime(item.expiry_date)}}</td>
47 52
                                 </tr>
48 53
                                 <tr>
49 54
                                   <td>合计</td>
@@ -77,7 +82,7 @@
77 82
 
78 83
 <script>
79 84
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
80
-import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList,getWarehouseOrderInfoList } from "@/api/stock";
85
+import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList,getWarehouseOrderInfoList,getOrderDetailByOrderId } from "@/api/stock";
81 86
 import print from 'print-js'
82 87
 const moment = require('moment');
83 88
 import { uParseTime } from '@/utils/tools'
@@ -90,7 +95,7 @@ export default {
90 95
           crumbs: [
91 96
             { path: false, name: '库存管理' },
92 97
             { path: false, name: '耗材管理' },
93
-            { path: false, name: '库单打印' },
98
+            { path: false, name: '库单打印' },
94 99
           ],
95 100
            isEdit: 0,
96 101
             checked: false,
@@ -118,7 +123,9 @@ export default {
118 123
             wareoutList:[],
119 124
             orgId:'',
120 125
             orgName:'',
121
-            orderInList:[]
126
+            orderInList:[],
127
+            tableList:[],
128
+            orderList:[]
122 129
         }
123 130
     },
124 131
     methods:{
@@ -146,36 +153,6 @@ export default {
146 153
             }
147 154
             })
148 155
         },
149
-       GetOrderDetail: function(order_id) {
150
-        const params = {
151
-          'id': order_id
152
-        };
153
-        getWarehouseOutInfo(params).then(response => {
154
-          if (response.data.state == 0) {
155
-
156
-            this.$message.error(response.data.msg);
157
-            return false
158
-          } else {
159
-
160
-            for (let i = 0; i < response.data.data.list.length; i++) {
161
-              this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
162
-            }
163
-            this.warehousingOutInfo.info = response.data.data.info;
164
-            console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData);
165
-            var total_price = 0;
166
-            for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
167
-              total_price += this.warehousingOutInfo.warehousingOutData[i].total_price   
168
-            }
169
-            console.log('this.allPrice',this.allPrice)
170
-           this.allPrice = total_price;
171
-
172
-           var wareoutList =  response.data.data.wareoutList;
173
-           console.log("出库数据",wareoutList);
174
-           this.wareoutList = wareoutList
175
-          }
176
-        })
177
-      },
178
-
179 156
        GetTotalCount(time){
180 157
           var params = {
181 158
            warehouse_out_time:time
@@ -241,10 +218,13 @@ export default {
241 218
             return false
242 219
           } else {
243 220
             this.list = [];
221
+        
244 222
             for (let i = 0; i < response.data.data.list.length; i++) {
223
+
224
+              
245 225
               this.list.push(response.data.data.list[i])
246 226
             }
247
-            console.log("list22222",this.list)
227
+          
248 228
           }
249 229
         })
250 230
       },
@@ -268,13 +248,13 @@ export default {
268 248
       },
269 249
 
270 250
       getWarehouseOutInfoCount(warehouse_out_id,good_id){
271
-        var count = 0;
272
-         for(let i=0;i<this.wareoutList.length;i++){
273
-            if(warehouse_out_id == this.wareoutList[i].warehouse_out_id && good_id == this.wareoutList[i].good_id){
274
-                count = this.wareoutList[i].count
275
-            }
251
+         var count = 0
252
+         for(let i=0;i<this.orderList.length;i++){
253
+          if(this.orderList[i].warehouse_out_id == warehouse_out_id && this.orderList[i].good_id == good_id){
254
+             count += this.orderList[i].count
255
+          } 
276 256
          }
277
-        return count
257
+         return count
278 258
       },
279 259
 
280 260
       getWarehouseOrderInfoList(){
@@ -324,7 +304,36 @@ export default {
324 304
           return uParseTime(val, '{y}-{m}-{d}')
325 305
          }
326 306
       },
327
-
307
+     
308
+      GetOrderDetailOne(id){
309
+        const params = {
310
+          'id': id
311
+        }
312
+        console.log("paramsssss",params)
313
+        getOrderDetailByOrderId(params).then(response=>{
314
+           if(response.data.state == 1){
315
+             var order = response.data.data.order
316
+             console.log("order22222",order)
317
+             var list = response.data.data.list
318
+             this.orderList = list
319
+             for(let i=0;i<order.length;i++){
320
+               order[i].child =[]
321
+               for(let j=0;j<list.length;j++){
322
+                  if(order[i].id == list[j].warehouse_out_id){
323
+                     order[i].child.push(list[j])
324
+                  }
325
+               }
326
+             }
327
+             console.log("详情打印222222",list)
328
+             this.tableList = order
329
+             var total_price = 0
330
+             for(let i=0;i<list.length;i++){
331
+               total_price += response.data.data.list[i].price * response.data.data.list[i].count
332
+             }
333
+             this.allPrice =  total_price
334
+           }
335
+        })
336
+     },
328 337
 
329 338
     },
330 339
     created(){
@@ -333,11 +342,9 @@ export default {
333 342
       const order_id = this.$route.query.id;
334 343
       const warehouse_out_time = this.$route.query.warehouse_out_time;
335 344
       this.GetConfigInfo();
336
-      this.GetOrderDetail(order_id);
337 345
       this.GetTotalCount(warehouse_out_time);
346
+      this.GetOrderDetailOne(order_id)
338 347
       this.getList()
339
-      //获取所有入库单
340
-      this.getWarehouseOrderInfoList()
341 348
     }
342 349
 }
343 350
 </script>

+ 92 - 35
src/xt_pages/stock/stockOutOrderEdit.vue Näytä tiedosto

@@ -76,14 +76,14 @@
76 76
                       v-model="scope.row.good_name"
77 77
                       :fetch-suggestions="querySearchAsync"
78 78
                       :trigger-on-focus="false"
79
-                      placeholder="请输入病人名字"
79
+                      placeholder="请输入耗材名称"
80 80
                       @select="handleSelect"
81 81
                       @input="changeGoodName(scope.$index)"
82 82
                       style="width:150px;"
83 83
                     >
84 84
                       <i class="el-icon-search el-input__icon" slot="suffix"></i>
85 85
                     <template slot-scope="{ item }">
86
-                      <div class="name">{{ item.good_name }}</div>
86
+                      <div class="name">{{item.good_name +"  " +item.specification_name + "  "+  item.manufacturer}}</div>
87 87
                     </template>
88 88
                   </el-autocomplete>
89 89
                 </el-form-item>
@@ -108,7 +108,7 @@
108 108
              
109 109
           <el-table-column width="140" align="center">
110 110
             <template slot="header" slot-scope="scope">
111
-              <span>规格&&单位<span style="color: red">*</span></span>
111
+              <span>规格&单位<span style="color: red">*</span></span>
112 112
             </template>
113 113
             <template slot-scope="scope">
114 114
               <el-form-item style="padding-top: 20px">
@@ -116,22 +116,25 @@
116 116
               </el-form-item>
117 117
             </template>
118 118
           </el-table-column>
119
-          <!-- <el-table-column min-width="35" align="center">
119
+
120
+          <el-table-column width="140" align="center">
120 121
             <template slot="header" slot-scope="scope">
121
-              <span>规格名称<span style="color: red">*</span></span>
122
+              <span>批号<span style="color: red"></span></span>
122 123
             </template>
123 124
             <template slot-scope="scope">
124
-
125
-              <el-form-item style="padding-top: 15px">
126
-                <el-input placeholder="请输入规格名称" v-model="scope.row.good_id"
127
-                          :value="specificationName(scope.row.good_id)"
128
-                          @focus="showDialog(scope.$index, scope.row)"></el-input>
125
+              <el-form-item style="padding-top: 20px">
126
+               <el-select v-model="scope.row.number" filterable placeholder="请选择">
127
+                  <el-option
128
+                    v-for="(item,index) in numberList"
129
+                    :key="index"
130
+                    :label="item.number"
131
+                    :value="item.number">
132
+                  </el-option>
133
+                </el-select>
129 134
               </el-form-item>
130
-
131 135
             </template>
132
-          </el-table-column> -->
133
-
134
-
136
+          </el-table-column>
137
+         
135 138
           <el-table-column min-width="23" align="center">
136 139
             <template slot="header" slot-scope="scope">
137 140
               <span>单价<span style="color: red">*</span></span>
@@ -181,7 +184,7 @@
181 184
               <el-input v-model="scope.row.remark"></el-input>
182 185
             </template>
183 186
           </el-table-column>
184
-          <el-table-column label="操作" align="center" min-width="20">
187
+          <el-table-column label="操作" align="center" min-width="30"  fixed="right">
185 188
             <template slot-scope="scope">
186 189
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
187 190
 
@@ -215,7 +218,7 @@
215 218
 <script>
216 219
   import { uParseTime } from '@/utils/tools'
217 220
 
218
-  import { deleteWarehouseOutInfo, editWarehouseoutInfo, getSalesReturnConfig, getWarehouseOutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList } from '@/api/stock'
221
+  import { deleteWarehouseOutInfo, editWarehouseoutInfo, getSalesReturnConfig, getWarehouseOutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getSingleOutOrderDetail } from '@/api/stock'
219 222
   import BreadCrumb from '../components/bread-crumb'
220 223
   import StockInDialog from './Dialog/stockInDialog'
221 224
 
@@ -282,6 +285,7 @@
282 285
         dealer: [],
283 286
         goodType: [],
284 287
         goodInfo:[],
288
+        numberList:[],
285 289
       }
286 290
     },
287 291
     methods: {
@@ -340,8 +344,6 @@
340 344
             this.dealer = response.data.data.dealer;
341 345
             this.goodType = response.data.data.goodType;
342 346
             this.goodInfo = response.data.data.goodInfo;
343
-            // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
344
-            // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
345 347
           }
346 348
           loading.close();
347 349
         });
@@ -370,6 +372,7 @@
370 372
         tempObj['count'] = ''
371 373
         tempObj['price'] = ''
372 374
         tempObj['remark'] = ''
375
+        tempObj['number'] = ""
373 376
         this.recordInfo.recordData.push(tempObj)
374 377
       }, handleDelete: function(index, row) {
375 378
         if (row.id == 0) {
@@ -486,13 +489,23 @@
486 489
             }
487 490
             for(let i=0;i<this.recordInfo.recordData.length;i++){
488 491
                this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
492
+              for(let j=0;j<this.manufacturerList.length;j++){
493
+                if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
494
+                  this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
495
+                }
496
+              }
489 497
             }
490 498
             const params = {
491 499
               'stockOut': this.recordInfo.recordData
492 500
             }
493 501
            
502
+            for(let i=0;i<this.goodList.length;i++){
503
+             
504
+            }
505
+
506
+           
494 507
             console.log("stockout",params)
495
-            
508
+          
496 509
             editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
497 510
               if (response.data.state == 0) {
498 511
                 this.$message.error(response.data.msg)
@@ -564,15 +577,15 @@
564 577
           
565 578
             var list = response.data.data.list
566 579
             this.goodList = list
567
-            // var manufacturerList = response.data.data.manufacturerList
568
-            // this.manufacturerList = manufacturerList
569
-            // for(let i=0;i<this.goodList.length;i++){
570
-            //   for(let j=0;j<this.manufacturerList.length;j++){
571
-            //     if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
572
-            //         this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
573
-            //     }
574
-            //   }
575
-            // }
580
+            var manufacturerList = response.data.data.manufacturerList
581
+            this.manufacturerList = manufacturerList
582
+            for(let i=0;i<this.goodList.length;i++){
583
+              for(let j=0;j<this.manufacturerList.length;j++){
584
+                if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
585
+                    this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
586
+                }
587
+              }
588
+            }
576 589
           
577 590
             cb(this.goodList)
578 591
         } else {
@@ -584,29 +597,73 @@
584 597
       this.currentIndex = val
585 598
     },
586 599
     handleSelect(val){
587
-      console.log("val",val)
600
+       console.log("val22222",val)
588 601
         for(let i=0;i<this.recordInfo.recordData.length;i++){
589 602
           if(this.currentIndex == i){
590 603
             this.recordInfo.recordData[i].good_type_id = val.id
591 604
             this.recordInfo.recordData[i].good_name = val.good_name
592 605
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
593
-            this.recordInfo.recordData[i].name = val.specification_name + "*" + val.min_number+val.min_unit +"/"+val.packing_unit
594
-            // this.recordInfo.recordData[i].number =  val.number
606
+            this.recordInfo.recordData[i].name = val.specification_name  +"/"+val.packing_unit
595 607
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
596 608
             this.recordInfo.recordData[i].remark = val.remark
597 609
             this.recordInfo.recordData[i].price = val.buy_price
598 610
             this.recordInfo.recordData[i].specification_name = val.specification_name
599 611
             this.recordInfo.recordData[i].good_id = val.id
600
-
601 612
          }
602 613
       }
614
+      console.log("hhhhh232323232",val.xt_warehouse_info)
615
+      if(val.xt_warehouse_info.length > 0){
616
+         console.log("hhhhhhhhhh")
617
+          for(let j=0;j<val.xt_warehouse_info.length;j++){
618
+            this.numberList.push(val.xt_warehouse_info[j])
619
+          }
620
+         this.recordInfo.recordData[i].number = val.xt_warehouse_info[0].number
621
+      }else{
622
+        this.recordInfo.recordData[i].number = ""
623
+      }
624
+    },
625
+     getSingleOutOrderDetail(order_id){
626
+       const params = {
627
+          'id': order_id
628
+        }
629
+      getSingleOutOrderDetail(params).then(response=>{
630
+        if(response.data.state == 1){
631
+          console.log("详情",response.data.data.list)
632
+          var dealerList = response.data.data.dealerList
633
+          this.dealerList = dealerList
634
+          var manufacturerList = response.data.data.manufacturerList
635
+          console.log("hhhhhhhhh",manufacturerList)
636
+          this.manufacturerList = manufacturerList
637
+          this.goodType = response.data.data.goodType
638
+          for (let i = 0; i < response.data.data.list.length; i++) {
639
+           
640
+            response.data.data.list[i].price = response.data.data.list[i].price.toString()
641
+            response.data.data.list[i].count = response.data.data.list[i].count.toString()
642
+            response.data.data.list[i].good_name = response.data.data.list[i].good_name
643
+            response.data.data.list[i].name = response.data.data.list[i].specification_name + "/" + response.data.data.list[i].packing_unit
644
+            response.data.data.list[i].good_type_id = response.data.data.list[i].good_type_id
645
+            this.numberList.push(response.data.data.list[i])
646
+            this.recordInfo.recordData.push(response.data.data.list[i])
647
+          }
648
+         
649
+        }
650
+      })
603 651
     }
604 652
     },
605 653
     created() {
606
-      this.GetConfigInfo()
654
+      var nowDate = new Date();
655
+      var nowYear = nowDate.getFullYear();
656
+      var nowMonth = nowDate.getMonth() + 1;
657
+      var nowDay = nowDate.getDate();
658
+      this.warehouse_out_time =
659
+        nowYear +
660
+        "-" +
661
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
662
+        "-" +
663
+        (nowDay < 10 ? "0" + nowDay : nowDay);
607 664
       this.propForm.goodUnit = this.$store.getters.good_unit
608
-      const order_id = this.$route.query.id
609
-      this.GetOrderDetail(order_id)
665
+      const order_id = this.$route.query.id  
666
+      this.getSingleOutOrderDetail(order_id)
610 667
     }
611 668
 
612 669
   }

+ 118 - 52
src/xt_pages/stock/stockPrint.vue Näytä tiedosto

@@ -21,34 +21,26 @@
21 21
                         <table class="table">
22 22
                             <thead>
23 23
                                 <tr>
24
-                                    <td width="60">商品编码</td>
25
-                                    <td width="80">耗材名称</td>
26 24
                                     <td width="80">耗材类型</td>
27
-                                    <td width="80">规格型号</td>
25
+                                    <td width="80">耗材名称</td>
26
+                                    <td width="80">规格&单位</td>
27
+                                    <td width="80">进货单价</td>
28
+                                    <td width="80">生产商</td>
28 29
                                     <td width="80">入库数量</td>
29
-                                    <td width="80">进货价</td>
30
-                                    <td width="80">入库退货</td>
31
-                                    <td width="80">实际入库</td>
32 30
                                     <td width="80">出库数量</td>
33
-                                    <td width="80">出库退库</td>
34
-                                    <td width="80">实际出库</td>
35 31
                                     <td width="80">剩余库存</td>
36 32
                                 </tr>
37 33
                             </thead>
38 34
                             <tbody>
39
-                                <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
40
-                                    <td>{{item.good_code}}</td>
41
-                                    <td>{{item.good_name}}</td>
42
-                                    <td>{{item.type.type_name}}</td>
43
-                                    <td>{{item.specification_name}}</td>
44
-                                    <td>{{stockInCount(item)}}</td>
45
-                                    <td>{{item.price}}</td>
46
-                                    <td>{{salesReturnCount(item)}}</td>
47
-                                    <td> {{ stockInCount(item) - salesReturnCount(item) }}</td>
48
-                                    <td>{{ stockOutCount(item) }}</td>
49
-                                    <td>{{cancelStockCount(item) }}</td>
50
-                                    <td>{{ stockOutCount(item) - cancelStockCount(item)}}</td>
51
-                                    <td>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</td>
35
+                                <tr v-for='(item,index) in tableList' :key="index">
36
+                                   <td>{{getGoodType(item.good_type_id)}}</td>
37
+                                   <td>{{item.good_name }}</td>
38
+                                   <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
39
+                                   <td>{{item.price}}</td>
40
+                                   <td>{{getManufacture(item.manufacturer)}}</td>
41
+                                   <td>{{getInCount(item.good_id)}}</td>
42
+                                   <td><span>{{getOutCount(item.good_id) + getAutoCount(item.good_id)}}</span></td> 
43
+                                   <td>{{getInCount(item.good_id)- getOutCount(item.good_id) - getAutoCount(item.good_id)}}</td>
52 44
                                 </tr>
53 45
                             </tbody>
54 46
                         </table>
@@ -61,7 +53,7 @@
61 53
 
62 54
 <script>
63 55
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
64
-import { getAllStockQueryList } from "@/api/stock";
56
+import { getAllStockList,GetAllGoodType,getStockDrugCount } from "@/api/stock";
65 57
 import print from 'print-js'
66 58
 const moment = require('moment')
67 59
 export default {
@@ -72,8 +64,8 @@ export default {
72 64
         return{
73 65
           crumbs: [
74 66
             { path: false, name: '库存管理' },
75
-            { path: false, name: '自备药查询' },
76
-            { path: false, name: '自备药打印' },
67
+            { path: false, name: '库存查询' },
68
+            { path: false, name: '库存查询打印' },
77 69
           ],
78 70
           start_time:"",
79 71
           end_time:"",
@@ -87,8 +79,14 @@ export default {
87 79
           page:"",
88 80
           WarehouseInfo: {
89 81
           loading: false,
90
-          warehouseInfoDate: []
82
+          warehouseInfoDate: [],
91 83
          },
84
+          tableList:[],
85
+          goodType:[],
86
+          manufacturerList:[],
87
+          countList:[],
88
+          outCountList:[],
89
+          autoCountList:[],
92 90
         }
93 91
     },
94 92
     methods:{
@@ -103,39 +101,40 @@ export default {
103 101
           })
104 102
       },
105 103
       getlist(){
106
-         const Params = {
107
-            page: this.page,
108
-            limit: this.limit,
109
-            keyword: this.keywords,
110
-            start_time:this.start_time,
111
-            end_time:this.end_time,
112
-            type_name:this.type_name,
113
-        };
114
-         this.WarehouseInfo.loading = true;
115
-         this.WarehouseInfo.warehouseInfoDate = [];
116
-         getAllStockQueryList(Params).then(response => {
117
-           if (response.data.state == 0) {
118
-            this.WarehouseInfo.loading = false;
104
+        const params = {
105
+          page: this.page,
106
+          limit: this.limit,
107
+          keywords: this.keywords,
108
+          start_time:this.start_time,
109
+          end_time:this.end_time,
110
+          type:this.type_name,
111
+        }
112
+        getAllStockList(params).then(response=>{
113
+         if(response.data.state == 1){
114
+           var list = response.data.data.list
115
+           console.log("list22222",list)
116
+           this.tableList = list
117
+           var total = response.data.data.total
118
+           console.log("total",total)
119
+           this.total = total
120
+           var manufacturerList = response.data.data.manufacturerList
121
+           this.manufacturerList = manufacturerList
122
+         }
123
+       })
124
+      },
125
+      GetAllGoodType() {
126
+        GetAllGoodType().then(response => {
127
+          if (response.data.state == 0) {
119 128
             this.$message.error(response.data.msg);
120 129
             return false;
121 130
           } else {
122
-            this.WarehouseInfo.loading = false;
123
-            this.total = response.data.data.total;
124
-          for (let i = 0; i < response.data.data.list.length; i++) {
125
-            this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
126
-          }
127
-          for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
128
-            if(this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info.length>0){
129
-              this.WarehouseInfo.warehouseInfoDate[i].price = this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price
130
-            }else{
131
-              this.WarehouseInfo.warehouseInfoDate[i].price = ""
131
+            for (let i = 0; i < response.data.data.goodType.length; i++) {
132
+              this.goodType.push(response.data.data.goodType[i]);
132 133
             }
133 134
           }
134
-         }
135
-            console.log("打印数据源头",this.WarehouseInfo.warehouseInfoDate)
136
-          });
135
+        });
137 136
       },
138
-       stockInCount: function(row) {
137
+      stockInCount: function(row) {
139 138
       let total = 0;
140 139
       for (let i = 0; i < row.query_warehousing_info.length; i++) {
141 140
         total = total + row.query_warehousing_info[i].warehousing_count;
@@ -163,6 +162,71 @@ export default {
163 162
       }
164 163
       return total;
165 164
     },
165
+    getGoodType(id){
166
+      var name = ""
167
+      for(let i=0;i<this.goodType.length;i++){
168
+        if(id == this.goodType[i].id){
169
+           name = this.goodType[i].type_name
170
+        }
171
+      }
172
+      return name
173
+     },
174
+    getManufacture(id){
175
+       var name = ""
176
+       for(let i=0;i<this.manufacturerList.length;i++){
177
+         if(id == this.manufacturerList[i].id){
178
+           name = this.manufacturerList[i].manufacturer_name
179
+         }
180
+       }
181
+       return name
182
+     },
183
+     getStockDrugCount(){
184
+        var params ={
185
+          keywords: this.keywords,
186
+          start_time:this.start_time,
187
+          end_time:this.end_time,
188
+        }
189
+      getStockDrugCount(params).then(response=>{
190
+         if(response.data.state == 1){
191
+           var count = response.data.data.count
192
+           console.log("入库统计",count)
193
+           this.countList = count
194
+           var outlist = response.data.data.outList
195
+           console.log("出库数量",outlist)
196
+           this.outCountList = outlist
197
+           var autoCount = response.data.data.autoCount
198
+           console.log("autoCount",autoCount)
199
+           this.autoCountList = autoCount
200
+         }
201
+      })
202
+    },
203
+      getInCount(id){
204
+        var count= ""
205
+      for(let i=0;i<this.countList.length;i++){
206
+        if(id == this.countList[i].good_id){
207
+            count = this.countList[i].count
208
+        }
209
+      }
210
+      return count
211
+      },
212
+      getOutCount(id){
213
+        var count = ""
214
+        for(let i=0;i<this.outCountList.length;i++){
215
+          if(id == this.outCountList[i].good_id){
216
+            count = this.outCountList[i].count
217
+          }
218
+        }
219
+        return count
220
+      },
221
+      getAutoCount(id){
222
+        var count= ""
223
+        for(let i=0;i<this.autoCountList.length;i++){
224
+          if(id == this.autoCountList[i].good_id){
225
+            count = this.autoCountList[i].count
226
+          }
227
+        }
228
+        return count
229
+      }
166 230
     },
167 231
     created(){
168 232
       var starttime =  this.$route.query.start_time
@@ -176,6 +240,8 @@ export default {
176 240
       this.page = this.$route.query.page
177 241
       this.limit = this.$route.query.limit
178 242
       this.getlist()
243
+      this.GetAllGoodType()
244
+      this.getStockDrugCount()
179 245
     }
180 246
 }
181 247
 </script>

+ 32 - 15
src/xt_pages/stock/stockQuery.vue Näytä tiedosto

@@ -88,7 +88,7 @@
88 88
         </el-table-column>
89 89
         <el-table-column label="规格&单位" align="center">
90 90
             <template slot-scope="scope">
91
-              <span>{{ scope.row.specification_name }}*{{scope.row.min_number}}{{scope.row.min_unit}}</span>
91
+              <span>{{ scope.row.specification_name }} / {{scope.row.packing_unit}}</span>
92 92
             </template>
93 93
          </el-table-column>
94 94
         <el-table-column label="进货单价" align="center">
@@ -103,19 +103,19 @@
103 103
         </el-table-column>
104 104
        <el-table-column label="入库数量" align="center">
105 105
          <template slot-scope="scope">
106
-          <span>{{getInCount(scope.row.good_id)}}</span>
106
+          <span>{{getInCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span>
107 107
          </template>
108 108
        </el-table-column>
109 109
        <el-table-column label="出库数量" align="center">
110 110
          <template slot-scope="scope">
111
-           <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}</span>
111
+           <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span>
112 112
 
113 113
          </template>
114 114
        </el-table-column>
115 115
       
116 116
        <el-table-column label="剩余库存量" align="center">
117 117
          <template slot-scope="scope">
118
-           {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}
118
+           {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}{{scope.row.packing_unit}}
119 119
          </template>
120 120
        </el-table-column>
121 121
        <el-table-column label="操作" align="center" width="260px">
@@ -165,7 +165,6 @@ import {
165 165
 export default {
166 166
   name: "stockIn",
167 167
   created() {
168
-    // this.GetAllStockQuery();
169 168
     this.GetAllGoodInfo();
170 169
     this.GetAllGoodType();
171 170
     this.getlist()
@@ -372,13 +371,22 @@ export default {
372 371
     },
373 372
 
374 373
     exportList(){
375
-
376 374
          import('@/vendor/Export2Excel').then(excel => {
377
-         const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','进货价','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
378
-         const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','price','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus']
379
-         const data = this.formatJson(filterVal, this.WarehouseInfo.warehouseInfoDate)
380
-         console.log("data",data)
381 375
 
376
+         const tHeader = ['耗材类型', '耗材名称', '规格&单位','规格型号','进货单价','生产商','入库数量','出库数量','库存剩余量']
377
+         const filterVal = ['type_name', 'good_name', 'unit','specification_name','price','prodect_name','inCount','outCount','overplus']
378
+
379
+       
380
+         for(let i=0;i<this.tableList.length;i++){
381
+           this.tableList[i].type_name = this.getGoodType(this.tableList[i].good_type_id)
382
+           this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
383
+           this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
384
+           this.tableList[i].inCount =  this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
385
+           this.tableList[i].outCount = this.getOutCount(this.tableList[i].good_id) + this.getAutoCount(this.tableList[i].good_id)
386
+           this.tableList[i].overplus =this.getInCount(this.tableList[i].good_id)- this.getOutCount(this.tableList[i].good_id) - this.getAutoCount(this.tableList[i].good_id)
387
+         }
388
+         console.log("table",this.tableList)
389
+         const data = this.formatJson(filterVal, this.tableList)
382 390
          excel.export_json_to_excel({
383 391
            header: tHeader,
384 392
            data,
@@ -391,7 +399,7 @@ export default {
391 399
         return jsonData.map(v => filterVal.map(j => v[j]));
392 400
       },
393 401
       changeTypeName(){
394
-       this.GetAllStockQuery()
402
+       this.getlist()
395 403
       },
396 404
       toPrint(){
397 405
         this.$router.push("/stock/stockprint?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keywords+"&type_name="+this.type_name+"&page="+this.page+"&limit="+this.limit)
@@ -429,7 +437,7 @@ export default {
429 437
         keywords: this.keywords,
430 438
         start_time:this.start_time,
431 439
         end_time:this.end_time,
432
-        type_name:this.type_name,
440
+        type:this.type_name,
433 441
       };
434 442
      console.log("params",params)
435 443
       getAllStockList(params).then(response=>{
@@ -456,16 +464,25 @@ export default {
456 464
     },
457 465
     toClick(val){
458 466
        var manufacturer_name = ""
467
+       var specification_name = ""
459 468
        for(let i=0;i<this.manufacturerList.length;i++){
460 469
           if(val.manufacturer == this.manufacturerList[i].id){
461 470
             manufacturer_name = this.manufacturerList[i].manufacturer_name  
462 471
           }
463 472
        }
464
-      console.log("厂家22222",manufacturer_name)
465
-      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name})
473
+      specification_name = val.specification_name + "/" + val.packing_unit
474
+      this.$router.push({path:"/stock/in/stockflow?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit})
466 475
     },
467 476
     toClickOne(val){
468
-      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name})
477
+       var manufacturer_name = ""
478
+       var specification_name = ""
479
+       for(let i=0;i<this.manufacturerList.length;i++){
480
+          if(val.manufacturer == this.manufacturerList[i].id){
481
+            manufacturer_name = this.manufacturerList[i].manufacturer_name  
482
+          }
483
+       }
484
+      specification_name = val.specification_name + "/" + val.packing_unit
485
+      this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.good_id+"&good_name="+val.good_name+"&manufacturer="+manufacturer_name+"&specification_name="+specification_name+"&packing_unit="+val.packing_unit})
469 486
     },
470 487
     getStockDrugCount(){
471 488
         var params ={

+ 20 - 1
src/xt_pages/user/inspection.vue Näytä tiedosto

@@ -202,6 +202,7 @@
202 202
                   v-model="item.value"
203 203
                   style="width:95%"
204 204
                   type="number"
205
+                  @input='changeInput(item)'
205 206
                 >
206 207
                   <template slot="append">{{ item.unit }}</template>
207 208
                 </el-input>
@@ -299,6 +300,24 @@ export default {
299 300
     }
300 301
   },
301 302
   methods: {
303
+    changeInput(item){
304
+      
305
+      if(item.item_name == '血清铁蛋白' || item.item_name == '总铁结合力'){
306
+        let index1 = ''
307
+        let index2 = ''
308
+        this.form.formItem.map((it,index) => {
309
+          if(this.form.formItem[index].item_name == '血清铁蛋白'){
310
+            index1 = index
311
+          }
312
+          if(this.form.formItem[index].item_name == '总铁结合力'){
313
+            index2 = index
314
+          }
315
+          if(it.item_name == '转铁蛋白饱和度(计算)'){
316
+            it.value = (parseFloat(this.form.formItem[index1].value) / parseFloat(this.form.formItem[index2].value)) * 100
317
+          }
318
+        })
319
+      }
320
+    },
302 321
     deleteInspection() {
303 322
       if (this.project == null || this.itemDate == '') {
304 323
         this.$message.error('请先选择删除删除的记录')
@@ -411,7 +430,7 @@ export default {
411 430
           unit: this.project.inspection_reference[index].unit
412 431
         })
413 432
       }
414
-
433
+      console.log('form.formItem',this.form.formItem)
415 434
       this.dialogFormVisible = true
416 435
     },
417 436
     submitEdit(formName) {