XMLWAN 3 years ago
parent
commit
bdce30d42a

+ 7 - 0
src/xt_pages/stock/drugs/drugDamaged.vue View File

448
 import { postSearchDrugWarehouseList,saveDrugDamage,getDrugDamageList,SaveDrugDamagePrice,getDrugDamageDetail,modifyDrugDamage,deleteDrugDamage,getDrugWarehouseInfoList,getDrugWarehouseInfoTotal } from "@/api/drug/drug"
448
 import { postSearchDrugWarehouseList,saveDrugDamage,getDrugDamageList,SaveDrugDamagePrice,getDrugDamageDetail,modifyDrugDamage,deleteDrugDamage,getDrugWarehouseInfoList,getDrugWarehouseInfoTotal } from "@/api/drug/drug"
449
 import { getDrugBatchNumber } from  "@/api/drug/drug_stock"
449
 import { getDrugBatchNumber } from  "@/api/drug/drug_stock"
450
 import { uParseTime } from '@/utils/tools'
450
 import { uParseTime } from '@/utils/tools'
451
+import { getDataConfig } from '@/utils/data'
451
 export default {
452
 export default {
452
     name: "stockModifyPrice",
453
     name: "stockModifyPrice",
453
     components:{
454
     components:{
517
             id:"",
518
             id:"",
518
             numberList:[],
519
             numberList:[],
519
             index:0,
520
             index:0,
521
+            unitList:[],
520
         }
522
         }
521
     },
523
     },
522
     methods:{
524
     methods:{
525
+      
523
         search(){
526
         search(){
524
           this.getlist()
527
           this.getlist()
525
         },
528
         },
1018
           
1021
           
1019
          }
1022
          }
1020
       })
1023
       })
1024
+     },
1025
+     changeMaxUnit(){
1026
+
1021
      }
1027
      }
1022
     },
1028
     },
1023
     created(){
1029
     created(){
1030
+     
1024
       this.getlist()
1031
       this.getlist()
1025
     },
1032
     },
