28169 1 viikko sitten
vanhempi
commit
cb505d8171

+ 2 - 2
src/xt_pages/outpatientDoctorStation/batch_print_template/batchPrintThree.vue Näytä tiedosto

@@ -199,7 +199,7 @@
199 199
               医    师:
200 200
               <span
201 201
                 style="width: 100px; display: inline-block"
202
-                v-if="i.info.creator == 0"
202
+                v-if="setAdminUserES(i.info.creator)==''"
203 203
               >
204 204
                {{ i.info.doctor ? i.info.doctor : "" }}
205 205
               </span>
@@ -208,7 +208,7 @@
208 208
                 :src="setAdminUserES(i.info.creator)"
209 209
                 alt=""
210 210
                 srcset=""
211
-                v-else
211
+                 v-if="setAdminUserES(i.info.creator)!=''"
212 212
               />
213 213
             </div>
214 214
             <!-- <div>药品金额:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}</div> -->

+ 44 - 5
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue Näytä tiedosto

@@ -155,14 +155,17 @@
155 155
                                             <template slot-scope="scope">{{ scope.row.zuobiao_stock_num }}</template>
156 156
                                           </el-table-column>
157 157
 
158
-
159 158
                                           <el-table-column label="规格" width="60" v-if="org_id == 10206 || org_id == 0">
160 159
                                             <template slot-scope="scope">
161 160
                                               <span>{{scope.row.drug_spec}}</span>
162 161
                                             </template>
163 162
                                           </el-table-column>
164
-                                            <el-table-column label="单价" width="40">
163
+                                          <el-table-column label="单价" width="40">
165 164
                                                 <template slot-scope="scope">{{ scope.row.retail_price }}</template>
165
+                                           </el-table-column>
166
+
167
+                                            <el-table-column label="库存" width="60" v-if="org_id != 10206" >
168
+                                              <template slot-scope="scope">{{ getSumCount(scope.row.sum_count,scope.row.min_number,scope.row.min_unit,scope.row.max_unit)}}</template>
166 169
                                             </el-table-column>
167 170
                                         </el-table>
168 171
                                     </div>
@@ -216,6 +219,8 @@
216 219
                                                 <template slot-scope="scope">{{ scope.row.type == 3?scope.row.zuobiao_stock_num :""}}</template>
217 220
                                               </el-table-column>
218 221
 
222
+                                           
223
+
219 224
 
220 225
                                                 <el-table-column label="规格" width="60">
221 226
                                                     <template slot-scope="scope">{{ scope.row.single_dose }}</template>
@@ -223,6 +228,13 @@
223 228
                                                 <el-table-column label="单价" width="40">
224 229
                                                     <template slot-scope="scope">{{ scope.row.price }}</template>
225 230
                                                 </el-table-column>
231
+                                               
232
+                                                <el-table-column label="库存" width="60" v-if="org_id != 10206" >
233
+                                                <template slot-scope="scope">
234
+                                                  <span v-if="scope.row.type == 3">{{scope.row.sum_count}}</span> 
235
+                                                </template>
236
+                                              </el-table-column>
237
+                                                
226 238
                                             </el-table>
227 239
                                         </div>
228 240
                                     </el-tab-pane>
@@ -818,6 +830,7 @@
818 830
             return false
