XMLWAN 3 年前
父节点
当前提交
41dcc5811e

+ 8 - 0
src/api/stock.js 查看文件

657
     params: params
657
     params: params
658
   })
658
   })
659
 }
659
 }
660
+
661
+export function getExportStockList(params) {
662
+  return request({
663
+    url: '/api/stock/getexportstocklist',
664
+    method: 'get',
665
+    params: params
666
+  })
667
+}

+ 1 - 0
src/xt_pages/data/components/addDrugs.vue 查看文件

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

+ 6 - 4
src/xt_pages/stock/drugs/drugBatchNumber.vue 查看文件

5
     </div>
5
     </div>
6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
-       药品名称:
9
-       库存:
10
-       厂家:
8
+       药品名称:<span>{{this.$route.query.drug_name}}</span>&nbsp;
9
+       库存:&nbsp;
10
+       规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
+       厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
11
       </div>
12
       </div>
12
       <div class="cell clearfix">
13
       <div class="cell clearfix">
13
         <span>日期查询:</span>
14
         <span>日期查询:</span>
60
         </el-table-column>
61
         </el-table-column>
61
         <el-table-column prop="drug_name" label="有效期" align="center">
62
         <el-table-column prop="drug_name" label="有效期" align="center">
62
            <template slot-scope="scope">
63
            <template slot-scope="scope">
63
-              {{getTime(scope.row.expiry_date)}}
64
+              {{getTime(scope.row.expiry_date,"{y}-{m}-{d}")}}
64
            </template>
65
            </template>
65
         </el-table-column>
66
         </el-table-column>
66
          <el-table-column prop="drug_name" label="批号" align="center">
67
          <el-table-column prop="drug_name" label="批号" align="center">
166
               this.tableList = detail
167
               this.tableList = detail
167
               var total = response.data.data.total
168
               var total = response.data.data.total
168
               console.log("total",total)
169
               console.log("total",total)
170
+              this.total = total
169
            }
171
            }
170
         })
172
         })
171
       },
173
       },

+ 5 - 3
src/xt_pages/stock/drugs/drugStockFlow.vue 查看文件

5
     </div>
5
     </div>
6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
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
+       库存:&nbsp;
10
+       规格:<span>{{this.$route.query.unit}}</span>&nbsp;
11
+       厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
12
+
11
       </div>
13
       </div>
12
       <div class="cell clearfix">
14
       <div class="cell clearfix">
13
         <span>日期查询:</span>
15
         <span>日期查询:</span>

+ 3 - 3
src/xt_pages/stock/drugs/drugStockInOrderDetailPrint.vue 查看文件

19
             <tr>
19
             <tr>
20
               <td width="80">药品名称</td>
20
               <td width="80">药品名称</td>
21
               <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
21
               <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
22
-              <td style="line-height:18px;" width="80">规格<br>型号</td>
22
+              <td style="line-height:18px;" width="100">规格<br>型号</td>
23
               <td style="line-height:18px;" width="80">生产<br>厂商</td>
23
               <td style="line-height:18px;" width="80">生产<br>厂商</td>
24
               <td style="line-height:18px;" width="80">单位</td>
24
               <td style="line-height:18px;" width="80">单位</td>
25
               <td style="line-height:18px;" width="80">进货价</td>
25
               <td style="line-height:18px;" width="80">进货价</td>
38
               </td>
38
               </td>
39
               <td style="line-height: 18px">{{ item.remark }}</td>
39
               <td style="line-height: 18px">{{ item.remark }}</td>
40
               <td style="line-height: 18px">
40
               <td style="line-height: 18px">
41
-                 <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
41
+                 <span v-if="item.drug_id != 0">{{item.drug.dose}}{{item.drug.dose_unit}}*{{item.drug.min_number}}{{item.drug.min_unit}}/{{item.drug.max_unit}}</span>
42
               </td>
42
               </td>
43
               <!-- <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td> -->
43
               <!-- <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td> -->
44
               <td style="line-height: 18px">{{ getManufacturer(item.drug.id) }}</td>
44
               <td style="line-height: 18px">{{ getManufacturer(item.drug.id) }}</td>
45
               <td style="line-height: 18px">