1026
     mounted() {
1033
     mounted() {

+ 3 - 1
src/xt_pages/stock/drugs/drugStockFlow.vue View File

68
              <span v-if="scope.row.consumable_type == 2">手动出库</span>
68
              <span v-if="scope.row.consumable_type == 2">手动出库</span>
69
              <span v-if="scope.row.consumable_type == 3">自动出库</span>
69
              <span v-if="scope.row.consumable_type == 3">自动出库</span>
70
              <span v-if="scope.row.consumable_type == 4">手动退库</span>
70
              <span v-if="scope.row.consumable_type == 4">手动退库</span>
71
+             <span v-if="scope.row.consumable_type == 5">报损数量</span>
71
            </template>
72
            </template>
72
         </el-table-column>
73
         </el-table-column>
73
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
74
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
75
              <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
76
              <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
76
               <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>
77
               <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>
77
               <span v-if="scope.row.consumable_type == 4">{{scope.row.cancel_order_number}}</span>
78
               <span v-if="scope.row.consumable_type == 4">{{scope.row.cancel_order_number}}</span>
79
+              <span v-if="scope.row.consumable_type == 5">{{scope.row.cancel_order_number}}</span>
78
            </template>
80
            </template>
79
         </el-table-column>
81
         </el-table-column>
80
         <el-table-column prop="drug_name" label="操作日期" align="center">
82
         <el-table-column prop="drug_name" label="操作日期" align="center">
88
              <span v-if="scope.row.consumable_type == 2">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
90
              <span v-if="scope.row.consumable_type == 2">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
89
              <span v-if="scope.row.consumable_type == 3">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
91
              <span v-if="scope.row.consumable_type == 3">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
90
              <span v-if="scope.row.consumable_type == 4">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
92
              <span v-if="scope.row.consumable_type == 4">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
91
-            
93
+             <span v-if="scope.row.consumable_type == 5">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
92
            </template>
94
            </template>
93
         </el-table-column>
95
         </el-table-column>
94
        
96
        

+ 141 - 21
src/xt_pages/stock/drugs/inventory.vue View File

53
                   {{getTime(scope.row.start_time)}}
53
                   {{getTime(scope.row.start_time)}}
54
                 </template>
54
                 </template>
55
             </el-table-column>
55
             </el-table-column>
56
+            <el-table-column prop="date" label="药品名称" align="center">
57
+                <template slot-scope="scope">
58
+                  {{scope.row.drug_name}}
59
+                </template>
60
+            </el-table-column>
61
+            <el-table-column prop="date" label="药品规格" align="center">
62
+                <template slot-scope="scope">
63
+                  {{scope.row.specification_name}}
64
+                </template>
65
+            </el-table-column>
56
             <el-table-column prop="name" label="盘点数量" align="center">
66
             <el-table-column prop="name" label="盘点数量" align="center">
57
                 <template slot-scope="scope">
67
                 <template slot-scope="scope">
58
                   {{scope.row.count}}
68
                   {{scope.row.count}}
82
             <el-table-column label="操作" align="center" width="260">
92
             <el-table-column label="操作" align="center" width="260">
83
                 <template slot-scope="scope">
93
                 <template slot-scope="scope">
84
                   <el-button type="primary" size="small" @click="editInventory(scope.row.id,scope.row.checker_status,scope.$index)">编辑</el-button>
94
                   <el-button type="primary" size="small" @click="editInventory(scope.row.id,scope.row.checker_status,scope.$index)">编辑</el-button>
85
-                  <el-button type="primary" size="small" @click="toProof(scope.row.id)">校正</el-button>
86
                   <el-button type="danger" size="small" @click="deleteDrugInventory(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
95
                   <el-button type="danger" size="small" @click="deleteDrugInventory(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
87
                  
96
                  
88
                 </template>
97
                 </template>
138
                 <el-form-item label="规格">
147
                 <el-form-item label="规格">
139
                     <el-input v-model="form.specification_name" :disabled="true"></el-input>
148
                     <el-input v-model="form.specification_name" :disabled="true"></el-input>
140
                 </el-form-item>
149
                 </el-form-item>
141
-                <el-form-item label="单位">
150
+                <!-- <el-form-item label="单位">
142
                     <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
151
                     <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
152
+                </el-form-item> -->
153
+                 <el-form-item prop="max_unit" label="单位">
154
+                    <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
155
+                      <el-option
156
+                        v-for="(item,index) in getDataConfig('hemodialysis','units')"
157
+                        :key="index"
158
+                        :label="item.name"
159
+                        :value="item.name">
160
+                      </el-option>
161
+                    </el-select>
143
                 </el-form-item>
162
                 </el-form-item>
144
                 <el-form-item label="进货价">
163
                 <el-form-item label="进货价">
145
                     <el-input v-model="form.last_price" :disabled="true"></el-input>
164
                     <el-input v-model="form.last_price" :disabled="true"></el-input>
231
                 width="100"
250
                 width="100"
232
                 label="操作">
251
                 label="操作">
233
                     <template slot-scope="scope">
252
                     <template slot-scope="scope">
234
-                        <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
253
+                        <el-button type="text" size="small" @click="toEdit(scope.row,scope.$index)">编辑</el-button>
235
                         <el-button type="text" size="small" @click="toDelete(scope.$index)">删除</el-button>
254
                         <el-button type="text" size="small" @click="toDelete(scope.$index)">删除</el-button>
236
                        
255
                        
237
                     </template>
256
                     </template>
273
                 <el-form-item label="规格">
292
                 <el-form-item label="规格">
274
                     <el-input v-model="form.specification_name" :disabled="true"></el-input>
293
                     <el-input v-model="form.specification_name" :disabled="true"></el-input>
275
                 </el-form-item>
294
                 </el-form-item>
276
-                <el-form-item label="单位">
295
+               <el-form-item label="批次">
296
+                  <el-select v-model="form.batch_number" filterable placeholder="请选择" @change="changeNumber">
297
+                      <el-option
298
+                        v-for="(item,index) in numberList"
299
+                        :key="index"
300
+                        :label="item.batch_number"
301
+                        :value="item.id">
302
+                      </el-option>
303
+                  </el-select>
304
+                </el-form-item>
305
+                <!-- <el-form-item label="单位">
277
                     <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
306
                     <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
307
+                </el-form-item> -->
308
+               <el-form-item prop="warehousing_unit" label="单位">
309
+                    <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
310
+                      <el-option
311
+                        v-for="(item,index) in getDataConfig('hemodialysis','units')"
312
+                        :key="index"
313
+                        :label="item.name"
314
+                        :value="item.name">
315
+                      </el-option>
316
+                    </el-select>
278
                 </el-form-item>
317
                 </el-form-item>
279
                 <el-form-item label="进货价">
318
                 <el-form-item label="进货价">
280
                     <el-input v-model="form.last_price" :disabled="true"></el-input>
319
                     <el-input v-model="form.last_price" :disabled="true"></el-input>
381
                 <el-form-item label="规格">
420
                 <el-form-item label="规格">
382
                     <el-input v-model="form.specification_name" :disabled="true"></el-input>
421
                     <el-input v-model="form.specification_name" :disabled="true"></el-input>
383
                 </el-form-item>
422
                 </el-form-item>
384
-                <el-form-item label="单位">
385
-                    <el-input v-model="form.warehousing_unit"></el-input>
423
+                <!-- <el-form-item label="单位">
424
+                    <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
425
+                </el-form-item> -->
426
+                <el-form-item prop="warehousing_unit" label="单位">
427
+                    <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
428
+                      <el-option
429
+                        v-for="(item,index) in getDataConfig('hemodialysis','units')"
430
+                        :key="index"
431
+                        :label="item.name"
432
+                        :value="item.name">
433
+                      </el-option>
434
+                    </el-select>
386
                 </el-form-item>
435
                 </el-form-item>
387
                 <el-form-item label="进货价">
436
                 <el-form-item label="进货价">
388
-                    <el-input v-model="form.last_price"></el-input>
437
+                    <el-input v-model="form.last_price" :disabled="true"></el-input>
389
                 </el-form-item>
438
                 </el-form-item>
390
                 <el-form-item label="零售价">
439
                 <el-form-item label="零售价">
391
-                    <el-input v-model="form.retail_price"></el-input>
440
+                    <el-input v-model="form.retail_price" :disabled="true"></el-input>
392
                 </el-form-item>
441
                 </el-form-item>
393
                 <el-form-item label="盘点数量">
442
                 <el-form-item label="盘点数量">
394
                     <el-input v-model="form.count"></el-input>
443
                     <el-input v-model="form.count"></el-input>
397
                     <el-input v-model="form.total" :disabled="true"></el-input>
446
                     <el-input v-model="form.total" :disabled="true"></el-input>
398
                 </el-form-item>
447
                 </el-form-item>
399
                 <el-form-item label="产地">
448
                 <el-form-item label="产地">
400
-                    <el-input v-model="form.drug_origin_place"></el-input>
449
+                    <el-input v-model="form.drug_origin_place" :disabled="true"></el-input>
401
                 </el-form-item>
450
                 </el-form-item>
402
                 <el-form-item label="批准文号">
451
                 <el-form-item label="批准文号">
403
-                    <el-input v-model="form.number"></el-input>
452
+                    <el-input v-model="form.number" :disabled="true"></el-input>
404
                 </el-form-item>
453
                 </el-form-item>
405
                 <el-form-item label="生产厂商">
454
                 <el-form-item label="生产厂商">
406
-                    <el-input v-model="form.manufacturer"></el-input>
455
+                    <el-input v-model="form.manufacturer" :disabled="true"></el-input>
407
                 </el-form-item>
456
                 </el-form-item>
408
                 <el-form-item label="备注">
457
                 <el-form-item label="备注">
409
                     <div style="display:flex;">
458
                     <div style="display:flex;">
441
                   </template>
490
                   </template>
442
                  </el-autocomplete>  
491
                  </el-autocomplete>  
443
                 </el-form-item>
492
                 </el-form-item>
444
-                <el-form-item label="单位">
493
+                <!-- <el-form-item label="单位">
445
                     <el-input v-model="form.warehousing_unit"></el-input>
494
                     <el-input v-model="form.warehousing_unit"></el-input>
495
+                </el-form-item> -->
496
+                <el-form-item prop="warehousing_unit" label="单位">
497
+                    <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
498
+                      <el-option
499
+                        v-for="(item,index) in getDataConfig('hemodialysis','units')"
500
+                        :key="index"
501
+                        :label="item.name"
502
+                        :value="item.name">
503
+                      </el-option>
504
+                    </el-select>
446
                 </el-form-item>
505
                 </el-form-item>
447
                 <el-form-item label="盘点数量">
506
                 <el-form-item label="盘点数量">
448
                     <el-input v-model="form.count"></el-input>
507
                     <el-input v-model="form.count"></el-input>
471
 
530
 
472
 <script>
531
 <script>
473
 import { uParseTime } from '@/utils/tools'
532
 import { uParseTime } from '@/utils/tools'
474
-import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory,getDrugInventoryList,SaveDrugCheckedInventory,getDrugInventoryDetail,modifyInventory,SaveDrugProofInventory} from "@/api/drug/drug"
533
+import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory,getDrugInventoryList,SaveDrugCheckedInventory,getDrugInventoryDetail,modifyInventory,SaveDrugProofInventory,getDrugWarehouseInfoTotal} from "@/api/drug/drug"
475
 import { getDrugBatchNumber } from  "@/api/drug/drug_stock"
