28169 před 2 měsíci
rodič
revize
ce86d3d032

+ 9 - 0
src/api/drug/drug.js Zobrazit soubor

@@ -925,4 +925,13 @@ export function getDrugInventoryRecordList(params){
925 925
     method:"get",
926 926
     params:params
927 927
   })
928
+}
929
+
930
+export function getInventoryRecordPrintList(params){
931
+
932
+  return request({
933
+    url:"/api/drug/getdruginventoryrecordprintlist",
934
+    method:"Get",
935
+    params:params,
936
+  })
928 937
 }

+ 9 - 0
src/api/stock.js Zobrazit soubor

@@ -1151,4 +1151,13 @@ export function getStockInventroyModePrintList(params){
1151 1151
     method:"get",
1152 1152
     params:params
1153 1153
   })
1154
+}
1155
+
1156
+export function getDrugInventroyModePrintList(params){
1157
+
1158
+  return request({
1159
+    url:"/api/drug/getdruginventorymodeprintlist",
1160
+    method:"Get",
1161
+    params:params,
1162
+  })
1154 1163
 }

+ 16 - 0
src/router/modules/drugs.js Zobrazit soubor

@@ -82,6 +82,22 @@ export default {
82 82
       is_menu: false,
83 83
       meta: { title: 'inventoryPrint', noCache: true }
84 84
     },