45
               <td style="line-height: 18px">
46
-                <span>{{getUnit(item.drug_id)}}</span>
46
+                <span>{{item.drug.max_unit}}</span>
47
               </td>
47
               </td>
48
               <td style="line-height:18px">
48
               <td style="line-height:18px">
49
                   {{item.price}}
49
                   {{item.price}}

+ 4 - 4
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue 查看文件

33
                 <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
33
                 <span v-if="item.drug_id != 0">{{item.drug.drug_name}}</span>
34
               </td>
34
               </td>
35
               <td style="line-height: 50px">
35
               <td style="line-height: 50px">
36
-                  <span v-if="item.drug_id != 0">{{item.drug?item.drug.drug_spec:''}}</span>
36
+                  <span v-if="item.drug_id != 0">{{item.drug.dose}}{{item.drug.dose_unit}}*{{item.drug.min_number}}{{item.drug.min_unit}}/{{item.drug.max_unit}}</span>
37
               </td>
37
               </td>
38
               <td style="line-height: 50px">
38
               <td style="line-height: 50px">
39
-                <span>{{getUnit(item.drug_id)}}</span>
39
+                <span>{{item.drug.max_unit}}</span>
40
               </td>
40
               </td>
41
 
41
 
42
               <td style="line-height: 50px">
42
               <td style="line-height: 50px">
43
                   {{item.count}}
43
                   {{item.count}}
44
               </td>
44
               </td>
45
               <td style="line-height:50px">
45
               <td style="line-height:50px">
46
-                  {{item.price}}
46
+                  {{item.drug.last_price}}
47
               </td>
47
               </td>
48
              <td  style="line-height:50px">
48
              <td  style="line-height:50px">
49
-                {{(item.count * item.price).toFixed(2)}}
49
+                {{(item.count * item.drug.last_price).toFixed(2)}}
50
              </td>
50
              </td>
51
              <td>{{getNumber(item.drug_id)}}</td>
51
              <td>{{getNumber(item.drug_id)}}</td>
52
              <td>{{getProductDate(item.drug_id)}}</td>
52
              <td>{{getProductDate(item.drug_id)}}</td>

+ 111 - 18
src/xt_pages/stock/drugs/query.vue 查看文件

32
     </div>
32
     </div>
33
     <div class="app-container ">
33
     <div class="app-container ">
34
       <div class="cell clearfix">
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
             <el-option
36
             <el-option
37
-              v-for="(item,index) in drugCategory"
37
+              v-for="(item,index) in drugTypeList"
38
               :key="index"
38
               :key="index"
39
               :label="item.name"
39
               :label="item.name"
40
               :value="item.id">
40
               :value="item.id">
113
         </el-table-column>
113
         </el-table-column>
114
         <el-table-column prop="drug_name" label="入库数量" align="center">
114
         <el-table-column prop="drug_name" label="入库数量" align="center">
115
            <template slot-scope="scope">
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
            </template>
118
            </template>
118
         </el-table-column>
119
         </el-table-column>
119
         <el-table-column prop="drug_name" label="出库数量" align="center">
120
         <el-table-column prop="drug_name" label="出库数量" align="center">
120
            <template slot-scope="scope">
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
            </template>
124
            </template>
123
         </el-table-column>
125
         </el-table-column>
124
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
126
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
125
            <template slot-scope="scope">
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
            </template>
130
            </template>
128
         </el-table-column>
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
           <template slot-scope="scope">
133
           <template slot-scope="scope">
131
             <el-button
134
             <el-button
132
               size="small"
135
               size="small"
133
               type="primary"
136
               type="primary"
134
-              @click="handleDetail(scope.row.drug_id)"
137
+              @click="handleDetail(scope.row)"
135
             >库存流水
138
             >库存流水
136
             </el-button>
139
             </el-button>
137
             <el-button
140
             <el-button
138
               size="small"
141
               size="small"
139
               type="primary"
142
               type="primary"
140
-              @click="handleBatch(scope.row.drug_id)"
143
+              @click="handleBatch(scope.row)"
141
             >批次
144
             >批次
142
             </el-button>
145
             </el-button>
143
           </template>