534
 import { getDrugBatchNumber } from  "@/api/drug/drug_stock"
535
+import { getDataConfig } from '@/utils/data'
476
 export default {
536
 export default {
477
     name: "drugInventory",
537
     name: "drugInventory",
478
     data() {
538
     data() {
529
             modifydialogVisible:false,
589
             modifydialogVisible:false,
530
             numberList:[],
590
             numberList:[],
531
             profdialogVisible:false,
591
             profdialogVisible:false,
592
+            index:"",
593
+            unitList:[],
532
         }
594
         }
533
     },
595
     },
534
     methods:{
596
     methods:{
535
         changeNumber(val){
597
         changeNumber(val){
536
           this.form.warehouse_info_id = val
598
           this.form.warehouse_info_id = val
599
+          this.getDrugWarehouseInfoTotal(val)
537
         },
600
         },
538
         search(){
601
         search(){
539
           this.getlist()
602
           this.getlist()
620
                 this.form.manufacturer = val.manufacturer
683
                 this.form.manufacturer = val.manufacturer
621
                 this.form.remark = val.remark
684
                 this.form.remark = val.remark
622
                 this.form.warehousing_unit = val.max_unit  
685
                 this.form.warehousing_unit = val.max_unit  
623
-                this.form.total = this.getTotal(total,val.max_unit,val.min_unit,val.min_number)
686
+                this.form.total = ""
687
+                // this.form.total = this.getTotal(total,val.max_unit,val.min_unit,val.min_number)
624
                 this.form.batch_number = val.batch_number
688
                 this.form.batch_number = val.batch_number
625
                 this.form.last_price = val.last_price
689
                 this.form.last_price = val.last_price
626
                 this.form.specification_name =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
690
                 this.form.specification_name =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
705
         toDelete(index){
769
         toDelete(index){
706
           this.tableData.splice(index,1)
770
           this.tableData.splice(index,1)
707
         },
771
         },
708
-        toEdit(val){
709
-            console.log("val2323223",val)
772
+        toEdit(val,index){
710
            this.form.id= val.id
773
            this.form.id= val.id
711
            this.form.drug_id = val.drug_id,
774
            this.form.drug_id = val.drug_id,
712
            this.form.drug_name = val.drug_name
775
            this.form.drug_name = val.drug_name
724
            this.form.expiry_date = val.expiry_date
787
            this.form.expiry_date = val.expiry_date
725
            this.form.product_date =val.product_date  
788
            this.form.product_date =val.product_date  
726
            this.form.count = val.count
789
            this.form.count = val.count
727
-          
790
+           this.index = index
728
            this.editdialogVisible = true
791
            this.editdialogVisible = true
729
         },
792
         },
730
         saveInventory(){
793
         saveInventory(){
747
                this.tableData[i].product_date = this.form.product_date
810
                this.tableData[i].product_date = this.form.product_date
748
                this.tableData[i].count =this.form.count
811
                this.tableData[i].count =this.form.count
749
              }
812
              }
813
+            if(this.index == i){
814
+               this.tableData[i].drug_id = this.form.drug_id
815
+               this.tableData[i].drug_name = this.form.drug_name
816
+               this.tableData[i].retail_price = this.form.retail_price
817
+               this.tableData[i].warehousing_order = this.form.warehousing_order
818
+               this.tableData[i].number = this.form.number
819
+               this.tableData[i].dealer = this.form.dealer
820
+               this.tableData[i].manufacturer = this.form.manufacturer
821
+               this.tableData[i].remark = this.form.remark
822
+               this.tableData[i].warehouseing_unit = this.form.warehousing_unit
823
+               this.tableData[i].total = this.form.total
824
+               this.tableData[i].batch_number = this.form.batch_number
825
+               this.tableData[i].last_price = this.form.last_price
826
+               this.tableData[i].specification_name = this.form.specification_name
827
+               this.tableData[i].expiry_date = this.form.expiry_date
828
+               this.tableData[i].product_date = this.form.product_date
829
+               this.tableData[i].count =this.form.count
830
+             }
750
           }   
831
           }   
751
           this.editdialogVisible = false
832
           this.editdialogVisible = false
752
         },
833
         },