85
+    {
86
+      path: '/stock/drugs/druginventoryPrint',
87
+      component: () => import('@/xt_pages/stock/drugs/inventoryRecordPrint'),
88
+      name: 'druginventoryPrint',
89
+      hidden: true,
90
+      is_menu: false,
91
+      meta: { title: 'druginventoryPrint', noCache: true }
92
+    },
93
+    {
94
+      path: '/stock/drugs/drugInventoryModePrint',
95
+      component: () => import('@/xt_pages/stock/drugs/drugInventoryModePrint'),
96
+      name: 'drugInventoryModePrint',
97
+      hidden: true,
98
+      is_menu: false,
99
+      meta: { title: 'drugInventoryModePrint', noCache: true }
100
+    },
85 101
     {
86 102
       path: '/stock/drugs/print',
87 103
       component: () => import('@/xt_pages/stock/drugs/print'),

+ 3 - 3
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue Zobrazit soubor

@@ -2741,13 +2741,13 @@
2741 2741
                         class="under_line"
2742 2742
                         style="width: 70px; text-align: center"
2743 2743
                       >
2744
-                        <span v-if="org_id!=10598 && org_id!=10551">{{
2744
+                        <!-- <span v-if="org_id!=10598 && org_id!=10551">{{
2745 2745
                           afterdialysis.weight_loss
2746 2746
                             ? afterdialysis.weight_loss
2747 2747
                             : "/"
2748 2748
                            }}
2749
-                         </span>
2750
-                         <span v-if="org_id ==10598 || org_id == 10551">
2749
+                         </span> -->
2750
+                         <span>
2751 2751
                           {{(predialysis.weight_before - afterdialysis.weight_after).toFixed(2)}}
2752 2752
                          </span>
2753 2753
 

+ 2 - 2
src/xt_pages/stock/drugs/drugInventory.vue Zobrazit soubor

@@ -26,9 +26,9 @@
26 26
           <drug-damaged ref="childOne"></drug-damaged>
27 27
         </el-tab-pane>
28 28
 
29
-        <!-- <el-tab-pane label="盘点日志表" name="seven">
29
+        <el-tab-pane label="盘点日志表" name="seven">
30 30
             <inventory-record ref="childSeven"></inventory-record>
31
-         </el-tab-pane> -->
31
+         </el-tab-pane>
32 32
       </el-tabs>
33 33
     </div>
34 34
   </div>

+ 417 - 0
src/xt_pages/stock/drugs/drugInventoryModePrint.vue Zobrazit soubor

@@ -0,0 +1,417 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+
14
+                <table class="printTable" border="0" cellspacing="0" align="center">
15
+                    <thead class="print_head">
16
+                        <tr><td colspan="11">{{org_name}}</td></tr>
17
+                        <tr><td colspan="11">药品盘点</td></tr>
18
+                    </thead>
19
+                    <tbody class="print_body">
20
+                    <tr>
21
+                        <td align="center">药品名称</td>
22
+                        <td align="center">规格</td>
23
+                     
24
+                        <td align="center">本月入库数量</td>
25
+                        <td align="center">本月出库数量</td>
26
+                        <td align="center">本月剩余库存</td>
27
+                        <td align="center">批号</td>
28
+                        <td align="center">生产日期</td> 
29
+                        <td align="center">有效日期</td>
30
+                        <td align="center">生产厂商</td>
31
+                        <td align="center">盘点数量</td>
32
+                       
33
+                    </tr>
34
+
35
+                    <tr v-for="(item,index) in tableList" :key="index">
36
+                        <td align="center">{{ item.good_name }}</td>
37
+                        <td align="center">{{ item.specification_name }}</td>
38
+                        <td align="center">{{ getInCount(item.good_id) }}</td>
39
+                        <td align="center">{{ getOutCount(item.good_id) }}</td> 
40
+                        <td align="center">{{ getSumCount(item.good_id) }}</td>
41
+                        <td align="center">
42
+                            <table
43
+                                class="ware_table"
44
+                                style="width: 100%; border-collapse: collapse"
45
+                                >
46
+                                <tr
47
+                                    v-for="(it, i) in item.child"
48
+                                    :key="i"
49
+                                    style="width: 100%"
50
+                                >
51
+                                    <td
52
+                                    :style="[
53
+                                        {
54
+                                        border:
55
+                                            i === item.child.length - 1
56
+                                            ? 'none'
57
+                                            : '',
58
+                                        },
59
+                                        {
60
+                                        borderStyle:
61
+                                            i === item.child.length - 1
62
+                                            ? 'initial'
63
+                                            : 'hidden',
64
+                                        },
65
+                                        {
66
+                                        borderBottom:
67
+                                            i === item.child.length - 1
68
+                                            ? 'none'
69
+                                            : '1px solid',
70
+                                        },
71
+                                    ]"
72
+                                    >
73
+                                    {{ it.number }}
74
+                                    </td>
75
+                              </tr>
76
+                            </table>
77
+                        </td>
78
+                       
79
+                        <td align="center">
80
+                            <table
81
+                                class="ware_table"
82
+                                style="width: 100%; border-collapse: collapse"
83
+                                >
84
+                                <tr
85
+                                    v-for="(it, i) in item.child"
86
+                                    :key="i"
87
+                                    style="width: 100%"
88
+                                >
89
+                                    <td
90
+                                    :style="[
91
+                                        {
92
+                                        border:
93
+                                            i === item.child.length - 1
94
+                                            ? 'none'
95
+                                            : '',
96
+                                        },
97
+                                        {
98
+                                        borderStyle:
99
+                                            i === item.child.length - 1
100
+                                            ? 'initial'
101
+                                            : 'hidden',
102
+                                        },
103
+                                        {
104
+                                        borderBottom:
105
+                                            i === item.child.length - 1
106
+                                            ? 'none'
107
+                                            : '1px solid',
108
+                                        },
109
+                                    ]"
110
+                                    >
111
+                                    {{ getTime(it.product_date) }}
112
+                                    </td>
113
+                              </tr>
114
+                            </table>
115
+                        </td>
116
+                        <td align="center">
117
+                            <table
118
+                                class="ware_table"
119
+                                style="width: 100%; border-collapse: collapse"
120
+                                >
121
+                                <tr
122
+                                    v-for="(it, i) in item.child"
123
+                                    :key="i"
124
+                                    style="width: 100%"
125
+                                >
126
+                                    <td
127
+                                    :style="[
128
+                                        {
129
+                                        border:
130
+                                            i === item.child.length - 1
131
+                                            ? 'none'
132
+                                            : '',
133
+                                        },
134
+                                        {
135
+                                        borderStyle:
136
+                                            i === item.child.length - 1
137
+                                            ? 'initial'
138
+                                            : 'hidden',
139
+                                        },
140
+                                        {
141
+                                        borderBottom:
142
+                                            i === item.child.length - 1
143
+                                            ? 'none'
144
+                                            : '1px solid',
145
+                                        },
146
+                                    ]"
147
+                                    >
148
+                                    {{ getTime(it.expiry_date) }}
149
+                                    </td>
150
+                              </tr>
151
+                            </table>
152
+                        </td>
153
+                        <td align="center">
154
+
155
+                            <table
156
+                                class="ware_table"
157
+                                style="width: 100%; border-collapse: collapse"
158
+                                >
159
+                                <tr
160
+                                    v-for="(it, i) in item.child"
161
+                                    :key="i"
162
+                                    style="width: 100%"
163
+                                >
164
+                                    <td
165
+                                    :style="[
166
+                                        {
167
+                                        border:
168
+                                            i === item.child.length - 1
169
+                                            ? 'none'
170
+                                            : '',
171
+                                        },
172
+                                        {
173
+                                        borderStyle:
174
+                                            i === item.child.length - 1
175
+                                            ? 'initial'
176
+                                            : 'hidden',
177
+                                        },
178
+                                        {
179
+                                        borderBottom:
180
+                                            i === item.child.length - 1
181
+                                            ? 'none'
182
+                                            : '1px solid',
183
+                                        },
184
+                                    ]"
185
+                                    >
186
+                                    {{ getManufacturerName(it.manufacturer) }}
187
+                                    </td>
188
+                              </tr>
189
+                            </table>
190
+
191
+                        </td>
192
+                        <td align="center">
193
+
194
+                            
195
+                        </td>
196
+                       
197
+                    </tr>
198
+                   
199
+                    </tbody>
200
+                </table>
201
+            </div>
202
+        </div>
203
+    </div>
204
+</template>
205
+
206
+<script>
207
+import print from "print-js"; 
208
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
209
+const moment = require('moment');
210
+import { uParseTime } from '@/utils/tools'
211
+import { getDrugInventroyModePrintList } from  "@/api/stock"
212
+  export default {
213
+    components:{
214
+        BreadCrumb
215
+    },
216
+     data(){
217
+       return{
218
+        crumbs: [
219
+            { path: false, name: '库存管理' },
220
+            { path: false, name: '耗材管理' },
221
+            { path: false, name: '耗材模版打印' },
222
+          ],
223
+          tableList:[],
224
+          org_name: this.$store.getters.xt_user.org.org_name,
225
+          start_time:"",
226
+          end_time:"",
227
+          manufacturerList:[],
228
+          infoList:[],
229
+          outinfo:[],
230
+          flowProList:[],
231
+          flowNoProList:[],
232
+          goodInfo:[]
233
+       }
234
+     },
235
+     methods:{
236
+        printAction: function() {
237
+            const style = '@page{size:landscape;margin: 10mm;} @media print { print_content{width:960px;margin:0} .flex{display: flex;justify-content: space-between;} .printTable{width:100%;border-collapse: collapse;border:0px;margin:10px 0;} .printTable thead{text-align:center}.printTable td{padding:5px;} .print_body tr td{border: 1px solid;font-size:12px;border-collapse:collapse;} }';
238
+            printJS({ 
239
+            printable: 'print_content',
240
+            type: 'html',
241
+            documentTitle: '  ',
242
+            style: style,
243
+            scanStyles: false
244
+            })
245
+        },
246
+        getTime(val) {
247
+         if(val < 0){
248
+            return ""
249
+          }
250
+         if(val == ""){
251
+            return ""
252
+          }else {
253
+            return uParseTime(val, '{y}-{m}-{d}')
254
+         }
255
+        },
256
+        getlist(){
257
+          
258
+          var params = {
259
+            start_time:this.$route.query.start_time,
260
+            end_time:this.$route.query.end_time,
261
+          }
262
+          console.log("params-------",params)
263
+          getDrugInventroyModePrintList(params).then(response=>{
264
+              if(response.data.state == 1){
265
+                 var list  =  response.data.data.list
266
+
267
+                 console.log("list===============",list)
268
+
269
+                if(list!=null && list.length > 0){
270
+                  let dataInfo = {}
271
+                  list.forEach((item, index) => {
272
+                  let { good_id } = item
273
+                  if (!dataInfo[good_id]) {
274
+                    dataInfo[good_id] = {
275
+                      good_id:item.good_id,
276
+                      child: [],
277
+                      count:0,
278
+                      specification_name:item.specification_name,
279
+                      good_name:item.good_name,
280
+                    }
281
+                  }
282
+                })
283
+                let arr = Object.values(dataInfo)
284
+                
285
+                for(let i=0;i<arr.length;i++){
286
+                   for(let j=0;j<list.length;j++){
287
+                       if(arr[i].good_id == list[j].good_id){
288
+                          arr[i].child.push(list[j])
289
+                       }
290
+                   }
291
+                }
292
+                
293
+                this.tableList = arr
294
+                console.log("arr--------------",arr)
295
+                }
296
+                 var manufacturerList = response.data.data.manufacturerList
297
+                 this.manufacturerList = manufacturerList
298
+
299
+                 this.infoList = response.data.data.infoList
300
+
301
+                 this.outinfo = response.data.data.outinfo
302
+
303
+                 this.flowNoProList = response.data.data.flowNoProList
304
+
305
+                 this.flowProList = response.data.data.flowProList
306
+
307
+                 this.goodInfo = response.data.data.goodInfo
308
+              }
309
+          })
310
+        },
311
+        getManufacturerName(id){
312
+           var manufacturer_name = ""
313
+           for(let i=0;i<this.manufacturerList.length;i++){
314
+             if(id == this.manufacturerList[i].id){
315
+                 manufacturer_name = this.manufacturerList[i].manufacturer_name
316
+             }
317
+           }
318
+           return manufacturer_name
319
+        },
320
+        
321
+        getInCount(good_id){
322
+          
323
+          var newArr =[]
324
+          var total_count =0
325
+          var newArrOne = []
326
+          var total_count_one  = 0
327
+          var total =0
328
+          for(let i=0;i<this.infoList.length;i++){
329
+            if(good_id == this.infoList[i].good_id){
330
+               newArr.push(this.infoList[i])
331
+            }
332
+          }
333
+          if(newArr!=null){
334
+            for(let i=0;i<newArr.length;i++){
335
+                total_count += parseInt(newArr[i].warehousing_count)
336
+            }
337
+          }
338
+
339
+          for(let i=0;i<this.flowProList.length;i++){
340
+            if(good_id == this.flowProList[i].good_id){
341
+               newArrOne.push(this.flowProList[i])
342
+            }
343
+          }
344
+          if(newArrOne!=null){
345
+            for(let i=0;i<newArrOne.length;i++){
346
+               total_count_one += newArrOne[i].count
347
+            }
348
+          }
349
+          total = total_count + total_count_one
350
+          return total
351
+        },
352
+        getOutCount(good_id){
353
+
354
+          var newArr =[]
355
+          var newArrOne = []
356
+          var total_count =0
357
+          var total_count_one  = 0
358
+          var total = 0
359
+          for(let i=0;i<this.outinfo.length;i++){
360
+            if(good_id == this.outinfo[i].good_id){
361
+               newArr.push(this.outinfo[i])
362
+            }
363
+          }
364
+          if(newArr!=null){
365
+            for(let i=0;i<newArr.length;i++){
366
+              total_count += parseInt(newArr[i].count)
367
+            }
368
+          }
369
+
370
+          for(let i=0;i<this.flowNoProList.length;i++){
371
+            if(good_id == this.flowNoProList[i].good_id){
372
+               newArrOne.push(this.flowNoProList[i])
373
+            }
374
+          }
375
+          if(newArrOne!=null){
376
+            for(let i=0;i<newArrOne.length;i++){
377
+               total_count_one += newArrOne[i].count
378
+            }
379
+          }
380
+
381
+
382
+          total = total_count + total_count_one
383
+          return total
384
+        },
385
+        getSumCount(good_id){
386
+          var sum_count = 0
387
+          for(let i=0;i<this.goodInfo.length;i++){
388
+             if(good_id == this.goodInfo[i].id){
389
+                sum_count = this.goodInfo[i].sum_count
390
+             }
391
+          }
392
+          return sum_count
393
+        }
394
+
395
+        
396
+     },
397
+     created(){
398
+        
399
+        this.getlist()
400
+     }
401
+
402
+  } 
403
+</script>
404
+
405
+
406
+<style rel="stylesheet/scss" lang="scss" scoped>
407
+.printTitle{font-size: 22px;text-align: center;}
408
+.flex{display: flex;justify-content: space-between;}
409
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
410
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
411
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
412
+.printTable{width:100%;border-collapse: collapse;}
413
+.printTable td{padding:5px;}
414
+.print_head{border: none;display: table-header-group;}
415
+.print_head tr td{text-align: center;border: none;}
416
+.print_body tr td{border:1px solid}
417
+</style>