146
           </template>
171
   import { getAllDrugStockQueryList,getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
174
   import { getAllDrugStockQueryList,getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
172
   import SettingDialog from './settingDialog/index'
175
   import SettingDialog from './settingDialog/index'
173
   import { getDictionaryDataConfig } from "@/utils/data";
176
   import { getDictionaryDataConfig } from "@/utils/data";
177
+import { min } from 'moment'
174
   export default {
178
   export default {
175
     name: 'stockIn',
179
     name: 'stockIn',
176
     created() {
180
     created() {
177
       var drugCategory = getDictionaryDataConfig('system','drug_category')
181
       var drugCategory = getDictionaryDataConfig('system','drug_category')
178
       this.drugCategory.push(...drugCategory)
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
       this.getlist()
185
       this.getlist()
182
       this.getDrugCountList()
186
       this.getDrugCountList()
183
     },
187
     },
212
         drugCategory:[
216
         drugCategory:[
213
           {id:0,name:"全部"}
217
           {id:0,name:"全部"}
214
         ],
218
         ],
215
-        drugTypeList:[],
219
+        drugTypeList:[
220
+          {id:0,name:"全部"}
221
+        ],
216
         tableList:[],
222
         tableList:[],
217
         manufacturerList:[],
223
         manufacturerList:[],
218
         countList:[],
224
         countList:[],
219
         outCountList:[],
225
         outCountList:[],
220
         autoCountList:[],
226
         autoCountList:[],
221
         keyword:"",
227
         keyword:"",
228
+        drug_type:0,
229
+        minCount:[],
230
+        drugOutList:[]
222
       }
231
       }
223
     },
232
     },
224
     methods: {
233
     methods: {
438
         return (new Date(time)).getTime() / 1000
447
         return (new Date(time)).getTime() / 1000
439
       },
448
       },
440
       changeDrug(){
449
       changeDrug(){
441
-     
442
-      this.getlist()
450
+        this.getlist()
443
       },
451
       },
444
       printOrder(){
452
       printOrder(){
445
         this.$router.push({
453
         this.$router.push({
454
           page: this.page,
462
           page: this.page,
455
           limit: this.limit,
463
           limit: this.limit,
456
           keyword: this.keywords,
464
           keyword: this.keywords,
457
-          drug_category:this.drug_category,
465
+          drug_type:this.drug_type,
458
           start_time:this.start_time,
466
           start_time:this.start_time,
459
           end_time:this.end_time,
467
           end_time:this.end_time,
460
         }
468
         }
461
-         
469
+        console.log("parasm222222",params)
462
         getDrugStockList(params).then(response=>{
470
         getDrugStockList(params).then(response=>{
463
           if(response.data.state == 1){
471
           if(response.data.state == 1){
464
              var list = response.data.data.list
472
              var list = response.data.data.list
493
         }
501
         }
494
         return name
502
         return name
495
       },
503
       },
496
-      handleDetail(id){
497
-        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+id})
504
+      handleDetail(val){
505
+        var manufacturer_name = ""
506
+        for(let i=0;i<this.manufacturerList.length;i++){
507
+         if(val.manufacturer == this.manufacturerList[i].id){
508
+           manufacturer_name = this.manufacturerList[i].manufacturer_name
509
+         }
510
+        }
511
+        var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
512
+        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit})
498
       },
513
       },
499
-      handleBatch(id){
500
-        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+id})
514
+      handleBatch(val){
515
+        var manufacturer_name = ""
516
+        for(let i=0;i<this.manufacturerList.length;i++){
517
+         if(val.manufacturer == this.manufacturerList[i].id){
518
+           manufacturer_name = this.manufacturerList[i].manufacturer_name
519
+         }
520
+        }
521
+        var unit =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
522
+        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit})
501
       },
523
       },