864
        getDrugInventoryDetail(id).then(response=>{
945
        getDrugInventoryDetail(id).then(response=>{
865
          if(response.data.state == 1){
946
          if(response.data.state == 1){
866
             var detail = response.data.data.detail
947
             var detail = response.data.data.detail
948
+            console.log("detial2323223",detail)
867
             this.id = detail.id
949
             this.id = detail.id
868
             this.form.drug_id = detail.drug_id
950
             this.form.drug_id = detail.drug_id
869
             this.form.drug_name = detail.drug_name
951
             this.form.drug_name = detail.drug_name
878
             this.form.total = detail.total
960
             this.form.total = detail.total
879
         
961
         
880
             this.form.last_price = detail.last_price
962
             this.form.last_price = detail.last_price
881
-          
963
+           
882
             this.form.count =  parseInt(detail.count)
964
             this.form.count =  parseInt(detail.count)
883
             this.form.drug_origin_place = detail.drug_origin_place
965
             this.form.drug_origin_place = detail.drug_origin_place
966
+            this.form.stock_max_number = detail.stock_max_number
967
+            this.form.stock_min_number = detail.stock_min_number
968
+            this.form.warehouse_info_id = detail.warehouse_info_id
884
             this.modifydialogVisible = true
969
             this.modifydialogVisible = true
885
          }
970
          }
886
        })
971
        })