+ 284 - 0
src/xt_pages/stock/drugs/inventoryRecordPrint.vue Zobrazit soubor

@@ -0,0 +1,284 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+
14
+                <table class="printTable" border="0" cellspacing="0" align="center">
15
+                    <thead class="print_head">
16
+                        <tr><td colspan="11">{{org_name}}</td></tr>
17
+                        <tr><td colspan="11">药品盘点</td></tr>
18
+                    </thead>  
19
+                    <tbody class="print_body">
20
+                    <tr>
21
+                        <td align="center">盘点时间</td>
22
+                        <td align="center">药品名称</td>
23
+                        <td align="center">规格</td>
24
+                        <td align="center">进价</td>
25
+                        <td align="center">批号</td>
26
+                        <td align="center">生产厂商</td>
27
+                        <td align="center">有效日期</td>
28
+                        <td align="center">仓库名称</td>
29
+                        <td align="center">盘点前数量</td> 
30
+                        <td align="center">盘点后数量</td>
31
+                        <td align="center">盘点类型</td>
32
+                        <td align="center">盘点人</td>
33
+                       
34
+                        
35
+                    </tr>
36
+                    <tr v-for="(item,index) in tableData" :key="index">
37
+                        <td align="center">{{ getTime(item.record_date) }}</td>
38
+                        <td align="center">{{item.drug_name}}</td>
39
+                        <td align="center">{{item.specification_name}}</td>
40
+                        <td align="center">{{ item.price }}</td>
41
+                        <td align="center">{{item.batch_number }}</td>
42
+                        <td align="center">{{ item.manufacturer_name }}</td>
43
+                        <td align="center">{{ getTime(item.expiry_date) }}</td>
44
+                        <td align="center">{{ getHouseName(item.storehouse_id) }}</td>
45
+                        <td align="center">
46
+                             {{ item.stock_max_number }}
47
+                           <span v-if="item.stock_max_number>0">{{ item.max_unit }}</span> 
48
+                             {{ item.stock_min_number }}
49
+                           <span v-if="item.stock_min_number>0">{{ item.min_unit }}</span> 
50
+                        </td> 
51
+                        <td align="center">
52
+                            {{ item.last_stock_max_number }}
53
+                           <span v-if="item.last_stock_max_number>0">{{ item.max_unit }}</span> 
54
+                             {{ item.last_stock_min_number }}
55
+                           <span v-if="item.last_stock_min_number>0">{{ item.min_unit }}</span> 
56
+                        </td>
57
+                        <td align="center">
58
+                            <span v-if="item.reason == 10">盘盈</span>
59
+                            <span v-if="item.reason == 11">盘亏</span>
60
+                        </td>
61
+                        <td align="center">
62
+                            {{getName(item.creater)}}
63
+                        </td>
64
+                       
65
+                    </tr>
66
+                    </tbody>
67
+                </table>
68
+            </div>
69
+        </div>
70
+    </div>
71
+</template>
72
+
73
+<script>
74
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
75
+const moment = require('moment');
76
+import { uParseTime } from '@/utils/tools'
77
+import { getInventoryRecordPrintList } from "@/api/drug/drug"
78
+import print from "print-js";
79
+import { min } from 'moment';
80
+export default {
81
+    components:{
82
+        BreadCrumb
83
+    },
84
+    data(){
85
+        return{
86
+          crumbs: [
87
+            { path: false, name: '库存管理' },
88
+            { path: false, name: '耗材管理' },
89
+            { path: false, name: '耗材盘点打印' },
90
+          ],
91
+          org_name: this.$store.getters.xt_user.org.org_name,
92
+          ids:"",
93
+          tableData:[],
94
+          manufacturerList:[],
95
+          houseList:[],
96
+          inventoryList:[],
97
+          doctorList:[],
98
+        }
99
+    },
100
+    methods:{
101
+        printAction: function() {
102
+            const style = '@page{size:landscape;margin: 10mm;} @media print { print_content{width:960px;margin:0} .flex{display: flex;justify-content: space-between;} .printTable{width:100%;border-collapse: collapse;border:0px;margin:10px 0;} .printTable thead{text-align:center}.printTable td{padding:5px;} .print_body tr td{border: 1px solid;font-size:12px;border-collapse:collapse;} }';
103
+            printJS({ 
104
+            printable: 'print_content',
105
+            type: 'html',
106
+            documentTitle: '  ',
107
+            style: style,
108
+            scanStyles: false
109
+            })
110
+        },
111
+        getTime(val) {
112
+         if(val < 0){
113
+            return ""
114
+          }
115
+         if(val == ""){
116
+            return ""
117
+          }else {
118
+            return uParseTime(val, '{y}-{m}-{d}')
119
+         }
120
+        },
121
+       getlist(){
122
+            var params = {
123
+              limit:this.$route.query.limit,
124
+              page:this.$route.query.page,
125
+              keyword:this.$route.query.drug_name,
126
+              storehouse_id:this.$route.query.storehouse_id,
127
+              ids:this.$route.query.ids,
128
+              start_time:this.$route.query.start_time,
129
+              end_time:this.$route.query.end_time,
130
+            }
131
+          getInventoryRecordPrintList(params).then(response=>{
132
+             if(response.data.state == 1){
133
+              this.total =  response.data.data.total
134
+              this.tableData = response.data.data.list
135
+              this.houseList = response.data.data.houseList
136
+              this.doctorList = response.data.data.doclist
137
+              
138
+             }
139
+          })   
140
+        },
141
+        getManufacturerName(id){
142
+
143
+           var name = ""
144
+           for(let i=0;i<this.manufacturerList.length;i++){
145
+              if(id == this.manufacturerList[i].id){
146
+                  name = this.manufacturerList[i].manufacturer_name
147
+              }
148
+           }
149
+           return name
150
+        },
151
+        getNumber(id){
152
+          var number = ""
153
+          for(let i=0;i<this.inventoryList.length;i++){
154
+            if(id == this.inventoryList[i].id){
155
+                number = this.inventoryList[i].drug_warehouse_info.batch_number
156
+            }
157
+          }
158
+          return number
159
+         },
160
+         getPrice(id){
161
+           var price = 0
162
+           for(let i=0;i<this.inventoryList.length;i++){
163
+            if(id == this.inventoryList[i].id){
164
+               price = this.inventoryList[i].drug_warehouse_info.price
165
+            }
166
+          }
167
+          if(price > 0){
168
+          return price
169
+          }
170
+          
171
+         },
172
+         getHouseName(id){
173
+         var storehouse_name = ""
174
+         for(let i=0;i<this.houseList.length;i++){
175
+           if(id == this.houseList[i].id){
176
+              storehouse_name = this.houseList[i].storehouse_name
177
+           }
178
+         }
179
+         if(storehouse_name == "全部"){
180
+           return ""
181
+         }else{
182
+           return storehouse_name
183
+         }
184
+       },
185
+       getCount(stock_max_number,stock_min_number,last_stock_max_number,last_stock_min_number,min_number,id){
186
+         
187
+         var cha_count = 0
188
+         var befor_total_count = 0
189
+         var after_total_count = 0
190
+         var befor_total_count = stock_max_number * min_number + stock_min_number
191
+         var after_total_count = last_stock_max_number * min_number + last_stock_min_number
192
+         var retail_price = 0
193
+         var price = 0
194
+         var max_count = 0
195
+         var min_count = 0
196
+         var total_price = 0
197
+        for(let i=0;i<this.inventoryList.length;i++){
198
+          if(id == this.inventoryList[i].id){
199
+            retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
200
+            price = this.inventoryList[i].drug_warehouse_info.price
201
+          }
202
+        }
203
+
204
+         //如果透前数量大于透后数量 盘亏
205
+         if(befor_total_count  > after_total_count){
206
+           cha_count = befor_total_count - after_total_count
207
+         }
208
+         max_count = cha_count/min_number
209
+         min_count = cha_count%min_number
210
+         console.log("price",price/min_number)
211
+         console.log("max_count23323232",max_count)
212
+         console.log("min_count33333",min_count)
213
+         console.log("min_number2332233232",min_number)
214
+         
215
+         total_price = Math.floor(max_count) * price + min_count * (price/min_number)
216
+         
217
+         if(total_price > 0){
218
+            return total_price.toFixed(2)
219
+         }else{
220
+          return ""
221
+         }
222
+        return cha_count
223
+       },
224
+       getCountOne(stock_max_number,stock_min_number,last_stock_max_number,last_stock_min_number,min_number,id){
225
+         var cha_count = 0
226
+         var befor_total_count = 0
227
+         var after_total_count = 0
228
+         var befor_total_count = stock_max_number * min_number + stock_min_number
229
+         var after_total_count = last_stock_max_number * min_number + last_stock_min_number
230
+         var retail_price = 0
231
+         var price = 0
232
+         var max_count = 0
233
+         var min_count = 0
234
+         var total_price = 0
235
+          for(let i=0;i<this.inventoryList.length;i++){
236
+          if(id == this.inventoryList[i].id){
237
+            retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
238
+            price = this.inventoryList[i].drug_warehouse_info.price
239
+          }
240
+        }
241
+         //如果透前数量大于透后数量 盘盈
242
+         if(befor_total_count  < after_total_count){
243
+           cha_count = after_total_count - befor_total_count
244
+         }
245
+         max_count = cha_count/min_number
246
+         min_count = cha_count%min_number
247
+         total_price =  Math.floor(max_count) *price + min_count * (price/min_number)
248
+         if(total_price > 0){
249
+            return total_price.toFixed(2)
250
+         }else{
251
+          return ""
252
+         }
253
+        
254
+       },
255
+       getName(admin_user_id){
256
+         var user_name = ""
257
+         for(let i=0;i<this.doctorList.length;i++){
258
+           if(admin_user_id == this.doctorList[i].admin_user_id){
259
+               user_name = this.doctorList[i].user_name
260
+           }
261
+         }
262
+         return user_name
263
+      }
264
+    },
265
+    created(){
266
+
267
+      this.getlist()
268
+    }
269
+}
270
+</script>
271
+
272
+
273
+<style rel="stylesheet/scss" lang="scss" scoped>
274
+.printTitle{font-size: 22px;text-align: center;}
275
+.flex{display: flex;justify-content: space-between;}
276
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
277
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
278
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
279
+.printTable{width:100%;border-collapse: collapse;}
280
+.printTable td{padding:5px;}
281
+.print_head{border: none;display: table-header-group;}
282
+.print_head tr td{text-align: center;border: none;}
283
+.print_body tr td{border:1px solid}
284
+</style>