502
       getDrugCountList(){
524
       getDrugCountList(){
503
          var params = {
525
          var params = {
516
             var aucountlist = response.data.data.auCountList
538
             var aucountlist = response.data.data.auCountList
517
             console.log("自动数据",aucountlist)
539
             console.log("自动数据",aucountlist)
518
             this.autoCountList = aucountlist
540
             this.autoCountList = aucountlist
541
+            var minCount = response.data.data.minCount
542
+            console.log("minCount",minCount)
543
+            this.minCount = minCount
544
+            var info = response.data.data.info
545
+            for(let i=0;i<info.length;i++){
546
+              if(info[i].count_unit == info[i].max_unit){
547
+                 info[i].count = info[i].count * info[i].min_number
548
+              }
549
+            }
550
+            console.log("info2222222",info)
551
+            this.drugOutList = info
552
+            var arr = []
553
+            for(let i=0;i<this.drugOutList.length;i++){
554
+              if(this.drugOutList[i].drug_id == 1197){
555
+                arr.push(this.drugOutList[i])
556
+              }
557
+            }
558
+            console.log("arrr",arr)
519
           }
559
           }
520
         })
560
         })
521
       },
561
       },
546
           }
586
           }
547
         }
587
         }
548
         return count
588
         return count
549
-      }
589
+      },
590
+      getMinCount(id){
591
+        var count=""
592
+        for(let i=0;i<this.minCount.length;i++){
593
+          if(id == this.minCount[i].drug_id){
594
+            count = this.minCount[i].count
595
+          }
596
+        }
597
+        return count
598
+      },
599
+      getCount(drug_id,min_number,max_unit,min_unit){
600
+        var count= 0
601
+        var str = ""
602
+        var min_str = ""
603
+        for(let i=0;i<this.drugOutList.length;i++){
604
+          if(drug_id == this.drugOutList[i].drug_id){
605
+             count += parseInt(this.drugOutList[i].count)
606
+          }
607
+        }
608
+        if(parseInt(count/min_number)!=0){
609
+          str = parseInt(count/min_number)+ max_unit
610
+        }
611
+        if((count%min_number)!=0){
612
+          min_str =  count%min_number + min_unit
613
+        }
614
+        return str + min_str
615
+      },
616
+
617
+      getCountOne(drug_id){
618
+        var count= 0
619
+        for(let i=0;i<this.drugOutList.length;i++){
620
+          if(drug_id == this.drugOutList[i].drug_id){
621
+             count += parseInt(this.drugOutList[i].count)
622
+          }
623
+        }
624
+        return count
625
+      },
626
+     getCountTwo(drug_id,min_number,max_unit,min_unit){
627
+       var total_count = 0
628
+       var out_count = 0
629
+       var count = 0
630
+       var str = ""
631
+       var str_min = ""
632
+       total_count = this.getInCount(drug_id) * min_number
633
+       out_count = this.getCountOne(drug_id)
634
+       count = total_count-out_count
635
+       if(parseInt(count/min_number)!=0){
636
+         str = parseInt(count/min_number) + max_unit
637
+       }
638
+       if((count%min_number)!=0){
639
+         str_min = count%min_number + min_unit
640
+       }
641
+       return str+str_min
642
+     }
550
     }
643
     }
551
   }
644
   }
552
 </script>
645
 </script>

+ 1 - 1
src/xt_pages/stock/stockFlow.vue 查看文件

80
              {{getTime(scope.row.ctime)}}
80
              {{getTime(scope.row.ctime)}}
81
            </template>
81
            </template>
82
         </el-table-column>
82
         </el-table-column>
83
-         <el-table-column prop="drug_name" label="入库数量"  align="center">
83
+         <el-table-column prop="drug_name" label="入库数量"  align="center">
84
            <template slot-scope="scope">
84
            <template slot-scope="scope">
85
              <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 == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
86
              <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}</span>
86
              <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}</span>

+ 64 - 18
src/xt_pages/stock/stockInOrder.vue 查看文件

75
 
75
 
76
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
76
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
77
 
77
 
78
-        <!-- <el-button size="small" type="primary" @click="exportList">导出</el-button> -->
78
+        <el-button size="small" type="primary" @click="toExport">导出</el-button>
79
       </div>
79
       </div>
80
 
80
 
81
       <el-table
81
       <el-table
82
+        ref="multipleTable"
82
         :data="Warehouse.warehouseDate"
83
         :data="Warehouse.warehouseDate"
83
         :class="signAndWeighBoxPatients"