891
           drug_id:this.form.drug_id,
976
           drug_id:this.form.drug_id,
892
           drug_name:this.form.drug_name,
977
           drug_name:this.form.drug_name,
893
           specification_name:this.form.specification_name,
978
           specification_name:this.form.specification_name,
894
-          warehousing_unit:this.form.warehouseing_unit,
979
+          warehousing_unit:this.form.warehousing_unit,
895
           last_price:this.form.last_price,
980
           last_price:this.form.last_price,
896
           retail_price:this.form.retail_price,
981
           retail_price:this.form.retail_price,
897
           count:this.form.count,
982
           count:this.form.count,
900
           batch_number:this.form.batch_number,
985
           batch_number:this.form.batch_number,
901
           manufacturer:this.form.manufacturer,
986
           manufacturer:this.form.manufacturer,
902
           remark:this.form.remark,
987
           remark:this.form.remark,
988
+          stock_max_number:this.form.stock_max_number,
989
+          stock_min_number:this.form.stock_min_number,
990
+          warehouse_info_id:this.form.warehouse_info_id,
903
        }
991
        }
992
+       console.log("params2222",params)
993
+      
904
       modifyInventory(params).then(response=>{
994
       modifyInventory(params).then(response=>{
905
          if(response.data.state == 1){
995
          if(response.data.state == 1){
906
            var inventory =  response.data.data.inventory
996
            var inventory =  response.data.data.inventory
933
           this.loading = false
1023
           this.loading = false
934
         });   
1024
         });   
935
      },
1025
      },