+ 28 - 10
src/xt_pages/stock/drugs/inventory_record.vue Zobrazit soubor

@@ -57,13 +57,19 @@
57 57
             </div>
58 58
             <div>
59 59
                <el-button size="small" type="primary" @click="print_1">打印</el-button>
60
-             
60
+               <el-button size="small" type="primary" @click="print_2">盘点模版打印2</el-button>
61 61
             </div>
62 62
           
63 63
         </div>
64 64
         <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" style="width:100%"  @selection-change="changePrice" >
65 65
            <el-table-column type="selection" width="50" align="center"> </el-table-column>
66
-            <el-table-column prop="date" label="药品名称" align="center">
66
+           
67
+           <el-table-column prop="name" label="盘点时间"  width="100" align="center">
68
+                <template slot-scope="scope">
69
+                   {{ getTime(scope.row.ctime) }}
70
+                </template>
71
+            </el-table-column>
72
+           <el-table-column prop="date" label="药品名称" align="center">
67 73
                <template slot-scope="scope">
68 74
                  {{scope.row.drug_name}}
69 75
                </template>
@@ -107,7 +113,7 @@
107 113
            
108 114
            <el-table-column prop="name" label="盘点前数量" width="100"  align="center">
109 115
                 <template slot-scope="scope">
110
-                  <span v-if="scope.row.stock_max_number>0">{{scope.row.stock_max_number}}{{scope.row.warehousing_unit}} </span>  
116
+                  <span v-if="scope.row.stock_max_number>0">{{scope.row.stock_max_number}}{{scope.row.max_unit}} </span>  
111 117
                   <span v-if="scope.row.stock_min_number>0">{{scope.row.stock_min_number}}{{scope.row.min_unit}}</span>