84
         :class="signAndWeighBoxPatients"
84
         style="width: 100%"
85
         style="width: 100%"
85
         border
86
         border
86
         highlight-current-row
87
         highlight-current-row
87
         v-loading="Warehouse.loading"
88
         v-loading="Warehouse.loading"
88
-        ref="multipleTable"
89
         @selection-change="select"
89
         @selection-change="select"
90
         :row-style="{ color: '#303133' }"
90
         :row-style="{ color: '#303133' }"
91
         :header-cell-style="{
91
         :header-cell-style="{
233
         </el-table-column>
233
         </el-table-column>
234
         <el-table-column label="生产日期" align="center">
234
         <el-table-column label="生产日期" align="center">
235
           <template slot-scope="scope">
235
           <template slot-scope="scope">
236
-            {{ getTime(scope.row.product_date)}}
236
+            {{ getTime(scope.row.product_date,"{y}-{m}-{d}")}}
237
           </template>
237
           </template>
238
         </el-table-column>
238
         </el-table-column>
239
         <el-table-column label="有效期" align="center">
239
         <el-table-column label="有效期" align="center">
240
           <template slot-scope="scope">
240
           <template slot-scope="scope">
241
-            {{ getTime(scope.row.expiry_date)}}
241
+            {{ getTime(scope.row.expiry_date,"{y}-{m}-{d}")}}
242
           </template>
242
           </template>
243
         </el-table-column>
243
         </el-table-column>
244
         <el-table-column label="备注" align="center">
244
         <el-table-column label="备注" align="center">
630
   getWarehouseList,
630
   getWarehouseList,
631
   DeleteWarehouseInfoItem,
631
   DeleteWarehouseInfoItem,
632
   GetAllGoodInfoByID,
632
   GetAllGoodInfoByID,
633
-  EditWarehouse
633
+  EditWarehouse,
634
+  getExportStockList
634
 } from "@/api/stock";
635
 } from "@/api/stock";
635
 
636
 
636
 import { GetAllDrugInfoByID,postDrugWarehouse} from "@/api/drug/drug_stock";
637
 import { GetAllDrugInfoByID,postDrugWarehouse} from "@/api/drug/drug_stock";
666
     this.fetchAllAdminUsers();
667
     this.fetchAllAdminUsers();
667
     this.GetAllGoodType()
668
     this.GetAllGoodType()
668
     this.GetAllGoodInfo()
669
     this.GetAllGoodInfo()
669
-    // this.getlist()
670
+
670
     
671
     
671
   },
672
   },
672
   data() {
673
   data() {
764
       tableList:[],
765
       tableList:[],
765
       isVisibility:false,
766
       isVisibility:false,
766
       order_id:0,
767
       order_id:0,
768
+      exportList:[]
767
     };
769
     };
768
     
770
     
769
   
771
   
1019
         } else {
1021
         } else {
1020
           this.manufacturer = response.data.data.manufacturer;
1022
           this.manufacturer = response.data.data.manufacturer;
1021
           this.dealer = response.data.data.dealer;
1023
           this.dealer = response.data.data.dealer;
1022
-          this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
1023
-          this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
1024
-         
1024
+          // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
1025
+          // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
1026
+          this.getlist()
1025
         }
1027
         }
1026
       });
1028
       });
1027
     },
1029
     },
1084
         })
1086
         })
1085
         .catch(() => {});
1087
         .catch(() => {});
1086
     },
1088
     },
1087
-    changeAllSelected: function(val) {
1088
-      if (val) {
1089
+    changeAllSelected: function() {
1090
+      console.log("22222",this.checked)
1091
+      this.$refs.multipleTable.clearSelection();
1092
+      if (this.checked) {
1089
         this.$refs.multipleTable.toggleAllSelection();
1093
         this.$refs.multipleTable.toggleAllSelection();
1090
-      } else {
1091
-        this.$refs.multipleTable.clearSelection();
1092
       }
1094
       }
1093
     },
1095
     },
1094
     select(selection) {
1096
     select(selection) {
1452
         start_time:this.start_time,
1454
         start_time:this.start_time,
1453
         end_time:this.end_time,
1455
         end_time:this.end_time,
1454
       }
1456
       }