936
-       exportList(){
1026
+    exportList(){
937
        
1027
        
938
          import('@/vendor/Export2Excel').then(excel => {
1028
          import('@/vendor/Export2Excel').then(excel => {
939
          const tHeader = ['药品名称', '规格', '单位','零售价','当前库存','盘点数','亏损金额']
1029
          const tHeader = ['药品名称', '规格', '单位','零售价','当前库存','盘点数','亏损金额']
1013
        changeEndTime(val){
1103
        changeEndTime(val){
1014
          this.end_time = this.getTime(val)
1104
          this.end_time = this.getTime(val)
1015
          this.getlist()
1105
          this.getlist()
1016
-       }
1106
+       },
1107
+      getDrugWarehouseInfoTotal(val){
1108
+        var params = {
1109
+          id:val,
1110
+        }
1111
+      getDrugWarehouseInfoTotal(params).then(response=>{
1112
+         if(response.data.state == 1){
1113
+           var list = response.data.data.list
1114
+           console.log("list",list)
1115
+        
1116
+          if(list.stock_max_number > 0){
1117
+            this.form.total = list.stock_max_number + list.XtBaseDrug.max_unit
1118
+            this.form.stock_max_number = list.stock_max_number
1119
+          }
1120
+          if(list.stock_min_number >0 ){
1121
+            this.form.total = list.stock_min_number + list.XtBaseDrug.min_unit
1122
+            this.form.stock_min_number = list.stock_min_number
1123
+          }
1124
+          
1125
+         }
1126
+      })
1127
+     },
1128
+     getDataConfig(module, filed_name) {
1129
+       return getDataConfig(module, filed_name)
1130
+      },  
1131
+    changeMaxUnit(val){
1132
+      console.log("val23232",val)
1133
+      this.form.warehousing_unit = val
1134
+    }
1017
     },
1135
     },
1018
     created(){
1136
     created(){
1137
+      this.unitList =  this.getDataConfig('hemodialysis','units')
1138
+      console.log("单位",this.unitList)
1019
       this.getlist()
1139
       this.getlist()
1020
     },
1140
     },
1021
     mounted() {
1141
     mounted() {

+ 15 - 12
src/xt_pages/stock/stockQuery.vue View File

109
        </el-table-column>
109
        </el-table-column>
110
        <el-table-column label="出库数量" align="center">
110
        <el-table-column label="出库数量" align="center">
111
          <template slot-scope="scope">
111
          <template slot-scope="scope">
112
-            <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info) - getOverplus(scope.row.xt_warehouse_info) - getCancelInfo(scope.row.cancel_stock_info)}}{{scope.row.packing_unit}}</span>
112
+            {{getAutoCount(scope.row.id) + getOutCount(scope.row.id)}}
113
+            <!-- <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info) - getOverplus(scope.row.xt_warehouse_info) - getCancelInfo(scope.row.cancel_stock_info)}}{{scope.row.packing_unit}}</span> -->
113
          </template>
114
          </template>
114
        </el-table-column>
115
        </el-table-column>
115
 
116
 
116
        <el-table-column label="剩余库存量" align="center">
117
        <el-table-column label="剩余库存量" align="center">
117
          <template slot-scope="scope">
118
          <template slot-scope="scope">
118
-           <span v-if="getOverplus(scope.row.xt_warehouse_info)>0">{{getOverplus(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span>
119
+           {{getWareInfo(scope.row.xt_warehouse_info) - getAutoCount(scope.row.id) - getOutCount(scope.row.id) + getCancelCount(scope.row.id) }}
120
+           <!-- <span v-if="getOverplus(scope.row.xt_warehouse_info)>0">{{getOverplus(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span> -->
119
          </template>
121
          </template>
120
        </el-table-column>
122
        </el-table-column>
121
        <el-table-column label="操作" align="center" width="260px">
123
        <el-table-column label="操作" align="center" width="260px">
188
     this.GetAllGoodInfo();
190
     this.GetAllGoodInfo();
189
     this.GetAllGoodType();
191
     this.GetAllGoodType();
190
     this.getlist()
192
     this.getlist()
191
-    // this.getStockDrugCount()
193
+    this.getStockDrugCount()
192
   },
194
   },
193
   components: {
195
   components: {
194
     BreadCrumb
196
     BreadCrumb
403
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
405
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
404
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
406
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
405
            this.tableList[i].inCount =  this.getWareInfo(this.tableList[i].xt_warehouse_info)
407
            this.tableList[i].inCount =  this.getWareInfo(this.tableList[i].xt_warehouse_info)
406
-        
407
-          this.tableList[i].outCount = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getOverplus(this.tableList[i].xt_warehouse_info) - this.getCancelInfo(this.tableList[i].cancel_stock_info)
408
-          this.tableList[i].overplus = this.getOverplus(this.tableList[i].xt_warehouse_info)
408
+          this.tableList[i].outCount =  this.getAutoCount(this.tableList[i].id) + this.getOutCount(this.tableList[i].id)
409
+          // this.tableList[i].outCount = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getOverplus(this.tableList[i].xt_warehouse_info) - this.getCancelInfo(this.tableList[i].cancel_stock_info)
410
+          // this.tableList[i].overplus = this.getOverplus(this.tableList[i].xt_warehouse_info)
411
+          this.tableList[i].overplus = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getAutoCount(this.tableList[i].id) - this.getOutCount(this.tableList[i].id) + this.getCancelCount(this.tableList[i].id)
409
          }
412
          }
410
          console.log("table",this.tableList)
413
          console.log("table",this.tableList)
411
          const data = this.formatJson(filterVal, this.tableList)
414
          const data = this.formatJson(filterVal, this.tableList)
516
         }
519
         }
517
       getStockDrugCount(params).then(response=>{
520
       getStockDrugCount(params).then(response=>{
518
          if(response.data.state == 1){
521
          if(response.data.state == 1){
519
-           var count = response.data.data.count
520
-           console.log("入库统计",count)
521
-           this.countList = count
522
+          //  var count = response.data.data.count
523
+          //  console.log("入库统计",count)
524
+          //  this.countList = count
522
            var outlist = response.data.data.outList
525
            var outlist = response.data.data.outList
523
            console.log("出库数量",outlist)
526
            console.log("出库数量",outlist)
524
            this.outCountList = outlist
527
            this.outCountList = outlist
525
            var autoCount = response.data.data.autoCount
528
            var autoCount = response.data.data.autoCount
526
            console.log("autoCount",autoCount)
529
            console.log("autoCount",autoCount)
527
            this.autoCountList = autoCount
530
            this.autoCountList = autoCount
528
-           var totalCount = response.data.data.totalCount
529
-           console.log("totalcount",totalCount)
530
-           this.cancelCountList = totalCount
531
+          //  var totalCount = response.data.data.totalCount
532
+          //  console.log("totalcount",totalCount)
533
+          //  this.cancelCountList = totalCount
531
          }
534
          }
532
       })
535
       })
533
     },
536
     },