112 118
                   <span v-if="scope.row.stock_max_number == 0 && scope.row.stock_min_number == 0">0</span>
113 119
                 </template> 
@@ -115,7 +121,7 @@
115 121
 
116 122
             <el-table-column prop="name" label="盘点后数量" width="100"  align="center">
117 123
                 <template slot-scope="scope">
118
-                   <span v-if="scope.row.last_stock_max_number > 0">{{scope.row.last_stock_max_number}}{{scope.row.warehousing_unit}}</span>  
124
+                   <span v-if="scope.row.last_stock_max_number > 0">{{scope.row.last_stock_max_number}}{{scope.row.max_unit}}</span>  
119 125
                    <span v-if="scope.row.last_stock_min_number>0">{{scope.row.last_stock_min_number}}{{scope.row.min_unit}}</span>
120 126
                    <span v-if="scope.row.last_stock_max_number == 0 && scope.row.last_stock_min_number == 0">0</span>
121 127
                 </template> 
@@ -133,11 +139,7 @@
133 139
                 </template>
134 140
             </el-table-column>
135 141
 
136
-            <el-table-column prop="name" label="盘点时间"  width="100" align="center">
137
-                <template slot-scope="scope">
138
-                   {{ getTime(scope.row.ctime) }}
139
-                </template>
140
-            </el-table-column>
142
+          
141 143
         </el-table>