1455
-      getExportStockList().then(response=>{
1457
+      getExportStockList(params).then(response=>{
1458
+        if(response.data.state == 1){
1459
+           var list = response.data.data.list
1460
+           console.log("l类型",this.manufacturer)
1461
+           for(let i=0;i<this.goodType.length;i++){
1462
+             for(let j=0;j<list.length;j++){
1463
+               if(this.goodType[i].id == list[j].good_type_id){
1464
+                 list[j].good_type_name = this.goodType[i].type_name
1465
+               }
1466
+             }
1467
+           }
1468
+          for(let i=0;i<list.length;i++){
1469
+            list[i].unit = list[i].specification_name + list[i].packing_unit
1470
+            list[i].total_price = (list[i].total_count * list[i].price).toFixed(2)
1471
+            list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}")
1472
+            list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}")
1473
+            for(let j=0;j<this.manufacturer.length;j++){
1474
+               if(list[i].manufacturer == this.manufacturer[j].id){
1475
+                  list[i].manufacturer = this.manufacturer[j].manufacturer_name
1476
+               }
1477
+            }
1456
 
1478
 
1479
+           for(let z=0;z<this.dealer.length;z++){
1480
+               if(list[i].dealer = this.dealer[z].id){
1481
+                 list[i].dealer = this.dealer[z].dealer_name
1482
+               }
1483
+            }
1484
+          }
1485
+         
1486
+          this.exportList = list
1487
+        }
1457
       })
1488
       })
1458
     },
1489
     },
1459
-    exportList(){
1460
-      exportList().then(response=>{
1461
-
1490
+    toExport(){
1491
+       console.log("列表22222222222",this.exportList)
1492
+      import('@/vendor/Export2Excel').then(excel => {
1493
+
1494
+      const tHeader = ['耗材类型', '耗材名称', '规格&单位','批号','入库数量','进货价','总价','生产厂家','生产日期','有效日期','经销商','备注']
1495
+      const filterVal = ['good_type_name', 'good_name', 'unit','number','total_count','price','total_price','manufacturer','product_date','expiry_date','dealer','remark']
1496
+
1497
+      console.log("table",this.exportList)
1498
+      const data = this.formatJson(filterVal, this.exportList)
1499
+      excel.export_json_to_excel({
1500
+        header: tHeader,
1501
+        data,
1502
+        filename: '耗材入库单详情'
1462
       })
1503
       })
1463
-    }
1504
+      this.downloadLoading = false
1505
+    })
1506
+    },
1507
+    formatJson(filterVal, jsonData) {
1508
+    return jsonData.map(v => filterVal.map(j => v[j]));
1509
+   },
1464
   }
1510
   }
1465
 };
1511
 };
1466
 </script>
1512
 </script>

+ 33 - 10
src/xt_pages/stock/stockOutOrderDetailPrint.vue 查看文件

17
                     </div>
17
                     </div>
18
                     <div style="display:flex;justify-content: space-between;">
18
                     <div style="display:flex;justify-content: space-between;">
19
                       <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
19
                       <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
-                        单据编号:{{warehousingOutInfo.info.warehouse_out_order_number}}
20
+                        <!-- 单据编号:{{warehousingOutInfo.info.warehouse_out_order_number}} -->
21
+                        单据编号: {{tableList[0].warehouse_out_order_number}}
21
                       </div>
22
                       </div>
22
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
23
                       <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
23
                         打印日期:{{time_now}}
24
                         打印日期:{{time_now}}
39
                                 </tr>
40
                                 </tr>
40
                             </thead>
41
                             </thead>
41
                             <tbody>
42
                             <tbody>
42
-                                <tr v-for='(item,index) in warehousingOutInfo.warehousingOutData' :key="index">
43
-                                    <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
44
-                                    <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
45
-                                    <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
43
+                                <tr v-for='(item,index) in tableList' :key="index">
44
+                                    <td><span v-if="item.good_id != 0">{{item.good_name}}</span></td>
45
+                                    <td><span v-if="item.good_id != 0">{{item.specification_name}}</span></td>
46
+                                    <td><span v-if="item.good_id!=0">{{item.packing_unit}}</span></td>
46
                                     <td>{{getOutStockCount(item.good_id) + getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id)}}</td>