+ 49 - 9
src/xt_pages/user/templateSummary.vue View File

126
                 <el-row :gutter="24">
126
                 <el-row :gutter="24">
127
                   <el-col :span="20">
127
                   <el-col :span="20">
128
                     <el-form-item label="阶段小结名称:">
128
                     <el-form-item label="阶段小结名称:">
129
-                      <el-input v-model="form.title"></el-input>
129
+                      <el-input v-model="form.title" style="width:200px"></el-input>
130
                     </el-form-item>
130
                     </el-form-item>
131
                   </el-col>
131
                   </el-col>
132
                 </el-row>
132
                 </el-row>
308
                      <keep-alive>
308
                      <keep-alive>
309
                         <editor ref="edit_neditor"
309
                         <editor ref="edit_neditor"
310
                                 id="edit_editor1"
310
                                 id="edit_editor1"
311
-                                style="width: 800px"
311
+                                style="width: 1200px"
312
                                 v-bind:r_content="form.template_summary_content">
312
                                 v-bind:r_content="form.template_summary_content">
313
                         </editor>
313
                         </editor>
314
                     </keep-alive>
314
                     </keep-alive>
400
                 <el-row :gutter="24">
400
                 <el-row :gutter="24">
401
                   <el-col :span="20">
401
                   <el-col :span="20">
402
                     <el-form-item label="阶段小结名称:">
402
                     <el-form-item label="阶段小结名称:">
403
-                      <el-input v-model="form.title"></el-input>
403
+                      <el-input v-model="form.title" style="width:200px"></el-input>
404
                     </el-form-item>
404
                     </el-form-item>
405
                   </el-col>
405
                   </el-col>
406
                 </el-row>
406
                 </el-row>
580
                        <keep-alive>
580
                        <keep-alive>
581
                         <editor ref="edit_neditor"
581
                         <editor ref="edit_neditor"
582
                                 id="edit_editor2"
582
                                 id="edit_editor2"
583
-                                style="width: 800px"
583
+                                style="width: 1200px"
584
                                 v-bind:r_content="form.template_summary_content">
584
                                 v-bind:r_content="form.template_summary_content">
585
                         </editor>
585
                         </editor>
586
                       </keep-alive>
586
                       </keep-alive>
672
               <el-form-item>
672
               <el-form-item>
673
                 <span>选择检验检查时间:</span>
673
                 <span>选择检验检查时间:</span>
674
                 <div>
674
                 <div>
675
-                  <el-form-item
675
+                  <!-- <el-form-item
676
                    label="时间:"