142 144
         <el-pagination
143 145
             @size-change="handleSizeChange"
@@ -157,6 +159,7 @@
157 159
 <script>
158 160
 import { uParseTime } from '@/utils/tools'
159 161
 import { getDrugInventoryRecordList } from "@/api/drug/drug"
162
+const moment = require('moment')
160 163
 export default {
161 164
     name: "inventory",
162 165
     data() {
@@ -194,7 +197,22 @@ export default {
194 197
              this.$message.error("请勾选需要打印的内容")
195 198
              return false
196 199
            }
197
-           this.$router.push({path:'/stock/drugs/print?storehouse_id='+this.storehouse_id+"&drug_name="+this.searchKey+"&limit="+this.limit+"&page="+this.page+"&ids="+this.ids}) 
200
+           this.$router.push({path:'/stock/drugs/druginventoryPrint?storehouse_id='+this.storehouse_id+"&drug_name="+this.searchKey+"&limit="+this.limit+"&page="+this.page+"&ids="+this.ids+"&start_time="+this.start_time+"&end_time="+this.end_time}) 
201
+        },
202
+        print_2(){
203
+          var start_time_one = ""
204
+          var end_time_one = ""
205
+          if(this.start_time!="" && this.end_time !=""){
206
+            start_time_one = this.start_time
207
+            end_time_one = this.end_time
208
+          }
209
+          if(this.start_time=="" && this.end_time ==""){
210
+
211
+            start_time_one = moment().startOf('month').format("YYYY-MM-DD")
212
+            end_time_one= moment().endOf('month').format("YYYY-MM-DD")
213
+
214
+          }
215
+          this.$router.push({path:'/stock/drugs/drugInventoryModePrint?start_time='+"&start_time="+start_time_one+"&end_time="+end_time_one}) 
198 216
         },
199 217
         handleSizeChange(val){
200 218
          this.limit = val