819 831
           } else {
820 832
             this.drugs = response.data.data.drugs
833
+            console.log("drugs------------------------",this.drugs)
821 834
             if (this.org_id == 10206) {
822 835
               for (let i = 0; i < this.zuobiao_drug.length; i++) {
823 836
                 for (let b = 0; b < this.drugs.length; b++) {
@@ -2185,6 +2198,7 @@
2185 2198
         getHisProject().then(response => {
2186 2199
           if (response.data.state == 1) {
2187 2200
             var project = response.data.data.project
2201
+            
2188 2202
             for (let i = 0; i < project.length; i++) {
2189 2203
               let obj = {
2190 2204
                 id: project[i].id,
@@ -2204,7 +2218,7 @@
2204 2218
                 number: "",
2205 2219
                 bbx01:project[i].bbx01,
2206 2220
                 bby01:project[i].bby01,
2207
-
2221
+                sum_count:""
2208 2222
 
2209 2223
               }
2210 2224
 
@@ -2212,7 +2226,7 @@
2212 2226
             }
2213 2227
 
2214 2228
             var good_info = response.data.data.good_info
2215
-
2229
+            console.log("good_info000000000000000000000",good_info)
2216 2230
             for (let i = 0; i < good_info.length; i++) {
2217 2231
               let obj = {
2218 2232
                 id: good_info[i].id,
@@ -2232,7 +2246,7 @@
2232 2246
                 number: good_info[i].good_number,
2233 2247
                 bbx01:good_info[i].bbx01,
2234 2248
                 bby01:good_info[i].bby01,
2235
-
2249
+                sum_count:good_info[i].sum_count
2236 2250
 
2237 2251
               }
2238 2252
               this.tabProject.push(obj)
@@ -2561,6 +2575,31 @@
2561 2575
 
2562 2576
           }
2563 2577
         })
2578
+      },
2579
+      getSumCount(total,min_number,min_unit,max_unit){
2580
+          var min_str  =""
2581
+          var max_str = ""
2582
+          if (total < min_number) {
2583
+              min_str = total + min_unit;
2584
+          }
2585
+          if (total == 0) {
2586
+              min_str = "";
2587
+              max_str = "";
2588
+          }
2589
+          if (total >= min_number) {
2590
+              if (parseInt(total / min_number) != 0) {
2591
+              max_str = parseInt(total / min_number) + max_unit;
2592
+              }
2593
+              if (total % min_number != 0) {
2594
+              min_str = (total % min_number) + min_unit;
2595
+              }
2596
+          }
2597
+         
2598
+          if(max_str == "" && min_str == ""){
2599
+              return "0"
2600
+          }else{
2601
+          return max_str + min_str
2602
+          }
2564 2603
       }
2565 2604
     }, created() {
2566 2605
       for(let key in this.$store.getters.treatment_mode){

+ 12 - 2
src/xt_pages/stock/detail/cancelStockDetail.vue Näytä tiedosto

@@ -60,7 +60,6 @@
60 60
           align="right"
61 61
           format="yyyy-MM-dd"
62 62
           value-format="yyyy-MM-dd"
63
-          @change="startTimeChange"
64 63
         ></el-date-picker>
65 64
         <span class="cellLine"> - </span>
66 65
         <el-date-picker
@@ -74,8 +73,16 @@
74 73
           align="right"
75 74
           format="yyyy-MM-dd"
76 75
           value-format="yyyy-MM-dd"
77
-          @change="endTimeChange"
78 76
         ></el-date-picker>
77
+        <el-button
78
+        size="small"
79
+        class="filter-item"
80
+        type="primary"
81
+        icon="el-icon-search"
82
+        @click="getAllQuery"
83
+        >查询</el-button
84
+      >
85
+
79 86
 
80 87
     </div>
81 88
 
@@ -526,6 +533,9 @@ export default {
526 533
         this.GetCancelStock();
527 534
       }
528 535
     },
536
+    getAllQuery(){
537
+      this.GetCancelStock();
538
+    },
529 539
     getTimestamp(time) {
530 540
       // 把时间日期转成时间戳
531 541
       return new Date(time).getTime() / 1000;

+ 11 - 3
src/xt_pages/stock/detail/stockInDetail.vue Näytä tiedosto

@@ -63,7 +63,6 @@
63 63
           align="right"
64 64
           format="yyyy-MM-dd"
65 65
           value-format="yyyy-MM-dd"
66
-          @change="startTimeChange"
67 66
           
68 67
         ></el-date-picker>
69 68
         <span class="cellLine"> - </span>
@@ -78,9 +77,15 @@
78 77
           align="right"
79 78
           format="yyyy-MM-dd"
80 79
           value-format="yyyy-MM-dd"
81
-          @change="endTimeChange"
82 80
         ></el-date-picker>
83
-
81
+        <el-button
82
+          size="small"
83
+          class="filter-item"
84
+          type="primary"
85
+          icon="el-icon-search"
86
+          @click="getAllQuery"
87
+          >查询</el-button
88
+        >
84 89
     </div>
85 90
 
86 91
     <!-- <el-row :gutter="12" style="margin-top: 10px"> -->
@@ -496,6 +501,9 @@ export default {
496 501
         this.GetCancelStock();
497 502
       }
498 503
     },
504
+    getAllQuery(){
505
+      this.GetCancelStock();
506
+    },
499 507
     getTimestamp(time) {
500 508
       // 把时间日期转成时间戳
501 509
       return new Date(time).getTime() / 1000;

+ 12 - 2
src/xt_pages/stock/detail/stockOutDetail.vue Näytä tiedosto

@@ -71,7 +71,6 @@
71 71
           align="right"
72 72
           format="yyyy-MM-dd"
73 73
           value-format="yyyy-MM-dd"
74
-          @change="startTimeChange"
75 74
         ></el-date-picker>
76 75
         <span class="cellLine"> - </span>
77 76
         <el-date-picker
@@ -85,9 +84,17 @@
85 84
           align="right"
86 85
           format="yyyy-MM-dd"
87 86
           value-format="yyyy-MM-dd"
88
-          @change="endTimeChange"
89 87
         ></el-date-picker>
90 88
 
89
+        <el-button
90
+        size="small"
91
+        class="filter-item"
92
+        type="primary"
93
+        icon="el-icon-search"
94
+        @click="getAllQuery"
95
+        >查询</el-button
96
+      >
97
+
91 98
     </div>
92 99
 
93 100
     <!-- <el-row :gutter="12" style="margin-top: 10px"> -->
@@ -521,6 +528,9 @@ export default {
521 528
       this.GetCancelStock();
522 529
       // this.getPrintStockGood()
523 530
     },
531
+    getAllQuery(){
532
+      this.GetCancelStock();
533
+    },
524 534
     startTimeChange(val) {
525 535
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
526 536
       if (time > 0) {

+ 11 - 2
src/xt_pages/stock/drugs/components/drugCancelDetail.vue Näytä tiedosto

@@ -51,7 +51,6 @@
51 51
           align="right"
52 52
           format="yyyy-MM-dd"
53 53
           value-format="yyyy-MM-dd"
54
-          @change="startTimeChange"
55 54
         ></el-date-picker>
56 55
         <span class="cellLine"> - </span>
57 56
         <el-date-picker
@@ -65,8 +64,15 @@
65 64
           align="right"
66 65
           format="yyyy-MM-dd"
67 66
           value-format="yyyy-MM-dd"
68
-          @change="endTimeChange"
69 67
         ></el-date-picker>
68
+        <el-button
69
+        size="small"
70
+        class="filter-item"
71
+        type="primary"
72
+        icon="el-icon-search"
73
+        @click="getAllQuery"
74
+        >查询</el-button
75
+      >
70 76
       </div>
71 77
     </div>
72 78
 
@@ -322,6 +328,9 @@ export default {
322 328
         this.getlist()
323 329
       }
324 330
     },
331
+    getAllQuery(){
332
+      this.getlist()
333
+    },
325 334
     getTimestamp(time) {
326 335
       // 把时间日期转成时间戳
327 336
       return new Date(time).getTime() / 1000;

+ 12 - 2
src/xt_pages/stock/drugs/components/drugInOrder.vue Näytä tiedosto

@@ -61,7 +61,6 @@
61 61
           align="right"
62 62
           format="yyyy-MM-dd"
63 63
           value-format="yyyy-MM-dd"
64
-          @change="startTimeChange"
65 64
          
66 65
         ></el-date-picker>
67 66
         <span class="cellLine"> - </span>
@@ -76,8 +75,15 @@
76 75
           align="right"
77 76
           format="yyyy-MM-dd"
78 77
           value-format="yyyy-MM-dd"
79
-          @change="endTimeChange"
80 78
         ></el-date-picker>
79
+        <el-button
80
+        size="small"
81
+        class="filter-item"
82
+        type="primary"
83
+        icon="el-icon-search"
84
+        @click="getAllQuery"
85
+        >查询</el-button
86
+      >
81 87
     </div>
82 88
 
83 89
     <!-- <el-row :gutter="12" style="margin-top: 10px"> -->
@@ -329,6 +335,10 @@ export default {
329 335
         this.getDrugWarehouseInfoPrint()
330 336
       }
331 337
     },
338
+    getAllQuery(){
339
+      this.getlist()
340
+      this.getDrugWarehouseInfoPrint()
341
+    },
332 342
     getTimestamp(time) {
333 343
       // 把时间日期转成时间戳
334 344
       return new Date(time).getTime() / 1000;

+ 12 - 2
src/xt_pages/stock/drugs/components/drugOutDetail.vue Näytä tiedosto

@@ -77,7 +77,6 @@
77 77
           align="right"
78 78
           format="yyyy-MM-dd"
79 79
           value-format="yyyy-MM-dd"
80
-          @change="startTimeChange"
81 80
         ></el-date-picker>
82 81
         <span class="cellLine"> - </span>
83 82
         <el-date-picker
@@ -91,8 +90,15 @@
91 90
           align="right"
92 91
           format="yyyy-MM-dd"
93 92
           value-format="yyyy-MM-dd"
94
-          @change="endTimeChange"
95 93
         ></el-date-picker>
94
+        <el-button
95
+        size="small"
96
+        class="filter-item"
97
+        type="primary"
98
+        icon="el-icon-search"
99
+        @click="getAllQuery"
100
+        >查询</el-button
101
+      >
96 102
 
97 103
     </div>
98 104
 
@@ -395,6 +401,10 @@ export default {
395 401
         this.getDrugOutOrderPrint()
396 402
       }
397 403
     },
404
+    getAllQuery(){
405
+      this.getlist()
406
+      this.getDrugOutOrderPrint()
407
+    },
398 408
     getTimestamp(time) {
399 409
       // 把时间日期转成时间戳
400 410
       return new Date(time).getTime() / 1000;

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

@@ -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>

+ 144 - 75
src/xt_pages/stock/drugs/drugInventoryModePrint.vue Näytä tiedosto

@@ -20,7 +20,6 @@
20 20
                     <tr>
21 21
                         <td align="center">药品名称</td>
22 22
                         <td align="center">规格</td>
23
-                     
24 23
                         <td align="center">本月入库数量</td>
25 24
                         <td align="center">本月出库数量</td>
26 25
                         <td align="center">本月剩余库存</td>
@@ -33,11 +32,11 @@
33 32
                     </tr>
34 33
 
35 34
                     <tr v-for="(item,index) in tableList" :key="index">
36
-                        <td align="center">{{ item.good_name }}</td>
35
+                        <td align="center">{{ item.drug_name }}</td>
37 36
                         <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>
37
+                        <td align="center">{{ getInCount(item.drug_id,item.min_number,item.min_unit,item.max_unit) }}</td>
38
+                        <td align="center">{{ getOutCount(item.drug_id,item.min_number,item.min_unit,item.max_unit) }}</td> 
39
+                        <td align="center">{{ getSumCount(item.sum_count,item.min_number,item.min_unit,item.max_unit) }}</td>
41 40
                         <td align="center">
42 41
                             <table
43 42
                                 class="ware_table"
@@ -70,14 +69,14 @@
70 69
                                         },
71 70
                                     ]"
72 71
                                     >
73
-                                    {{ it.number }}
72
+                                    {{ it.batch_number }}
74 73
                                     </td>
75 74
                               </tr>
76 75
                             </table>
77 76
                         </td>
78 77
                        
79 78
                         <td align="center">
80
-                            <table
79
+                             <table
81 80
                                 class="ware_table"
82 81
                                 style="width: 100%; border-collapse: collapse"
83 82
                                 >
@@ -114,7 +113,7 @@
114 113
                             </table>
115 114
                         </td>
116 115
                         <td align="center">
117
-                            <table
116
+                          <table
118 117
                                 class="ware_table"
119 118
                                 style="width: 100%; border-collapse: collapse"
120 119
                                 >
@@ -148,7 +147,7 @@
148 147
                                     {{ getTime(it.expiry_date) }}
149 148
                                     </td>
150 149
                               </tr>
151
-                            </table>
150
+                            </table> 
152 151
                         </td>
153 152
                         <td align="center">
154 153
 
@@ -217,8 +216,8 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
217 216
        return{
218 217
         crumbs: [
219 218
             { path: false, name: '库存管理' },
220
-            { path: false, name: '耗材管理' },
221
-            { path: false, name: '耗材模版打印' },
219
+            { path: false, name: '药品管理' },
220
+            { path: false, name: '药品模版打印' },
222 221
           ],
223 222
           tableList:[],
224 223
           org_name: this.$store.getters.xt_user.org.org_name,
@@ -226,10 +225,8 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
226 225
           end_time:"",
227 226
           manufacturerList:[],
228 227
           infoList:[],
229
-          outinfo:[],
230
-          flowProList:[],
231
-          flowNoProList:[],
232
-          goodInfo:[]
228
+          drugList:[],
229
+          outList:[]
233 230
        }
234 231
      },
235 232
      methods:{
@@ -264,19 +261,23 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
264 261
               if(response.data.state == 1){
265 262
                  var list  =  response.data.data.list
266 263
 
267
-                 console.log("list===============",list)
264
+                 console.log("list===============998",list)
268 265
 
269 266
                 if(list!=null && list.length > 0){
270 267
                   let dataInfo = {}
271 268
                   list.forEach((item, index) => {
272
-                  let { good_id } = item
273
-                  if (!dataInfo[good_id]) {
274
-                    dataInfo[good_id] = {
275
-                      good_id:item.good_id,
269
+                  let { drug_id } = item
270
+                  if (!dataInfo[drug_id]) {
271
+                    dataInfo[drug_id] = {
272
+                      drug_id:item.drug_id,
276 273
                       child: [],
277 274
                       count:0,
278
-                      specification_name:item.specification_name,
279
-                      good_name:item.good_name,
275
+                      specification_name:item.dose +item.dose_unit+"*"+item.min_number+item.min_unit+"/"+item.max_unit,
276
+                      drug_name:item.drug_name,
277
+                      min_number:item.min_number,
278
+                      min_unit:item.min_unit,
279
+                      max_unit:item.max_unit,
280
+                      sum_count:item.sum_count,
280 281
                     }
281 282
                   }
282 283
                 })
@@ -284,7 +285,7 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
284 285
                 
285 286
                 for(let i=0;i<arr.length;i++){
286 287
                    for(let j=0;j<list.length;j++){
287
-                       if(arr[i].good_id == list[j].good_id){
288
+                       if(arr[i].drug_id == list[j].drug_id){
288 289
                           arr[i].child.push(list[j])
289 290
                        }
290 291
                    }
@@ -298,13 +299,10 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
298 299
 
299 300
                  this.infoList = response.data.data.infoList
300 301
 
301
-                 this.outinfo = response.data.data.outinfo
302
+                 this.outList = response.data.data.outList
302 303
 
303
-                 this.flowNoProList = response.data.data.flowNoProList
304
-
305
-                 this.flowProList = response.data.data.flowProList
306
-
307
-                 this.goodInfo = response.data.data.goodInfo
304
+              
305
+                 this.drugList = response.data.data.drugList
308 306
               }
309 307
           })
310 308
         },
@@ -318,78 +316,149 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
318 316
            return manufacturer_name
319 317
         },
320 318
         
321
-        getInCount(good_id){
319
+        getInCount(drug_id,min_number,min_unit,max_unit){
322 320
           
323 321
           var newArr =[]
324
-          var total_count =0
325
-          var newArrOne = []
326
-          var total_count_one  = 0
327 322
           var total =0
323
+          var min_str  =""
324
+          var max_str = ""
328 325
           for(let i=0;i<this.infoList.length;i++){
329
-            if(good_id == this.infoList[i].good_id){
326
+            if(drug_id == this.infoList[i].drug_id){
330 327
                newArr.push(this.infoList[i])
331 328
             }
332 329
           }
330
+        
331
+         if(newArr!=null){
332
+            for(let i=0;i<newArr.length;i++){
333
+               if(newArr[i].max_unit == max_unit && max_unit!=min_unit){
334
+                 newArr[i].last_stock_max_number = newArr[i].count * min_number
335
+               } 
336
+               if(newArr[i].max_unit == min_unit && max_unit!=min_unit){
337
+                 newArr[i].last_stock_max_number = newArr[i].count 
338
+               } 
339
+               if(newArr[i].max_unit == max_unit && max_unit==min_unit){
340
+                 newArr[i].last_stock_max_number = newArr[i].count 
341
+               } 
342
+            }
343
+         }
344
+
345
+
346
+
347
+        console.log("newARR========",newArr)
333 348
           if(newArr!=null){
334 349
             for(let i=0;i<newArr.length;i++){
335
-                total_count += parseInt(newArr[i].warehousing_count)
350
+                total += parseInt(newArr[i].last_stock_max_number)
336 351
             }
337 352
           }
338 353
 
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])
354
+        
355
+          if (total < min_number) {
356
+               min_str = total + min_unit;
357
+           }
358
+            if (total == 0) {
359
+                min_str = "";
360
+                max_str = "";
342 361
             }
343
-          }
344
-          if(newArrOne!=null){
345
-            for(let i=0;i<newArrOne.length;i++){
346
-               total_count_one += newArrOne[i].count
362
+            if (total >= min_number) {
363
+                if (parseInt(total / min_number) != 0) {
364
+                max_str = parseInt(total / min_number) + max_unit;
365
+                }
366
+                if (total % min_number != 0) {
367
+                min_str = (total % min_number) + min_unit;
368
+                }
369
+            }
370
+            console.log("max_str",max_str)
371
+            console.log("min_str",min_str)
372
+            if(max_str == "" && min_str == ""){
373
+                return "0"
374
+            }else{
375
+            return max_str + min_str
347 376
             }
348
-          }
349
-          total = total_count + total_count_one
350
-          return total
351 377
         },
352
-        getOutCount(good_id){
353
-
378
+        getOutCount(drug_id,min_number,min_unit,max_unit){
379
+          
354 380
           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])
381
+          var total =0
382
+          var min_str  =""
383
+          var max_str = ""
384
+          for(let i=0;i<this.outList.length;i++){
385
+            if(drug_id == this.outList[i].drug_id){
386
+               newArr.push(this.outList[i])
362 387
             }
363 388
           }
389
+        
390
+         if(newArr!=null){
391
+            for(let i=0;i<newArr.length;i++){
392
+               if(newArr[i].max_unit == max_unit && max_unit!=min_unit){
393
+                 newArr[i].last_stock_max_number = newArr[i].count * min_number
394
+               } 
395
+               if(newArr[i].max_unit == min_unit && max_unit!=min_unit){
396
+                 newArr[i].last_stock_max_number = newArr[i].count 
397
+               } 
398
+               if(newArr[i].max_unit == max_unit && max_unit==min_unit){
399
+                 newArr[i].last_stock_max_number = newArr[i].count 
400
+               } 
401
+            }
402
+         }
403
+
404
+
405
+
406
+        console.log("newARR========",newArr)
364 407
           if(newArr!=null){
365 408
             for(let i=0;i<newArr.length;i++){
366
-              total_count += parseInt(newArr[i].count)
409
+                total += parseInt(newArr[i].last_stock_max_number)
367 410
             }
368 411
           }
369 412
 
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])
413
+        
414
+          if (total < min_number) {
415
+               min_str = total + min_unit;
416
+           }
417
+            if (total == 0) {
418
+                min_str = "";
419
+                max_str = "";
373 420
             }
374
-          }
375
-          if(newArrOne!=null){
376
-            for(let i=0;i<newArrOne.length;i++){
377
-               total_count_one += newArrOne[i].count
421
+            if (total >= min_number) {
422
+                if (parseInt(total / min_number) != 0) {
423
+                max_str = parseInt(total / min_number) + max_unit;
424
+                }
425
+                if (total % min_number != 0) {
426
+                min_str = (total % min_number) + min_unit;
427
+                }
428
+            }
429
+            console.log("max_str",max_str)
430
+            console.log("min_str",min_str)
431
+            if(max_str == "" && min_str == ""){
432
+                return "0"
433
+            }else{
434
+            return max_str + min_str
378 435
             }
379
-          }
380
-
381
-
382
-          total = total_count + total_count_one
383
-          return total
384 436
         },
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
437
+        getSumCount(total,min_number,min_unit,max_unit){
438
+           var min_str  =""
439
+           var max_str = ""
440
+           if (total < min_number) {
441
+               min_str = total + min_unit;
442
+           }
443
+            if (total == 0) {
444
+                min_str = "";
445
+                max_str = "";
446
+            }
447
+            if (total >= min_number) {
448
+                if (parseInt(total / min_number) != 0) {
449
+                max_str = parseInt(total / min_number) + max_unit;
450
+                }
451
+                if (total % min_number != 0) {
452
+                min_str = (total % min_number) + min_unit;
453
+                }
454
+            }
455
+            console.log("max_str",max_str)
456
+            console.log("min_str",min_str)
457
+            if(max_str == "" && min_str == ""){
458
+                return "0"
459
+            }else{
460
+            return max_str + min_str
461
+            }
393 462
         }
394 463
 
395 464
         

+ 10 - 8
src/xt_pages/stock/drugs/inventoryRecordPrint.vue Näytä tiedosto

@@ -43,16 +43,18 @@
43 43
                         <td align="center">{{ getTime(item.expiry_date) }}</td>
44 44
                         <td align="center">{{ getHouseName(item.storehouse_id) }}</td>
45 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> 
46
+                            
47
+                           <span v-if="item.stock_max_number>0"> {{ item.stock_max_number}}{{ item.max_unit }}</span> 
48
+                          
49
+                           <span v-if="item.stock_min_number>0"> {{ item.stock_min_number}}{{ item.min_unit }}</span> 
50 50
                         </td> 
51 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> 
52
+                           
53
+                           <span v-if="item.last_stock_max_number>0">
54
+                            {{ item.last_stock_max_number }} {{ item.max_unit }}
55
+                            </span> 
56
+                            
57
+                           <span v-if="item.last_stock_min_number>0"> {{ item.last_stock_min_number }}{{ item.min_unit }}</span> 
56 58
                         </td>
57 59
                         <td align="center">
58 60
                             <span v-if="item.reason == 10">盘盈</span>

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

@@ -57,7 +57,7 @@
57 57
             </div>
58 58
             <div>
59 59
                <el-button size="small" type="primary" @click="print_1">打印</el-button>
60
-               <el-button size="small" type="primary" @click="print_2">盘点模版打印2</el-button>
60
+               <el-button size="small" type="primary" @click="print_2">盘点模版打印</el-button>
61 61
             </div>
62 62
           
63 63
         </div>
@@ -212,7 +212,7 @@ export default {
212 212
             end_time_one= moment().endOf('month').format("YYYY-MM-DD")
213 213
 
214 214
           }
215
-          this.$router.push({path:'/stock/drugs/drugInventoryModePrint?start_time='+"&start_time="+start_time_one+"&end_time="+end_time_one}) 
215
+          this.$router.push({path:'/stock/drugs/drugInventoryModePrint?start_time='+start_time_one+"&end_time="+end_time_one}) 
216 216
         },
217 217
         handleSizeChange(val){
218 218
          this.limit = val