676
                    label="时间:"
677
                    prop="startYear"
677
                    prop="startYear"
678
                    style="width:100%;"
678
                    style="width:100%;"
686
                     format="yyyy-MM"
686
                     format="yyyy-MM"
687
                     value-format="yyyy-MM">
687
                     value-format="yyyy-MM">
688
 	               </el-date-picker>
688
 	               </el-date-picker>
689
+                 </el-form-item> -->
690
+                 <el-form-item>
691
+                    <el-select v-model="quartype" placeholder="请选择" @change="changetype">
692
+                      <el-option
693
+                        v-for="item in quarterType"
694
+                        :key="item.id"
695
+                        :label="item.name"
696
+                        :value="item.id">
697
+                      </el-option>
698
+                    </el-select>
689
                  </el-form-item>
699
                  </el-form-item>
690
                  <!-- <el-form-item  label="月份:"
700
                  <!-- <el-form-item  label="月份:"
691
                    prop="startYear"
701
                    prop="startYear"
939
         end_date: moment(new Date()).endOf('month').format("YYYY-MM-DD"),
949
         end_date: moment(new Date()).endOf('month').format("YYYY-MM-DD"),
940
         ids:"",
950
         ids:"",
941
         lastYear:new moment().subtract(1,'months').date(1).format("YYYY-MM-DD"),
951
         lastYear:new moment().subtract(1,'months').date(1).format("YYYY-MM-DD"),
952
+       quarterType: [
953
+        { id: 1, name: "第一季度"},
954
+        { id: 2,  name: "第二季度"},
955
+        { id: 3, name: "第三季度"},
956
+        { id: 4, name: "第四季度"}
957
+       ],
958
+       quartype:1,
942
       }
959
       }
943
     },
960
     },
944
     created() {
961
     created() {
962
+     
945
       console.log("this.$store.getters.xt_user.user.id",this.$store.getters.xt_user.user.id)
963
       console.log("this.$store.getters.xt_user.user.id",this.$store.getters.xt_user.user.id)
946
       this.patient_id = this.$route.params && this.$route.params.id
964
       this.patient_id = this.$route.params && this.$route.params.id
947
       var now = new Date()
965
       var now = new Date()
1162
 
1180
 
1163
         this.dialogVisibleInspection = true
1181
         this.dialogVisibleInspection = true
1164
       },
1182
       },
1165
-
1183
+      changetype(){
1184
+        this.getInspectionMajor()
1185
+      },
1166
       //获取大项数据来源
1186
       //获取大项数据来源
1167
       getInspectionMajor(){
1187
       getInspectionMajor(){
1168
-          console.log("start_year",this.startYear)
1188
+          console.log("type23232232",this.quartype)
1189
+          var start_time = ""
1190
+          var end_time = ""
1191
+          if(this.quartype == 1){
1192
+             start_time =  moment().startOf('year').format('YYYY-MM-DD')
1193
+             end_time = moment().month(2).endOf('month').format("YYYY-MM-DD")
1194
+          }
1195
+          if(this.quartype == 2){
1196
+            start_time = moment().month(3).startOf('month').format("YYYY-MM-DD")   
1197
+            end_time = moment().month(5).endOf('month').format("YYYY-MM-DD")
1198
+          }
1199
+          if(this.quartype == 3){
1200
+            start_time = moment().month(6).startOf('month').format("YYYY-MM-DD")
1201
+            end_time = moment().month(8).endOf('month').format("YYYY-MM-DD")
1202
+          }
1203
+          if(this.quartype == 4){
1204
+             start_time = moment().month(8).startOf('month').format("YYYY-MM-DD")
1205
+             end_time = moment().month(11).endOf('month').format("YYYY-MM-DD")
1206
+          }
1207
+          console.log("start_time",start_time)
1208
+          console.log("end_time",end_time)
1169
           var params = {
1209
           var params = {
1170
-            other_start_time:this.startYear,
1210
+            other_start_time:end_time,
1171
             patient_id:this.patient_id,
1211
             patient_id:this.patient_id,
1172
-            last_time:this.lastYear,
1212
+            last_time:start_time,
1173
           }
1213
           }
1174
          console.log("开始数据",params)
1214
          console.log("开始数据",params)
1175
         getInspectionMajorItem(params).then(response=>{
1215
         getInspectionMajorItem(params).then(response=>{