47
                                     <td>{{getOutStockCount(item.good_id) + getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id)}}</td>
47
                                     <td>{{item.price}}</td>
48
                                     <td>{{item.price}}</td>
48
                                     <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
49
                                     <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
82
 
83
 
83
 <script>
84
 <script>
84
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
85
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
85
-import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList,getWarehouseOrderInfoList } from "@/api/stock";
86
+import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList,getWarehouseOrderInfoList,getOrderDetailByOrderId } from "@/api/stock";
86
 import print from 'print-js'
87
 import print from 'print-js'
87
 const moment = require('moment');
88
 const moment = require('moment');
88
 import { uParseTime } from '@/utils/tools'
89
 import { uParseTime } from '@/utils/tools'
123
             wareoutList:[],
124
             wareoutList:[],
124
             orgId:'',
125
             orgId:'',
125
             orgName:'',
126
             orgName:'',
126
-            orderInList:[]
127
+            orderInList:[],
128
+            tableList:[]
127
         }
129
         }
128
     },
130
     },
129
     methods:{
131
     methods:{
246
             return false
248
             return false
247
           } else {
249
           } else {
248
             this.list = [];
250
             this.list = [];
251
+        
249
             for (let i = 0; i < response.data.data.list.length; i++) {
252
             for (let i = 0; i < response.data.data.list.length; i++) {
253
+
254
+              
250
               this.list.push(response.data.data.list[i])
255
               this.list.push(response.data.data.list[i])
251
             }
256
             }
252
-            console.log("list22222",this.list)
257
+          
253
           }
258
           }
254
         })
259
         })
255
       },
260
       },
329
           return uParseTime(val, '{y}-{m}-{d}')
334
           return uParseTime(val, '{y}-{m}-{d}')
330
          }
335
          }
331
       },
336
       },
332
-
337
+     
338
+      GetOrderDetailOne(id){
339
+        const params = {
340
+          'id': id
341
+        }
342
+        getOrderDetailByOrderId(params).then(response=>{
343
+           if(response.data.state == 1){
344
+             var list = response.data.data.list
345
+             console.log("详情打印222222",list)
346
+             var total_price = 0
347
+             for(let i=0;i<list.length;i++){
348
+               total_price += response.data.data.list[i].price * response.data.data.list[i].count
349
+               this.tableList.push(list[i])
350
+             }
351
+             this.allPrice =  total_price
352
+           }
353
+        })
354
+     },
333
 
355
 
334
     },
356
     },
335
     created(){
357
     created(){
338
       const order_id = this.$route.query.id;
360
       const order_id = this.$route.query.id;
339
       const warehouse_out_time = this.$route.query.warehouse_out_time;
361
       const warehouse_out_time = this.$route.query.warehouse_out_time;
340
       this.GetConfigInfo();
362
       this.GetConfigInfo();
341
-      this.GetOrderDetail(order_id);
363
+      // this.GetOrderDetail(order_id);
342
       this.GetTotalCount(warehouse_out_time);
364
       this.GetTotalCount(warehouse_out_time);
365
+      this.GetOrderDetailOne(order_id)
343
       this.getList()
366
       this.getList()
344
       //获取所有入库单
367
       //获取所有入库单
345
       this.getWarehouseOrderInfoList()
368
       this.getWarehouseOrderInfoList()

+ 1 - 1
src/xt_pages/stock/stockOutOrderEdit.vue 查看文件

76
                       v-model="scope.row.good_name"
76
                       v-model="scope.row.good_name"
77
                       :fetch-suggestions="querySearchAsync"
77
                       :fetch-suggestions="querySearchAsync"
78
                       :trigger-on-focus="false"
78
                       :trigger-on-focus="false"
79
-                      placeholder="请输入病人名字"
79
+                      placeholder="请输入耗材名称"
80
                       @select="handleSelect"
80
                       @select="handleSelect"
81
                       @input="changeGoodName(scope.$index)"
81
                       @input="changeGoodName(scope.$index)"
82
                       style="width:150px;"
82
                       style="width:150px;"