Ver código fonte

11月7日 库存扣减更新

XMLWAN 3 anos atrás
pai
commit
4b6aeb4884
30 arquivos alterados com 1027 adições e 1624 exclusões
  1. 8 0
      src/api/drug/drug.js
  2. 24 0
      src/api/stock.js
  3. 6 6
      src/router/modules/drugs.js
  4. 1 0
      src/xt_pages/hospitalStation/doctorDesk.vue
  5. 1 19
      src/xt_pages/management/home.vue
  6. 25 8
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue
  7. 18 3
      src/xt_pages/outpatientDoctorStation/doctorDesk.vue
  8. 12 40
      src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue
  9. 20 8
      src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue
  10. 211 9
      src/xt_pages/stock/drugs/drugDamaged.vue
  11. 19 8
      src/xt_pages/stock/drugs/drugInventory.vue
  12. 8 1
      src/xt_pages/stock/drugs/drugStockFlow.vue
  13. 5 30
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  14. 13 8
      src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue
  15. 24 25
      src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue
  16. 2 3
      src/xt_pages/stock/drugs/inventory.vue
  17. 3 2
      src/xt_pages/stock/drugs/inventoryDetails.vue
  18. 35 3
      src/xt_pages/stock/drugs/query.vue
  19. 235 811
      src/xt_pages/stock/inventory.vue
  20. 32 64
      src/xt_pages/stock/inventoryDetails.vue
  21. 153 357
      src/xt_pages/stock/stockDamaged.vue
  22. 7 4
      src/xt_pages/stock/stockFlow.vue
  23. 0 1
      src/xt_pages/stock/stockInOrderAdd.vue
  24. 0 9
      src/xt_pages/stock/stockInOrderEdit.vue
  25. 17 6
      src/xt_pages/stock/stockInventory.vue
  26. 13 47
      src/xt_pages/stock/stockOutOrder.vue
  27. 28 16
      src/xt_pages/stock/stockOutOrderAdd.vue
  28. 50 13
      src/xt_pages/stock/stockOutOrderEdit.vue
  29. 56 123
      src/xt_pages/stock/stockQuery.vue
  30. 1 0
      src/xt_pages/user/patients.vue

+ 8 - 0
src/api/drug/drug.js Ver arquivo

476
   })
476
   })
477
 }
477
 }
478
 
478
 
479
+export function getDamagedByDrugId(params) {
480
+  return request({
481
+    url: '/api/drug/getdamagebydrugid',
482
+    method: 'get',
483
+    params: params
484
+  })
485
+}
486
+

+ 24 - 0
src/api/stock.js Ver arquivo

946
     params: params
946
     params: params
947
   })
947
   })
948
 }
948
 }
949
+
950
+export function getGoodInventoryWarehouseList(params) {
951
+  return request({
952
+    url: '/api/stock/getgoodinventorywarehouselist',
953
+    method: 'get',
954
+    params: params
955
+  })
956
+}
957
+
958
+export function saveStockInentoryList(data) {
959
+  return request({
960
+    url: '/api/stock/savestockinentorylist',
961
+    method: 'post',
962
+    data: data
963
+  })
964
+}
965
+
966
+export function getDamageDetailByGoodId(params) {
967
+  return request({
968
+    url: '/api/sotck/getdamagedetailbygoodid',
969
+    method: 'get',
970
+    params: params
971
+  })
972
+}

+ 6 - 6
src/router/modules/drugs.js Ver arquivo

44
       is_menu: false,
44
       is_menu: false,
45
       meta: { title: 'drugModifyPricePrint', noCache: true }
45
       meta: { title: 'drugModifyPricePrint', noCache: true }
46
     },
46
     },
47
-    {
48
-      path: '/stock/drugs/drugDamaged',
49
-      component: () => import('@/xt_pages/stock/drugs/drugDamaged'),
50
-      name: 'drugDamaged',
51
-      meta: { title: 'drugDamaged', noCache: true }
52
-    },
47
+    // {
48
+    //   path: '/stock/drugs/drugDamaged',
49
+    //   component: () => import('@/xt_pages/stock/drugs/drugDamaged'),
50
+    //   name: 'drugDamaged',
51
+    //   meta: { title: 'drugDamaged', noCache: true }
52
+    // },
53
     {
53
     {
54
       path: '/stock/drugs/drugDamagePrint',
54
       path: '/stock/drugs/drugDamagePrint',
55
       component: () => import('@/xt_pages/stock/drugs/drugDamagePrint'),
55
       component: () => import('@/xt_pages/stock/drugs/drugDamagePrint'),

+ 1 - 0
src/xt_pages/hospitalStation/doctorDesk.vue Ver arquivo

935
             return false
935
             return false
936
           } else {
936
           } else {
937
             this.drugs = response.data.data.drugs
937
             this.drugs = response.data.data.drugs
938
+            console.log("所有药品信息",this.drugs)
938
             this.allDrugs = response.data.data.drugs
939
             this.allDrugs = response.data.data.drugs
939
             this.advices_template = response.data.data.advices_template
940
             this.advices_template = response.data.data.advices_template
940
 
941
 

+ 1 - 19
src/xt_pages/management/home.vue Ver arquivo

4425
         if (this.userform.user_total == ""){
4425
         if (this.userform.user_total == ""){
4426
           this.userform.user_total = 0
4426
           this.userform.user_total = 0
4427
         }
4427
         }
4428
+        this.userform.user_total = parseInt(this.userform.user_total)
4428
 
4429
 
4429
         console.log("user_form",this.userform)
4430
         console.log("user_form",this.userform)
4430
       
4431
       
4458
       toLink() {
4459
       toLink() {
4459
         window.location.href = this.guaForm.images
4460
         window.location.href = this.guaForm.images
4460
       },
4461
       },
4461
-      // changStartTime(val) {
4462
-      //   this.userform.starttime = val
4463
-      // },
4464
-      // changeEndTime(val) {
4465
-      //   this.userform.endtime = val
4466
-      //   console.log('val', val)
4467
-      //   console.log('开始时间', this.userform.starttime)
4468
-      //   console.log('呵呵', this.formatDuring(val))
4469
-      // },
4470
-      // formatDuring(mss) {
4471
-      //   const days = parseInt(mss / (1000 * 60 * 60 * 24)) // 得到天数
4472
-      //   const hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) // 得到小时
4473
-      //   const minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)) // 得到分钟数
4474
-      //   const seconds = (mss % (1000 * 60)) / 1000 // 得到秒数
4475
-      //   const str1 = hours < 10 ? ('0' + hours) : hours
4476
-      //   console.log('str1', str1)
4477
-      //   const str2 = minutes < 10 ? ('0' + minutes) : minutes
4478
-      //   return str1 + ':' + str2
4479
-      // },
4480
       // 获取签名
4462
       // 获取签名
4481
       getAllOrganization() {
4463
       getAllOrganization() {
4482
         getAllOrganization().then(response => {
4464
         getAllOrganization().then(response => {

+ 25 - 8
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Ver arquivo

281
                                         </el-table-column>
281
                                         </el-table-column>
282
                                         <el-table-column label="规格" width="60">
282
                                         <el-table-column label="规格" width="60">
283
                                             <template slot-scope="scope">
283
                                             <template slot-scope="scope">
284
-                                                <!-- {{ scope.row.drug_spec }} -->
285
                                                 <span v-if="scope.row.min_unit != scope.row.dose_unit">{{scope.row.dose}}{{scope.row.dose_unit}}&nbsp;* &nbsp;</span>{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
284
                                                 <span v-if="scope.row.min_unit != scope.row.dose_unit">{{scope.row.dose}}{{scope.row.dose_unit}}&nbsp;* &nbsp;</span>{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
286
                                             </template>
285
                                             </template>
287
                                         </el-table-column>
286
                                         </el-table-column>
288
                                         <el-table-column label="库存" width="60">
287
                                         <el-table-column label="库存" width="60">
289
                                             <template slot-scope="scope">
288
                                             <template slot-scope="scope">
290
-                                                {{scope.row.total}}{{scope.row.total?scope.row.min_unit:''}}
291
-                                                <!--/ {{-->
292
-                                                <!--scope.row.total * (scope.row.dose / scope.row.min_number)}}-->
293
-                                                <!--{{(scope.row.total * (scope.row.dose /-->
294
-                                                <!--scope.row.min_number))?scope.row.max_unit:''}}-->
289
+                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138">
290
+                                               <span v-if="scope.row.count/scope.row.min_number>0">{{Math.floor(scope.row.count/scope.row.min_number)}}{{scope.row.max_unit}}</span> 
291
+                                               <span v-if="scope.row.count%scope.row.min_number>0"> {{scope.row.count%scope.row.min_number}}{{scope.row.min_unit}}</span>
292
+                                              </span>
293
+                                              <span v-else> {{scope.row.total}}{{scope.row.total?scope.row.min_unit:''}}</span> 
294
+                                             
295
                                             </template>
295
                                             </template>
296
                                         </el-table-column>
296
                                         </el-table-column>
297
                                         <el-table-column label="单价" width="40">
297
                                         <el-table-column label="单价" width="40">
382
                                             <template slot-scope="scope">{{ scope.row.single_dose }}</template>
382
                                             <template slot-scope="scope">{{ scope.row.single_dose }}</template>
383
                                         </el-table-column>
383
                                         </el-table-column>
384
                                         <el-table-column label="库存" width="40">
384
                                         <el-table-column label="库存" width="40">
385
-                                            <template slot-scope="scope">{{ scope.row.total }}</template>
385
+                                            <template slot-scope="scope">
386
+                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138">
387
+                                                   {{scope.row.stock_count}}
388
+                                              </span>
389
+                                              <span v-else> {{ scope.row.total }}</span>
390
+                                            </template>
386
                                         </el-table-column>
391
                                         </el-table-column>
387
                                         <el-table-column label="单价" width="40">
392
                                         <el-table-column label="单价" width="40">
388
                                             <template slot-scope="scope">{{ scope.row.price }}</template>
393
                                             <template slot-scope="scope">{{ scope.row.price }}</template>
501
       record_date: String,
506
       record_date: String,
502
       search_keyword: '',
507
       search_keyword: '',
503
       month_prescriptions: Array,
508
       month_prescriptions: Array,
509
+      org_id:Number,
504
       isloading: false,
510
       isloading: false,
505
       loading: false,
511
       loading: false,
506
       other_sick: {
512
       other_sick: {
2926
         getHisProject().then(response => {
2932
         getHisProject().then(response => {
2927
           if (response.data.state == 1) {
2933
           if (response.data.state == 1) {
2928
             var project = response.data.data.project
2934
             var project = response.data.data.project
2935
+            console.log("项目列表",project)
2929
             for (let i = 0; i < project.length; i++) {
2936
             for (let i = 0; i < project.length; i++) {
2930
               let obj = {
2937
               let obj = {
2931
                 id: project[i].id,
2938
                 id: project[i].id,
2943
                 total: project[i].total,
2950
                 total: project[i].total,
2944
                 is_special_diseases: project[i].disease_directory,
2951
                 is_special_diseases: project[i].disease_directory,
2945
                 project: project[i],
2952
                 project: project[i],
2953
+                stock_count:0,
2946
               }
2954
               }
2947
 
2955
 
2948
               this.tabProject.push(obj)
2956
               this.tabProject.push(obj)
2949
             }
2957
             }
2950
 
2958
 
2951
             var good_info = response.data.data.good_info
2959
             var good_info = response.data.data.good_info
2952
-
2960
+          
2961
+ 
2953
             for (let i = 0; i < good_info.length; i++) {
2962
             for (let i = 0; i < good_info.length; i++) {
2963
+               good_info[i].stock_count = 0
2964
+              if(good_info[i].good_stock_in.length >0 ){
2965
+                for(let j=0;j<good_info[i].good_stock_in.length;j++){
2966
+                   good_info[i].stock_count += good_info[i].good_stock_in[j].stock_count
2967
+                }
2968
+              }
2969
+               console.log("耗材列表2323232322332",good_info)
2954
               let obj = {
2970
               let obj = {
2955
                 id: good_info[i].id,
2971
                 id: good_info[i].id,
2956
                 project_name: good_info[i].good_name,
2972
                 project_name: good_info[i].good_name,
2967
                 total: good_info[i].total,
2983
                 total: good_info[i].total,
2968
                 is_special_diseases: good_info[i].is_special_diseases,
2984
                 is_special_diseases: good_info[i].is_special_diseases,
2969
                 good_info: good_info[i],
2985
                 good_info: good_info[i],
2986
+                stock_count:good_info[i].stock_count,
2970
               }
2987
               }
2971
               this.tabProject.push(obj)
2988
               this.tabProject.push(obj)
2972
             }
2989
             }

+ 18 - 3
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Ver arquivo

155
                                    v-on:month="changeMonth"
155
                                    v-on:month="changeMonth"
156
                                    v-on:day="changeDay"
156
                                    v-on:day="changeDay"
157
                                    :month_prescriptions="month_prescriptions"
157
                                    :month_prescriptions="month_prescriptions"
158
+                                   :org_id="org_id"
158
                                    ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
159
                                    ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
159
                                    :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
160
                                    :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
160
                                    v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
161
                                    v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
423
 
424
 
424
         all_his_patients: [],
425
         all_his_patients: [],
425
         checkVisible: false,
426
         checkVisible: false,
426
-        current_tab: 'day'
427
+        current_tab: 'day',
428
+        org_id:0,
427
       }
429
       }
428
     },
430
     },
429
     methods: {
431
     methods: {
1011
         this.month_prescriptions.push(p1)
1013
         this.month_prescriptions.push(p1)
1012
         this.month_prescriptions.push(p2)
1014
         this.month_prescriptions.push(p2)
1013
 
1015
 
1016
+
1014
       },
1017
       },
1015
 
1018
 
1016
       // setMonthPrescription(month_prescriptions){
1019
       // setMonthPrescription(month_prescriptions){
1179
             this.$message.error(response.data.msg)
1182
             this.$message.error(response.data.msg)
1180
             return false
1183
             return false
1181
           } else {
1184
           } else {
1182
-            this.drugs = response.data.data.drugs
1185
+            var drugs = response.data.data.drugs
1186
+            for(let i=0;i<drugs.length;i++){
1187
+                drugs[i].count = 0
1188
+              if(drugs[i].stock_in.length > 0){
1189
+                 for(let j=0;j<drugs[i].stock_in.length;j++){
1190
+                    drugs[i].count += (drugs[i].stock_in[j].stock_max_number * drugs[i].min_number + drugs[i].stock_in[j].stock_min_number)
1191
+                 }
1192
+              }
1193
+            }
1194
+            this.drugs = drugs
1195
+            console.log("五一劳动节2332323322332",this.drugs)
1196
+          
1183
             this.allDrugs = response.data.data.drugs
1197
             this.allDrugs = response.data.data.drugs
1184
             this.advices_template = response.data.data.advices_template
1198
             this.advices_template = response.data.data.advices_template
1185
 
1199
 
4609
       // this.other_sick = this.getDictionaryDataConfig('system', 'other_sick_history')
4623
       // this.other_sick = this.getDictionaryDataConfig('system', 'other_sick_history')
4610
       let tableHeight = document.body.clientHeight - 263
4624
       let tableHeight = document.body.clientHeight - 263
4611
       this.tableHeight = tableHeight
4625
       this.tableHeight = tableHeight
4612
-
4626
+      this.org_id = this.$store.getters.xt_user.template_info.org_id 
4627
+     
4613
     },
4628
     },
4614
 
4629
 
4615
     mounted() {
4630
     mounted() {

+ 12 - 40
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue Ver arquivo

53
             value-format="yyyy-MM-dd"
53
             value-format="yyyy-MM-dd"
54
           ></el-date-picker>
54
           ></el-date-picker>
55
         </div>
55
         </div>
56
-
57
-        <!-- <div class="cell clearfix">
58
-          <label class="title"><span class="name">经销商</span> : </label>
59
-          <el-select
60
-            size="small"
61
-            v-model="form.dealer"
62
-            filterable
63
-            placeholder="请选择经销商"
64
-            @change="changeDealer"
65
-          >
66
-            <el-option
67
-              v-for="(option, index) in dealer"
68
-              :key="index"
69
-              :label="option.dealer_name"
70
-              :value="option.id"
71
-            >
72
-            </el-option>
73
-          </el-select>
74
-        </div> -->
75
-
76
-        <!-- <div class="cell clearfix">
77
-          <label class="title"><span class="name">厂商</span> : </label>
78
-          <el-select
79
-            size="small"
80
-            v-model="form.manufacturer"
81
-            filterable
82
-            placeholder="请选择厂商"
83
-            @change="changeManufacturer"
84
-          >
85
-            <el-option
86
-              v-for="(option, index) in manufacturer"
87
-              :key="index"
88
-              :label="option.manufacturer_name"
89
-              :value="option.id"
90
-            >
91
-            </el-option>
92
-          </el-select>
93
-        </div> -->
94
       </div>
56
       </div>
95
 
57
 
96
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
58
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
612
             cancelStock: this.recordInfo.recordData
574
             cancelStock: this.recordInfo.recordData
613
           };
575
           };
614
           console.log("params2222",params,this.return_time)
576
           console.log("params2222",params,this.return_time)
615
-        
577
+          
616
           postDrugCancelStock(
578
           postDrugCancelStock(
617
             params,
579
             params,
618
             this.return_time,
580
             this.return_time,
637
               if(response.data.data.msg == 2){
599
               if(response.data.data.msg == 2){
638
                 this.$message.error("退库数量大于出库数量")
600
                 this.$message.error("退库数量大于出库数量")
639
               }
601
               }
602
+             
640
             }
603
             }
641
           });
604
           });
642
         } else {
605
         } else {
694
         this.currentIndex = val
657
         this.currentIndex = val
695
       },
658
       },
696
       handleSelect(val){
659
       handleSelect(val){
697
-         console.log("val23232",val)
660
+         var arr = []
661
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
662
+            arr.push(this.recordInfo.recordData[i].drug_id)
663
+         }
664
+         var str = arr.join(",")
665
+         console.log("str",str)
666
+         if(str.indexOf(val.id)!=-1){
667
+            this.$message.error("该药品已存在列表中")
668
+            return
669
+         }
698
          this.getDrugBatchNumber(val.id)
670
          this.getDrugBatchNumber(val.id)
699
          for(let i=0;i<this.recordInfo.recordData.length;i++){
671
          for(let i=0;i<this.recordInfo.recordData.length;i++){
700
            if(i == this.currentIndex){
672
            if(i == this.currentIndex){

+ 20 - 8
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue Ver arquivo

270
 <script>
270
 <script>
271
   import { uParseTime } from '@/utils/tools'
271
   import { uParseTime } from '@/utils/tools'
272
 
272
 
273
-  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockConfig, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber  } from '@/api/drug/drug_stock'
273
+  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber  } from '@/api/drug/drug_stock'
274
   import BreadCrumb from '../../components/bread-crumb'
274
   import BreadCrumb from '../../components/bread-crumb'
275
   import DrugsStockDialog from './drugsStockDialog/index'
275
   import DrugsStockDialog from './drugsStockDialog/index'
276
   import {postSearchDrugList} from "@/api/data"
276
   import {postSearchDrugList} from "@/api/data"
528
 
528
 
529
       back() {
529
       back() {
530
         this.$router.go(-1)
530
         this.$router.go(-1)
531
-      }, submit() {
531
+      },
532
+     submit() {
532
         this.$refs['tableForm'].validate((valid) => {
533
         this.$refs['tableForm'].validate((valid) => {
533
           if (valid) {
534
           if (valid) {
534
             const array = this.recordInfo.recordData
535
             const array = this.recordInfo.recordData
538
                 return
539
                 return
539
               }
540
               }
540
             }
541
             }
541
-            console.log("hhhhh3223",this.recordInfo.recordData)
542
-            console.log("900000000",this.numberList)
542
+
543
             for(let i=0;i<this.recordInfo.recordData.length;i++){
543
             for(let i=0;i<this.recordInfo.recordData.length;i++){
544
               for(let j=0;j<this.numberList.length;j++){
544
               for(let j=0;j<this.numberList.length;j++){
545
                  if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
545
                  if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
554
               'cancelStock': this.recordInfo.recordData
554
               'cancelStock': this.recordInfo.recordData
555
             }
555
             }
556
             console.log("232323223",this.recordInfo.recordData)
556
             console.log("232323223",this.recordInfo.recordData)
557
-           
557
+            
558
             editDrugCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
558
             editDrugCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
559
               if (response.data.state == 0) {
559
               if (response.data.state == 0) {
560
                 this.$message.error(response.data.msg)
560
                 this.$message.error(response.data.msg)
565
                    this.$router.back(-1)
565
                    this.$router.back(-1)
566
                 }
566
                 }
567
                 if(response.data.data.msg == 2){
567
                 if(response.data.data.msg == 2){
568
-                   this.$message.error("退库数量大于入库数量")
568
+                   this.$message.error("该批次退库数量大于入库数量,请更改批次")
569
                 }
569
                 }
570
                 if(response.data.data.msg == 4){
570
                 if(response.data.data.msg == 4){
571
-                  this.$message.error("退库数量大于出库数量")
571
+                  this.$message.error("该批次退库数量大于出库数量,请更改批次")
572
                 }
572
                 }
573
               
573
               
574
               }
574
               }
577
             return false
577
             return false
578
           }
578
           }
579
         })
579
         })
580
-      }, GetOrderDetail: function(order_id) {
580
+      },
581
+       GetOrderDetail: function(order_id) {
581
         const params = {
582
         const params = {
582
           'id': order_id
583
           'id': order_id
583
         }
584
         }
585
+
584
         getDrugCancelStockInfo(params).then(response => {
586
         getDrugCancelStockInfo(params).then(response => {
585
           if (response.data.state == 0) {
587
           if (response.data.state == 0) {
586
             this.$message.error(response.data.msg)
588
             this.$message.error(response.data.msg)
663
         this.currentIndex = val
665
         this.currentIndex = val
664
       },
666
       },
665
       handleSelect(val){
667
       handleSelect(val){
668
+         var arr = []
669
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
670
+            arr.push(this.recordInfo.recordData[i].drug_id)
671
+         }
672
+         var str = arr.join(",")
673
+         console.log("str",str)
674
+         if(str.indexOf(val.id)!=-1){
675
+            this.$message.error("该药品已存在列表中")
676
+            return
677
+         }
666
          this.getDrugBatchNumber(val.id)
678
          this.getDrugBatchNumber(val.id)
667
          for(let i=0;i<this.recordInfo.recordData.length;i++){
679
          for(let i=0;i<this.recordInfo.recordData.length;i++){
668
            if(i == this.currentIndex){
680
            if(i == this.currentIndex){

+ 211 - 9
src/xt_pages/stock/drugs/drugDamaged.vue Ver arquivo

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
-    <div class="position">
4
-      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
-    </div>
6
     <div class="app-container">
3
     <div class="app-container">
7
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
8
             <div>
5
             <div>
11
                 style="width: 200px;"
8
                 style="width: 200px;"
12
                 class="filter-item"
9
                 class="filter-item"
13
                 v-model.trim="searchKey"
10
                 v-model.trim="searchKey"
14
-                placeholder="请输入单据编号或操作人姓名"
11
+                placeholder="请输入药品名称"
15
                 />
12
                 />
16
                 <el-button
13
                 <el-button
17
                 size="small"
14
                 size="small"
58
             </el-table-column>
55
             </el-table-column>
59
             <el-table-column prop="name" label="总报损数量" align="center">
56
             <el-table-column prop="name" label="总报损数量" align="center">
60
                <template slot-scope="scope">
57
                <template slot-scope="scope">
61
-                  {{scope.row.count}}
58
+                  {{getTotalCount(scope.row.drug_id,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
62
                 </template>
59
                 </template>
63
             </el-table-column>
60
             </el-table-column>
64
             <el-table-column prop="name" label="总报损金额" align="center">
61
             <el-table-column prop="name" label="总报损金额" align="center">
65
                <template slot-scope="scope">
62
                <template slot-scope="scope">
66
-                  {{scope.row.count}}
63
+                  {{getTotalPrice(scope.row.drug_id,scope.row.min_price)}}
67
                 </template>
64
                 </template>
68
             </el-table-column>
65
             </el-table-column>
69
             <el-table-column prop="name" label="操作人" align="center">
66
             <el-table-column prop="name" label="操作人" align="center">
73
             </el-table-column>
70
             </el-table-column>
74
             <el-table-column label="操作" align="center" width="200">
71
             <el-table-column label="操作" align="center" width="200">
75
                 <template slot-scope="scope">
72
                 <template slot-scope="scope">
76
-                  <el-button type="primary" size="small" @click="moDrugDamage(scope.row.id,scope.row.checker_status)">编辑</el-button>
77
-                  <el-button type="danger" size="small" @click="deleteDrugDamage(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
73
+                  <el-button type="primary" size="small" @click="clickDetai(scope.row.drug_id)">查看详情</el-button>
78
                 </template>
74
                 </template>
79
             </el-table-column>
75
             </el-table-column>
80
         </el-table>
76
         </el-table>
89
             :total="total">
85
             :total="total">
90
         </el-pagination>
86
         </el-pagination>
91
     </div>
87
     </div>
88
+
89
+    <el-dialog
90
+      title="盘点批次详情"
91
+      :visible.sync="dialogVisible"
92
+      width="80%">
93
+      <span>
94
+        <el-form>
95
+          <el-row>
96
+            <el-col>
97
+              <el-form-item label="入库单号:">
98
+                 <el-input v-model ="form.warehouseing_order" style="width:200px"></el-input>
99
+              </el-form-item>
100
+              <el-form-item label="原因:">
101
+                  <el-select v-model="form.type" placeholder="请选择">
102
+                      <el-option
103
+                        v-for="item in reasonList"
104
+                        :key="item.id"
105
+                        :label="item.name"
106
+                        :value="item.id">
107
+                      </el-option>
108
+                  </el-select>
109
+              </el-form-item>
110
+              <el-button type="primary" @click="toQuery">查询</el-button>
111
+            </el-col>
112
+          </el-row>
113
+          <el-row>
114
+            <div>&nbsp;&nbsp;{{drug_name}}  &nbsp;&nbsp;总损耗数量: {{getDamagedCount(total_count)}}    &nbsp;&nbsp;总报损金额:{{(total_count * min_price).toFixed(2)}}</div>
115
+          </el-row>
116
+          <el-row>
117
+            <el-table
118
+              :data="goodList"
119
+              border
120
+              style="width: 100%">
121
+              <el-table-column prop="date" label="序号" width="180" align="center">
122
+               <template slot-scope="scope">
123
+                  {{scope.$index + 1}}
124
+                </template>
125
+              </el-table-column>
126
+              <el-table-column prop="name" label="入库单号" width="180" align="center">
127
+                <template slot-scope="scope">
128
+                  {{scope.row.warehousing_order}}
129
+                </template>
130
+              </el-table-column>
131
+              <el-table-column prop="address" label="损耗数量" align="center">
132
+                <template slot-scope="scope">
133
+                  <span v-if="scope.row.last_stock_max_number>0">{{scope.row.last_stock_max_number}}{{scope.row.warehousing_unit}}</span>
134
+                   <span v-if="scope.row.last_stock_min_number>0">{{scope.row.last_stock_min_number}}{{scope.row.min_unit}}</span>
135
+                </template>
136
+              </el-table-column>
137
+              <el-table-column prop="address" label="药损比" align="center">
138
+                  <template slot-scope="scope">
139
+                    {{getDrugDamageRadio(scope.row.count)}}%
140
+                  </template>
141
+              </el-table-column>
142
+              <el-table-column prop="address" label="报损金额" align="center">
143
+                <template slot-scope="scope">
144
+                  <span v-if="scope.row.XtBaseDrug.min_price!=0">{{scope.row.XtBaseDrug.min_price}} </span> 
145
+                </template>
146
+              </el-table-column>
147
+
148
+              <el-table-column prop="address" label="盘点原因" align="center">
149
+                <template slot-scope="scope">
150
+                  <span v-if="scope.row.type == 0">默认</span> 
151
+                  <span v-if="scope.row.type == 1">到期退货</span> 
152
+                  <span v-if="scope.row.type == 2">异常退货</span> 
153
+                  <span v-if="scope.row.type == 3">退货</span> 
154
+                  <span v-if="scope.row.type == 4">人为损坏</span> 
155
+                  <span v-if="scope.row.type == 5">不计入报损分析</span> 
156
+                </template>
157
+              </el-table-column>
158
+            </el-table>
159
+          </el-row>
160
+        </el-form>
161
+      </span>
162
+      <span slot="footer" class="dialog-footer">
163
+        <el-button @click="dialogVisible = false">取 消</el-button>
164
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
165
+      </span>
166
+    </el-dialog>
92
   </div>
167
   </div>
93
 </template>
168
 </template>
94
 
169
 
95
 <script>
170
 <script>
96
 import BreadCrumb from "../../components/bread-crumb";
171
 import BreadCrumb from "../../components/bread-crumb";
97
-import { getDrugDamageList } from "@/api/drug/drug"
172
+import { getDrugDamageList,getDamagedByDrugId } from "@/api/drug/drug"
98
 import { uParseTime } from '@/utils/tools'
173
 import { uParseTime } from '@/utils/tools'
99
 import { getDataConfig } from '@/utils/data'
174
 import { getDataConfig } from '@/utils/data'
100
 export default {
175
 export default {
167
             numberList:[],
242
             numberList:[],
168
             index:0,
243
             index:0,
169
             unitList:[],
244
             unitList:[],
245
+            datamageList:[],
246
+            reasonList:[
247
+              {id:0,name:"默认"},
248
+              {id:1,name:"到期退货"},
249
+              {id:2,name:"异常退货"},
250
+              {id:3,name:"退货"},
251
+              {id:4,name:"人为损坏"},
252
+              {id:5,name:"不计入报损分析"},
253
+            ],
254
+            goodList:[],
255
+            drug_name:"",
256
+            total_count:0,
257
+            min_number:0,
258
+            max_unit:"",
259
+            min_unit:"",
260
+            min_price:0,
261
+            drug_id:0,
170
         }
262
         }
171
     },
263
     },
172
     methods:{
264
     methods:{
208
              this.doctorList = response.data.data.doctorList
300
              this.doctorList = response.data.data.doctorList
209
              var datamagelist = response.data.data.damagelist
301
              var datamagelist = response.data.data.damagelist
210
              console.log("hhh233223",datamagelist)
302
              console.log("hhh233223",datamagelist)
303
+             this.datamageList = datamagelist
211
            }
304
            }
212
         })
305
         })
213
       },
306
       },
225
      },
318
      },
226
      changeEndTime(){
319
      changeEndTime(){
227
 
320
 
321
+     },
322
+     getTotalCount(drugid,max_unit,min_unit,min_number){
323
+        
324
+        var total = 0
325
+        var str = ""
326
+        var str_min = ""
327
+        for(let i=0;i<this.datamageList.length;i++){
328
+          if(drugid == this.datamageList[i].drug_id){
329
+             total +=this.datamageList[i].count
330
+          }
331
+        }
332
+        if(parseInt(total/min_number)!=0){
333
+          str = parseInt(total/min_number) + max_unit
334
+        }
335
+        if((total%min_number)!=0){
336
+          str_min = total%min_number + min_unit
337
+        }
338
+        return str+str_min
339
+     },
340
+     getTotalPrice(drugid,minprice){
341
+        var total = 0 
342
+        for(let i=0;i<this.datamageList.length;i++){
343
+          if(drugid == this.datamageList[i].drug_id){
344
+            total+=this.datamageList[i].count
345
+          }
346
+        }
347
+        return (total*minprice).toFixed(2)
348
+     },
349
+     clickDetai(drugid){
350
+        this.drug_id = drugid
351
+         var params = {
352
+           drug_id:drugid,
353
+           warehouseing_order:this.form.warehousing_order,
354
+           type:this.form.type,
355
+         }
356
+        this.dialogVisible = true
357
+        getDamagedByDrugId(params).then(response=>{
358
+           if(response.data.state ==1){
359
+             var list =  response.data.data.list
360
+             for(let i=0;i<list.length;i++){
361
+               list[i].min_number = 0
362
+               list[i].min_number == list[i].XtBaseDrug.min_number
363
+               list[i].total = 0
364
+             }
365
+             console.log("list232232332",list)
366
+
367
+             for(let i=0;i<list.length;i++){
368
+               this.drug_name = list[0].drug_name
369
+               list[i].total = list[i].count
370
+             }
371
+             var total = 0
372
+             for(let i=0;i<list.length;i++){
373
+               total += list[i].total
374
+               this.min_number = list[0].XtBaseDrug.min_number
375
+               this.max_unit = list[0].XtBaseDrug.max_unit
376
+               this.min_unit = list[0].XtBaseDrug.min_unit
377
+               this.min_price = list[0].XtBaseDrug.min_price
378
+             }
379
+             this.total_count = total
380
+             this.goodList = list
381
+           }
382
+        })
383
+     },
384
+     getDamagedCount(total){
385
+     
386
+      var str = ""
387
+      var min_str = ""
388
+      if(total< this.min_number){
389
+        str = ""
390
+        min_str = total + this.min_unit
391
+      }
392
+     if(total >= this.min_number){
393
+        if(parseInt(total/this.min_number)!=0){
394
+            str = parseInt(total/this.min_number)+ this.max_unit
395
+        }
396
+       if((total%this.min_number)!=0){
397
+          min_str =  total%this.min_number + this.min_unit
398
+        }
399
+      }
400
+      return str + min_str
401
+     },
402
+    getDamagedCountOne(total){
403
+     
404
+      var str = ""
405
+      var min_str = ""
406
+      if(total< this.min_number){
407
+        str = ""
408
+        min_str = total 
409
+      }
410
+     if(total >= this.min_number){
411
+        if(parseInt(total/this.min_number)!=0){
412
+            str = parseInt(total/this.min_number)
413
+        }
414
+       if((total%this.min_number)!=0){
415
+          min_str =  total%this.min_number
416
+        }
417
+      }
418
+      return str + min_str
419
+     },
420
+     toQuery(){
421
+       this.clickDetai(this.drug_id)
422
+     },
423
+     getDrugDamageRadio(count){
424
+
425
+       var total_count =  this.getDamagedCountOne(this.total_count)
426
+       var all_count = 0
427
+       all_count =  total_count * this.min_number
428
+      
429
+       return (count / all_count).toFixed(2)*100
228
      }
430
      }
229
     },
431
     },
230
     created(){
432
     created(){

+ 19 - 8
src/xt_pages/stock/drugs/drugInventory.vue Ver arquivo

4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5
     </div>
5
     </div>
6
     <div class="app-container" style="height: calc(100vh - 118px);overflow: hidden;">
6
     <div class="app-container" style="height: calc(100vh - 118px);overflow: hidden;">
7
-        <el-tabs v-model="activeName" style="height: 100%;display: flex;flex-direction: column;">
8
-            <el-tab-pane label="药品盘点" name="first">
7
+        <el-tabs v-model="activeName" style="height: 100%;display: flex;flex-direction: column;" @tab-click="handleClick">
8
+            <el-tab-pane label="药品盘点" name="first" v-if="first" >
9
                 <drug-inventory></drug-inventory>
9
                 <drug-inventory></drug-inventory>
10
             </el-tab-pane>
10
             </el-tab-pane>
11
-            <el-tab-pane label="盘点列表" name="second">
12
-                <inventory-details></inventory-details>
11
+            <el-tab-pane label="盘点列表" name="second" v-if="second">
12
+                <inventory-details ref="child"></inventory-details>
13
             </el-tab-pane>
13
             </el-tab-pane>
14
 
14
 
15
-            <el-tab-pane label="报损列表" name="three">
16
-                <drug-damaged></drug-damaged>
15
+            <el-tab-pane label="报损列表" name="three" v-if="three">
16
+                <drug-damaged ref="childOne"></drug-damaged>
17
             </el-tab-pane>
17
             </el-tab-pane>
18
         </el-tabs>
18
         </el-tabs>
19
     </div>
19
     </div>
42
                 { path: false, name: "药品管理" },
42
                 { path: false, name: "药品管理" },
43
                 { path: false, name: "药品盘点" }
43
                 { path: false, name: "药品盘点" }
44
             ],
44
             ],
45
-            activeName:'first'
45
+            activeName:'first',
46
+            first:true,
47
+            second:true,
48
+            three:true,
46
         }
49
         }
47
     },
50
     },
48
     methods:{
51
     methods:{
49
-
52
+      handleClick(){
53
+        if(this.activeName == "second"){
54
+         this.$refs.child.getlist()
55
+        }
56
+        if(this.activeName =="three"){
57
+          this.$refs.childOne.getlist()
58
+        }
59
+      }
50
     },
60
     },
51
     created(){
61
     created(){
62
+      console.log("hhh2333223",localStorage.getItem("second")) 
52
     },
63
     },
53
     mounted() {
64
     mounted() {
54
     },
65
     },

+ 8 - 1
src/xt_pages/stock/drugs/drugStockFlow.vue Ver arquivo

93
            </template>
93
            </template>
94
         </el-table-column>
94
         </el-table-column>
95
 
95
 
96
+        <el-table-column prop="drug_name" label="单位" align="center">
97
+           <template slot-scope="scope">
98
+              {{scope.row.max_unit}}
99
+           </template>
100
+        </el-table-column>
101
+
102
+
96
        <!-- <el-table-column prop="drug_name" label="剩余量" align="center">
103
        <!-- <el-table-column prop="drug_name" label="剩余量" align="center">
97
            <template slot-scope="scope">
104
            <template slot-scope="scope">
98
              {{getCountList(scope.row.BaseDrugLib.min_number,scope.row.DrugWarehouseInfo,scope.row.BaseDrugLib.max_unit,scope.row.BaseDrugLib.min_unit)}}
105
              {{getCountList(scope.row.BaseDrugLib.min_number,scope.row.DrugWarehouseInfo,scope.row.BaseDrugLib.max_unit,scope.row.BaseDrugLib.min_unit)}}
99
            </template>
106
            </template>
100
         </el-table-column> -->
107
         </el-table-column> -->
101
        
108
        
102
-        <el-table-column prop="drug_name" label="进货单价" align="center">
109
+        <el-table-column prop="drug_name" label="单价" align="center">
103
            <template slot-scope="scope">
110
            <template slot-scope="scope">
104
               <span>{{scope.row.price}}</span>
111
               <span>{{scope.row.price}}</span>
105
            </template>
112
            </template>

+ 5 - 30
src/xt_pages/stock/drugs/drugStockOutOrder.vue Ver arquivo

225
               {{scope.row.dose}}&nbsp;{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
225
               {{scope.row.dose}}&nbsp;{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
226
             </template>
226
             </template>
227
           </el-table-column>
227
           </el-table-column>
228
-          <!-- <el-table-column label="批号" align="center">
229
-            <template slot-scope="scope">
230
-              <span v-if="scope.row.batch_number!=''">{{scope.row.batch_number}}</span> 
231
-             <span v-if="scope.row.batch_number == '0'"></span> 
232
-            </template>
233
-          </el-table-column> -->
228
+         
234
           <el-table-column label="出库数量" align="center">
229
           <el-table-column label="出库数量" align="center">
235
             <template slot-scope="scope">
230
             <template slot-scope="scope">
236
               <!-- <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span> -->
231
               <!-- <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span> -->
336
               <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
331
               <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
337
             </template>
332
             </template>
338
           </el-table-column>
333
           </el-table-column>
339
-
340
-
341
-          <el-table-column min-width="35" align="center">
342
-            <template slot="header" slot-scope="scope">
343
-              <span>批次号</span>
344
-            </template>
345
-            <template slot-scope="scope">
346
-              <span>{{getDrugBatchNumber(scope.row.drug_id,scope.row.count)}}</span>
347
-            </template>
348
-          </el-table-column>
349
-          
334
+      
350
         </el-table>
335
         </el-table>
351
       </span>
336
       </span>
352
       <span slot="footer" class="dialog-footer">
337
       <span slot="footer" class="dialog-footer">
399
               <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
384
               <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
400
             </template>
385
             </template>
401
           </el-table-column>
386
           </el-table-column>
402
-
403
-         <el-table-column min-width="35" align="center">
404
-            <template slot="header" slot-scope="scope">
405
-              <span>批号</span>
406
-            </template>
407
-            <template slot-scope="scope">
408
-              <span>{{scope.row.batch_number}} </span>
409
-            </template>
410
-          </el-table-column>
411
-
412
         </el-table>
387
         </el-table>
413
       </span>
388
       </span>
414
       <span slot="footer" class="dialog-footer">
389
       <span slot="footer" class="dialog-footer">
947
           this.tableShow = true
922
           this.tableShow = true
948
           this.tableList = []
923
           this.tableList = []
949
           var list =  response.data.data.list
924
           var list =  response.data.data.list
950
-          // console.log("list",list)
925
+     
951
          this.manufacturerList = response.data.data.manufacturerList
926
          this.manufacturerList = response.data.data.manufacturerList
952
          this.dealerList = response.data.data.dealerList
927
          this.dealerList = response.data.data.dealerList
953
          var drugFlowList = response.data.data.drugFlowList
928
          var drugFlowList = response.data.data.drugFlowList
1001
        if(response.data.state == 1){
976
        if(response.data.state == 1){
1002
         
977
         
1003
         this.userList = response.data.data.list
978
         this.userList = response.data.data.list
1004
-        // console.log("自动出库数据",this.userList)
979
+        console.log("自动出库数据",this.userList)
1005
         if(val.is_sys == 1){
980
         if(val.is_sys == 1){
1006
         
981
         
1007
           this.drugDialogVisible = true
982
           this.drugDialogVisible = true
1243
           }
1218
           }
1244
         }
1219
         }
1245
         all_price = total * price
1220
         all_price = total * price
1246
-        // console.log("total",total,min_price)
1221
+      
1247
         return  all_price
1222
         return  all_price
1248
       },
1223
       },
1249
   }
1224
   }

+ 13 - 8
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Ver arquivo

116
               </el-form-item>
116
               </el-form-item>
117
             </template>
117
             </template>
118
           </el-table-column>
118
           </el-table-column>
119
-          <el-table-column align="center" width="150">
119
+          <!-- <el-table-column align="center" width="150">
120
             <template slot="header" slot-scope="scope" >
120
             <template slot="header" slot-scope="scope" >
121
                   <span>批号</span>
121
                   <span>批号</span>
122
               </template>
122
               </template>
123
                 <template slot-scope="scope">
123
                 <template slot-scope="scope">
124
                   <el-form-item style="padding-top: 20px">
124
                   <el-form-item style="padding-top: 20px">
125
-                    <!-- <el-input
126
-                      placeholder="请输入批号"
127
-                      v-model="scope.row.batch_number"
128
-                    ></el-input> -->
129
                     <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" @change="changeBatchNumber(scope.row)">
125
                     <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" @change="changeBatchNumber(scope.row)">
130
                       <el-option
126
                       <el-option
131
                         v-for="(item,index) in numberList"
127
                         v-for="(item,index) in numberList"
136
                     </el-select>
132
                     </el-select>
137
                   </el-form-item>
133
                   </el-form-item>
138
               </template>
134
               </template>
139
-          </el-table-column>
135
+          </el-table-column> -->
140
           <el-table-column width="200" align="center">
136
           <el-table-column width="200" align="center">
141
             <template slot="header" slot-scope="scope">
137
             <template slot="header" slot-scope="scope">
142
               <span>出库数量<span style="color: red">*</span></span>
138
               <span>出库数量<span style="color: red">*</span></span>
608
               var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
604
               var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
609
               console.log("str22222222",str)
605
               console.log("str22222222",str)
610
               if(msg == 1){
606
               if(msg == 1){
611
-                this.$message.error(str + "该批次库存不足")
607
+                this.$message.error(str + "库存不足")
612
               }else{
608
               }else{
613
                 this.$message.success("出库成功");
609
                 this.$message.success("出库成功");
614
                 this.recordInfo.recordData = [];
610
                 this.recordInfo.recordData = [];
675
         this.currentIndex = val
671
         this.currentIndex = val
676
       },
672
       },
677
       handleSelect(val){
673
       handleSelect(val){
678
-        console.log("val2222222",val)
674
+        var arr = []
675
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
676
+            arr.push(this.recordInfo.recordData[i].drug_id)
677
+         }
678
+         var str = arr.join(",")
679
+         console.log("str",str)
680
+         if(str.indexOf(val.id)!=-1){
681
+            this.$message.error("该药品已存在列表中")
682
+            return
683
+         }
679
          this.getDrugBatchNumber(val.id)
684
          this.getDrugBatchNumber(val.id)
680
         for(let i=0;i<this.recordInfo.recordData.length;i++){
685
         for(let i=0;i<this.recordInfo.recordData.length;i++){
681
           if(this.currentIndex == i){
686
           if(this.currentIndex == i){

+ 24 - 25
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Ver arquivo

84
               </el-form-item>
84
               </el-form-item>
85
             </template>
85
             </template>
86
           </el-table-column>
86
           </el-table-column>
87
-         <el-table-column align="center" width="150">
87
+         <!-- <el-table-column align="center" width="150">
88
             <template slot="header" slot-scope="scope" >
88
             <template slot="header" slot-scope="scope" >
89
                   <span>批号</span>
89
                   <span>批号</span>
90
               </template>
90
               </template>
91
                 <template slot-scope="scope">
91
                 <template slot-scope="scope">
92
                   <el-form-item style="padding-top: 20px">
92
                   <el-form-item style="padding-top: 20px">
93
-                    <!-- <el-input
94
-                     :disabled="drug_show"
95
-                      placeholder="请输入批号"
96
-                      v-model="scope.row.batch_number"
97
-                    ></el-input> -->
98
                     <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
93
                     <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
99
                       <el-option
94
                       <el-option
100
                         v-for="(item,index) in numberList"
95
                         v-for="(item,index) in numberList"
105
                     </el-select>
100
                     </el-select>
106
                   </el-form-item>
101
                   </el-form-item>
107
               </template>
102
               </template>
108
-          </el-table-column>
103
+          </el-table-column> -->
109
            <el-table-column width="200" align="center">
104
            <el-table-column width="200" align="center">
110
             <template slot="header" slot-scope="scope">
105
             <template slot="header" slot-scope="scope">
111
               <span>出库数量<span style="color: red">*</span></span>
106
               <span>出库数量<span style="color: red">*</span></span>
266
 <script>
261
 <script>
267
   import { uParseTime } from '@/utils/tools'
262
   import { uParseTime } from '@/utils/tools'
268
 
263
 
269
-  import { deleteDrugWarehouseOutInfo, editDrugWarehouseoutInfo, getDrugSalesReturnConfig, getDrugWarehouseOutInfo,GetAllConfig,GetAllDrugInfoByID,getDrugBatchNumber } from '@/api/drug/drug_stock'
264
+  import { deleteDrugWarehouseOutInfo, editDrugWarehouseoutInfo, getDrugWarehouseOutInfo,GetAllConfig,GetAllDrugInfoByID,getDrugBatchNumber } from '@/api/drug/drug_stock'
270
   import BreadCrumb from '../../components/bread-crumb'
265
   import BreadCrumb from '../../components/bread-crumb'
271
   import DrugsStockDialog from './drugsStockDialog/index'
266
   import DrugsStockDialog from './drugsStockDialog/index'
272
   import {postSearchDrugList } from "@/api/data"
267
   import {postSearchDrugList } from "@/api/data"
424
         return name;
419
         return name;
425
       },
420
       },
426
       specificationName: function(drug_id) {
421
       specificationName: function(drug_id) {
427
-        console.log(this.goodInfo)
422
+      
428
         let name = "";
423
         let name = "";
429
         for (let i = 0; i < this.goodInfo.length; i++) {
424
         for (let i = 0; i < this.goodInfo.length; i++) {
430
           if (this.goodInfo[i].id == drug_id) {
425
           if (this.goodInfo[i].id == drug_id) {
550
 
545
 
551
       back() {
546
       back() {
552
         this.$router.go(-1)
547
         this.$router.go(-1)
553
-      }, submit() {
548
+      }, 
549
+      submit() {
554
         this.$refs['tableForm'].validate((valid) => {
550
         this.$refs['tableForm'].validate((valid) => {
555
           if (valid) {
551
           if (valid) {
556
             const array = this.recordInfo.recordData
552
             const array = this.recordInfo.recordData
560
                 return;
556
                 return;
561
               }
557
               }
562
             }
558
             }
563
-            console.log("经销商",this.dealerList)
564
             for(let i=0;i<this.recordInfo.recordData.length;i++){
559
             for(let i=0;i<this.recordInfo.recordData.length;i++){
565
               if(this.recordInfo.recordData[i].dealer == ""){
560
               if(this.recordInfo.recordData[i].dealer == ""){
566
                 this.recordInfo.recordData[i].dealer = 0
561
                 this.recordInfo.recordData[i].dealer = 0
590
             const params = {
585
             const params = {
591
               'stockOut': this.recordInfo.recordData
586
               'stockOut': this.recordInfo.recordData
592
             }
587
             }
593
-            console.log("params----",params)
594
-            
588
+          
589
+          
595
             editDrugWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
590
             editDrugWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
596
               if (response.data.state == 0) {
591
               if (response.data.state == 0) {
597
                 this.$message.error(response.data.msg)
592
                 this.$message.error(response.data.msg)
599
               } else {
594
               } else {
600
                 var msg = response.data.data.msg
595
                 var msg = response.data.data.msg
601
                 var drug_name =  response.data.data.drug_name
596
                 var drug_name =  response.data.data.drug_name
602
-                console.log("drug_name",drug_name)
603
                 var dose = response.data.data.dose
597
                 var dose = response.data.data.dose
604
-                console.log("dose",dose)
605
                 var dose_unit = response.data.data.dose_unit
598
                 var dose_unit = response.data.data.dose_unit
606
-                console.log("dose_unit",dose_unit)
607
                 var min_number = response.data.data.min_number
599
                 var min_number = response.data.data.min_number
608
-                console.log("min_number",min_number)
609
                 var min_unit =  response.data.data.min_unit
600
                 var min_unit =  response.data.data.min_unit
610
-                console.log("min_unit",min_unit)
611
                 var max_unit =  response.data.data.max_unit
601
                 var max_unit =  response.data.data.max_unit
612
-                console.log("max_unit",max_unit)
613
                 var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
602
                 var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
614
-                console.log("str22222222",str)
603
+               
615
               if(msg == 1){
604
               if(msg == 1){
616
                 this.$message.error(str + "库存不足,请入库")
605
                 this.$message.error(str + "库存不足,请入库")
617
               }else{
606
               }else{
635
             this.$message.error(response.data.msg)
624
             this.$message.error(response.data.msg)
636
             return false
625
             return false
637
           } else {
626
           } else {
638
-             console.log("出库详情",response.data.data.list)
627
+            
639
 
628
 
640
             var manulist = response.data.data.manulist
629
             var manulist = response.data.data.manulist
641
             this.manufacturerList = manulist
630
             this.manufacturerList = manulist
724
             searchArray = response.data.data.list;
713
             searchArray = response.data.data.list;
725
             
714
             
726
              var list = response.data.data.list
715
              var list = response.data.data.list
727
-             console.log("猎豹22222222222",list)
716
+            
728
 
717
 
729
              this.drugList = list
718
              this.drugList = list
730
              var manufacturerList = response.data.data.manufacturerList
719
              var manufacturerList = response.data.data.manufacturerList
748
         this.currentIndex = val
737
         this.currentIndex = val
749
       },
738
       },
750
       handleSelect(val){
739
       handleSelect(val){
740
+         var arr = []
741
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
742
+            arr.push(this.recordInfo.recordData[i].drug_id)
743
+         }
744
+         var str = arr.join(",")
745
+
746
+         if(str.indexOf(val.id)!=-1){
747
+            this.$message.error("该药品已存在列表中")
748
+            return
749
+         }
751
          this.getDrugBatchNumber(val.id)
750
          this.getDrugBatchNumber(val.id)
752
          for(let i=0;i<this.recordInfo.recordData.length;i++){
751
          for(let i=0;i<this.recordInfo.recordData.length;i++){
753
            if(i == this.currentIndex){
752
            if(i == this.currentIndex){
767
              }
766
              }
768
            }
767
            }
769
         }
768
         }
770
-        console.log("333333",this.recordInfo.recordData)
769
+ 
771
       },
770
       },
772
       getDictionaryDataConfig(module, filed_name) {
771
       getDictionaryDataConfig(module, filed_name) {
773
         return getDictionaryDataConfig(module, filed_name)
772
         return getDictionaryDataConfig(module, filed_name)
782
         getDrugBatchNumber(params).then(response=>{
781
         getDrugBatchNumber(params).then(response=>{
783
            if(response.data.state == 1){
782
            if(response.data.state == 1){
784
              var list = response.data.data.list
783
              var list = response.data.data.list
785
-             console.log("list2222",list)
784
+           
786
              this.numberList = list
785
              this.numberList = list
787
            }
786
            }
788
         })
787
         })
802
         this.drug_show = true
801
         this.drug_show = true
803
       }
802
       }
804
      this.unitList =  getDataConfig('hemodialysis','units')
803
      this.unitList =  getDataConfig('hemodialysis','units')
805
-      console.log("单位",this.unitList)
804
+
806
     }
805
     }
807
 
806
 
808
   }
807
   }

+ 2 - 3
src/xt_pages/stock/drugs/inventory.vue Ver arquivo

828
        return getDataConfig(module, filed_name)
828
        return getDataConfig(module, filed_name)
829
       },  
829
       },  
830
     changeMaxUnit(val){
830
     changeMaxUnit(val){
831
-      console.log("val23232",val)
832
       this.form.warehousing_unit = val
831
       this.form.warehousing_unit = val
833
     },
832
     },
834
     saveInentoryList(){
833
     saveInentoryList(){
835
-       console.log("数据库323232",this.tableData)
836
        var arr = []
834
        var arr = []
837
        for(let i=0;i<this.tableData.length;i++){
835
        for(let i=0;i<this.tableData.length;i++){
838
          for(let j=0;j<this.tableData[i].child.length;j++){
836
          for(let j=0;j<this.tableData[i].child.length;j++){
851
 
849
 
852
          
850
          
853
        }
851
        }
854
-      console.log("arrr2323223",arr)
852
+
855
        var params = {
853
        var params = {
856
          tableData:arr
854
          tableData:arr
857
        }
855
        }
859
         if(response.data.state == 1){
857
         if(response.data.state == 1){
860
            var inventory = response.data.data.inventory
858
            var inventory = response.data.data.inventory
861
            this.$message.success("保存成功")
859
            this.$message.success("保存成功")
860
+           this.tableData = []
862
         }
861
         }
863
       })
862
       })
864
     }
863
     }

+ 3 - 2
src/xt_pages/stock/drugs/inventoryDetails.vue Ver arquivo

100
         <el-pagination
100
         <el-pagination
101
             @size-change="handleSizeChange"
101
             @size-change="handleSizeChange"
102
             @current-change="handleCurrentChange"
102
             @current-change="handleCurrentChange"
103
-            :page-sizes="[5, 10, 50, 100]"
104
-            :page-size="5"
103
+            :page-sizes="[10, 20, 50, 100]"
104
+            :page-size="10"
105
             background
105
             background
106
             style="margin-top:20px;text-align: right"
106
             style="margin-top:20px;text-align: right"
107
             layout="total, sizes, prev, pager, next, jumper"
107
             layout="total, sizes, prev, pager, next, jumper"
185
       this.getlist()
185
       this.getlist()
186
     },
186
     },
187
     mounted() {
187
     mounted() {
188
+     
188
     },
189
     },
189
 };
190
 };
190
 </script>
191
 </script>

+ 35 - 3
src/xt_pages/stock/drugs/query.vue Ver arquivo

113
         <el-table-column prop="drug_name" label="出库数量" align="center">
113
         <el-table-column prop="drug_name" label="出库数量" align="center">
114
            <template slot-scope="scope">
114
            <template slot-scope="scope">
115
              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
115
              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
116
-                <span v-if="scope.row.drug_warehouse_out.length > 0"></span> {{getDrugOutList(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
116
+                <span> 
117
+                 {{getOutFlush(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info)}}
118
+                </span> 
117
              </span>
119
              </span>
118
              <span v-else>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
120
              <span v-else>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
119
            </template>
121
            </template>
122
            <template slot-scope="scope">
124
            <template slot-scope="scope">
123
             <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info)!=0">
125
             <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info)!=0">
124
                <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
126
                <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
125
-                 {{getDrugChaCount(scope.row.drug_warehouse_info,scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info)}}
127
+                {{ getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
126
                </span>
128
                </span>
127
                
129
                
128
                <span v-else>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>
130
                <span v-else>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>
171
 <script>
173
 <script>
172
   import { uParseTime } from '@/utils/tools'
174
   import { uParseTime } from '@/utils/tools'
173
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
175
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
174
-  import { getAllDrugStockQueryList,getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
176
+  import { getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
175
   import SettingDialog from './settingDialog/index'
177
   import SettingDialog from './settingDialog/index'
176
   import { getDictionaryDataConfig } from "@/utils/data";
178
   import { getDictionaryDataConfig } from "@/utils/data";
177
 import { min } from 'moment'
179
 import { min } from 'moment'
789
            str_min =  cha_count%min_number + min_unit
791
            str_min =  cha_count%min_number + min_unit
790
          }
792
          }
791
          return str + str_min
793
          return str + str_min
794
+      },
795
+      getOutFlush(info,max_unit,min_unit,min_number,cancel_info){
796
+        
797
+        var str = ""
798
+        var str_min = ""
799
+        //总库存
800
+        var total = 0
801
+        var out_count = 0
802
+        var over_count = 0
803
+        var cancel_count = 0
804
+        for(let i=0;i<info.length;i++){
805
+           total += (info[i].warehousing_count * min_number)
806
+        }
807
+        console.log("total232323232332323223",total)
808
+        for(let j=0;j<info.length;j++){
809
+           out_count += (info[j].stock_max_number + info[j].stock_min_number)
810
+        }
811
+        console.log("剩余库存",out_count)
812
+        for(let z=0;z<cancel_info.length;z++){
813
+           cancel_count += cancel_info[z].count
814
+        }
815
+        over_count = total - out_count + cancel_count
816
+        console.log("hh233223232322323232323322332",over_count)
817
+        if(parseInt(over_count/min_number)!=0){
818
+            str = parseInt(over_count/min_number)+ max_unit
819
+         }
820
+         if(over_count%min_number !=0){
821
+           str_min =  over_count%min_number + min_unit
822
+         }
823
+       return str+str_min
792
       }
824
       }
793
     }
825
     }
794
   }
826
   }

Diferenças do arquivo suprimidas por serem muito extensas
+ 235 - 811
src/xt_pages/stock/inventory.vue


+ 32 - 64
src/xt_pages/stock/inventoryDetails.vue Ver arquivo

2
     <div>
2
     <div>
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4
             <div>
4
             <div>
5
-                <!-- 耗材类别:
6
-                <el-select v-model="value" size="small" placeholder="请选择">
7
-                    <el-option
8
-                    v-for="item in options"
9
-                    :key="item.value"
10
-                    :label="item.label"
11
-                    :value="item.value">
12
-                    </el-option>
13
-                </el-select> -->
14
-                <!-- 停用状态:
15
-                <el-select v-model="value" size="small" placeholder="请选择">
16
-                    <el-option
17
-                    v-for="item in options"
18
-                    :key="item.value"
19
-                    :label="item.label"
20
-                    :value="item.value">
21
-                    </el-option>
22
-                </el-select> -->
23
                 <el-input
5
                 <el-input
24
                 size="small"
6
                 size="small"
25
                 style="width: 200px;margin-left:10px;"
7
                 style="width: 200px;margin-left:10px;"
26
                 class="filter-item"
8
                 class="filter-item"
27
                 v-model.trim="searchKey"
9
                 v-model.trim="searchKey"
28
-                placeholder="请输入单据编号或操作人姓名"
10
+                placeholder="请输入耗材名称"
29
                 />
11
                 />
30
                 <el-button
12
                 <el-button
31
                 size="small"
13
                 size="small"
39
                 <el-button size="small" type="primary" @click="exportList">导出</el-button>
21
                 <el-button size="small" type="primary" @click="exportList">导出</el-button>
40
             </div> -->
22
             </div> -->
41
         </div>
23
         </div>
42
-        <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice" style="width:100%">
24
+        <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice" >
43
             <el-table-column type="selection" width="55" align="center"> </el-table-column>
25
             <el-table-column type="selection" width="55" align="center"> </el-table-column>
44
-            <el-table-column prop="date" label="耗材名称"  width="100" align="center">
26
+            <el-table-column prop="date" label="耗材名称"  width="300" align="center">
45
                 <template slot-scope="scope">
27
                 <template slot-scope="scope">
46
                   {{scope.row.good_name}}
28
                   {{scope.row.good_name}}
47
                 </template>
29
                 </template>
48
             </el-table-column>
30
             </el-table-column>
49
-            <!-- <el-table-column prop="date" label="类别" width="100">
50
-            </el-table-column> -->
51
-            <el-table-column prop="name" label="规格" width="100" align="center">
31
+            <el-table-column prop="name" label="规格" width="200" align="center">
52
                <template slot-scope="scope">
32
                <template slot-scope="scope">
53
                   {{scope.row.specification_name}}
33
                   {{scope.row.specification_name}}
54
                 </template>
34
                 </template>
55
             </el-table-column>
35
             </el-table-column>
56
-            <el-table-column prop="name" label="单位" width="100" align="center">
57
-                <template slot-scope="scope">
58
-                  {{scope.row.warehousing_unit}}
59
-                </template>
36
+
37
+            <el-table-column  prop="name" label="有效日期" width="200" align="center">
38
+               <template slot-scope="scope">
39
+                 {{getTime(scope.row.product_date)}}
40
+               </template>
60
             </el-table-column>
41
             </el-table-column>
61
-            <el-table-column prop="name" label="库存数量" width="100" align="center">
42
+           
43
+            <el-table-column prop="name" label="盘点前数量" width="100" align="center">
62
               <template slot-scope="scope">
44
               <template slot-scope="scope">
63
-                  {{scope.row.total}}
45
+                 <span v-if="scope.row.stock_count >0 ">{{scope.row.stock_count}}</span>
64
                 </template>
46
                 </template>
65
             </el-table-column>
47
             </el-table-column>
66
-            <el-table-column prop="name" label="进价" width="100" align="center">
48
+            <el-table-column prop="name" label="盘点后数量" width="100" align="center">
67
               <template slot-scope="scope">
49
               <template slot-scope="scope">
68
-                {{scope.row.buy_price}}
50
+                <span v-if="scope.row.last_stock_count>0">{{scope.row.last_stock_count}}</span> 
69
              </template>
51
              </template>
70
             </el-table-column>
52
             </el-table-column>
71
-            <el-table-column prop="name" label="零售价" width="100" align="center">
53
+           
54
+            <el-table-column prop="name" label="盘盈类型"  width="100" align="center">
72
                 <template slot-scope="scope">
55
                 <template slot-scope="scope">
73
-                 {{scope.row.packing_price}}
56
+                   <span v-if="scope.row.count > scope.row.last_stock_count">盘盈</span>
57
+                   <span v-if="scope.row.count < scope.row.last_stock_count">盘亏</span>
74
                 </template>
58
                 </template>
75
             </el-table-column>
59
             </el-table-column>
76
-            <el-table-column prop="name"  label="零售总价"  width="100" align="center">
77
-                <template slot-scope="scope">
78
-                  {{scope.row.total * scope.row.packing_price}}
79
-                </template>
80
-            </el-table-column>
81
-            <!-- <el-table-column prop="name" label="产地"  width="100">
82
-              {{scope.row.now_g}}
83
-            </el-table-column> -->
84
-            <el-table-column  prop="name" label="生产厂商" width="260" align="center">
60
+           
61
+            <el-table-column prop="name" label="盘点原因" width="230" align="center">
85
               <template slot-scope="scope">
62
               <template slot-scope="scope">
86
-                {{scope.row.manufacturer}}
87
-             </template>
88
-            </el-table-column>
89
-            <el-table-column prop="name" label="实盘点"  width="100" align="center">
90
-                <template slot-scope="scope">
91
-                    {{scope.row.count}}
92
-                </template>
93
-            </el-table-column>
94
-            <!-- <el-table-column  prop="name" label="亏损价格" width="100" align="center">
95
-            </el-table-column> -->
96
-            <el-table-column prop="name" label="生产日期" width="100" align="center">
97
-              <template slot-scope="scope">
98
-               {{getTime(scope.row.expire_date)}}
99
-               </template>
100
-            </el-table-column>
101
-            <el-table-column  prop="name" label="有效日期" width="100" align="center">
102
-               <template slot-scope="scope">
103
-                 {{getTime(scope.row.product_date)}}
63
+                <span v-if="scope.row.inventory_type ==0">默认</span>
64
+                <span v-if="scope.row.inventory_type ==1">到期退货</span>
65
+                <span v-if="scope.row.inventory_type ==2">异常退货</span>
66
+                <span v-if="scope.row.inventory_type ==3">退货</span>
67
+                <span v-if="scope.row.inventory_type ==4">人为损坏</span>
68
+                <span v-if="scope.row.inventory_type ==5">不计入报损分析</span>
104
                </template>
69
                </template>
105
             </el-table-column>
70
             </el-table-column>
71
+          
106
         </el-table>
72
         </el-table>
107
         <el-pagination
73
         <el-pagination
108
             @size-change="handleSizeChange"
74
             @size-change="handleSizeChange"
137
             limit:10,
103
             limit:10,
138
             page:1,
104
             page:1,
139
             ids:"",
105
             ids:"",
106
+            damageList:[],
140
          }
107
          }
141
     },
108
     },
142
     methods:{
109
     methods:{
158
             limit:this.limit,
125
             limit:this.limit,
159
             page:this.page,
126
             page:this.page,
160
           }
127
           }
128
+          this.tableData = []
161
           getInventoryDetailList(params).then(response=>{
129
           getInventoryDetailList(params).then(response=>{
162
              if(response.data.state == 1){
130
              if(response.data.state == 1){
163
                var list =  response.data.data.list
131
                var list =  response.data.data.list
132
+               console.log("盘点列表23223232323",list)
133
+             
164
                this.tableData = list
134
                this.tableData = list
165
                this.total = response.data.data.total
135
                this.total = response.data.data.total
166
              }
136
              }
167
           })
137
           })
168
         },
138
         },
169
       changePrice(val){  
139
       changePrice(val){  
170
-        console.log("val2323323322323",val)
140
+       
171
         var arr = []
141
         var arr = []
172
         for(let i=0;i<val.length;i++){
142
         for(let i=0;i<val.length;i++){
173
             arr.push(val[i].id)
143
             arr.push(val[i].id)
210
     created(){
180
     created(){
211
       this.getlist()
181
       this.getlist()
212
     },
182
     },
213
-    mounted() {
214
-    },
215
 };
183
 };
216
 </script>
184
 </script>

+ 153 - 357
src/xt_pages/stock/stockDamaged.vue Ver arquivo

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
-    <div class="position">
3
+    <!-- <div class="position">
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5
-    </div>
5
+    </div> -->
6
     <div class="app-container">
6
     <div class="app-container">
7
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
7
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
8
             <div>
8
             <div>
11
                 style="width: 200px;"
11
                 style="width: 200px;"
12
                 class="filter-item"
12
                 class="filter-item"
13
                 v-model.trim="searchKey"
13
                 v-model.trim="searchKey"
14
-                placeholder="请输入单据编号或操作人姓名"
14
+                placeholder="请输入耗材名称"
15
                 />
15
                 />
16
                 <el-button
16
                 <el-button
17
                 size="small"
17
                 size="small"
19
                 type="primary"
19
                 type="primary"
20
                 icon="el-icon-search"
20
                 icon="el-icon-search"
21
                 @click="search">搜索</el-button>
21
                 @click="search">搜索</el-button>
22
-                <el-date-picker
22
+                <!-- <el-date-picker
23
                 size="small"
23
                 size="small"
24
                 @change="changeStartTime"
24
                 @change="changeStartTime"
25
                 v-model="start_time"
25
                 v-model="start_time"
34
                 type="date"
34
                 type="date"
35
                 style="margin-left:5px;width:140px;"
35
                 style="margin-left:5px;width:140px;"
36
                 placeholder="选择日期">
36
                 placeholder="选择日期">
37
-                </el-date-picker>
37
+                </el-date-picker> -->
38
             </div>
38
             </div>
39
-            <div>
39
+            <!-- <div>
40
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
40
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
41
                 <el-button size="small" type="primary" @click="toCheck">核对</el-button>
41
                 <el-button size="small" type="primary" @click="toCheck">核对</el-button>
42
-                <!-- <el-button size="small" type="primary" @click="print">打印</el-button>
43
-                <el-button size="small" type="primary" @click="exportList">导出</el-button> -->
44
-            </div>
42
+                <el-button size="small" type="primary" @click="print">打印</el-button>
43
+                <el-button size="small" type="primary" @click="exportList">导出</el-button>
44
+            </div> -->
45
         </div>
45
         </div>
46
         <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
46
         <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
47
             <el-table-column type="selection" width="55" align="center"> </el-table-column>
47
             <el-table-column type="selection" width="55" align="center"> </el-table-column>
48
-            <el-table-column prop="date" label="报损编码" align="center">
48
+            <!-- <el-table-column prop="date" label="报损编码" align="center">
49
                <template  slot-scope="scope">
49
                <template  slot-scope="scope">
50
                 {{scope.row.warehousing_order}}
50
                 {{scope.row.warehousing_order}}
51
                </template>    
51
                </template>    
52
-            </el-table-column>
53
-            <el-table-column prop="date" label="报损日期"  align="center">
52
+            </el-table-column> -->
53
+            <!-- <el-table-column prop="date" label="报损日期"  align="center">
54
               <template  slot-scope="scope">
54
               <template  slot-scope="scope">
55
                 {{getTime(scope.row.start_time)}}
55
                 {{getTime(scope.row.start_time)}}
56
                </template>    
56
                </template>    
57
-            </el-table-column>
57
+            </el-table-column> -->
58
             <el-table-column prop="date" label="耗材名称"  align="center">
58
             <el-table-column prop="date" label="耗材名称"  align="center">
59
               <template  slot-scope="scope">
59
               <template  slot-scope="scope">
60
                 {{scope.row.good_name}}
60
                 {{scope.row.good_name}}
65
                 {{scope.row.specification_name}}
65
                 {{scope.row.specification_name}}
66
                </template>    
66
                </template>    
67
             </el-table-column>
67
             </el-table-column>
68
-             <el-table-column prop="date" label="报损数量"  align="center">
68
+             <el-table-column prop="date" label="总耗损数量"  align="center">
69
+              <template  slot-scope="scope">
70
+                {{getDamageCount(scope.row.good_id)}}
71
+               </template>    
72
+            </el-table-column>
73
+            <el-table-column prop="date" label="总报损金额"  align="center">
69
               <template  slot-scope="scope">
74
               <template  slot-scope="scope">
70
                 {{scope.row.count}}
75
                 {{scope.row.count}}
71
                </template>    
76
                </template>    
72
             </el-table-column>
77
             </el-table-column>
73
-            <el-table-column prop="name" label="操作人"  align="center">
78
+            <el-table-column prop="name" label="操作"  align="center">
74
               <template  slot-scope="scope">
79
               <template  slot-scope="scope">
75
-                {{scope.row.user_name}}
80
+                <el-button type="primary" @click="toDamagedDetail(scope.row.good_id)">查看详情</el-button>
76
                </template>     
81
                </template>     
77
             </el-table-column>
82
             </el-table-column>
78
-            <el-table-column prop="name" label="审核日期"  align="center">
83
+            <!-- <el-table-column prop="name" label="审核日期"  align="center">
79
               <template  slot-scope="scope">
84
               <template  slot-scope="scope">
80
                 {{getTime(scope.row.checker_time)}}
85
                 {{getTime(scope.row.checker_time)}}
81
              </template>
86
              </template>
82
-            </el-table-column>
83
-            <el-table-column prop="name" label="核对人"  align="center">
87
+            </el-table-column> -->
88
+            <!-- <el-table-column prop="name" label="核对人"  align="center">
84
               <template slot-scope="scope">
89
               <template slot-scope="scope">
85
                 {{getChecker(scope.row.checker)}}
90
                 {{getChecker(scope.row.checker)}}
86
               </template>
91
               </template>
90
                 <span v-if="scope.row.checker_status == 1">已核对</span>
95
                 <span v-if="scope.row.checker_status == 1">已核对</span>
91
                 <span v-if="scope.row.checker_status == 2">未核对</span>
96
                 <span v-if="scope.row.checker_status == 2">未核对</span>
92
               </template>
97
               </template>
93
-            </el-table-column>
94
-            <el-table-column label="操作"  align="center"  width="200" >
98
+            </el-table-column> -->
99
+            <!-- <el-table-column label="操作"  align="center"  width="200" >
95
                 <template slot-scope="scope">
100
                 <template slot-scope="scope">
96
                 <el-button type="primary" size="small" @click="editStockDamage(scope.row.id,scope.row.checker_status)">编辑</el-button>
101
                 <el-button type="primary" size="small" @click="editStockDamage(scope.row.id,scope.row.checker_status)">编辑</el-button>
97
                 <el-button type="danger" size="small" @click="deleteStockDamage(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
102
                 <el-button type="danger" size="small" @click="deleteStockDamage(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
98
                 </template>
103
                 </template>
99
-            </el-table-column>
104
+            </el-table-column> -->
100
         </el-table>
105
         </el-table>
101
         <el-pagination
106
         <el-pagination
102
             @size-change="handleSizeChange"
107
             @size-change="handleSizeChange"
295
         </span>
300
         </span>
296
     </el-dialog>
301
     </el-dialog>
297
 
302
 
298
-<!-- 编辑 -->
299
-      <el-dialog
300
-        title="编辑报损"
301
-        :visible.sync="editPriceDialogVisible"
302
-        width="50%">
303
-        <span>
304
-          <el-form  :model="form">
305
-            <el-row>
306
-               <el-col>
307
-                <el-form-item label="耗材名称:">
308
-                    <el-autocomplete
309
-                        class="checkSearch"
310
-                        popper-class="my-autocomplete"
311
-                        v-model="form.good_name"
312
-                        :fetch-suggestions="querySearchAsync"
313
-                        :trigger-on-focus="true"
314
-                        placeholder="请输入耗材名称"
315
-                        @select="handleSelect"
316
-                        @input="changeGoodName(scope.$index)"
317
-                        style="width:160px;"
318
-                    >
319
-                        <i class="el-icon-search el-input__icon" slot="suffix"></i>
320
-                    <template slot-scope="{ item }">
321
-                        <div class="name">{{ item.good_name +"  " +item.specification_name + "  "+item.manufacturer }}</div>
322
-                    </template>
323
-                    </el-autocomplete>
324
-                </el-form-item>
325
-               <el-form-item label="规格:">
326
-                 <el-input v-model="form.specification_name" style="width:200px"></el-input>
327
-               </el-form-item>
328
-               <el-form-item label="批号">
329
-                 <el-select v-model="form.number" filterable placeholder="请选择"  @change="chageNumberlist">
330
-                  <el-option
331
-                    v-for="(item,index) in numberList"
332
-                    :key="index"
333
-                    :label="item.number"
334
-                    :value="item.number">
335
-                  </el-option>
336
-                </el-select>
337
-              </el-form-item>
338
-              <el-form-item label="单位">
339
-                 <el-input v-model="form.warehousing_unit" style="width:200px" :disabled="true"></el-input>
340
-              </el-form-item>
341
-              <el-form-item label="进货价">
342
-                  <el-input v-model="form.buy_price" style="width:200px" :disabled="true"></el-input>
343
-              </el-form-item>
344
-              <el-form-item label="零售价">
345
-                  <el-input v-model="form.packing_price" style="width:200px" :disabled="true"></el-input>
346
-              </el-form-item>
347
-              <el-form-item label="库存">
348
-                  <el-input v-model="form.total" style="width:200px" :disabled="true"></el-input>
349
-              </el-form-item>
350
-              <el-form-item label="产地">
351
-                  <el-input v-model="form.good_origin_place" style="width:200px" :disabled="true"></el-input>
352
-              </el-form-item>
353
-              <el-form-item label="批准文号">
354
-                  <el-input v-model="form.license_number" style="width:200px" :disabled="true"></el-input>
355
-              </el-form-item>
356
-              <el-form-item label="生产厂商">
357
-                  <el-input v-model="form.manufacturer" style="width:200px" :disabled="true"></el-input>
358
-              </el-form-item>
359
-              <el-form-item label="供应商">
360
-                  <el-input v-model="form.dealer" style="width:200px" :disabled="true"></el-input>
361
-              </el-form-item>
362
-                <el-form-item label="报损数量:">
363
-                 <el-input v-model="form.count" style="width:200px"></el-input>
364
-               </el-form-item>
365
-             </el-col> 
366
-            </el-row>
367
-            <el-row>
368
-             <el-col>
369
-                <el-form-item label="备注:">
370
-                    <div style="display:flex;">
371
-                        <el-input v-model="form.remark"  style="width:200px"></el-input>
372
-                    </div>
373
-                </el-form-item>
374
-              </el-col>  
375
-            </el-row>
376
-          </el-form>
377
-        </span>
378
-        <span slot="footer" class="dialog-footer">
379
-            <el-button @click="editPriceDialogVisible = false">取 消</el-button>
380
-            <el-button type="primary" @click="upatePrice">保存</el-button>
381
-        </span>
382
-    </el-dialog>
383
-
384
 
303
 
385
      <el-dialog
304
      <el-dialog
386
-        title="编辑"
387
-        :visible.sync="modifyPriceDialogVisible"
388
-        width="50%">
389
-        <span>
390
-          <el-form  :model="form">
391
-            <el-row>
392
-             <el-col>
393
-                <el-form-item label="耗材名称:">
394
-                    <el-autocomplete
395
-                        class="checkSearch"
396
-                        popper-class="my-autocomplete"
397
-                        v-model="form.good_name"
398
-                        :fetch-suggestions="querySearchAsync"
399
-                        :trigger-on-focus="true"
400
-                        placeholder="请输入耗材名称"
401
-                        @select="handleSelect"
402
-                        @input="changeGoodName(scope.$index)"
403
-                        style="width:160px;"
404
-                    >
405
-                        <i class="el-icon-search el-input__icon" slot="suffix"></i>
406
-                    <template slot-scope="{ item }">
407
-                        <div class="name">{{ item.good_name +"  " +item.specification_name + "  "+item.manufacturer }}</div>
408
-                    </template>
409
-                    </el-autocomplete>
410
-                </el-form-item>
411
-               <el-form-item label="规格:">
412
-                 <el-input v-model="form.specification_name" style="width:200px" :disabled="true"></el-input>
413
-               </el-form-item>
414
-               <el-form-item label="批号">
415
-                 <el-select v-model="form.number" filterable placeholder="请选择" @change="chageNumberlist">
416
-                  <el-option
417
-                    v-for="(item,index) in numberList"
418
-                    :key="index"
419
-                    :label="item.number"
420
-                    :value="item.number">
421
-                  </el-option>
422
-                </el-select>
305
+      title="盘点批次详情"
306
+      :visible.sync="modifyDialogVisible"
307
+      width="80%">
308
+      <span>
309
+        <el-form>
310
+          <el-row>
311
+            <el-col>
312
+              <el-form-item label="入库单号:">
313
+                 <el-input v-model ="form.warehouseing_order" style="width:200px"></el-input>
423
               </el-form-item>
314
               </el-form-item>
424
-               <el-form-item label="单位">
425
-                 <el-input v-model="form.warehousing_unit" style="width:200px" :disabled="true"></el-input>
315
+              <el-form-item label="原因:">
316
+                  <el-select v-model="form.type" placeholder="请选择">
317
+                      <el-option
318
+                        v-for="item in reasonList"
319
+                        :key="item.id"
320
+                        :label="item.name"
321
+                        :value="item.id">
322
+                      </el-option>
323
+                  </el-select>
426
               </el-form-item>
324
               </el-form-item>
427
-              <el-form-item label="进货价">
428
-                  <el-input v-model="form.buy_price" style="width:200px" :disabled="true"></el-input>
429
-              </el-form-item>
430
-              <el-form-item label="零售价">
431
-                  <el-input v-model="form.packing_price" style="width:200px" :disabled="true"></el-input>
432
-              </el-form-item>
433
-              <el-form-item label="库存">
434
-                  <el-input v-model="form.total" style="width:200px" :disabled="true"></el-input>
435
-              </el-form-item>
436
-              <el-form-item label="产地">
437
-                  <el-input v-model="form.good_origin_place" style="width:200px" :disabled="true"></el-input>
438
-              </el-form-item>
439
-              <el-form-item label="批准文号">
440
-                  <el-input v-model="form.license_number" style="width:200px" :disabled="true"></el-input>
441
-              </el-form-item>
442
-              <el-form-item label="生产厂商">
443
-                  <el-input v-model="form.manufacturer" style="width:200px" :disabled="true"></el-input>
444
-              </el-form-item>
445
-              <el-form-item label="供应商">
446
-                  <el-input v-model="form.dealer" style="width:200px" :disabled="true"></el-input>
447
-              </el-form-item>
448
-               <el-form-item label="报损数量:">
449
-                 <el-input v-model="form.count" style="width:200px"></el-input>
450
-               </el-form-item>
451
-             </el-col> 
452
-            </el-row>
453
-            <el-row>
454
-             <el-col>
455
-                <el-form-item label="备注:">
456
-                    <div style="display:flex;">
457
-                        <el-input v-model="form.remark"  style="width:200px"></el-input>
458
-                    </div>
459
-                </el-form-item>
460
-              </el-col>  
461
-            </el-row>
462
-          </el-form>
463
-        </span>
464
-        <span slot="footer" class="dialog-footer">
465
-            <el-button @click="modifyPriceDialogVisible = false">取 消</el-button>
466
-            <el-button type="primary" @click="modifyPrice">保存</el-button>
467
-        </span>
325
+              <el-button type="primary" @click="toQuery">查询</el-button>
326
+            </el-col>
327
+          </el-row>
328
+          <el-row>
329
+            <div>&nbsp;&nbsp; &nbsp;&nbsp;总损耗数量:{{getDamageCount(good_id)}}     &nbsp;&nbsp;总报损金额:{{ (getDamageCount(good_id) * price).toFixed(2) }}</div>
330
+          </el-row>
331
+          <el-row>
332
+            <el-table
333
+              :data="goodList"
334
+              border
335
+              style="width: 100%">
336
+              <el-table-column prop="date" label="序号" width="180" align="center">
337
+               <template slot-scope="scope">
338
+                  {{scope.$index + 1}}
339
+                </template>
340
+              </el-table-column>
341
+              <el-table-column prop="name" label="入库单号" width="180" align="center">
342
+                <template slot-scope="scope">
343
+                   {{scope.row.warehousing_order}}
344
+                </template>
345
+              </el-table-column>
346
+              <el-table-column prop="address" label="损耗数量" align="center">
347
+                <template slot-scope="scope">
348
+                  {{scope.row.count}}
349
+                </template>
350
+              </el-table-column>
351
+              <el-table-column prop="address" label="药损比" align="center">
352
+                  <template slot-scope="scope">
353
+                    {{(scope.row.count / getDamageCount(scope.row.good_id)).toFixed(2)*100}}%
354
+                  </template>
355
+              </el-table-column>
356
+              <el-table-column prop="address" label="报损金额" align="center">
357
+                <template slot-scope="scope">
358
+                  {{scope.row.buy_price}}
359
+                </template>
360
+              </el-table-column>
361
+
362
+              <el-table-column prop="address" label="盘点原因" align="center">
363
+                <template slot-scope="scope">
364
+                  <span v-if="scope.row.inventory_type == 0">默认</span> 
365
+                  <span v-if="scope.row.inventory_type == 1">到期退货</span> 
366
+                  <span v-if="scope.row.inventory_type == 2">异常退货</span> 
367
+                  <span v-if="scope.row.inventory_type == 3">退货</span> 
368
+                  <span v-if="scope.row.inventory_type == 4">人为损坏</span> 
369
+                  <span v-if="scope.row.inventory_type == 5">不计入报损分析</span> 
370
+                </template>
371
+              </el-table-column>
372
+            </el-table>
373
+          </el-row>
374
+        </el-form>
375
+      </span>
376
+      <span slot="footer" class="dialog-footer">
377
+        <el-button @click="modifyDialogVisible = false">取 消</el-button>
378
+        <el-button type="primary" @click="modifyDialogVisible = false">确 定</el-button>
379
+      </span>
468
     </el-dialog>
380
     </el-dialog>
469
   </div>
381
   </div>
470
 </template>
382
 </template>
472
 <script>
384
 <script>
473
 import BreadCrumb from "../components/bread-crumb";
385
 import BreadCrumb from "../components/bread-crumb";
474
 import { uParseTime } from '@/utils/tools'
386
 import { uParseTime } from '@/utils/tools'
475
-import { postSearchGoodWarehouseList,saveReportStock,getReportStockList,SaveCheckedDamage,getStockDamageDetail,modifyPrice,deleteStockDamage,getStockBatchNumber,getGoodWarehouseList,getWarehouseTotal} from "@/api/stock"
387
+import { postSearchGoodWarehouseList,saveReportStock,getReportStockList,getStockBatchNumber,getGoodWarehouseList,getWarehouseTotal,getDamageDetailByGoodId} from "@/api/stock"
476
 export default {
388
 export default {
477
     name: "stockModifyPrice",
389
     name: "stockModifyPrice",
478
     components:{
390
     components:{
531
             editPriceDialogVisible:false,
443
             editPriceDialogVisible:false,
532
             modifyPriceDialogVisible:false,
444
             modifyPriceDialogVisible:false,
533
             id:0,
445
             id:0,
534
-            numberList:[]
446
+            numberList:[],
447
+            damageList:[],
448
+            modifyDialogVisible:false,
449
+            reasonList:[
450
+              {id:0,name:"默认"},
451
+              {id:1,name:"到期退货"},
452
+              {id:2,name:"异常退货"},
453
+              {id:3,name:"退货"},
454
+              {id:4,name:"人为损坏"},
455
+              {id:5,name:"不计入报损分析"},
456
+            ],
457
+            goodList:[],
458
+            good_name:"",
459
+            price:0,
460
+            good_id:0,
535
         }
461
         }
536
     },
462
     },
537
     methods:{
463
     methods:{
741
             this.tableList = list
667
             this.tableList = list
742
            var doctorlist = response.data.data.doctorlist
668
            var doctorlist = response.data.data.doctorlist
743
            this.doctorList = doctorlist
669
            this.doctorList = doctorlist
670
+           var damageList =  response.data.data.damageList
671
+           console.log("datamagelist",damageList)
672
+          this.damageList = damageList
744
           }
673
           }
745
        })   
674
        })   
746
       },
675
       },
747
-     toCheck(){
748
-      if(this.ids.length <=0){
749
-         this.$message.error("请勾选核对数据")
750
-         return
751
-       }else{
752
-         this.checkDialogVisible = true
753
-       }
754
-     },
755
-    changePrice(val){
756
-       var arr = []
757
-       for(let i=0;i<val.length;i++){
758
-         arr.push(val[i].id)
759
-       }
760
-      var str = arr.join(",")
761
-      this.ids = str 
762
-     },
763
-     SaveCheckedDamage(){
764
-         var params = {
765
-            ids:this.ids,
766
-            check_time:this.getTime(this.check_time),
767
-            checker:this.checker,
768
-         }
769
-       console.log("params",params)
770
-       SaveCheckedDamage(params).then(response=>{
771
-         if(response.data.state == 1){
772
-           this.$message.success("保存成功")
773
-           var reportprice = response.data.data.reportprice 
774
-           this.checkDialogVisible = false
775
-           this.getlist()
776
-         }
777
-       })
778
-     },
779
-     getChecker(id){
780
-       var name = ""
781
-       for(let i=0;i<this.doctorList.length;i++){
782
-          if(id == this.doctorList[i].admin_user_id){
783
-             name = this.doctorList[i].user_name
784
-          }
785
-       }
786
-       return name
787
-     },
788
-     toDelete(index){
789
-       this.tableData.splice(index,1)
790
-     },
791
-     toEdit(row){
792
-      console.log("row",row)
793
-      this.form.good_name = row.good_name
794
-      this.form.warehousing_unit = row.warehousing_unit
795
-      this.form.packing_price = row.packing_price
796
-      this.form.count = row.count
797
-      this.form.remark = row.remark
798
-      this.form.id = row.id
799
-      this.form.specification_name = row.specification_name
800
-      this.form.dealer = row.dealer
801
-      this.form.manufacturer = row.manufacturer
802
-      this.form.good_origin_place = row.good_origin_place
803
-      this.form.total = row.total
804
-      this.form.number = row.number
805
-      this.form.license_number = row.license_number
806
-      this.editPriceDialogVisible = true  
807
-     },
808
-     upatePrice(){
809
-       if(this.form.count == ""){
810
-         this.$message.error("请输入报损数量")
811
-         return false
812
-       }
813
-       for(let i=0;i<this.tableData.length;i++){
814
-         if(this.form.id == this.tableData[i].id){
815
-            this.tableData[i].good_name = this.form.good_name
816
-            this.tableData[i].packing_price = this.form.packing_price
817
-            this.tableData[i].count = this.form.count
818
-            this.tableData[i].remark = this.form.remark
819
-            this.tableData[i].good_name = this.form.specification_name
820
-            this.tableData[i].warehousing_unit  = this.form.warehousing_unit
821
-            this.tableData[i].total = this.form.total
822
-            this.tableData[i].number = this.form.number
823
-            this.tableData[i].license_number = this.form.license_number
824
-            this.tableData[i].manufacturer = this.form.manufacturer
825
-            this.tableData[i].good_origin_place = this.form.good_origin_place
826
-         }
827
-       }
828
-       this.editPriceDialogVisible = false
829
-       this.form.good_name = ""
830
-       this.form.packing_price = ""
831
-       this.form.count = ""
832
-       this.form.remark = ""
833
-     },
834
-     editStockDamage(id,check_status){
835
-        if(check_status == 1){
836
-          this.$message.error("已核对,不能编辑")
837
-          return
838
-        }
839
-       getStockDamageDetail(id).then(response=>{
840
-         if(response.data.state == 1){
841
-           var detail = response.data.data.detail
842
-           console.log("hhhhh32233223",detail)
843
-           this.form.count = detail.count
844
-           this.form.good_name = detail.good_name
845
-           this.form.specification_name = detail.specification_name
846
-           this.form.total = detail.total
847
-           this.form.buy_price = detail.buy_price
848
-           this.form.packing_price = detail.packing_price
849
-           this.form.good_origin_place = detail.good_origin_place
850
-           this.form.warehousing_unit = detail.warehousing_unit
851
-           this.form.manufacturer = detail.manufacturer
852
-           this.form.dealer = detail.dealer
853
-           this.form.license_number = detail.license_number
854
-           this.form.number = detail.number
855
-           this.id = detail.id
856
-           this.form.good_id = detail.good_id
857
-           this.form.warehousing_info_id = detail.warehousing_info_id
858
-           this.modifyPriceDialogVisible = true
859
-         }
860
-       })
861
-     },
862
-     modifyPrice(){
863
-        var params = {
864
-          count:parseInt(this.form.count),
865
-          id:this.id,
866
-          good_name:this.form.good_name,
867
-          specification_name:this.form.specification_name,
868
-          number:this.form.number,
869
-          warehousing_unit:this.form.warehousing_unit,
870
-          buy_price:this.form.buy_price.toString(),
871
-          packing_price:this.form.packing_price.toString(),
872
-          good_origin_place:this.form.good_origin_place,
873
-          manufacturer:this.form.manufacturer,
874
-          dealer:this.form.dealer,
875
-          license_number:this.form.license_number,
876
-          warehousing_info_id:this.form.warehousing_info_id,
877
-          good_id:this.form.good_id,
878
-        }
879
-        console.log("param2323",params)
880
-       
881
-       modifyPrice(params).then(response=>{
882
-         if(response.data.state ==1){
883
-           var adjust = response.data.data.adjust
884
-           this.modifyPriceDialogVisible = false
885
-           this.$message.success("保存成功")
886
-           this.getlist()
887
-         }
888
-       })
889
-     },
890
-     deleteStockDamage(id,check_status,index){
891
-       if(check_status == 1){
892
-         this.$message.error("已核对不能编辑")
893
-         return
894
-       }
895
-        this.$confirm('是否删除所选内容?', '提示', {
896
-          confirmButtonText: '确定',
897
-          cancelButtonText: '取消',
898
-          type: 'warning'
899
-        }).then(() => {
900
-          let params = {
901
-            id:id,
902
-          }
903
-          deleteStockDamage(params).then(response => {
904
-            if (response.data.state == 1) {
905
-              var msg = response.data.data.msg
906
-              this.$message.success("保存成功")
907
-              this.tableList.splice(index,1)
908
-            } 
909
-          })
910
-        }).catch(() => {
911
-          this.loading = false
912
-        });
913
-     },
676
+   
914
      exportList(){
677
      exportList(){
915
        
678
        
916
          import('@/vendor/Export2Excel').then(excel => {
679
          import('@/vendor/Export2Excel').then(excel => {
994
             this.form.total = list.stock_count
757
             this.form.total = list.stock_count
995
           }
758
           }
996
         })
759
         })
760
+      },
761
+      getDamageCount(good_id){
762
+        var count = 0
763
+        for(let i=0;i<this.damageList.length;i++){
764
+          if(good_id == this.damageList[i].good_id){
765
+             count = this.damageList[i].count
766
+          }
767
+        }
768
+        return count
769
+      },
770
+      toDamagedDetail(good_id){
771
+          var params = {
772
+            good_id:good_id,
773
+            warehousing_order:this.form.warehousing_order,
774
+            type:this.form.type,
775
+          }
776
+         getDamageDetailByGoodId(params).then(response=>{
777
+            if(response.data.state == 1){
778
+              var list = response.data.data.list
779
+              console.log("list233232",list)
780
+              this.modifyDialogVisible = true
781
+              this.good_name = list[0].good_name
782
+              this.price = list[0].buy_price
783
+              this.good_id = list[0].good_id
784
+              this.goodList = []
785
+              this.goodList = list
786
+              this.damageList = []
787
+              this.damageList = response.data.data.damageList
788
+            }
789
+         })
790
+      },
791
+      toQuery(){
792
+        this.toDamagedDetail(this.good_id)
997
       }
793
       }
998
     },
794
     },
999
     created(){
795
     created(){

+ 7 - 4
src/xt_pages/stock/stockFlow.vue Ver arquivo

65
              <span v-if="scope.row.consumable_type == 2">手动出库</span>
65
              <span v-if="scope.row.consumable_type == 2">手动出库</span>
66
              <span v-if="scope.row.consumable_type == 3">自动出库</span>
66
              <span v-if="scope.row.consumable_type == 3">自动出库</span>
67
              <span v-if="scope.row.consumable_type == 4">手动退库</span>
67
              <span v-if="scope.row.consumable_type == 4">手动退库</span>
68
-             <span v-if="scope.row.consumable_type == 5">报损数量</span>
68
+             <span v-if="scope.row.consumable_type == 10">盘盈</span>
69
+             <span v-if="scope.row.consumable_type == 11">盘亏</span>
69
            </template>
70
            </template>
70
         </el-table-column>
71
         </el-table-column>
71
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
72
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
74
             <span v-if="scope.row.consumable_type == 2">{{scope.row.warehouse_out_order_number}}</span>  
75
             <span v-if="scope.row.consumable_type == 2">{{scope.row.warehouse_out_order_number}}</span>  
75
             <span v-if="scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>  
76
             <span v-if="scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>  
76
             <span v-if="scope.row.consumable_type == 4">{{scope.row.cancel_order_number}}</span>  
77
             <span v-if="scope.row.consumable_type == 4">{{scope.row.cancel_order_number}}</span>  
77
-            <span v-if="scope.row.consumable_type == 5">{{scope.row.warehouse_out_order_number}}</span>
78
+            <span v-if="scope.row.consumable_type == 10">{{scope.row.warehouse_out_order_number}}</span>
79
+            <span v-if="scope.row.consumable_type == 11">{{scope.row.warehouse_out_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">
102
        </el-table-column>
104
        </el-table-column>
103
 
105
 
104
     
106
     
105
-        <el-table-column prop="drug_name" label="进/出货单价"  align="center">
107
+        <el-table-column prop="drug_name" label="单价"  align="center">
106
            <template slot-scope="scope">
108
            <template slot-scope="scope">
107
              <span>{{scope.row.price}}</span>
109
              <span>{{scope.row.price}}</span>
108
            </template>
110
            </template>
214
           {id:2,name:"手动出库"},
216
           {id:2,name:"手动出库"},
215
           {id:3,name:"自动出库"},
217
           {id:3,name:"自动出库"},
216
           {id:4,name:"手动退库"},
218
           {id:4,name:"手动退库"},
217
-          {id:5,name:"报损数量"},
219
+          {id:10,name:"盘盈"},
220
+          {id:11,name:"盘亏"},
218
         ],
221
         ],
219
         countList:[],
222
         countList:[],
220
         outCountList:[],
223
         outCountList:[],

+ 0 - 1
src/xt_pages/stock/stockInOrderAdd.vue Ver arquivo

735
         })
735
         })
736
       },
736
       },
737
       changeGoodName(val){
737
       changeGoodName(val){
738
-        console.log("val",val)
739
         this.currentIndex = val
738
         this.currentIndex = val
740
       },
739
       },
741
       handleSelect(val){
740
       handleSelect(val){

+ 0 - 9
src/xt_pages/stock/stockInOrderEdit.vue Ver arquivo

797
       this.currentIndex = val
797
       this.currentIndex = val
798
     },
798
     },
799
     handleSelect(val){
799
     handleSelect(val){
800
-      console.log("val",val)
801
         for(let i=0;i<this.recordInfo.recordData.length;i++){
800
         for(let i=0;i<this.recordInfo.recordData.length;i++){
802
           if(this.currentIndex == i){
801
           if(this.currentIndex == i){
803
             this.recordInfo.recordData[i].good_type_id = val.id
802
             this.recordInfo.recordData[i].good_type_id = val.id
823
             }
822
             }
824
           
823
           
825
           }
824
           }
826
-         
827
-         if(val.xt_warehouse_info !=null &&  val.xt_warehouse_info.length > 0){
828
-           
829
-          for(let j=0;j<val.xt_warehouse_info.length;j++){
830
-              this.numberList.push(val.xt_warehouse_info[j])
831
-            }
832
-            this.recordInfo.recordData[i].number = val.xt_warehouse_info[0].number
833
-          }
834
         }
825
         }
835
      
826
      
836
     }
827
     }

+ 17 - 6
src/xt_pages/stock/stockInventory.vue Ver arquivo

4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5
     </div>
5
     </div>
6
     <div class="app-container">
6
     <div class="app-container">
7
-        <el-tabs v-model="activeName">
7
+        <el-tabs v-model="activeName" @tab-click="handleClick">
8
             <el-tab-pane label="耗材盘点" name="first">
8
             <el-tab-pane label="耗材盘点" name="first">
9
                 <inventory></inventory>
9
                 <inventory></inventory>
10
             </el-tab-pane>
10
             </el-tab-pane>
11
-            <el-tab-pane label="盘点明细" name="second">
12
-                <inventory-details></inventory-details>
11
+            <el-tab-pane label="盘点列表" name="second">
12
+                <inventory-details ref="child"></inventory-details>
13
+            </el-tab-pane>
14
+            <el-tab-pane label="报损列表" name="three">
15
+                <stockDamaged ref="childOne"></stockDamaged>
13
             </el-tab-pane>
16
             </el-tab-pane>
14
         </el-tabs>
17
         </el-tabs>
15
         
18
         
23
 import BreadCrumb from "../components/bread-crumb";
26
 import BreadCrumb from "../components/bread-crumb";
24
 import inventory from './inventory.vue'
27
 import inventory from './inventory.vue'
25
 import inventoryDetails from './inventoryDetails.vue'
28
 import inventoryDetails from './inventoryDetails.vue'
26
-
29
+import stockDamaged from "./stockDamaged.vue"
27
 export default {
30
 export default {
28
     name: "stockModifyPrice",
31
     name: "stockModifyPrice",
29
     components:{
32
     components:{
30
         BreadCrumb,
33
         BreadCrumb,
31
         inventory,
34
         inventory,
32
-        inventoryDetails
35
+        inventoryDetails,
36
+        stockDamaged
33
     },
37
     },
34
     data() {
38
     data() {
35
         return{
39
         return{
42
         }
46
         }
43
     },
47
     },
44
     methods:{
48
     methods:{
45
-
49
+      handleClick(){
50
+        if(this.activeName == "second"){
51
+         this.$refs.child.getlist()
52
+        }
53
+        if(this.activeName =="three"){
54
+          this.$refs.childOne.getlist()
55
+        }
56
+      }
46
     },
57
     },
47
     created(){
58
     created(){
48
     },
59
     },

+ 13 - 47
src/xt_pages/stock/stockOutOrder.vue Ver arquivo

185
               {{ scope.row.good_name }}
185
               {{ scope.row.good_name }}
186
             </template>
186
             </template>
187
           </el-table-column>
187
           </el-table-column>
188
-          <!-- <el-table-column label="耗材类型" align="center">
189
-            <template slot-scope="scope">
190
-              {{  getTypeName(scope.row.good_type_id)}}
191
-            </template>
192
-          </el-table-column> -->
188
+        
193
           <el-table-column label="规格&单位" align="center">
189
           <el-table-column label="规格&单位" align="center">
194
             <template slot-scope="scope">
190
             <template slot-scope="scope">
195
               {{ scope.row.specification_name}} / {{scope.row.packing_unit}}
191
               {{ scope.row.specification_name}} / {{scope.row.packing_unit}}
196
             </template>
192
             </template>
197
           </el-table-column>
193
           </el-table-column>
198
-          <!-- <el-table-column label="批号" align="center">
199
-            <template slot-scope="scope">
200
-              {{ scope.row.number}}
201
-            </template>
202
-          </el-table-column> -->
194
+         
203
           <el-table-column label="出库数量" align="center">
195
           <el-table-column label="出库数量" align="center">
204
             <template slot-scope="scope">
196
             <template slot-scope="scope">
205
               <span v-if="scope.row.is_sys == 0">{{ scope.row.count}}{{scope.row.packing_unit}}</span> 
197
               <span v-if="scope.row.is_sys == 0">{{ scope.row.count}}{{scope.row.packing_unit}}</span> 
414
              {{scope.row.count}}
406
              {{scope.row.count}}
415
             </template>
407
             </template>
416
           </el-table-column>
408
           </el-table-column>
417
-          <el-table-column min-width="35" align="center">
418
-            <template slot="header" slot-scope="scope">
419
-              <span>批次号</span>
420
-            </template>
421
-            <template slot-scope="scope">
422
-               <!-- {{scope.row.number}} -->
423
-               {{getBatchNumber(scope.row.patient_id,scope.row.good_id)}}
424
-            </template>
425
-          </el-table-column>
409
+      
426
           <el-table-column min-width="35" align="center">
410
           <el-table-column min-width="35" align="center">
427
             <template slot="header" slot-scope="scope">
411
             <template slot="header" slot-scope="scope">
428
               <span>使用时间</span>
412
               <span>使用时间</span>
629
 
613
 
630
             </template>
614
             </template>
631
           </el-table-column>
615
           </el-table-column>
632
-         <el-table-column min-width="70" align="center">
633
-            <template slot="header" slot-scope="scope">
634
-              <span>批次号</span>
635
-            </template>
636
-            <template slot-scope="scope">
637
-               <span v-if="scope.row.is_total ==0">{{scope.row.number}}</span>
638
-            </template>
639
-          </el-table-column>
640
         </el-table>
616
         </el-table>
641
       </el-row>
617
       </el-row>
642
     </div>
618
     </div>
1078
 
1054
 
1079
     handleSearch(val){
1055
     handleSearch(val){
1080
       this.tableList = []
1056
       this.tableList = []
1081
-    
1082
       this.editdialogVisibleThree = false
1057
       this.editdialogVisibleThree = false
1083
       this.GetOrderDetailOne(val.id)
1058
       this.GetOrderDetailOne(val.id)
1084
       this.GetTotalCount(val.warehouse_out_time)
1059
       this.GetTotalCount(val.warehouse_out_time)
1091
         getOrderDetailByOrderId(params).then(response=>{
1066
         getOrderDetailByOrderId(params).then(response=>{
1092
             if(response.data.state == 1){
1067
             if(response.data.state == 1){
1093
               this.tableShow = true
1068
               this.tableShow = true
1094
-              var info = response.data.data.list
1095
-              console.log("list22222222",info)
1096
-              var list = response.data.data.info
1097
-              for(let i=0;i<info.length;i++){
1098
-                for(let j=0;j<list.length;j++){
1099
-                  if(info[i].good_id == list[j].good_id){
1100
-                     list[j].count = info[i].count
1101
-                  }
1102
-                }
1103
-              }
1069
+              var list = response.data.data.list          
1104
               console.log("info2232323",list)
1070
               console.log("info2232323",list)
1105
               this.tableList = []
1071
               this.tableList = []
1106
               for(let i=0;i<list.length;i++){
1072
               for(let i=0;i<list.length;i++){
1107
-                if(list[i].dealer == 0){
1108
-                  list[i].dealer = ""
1109
-                }
1110
-                if(list[i].manufacturer == 0){
1111
-                  list[i].manufacturer = ""
1112
-                }  
1113
-                list[i].good_name = list[i].info.good_name
1114
-                list[i].specification_name = list[i].info.specification_name
1115
-                list[i].packing_unit = list[i].info.packing_unit
1073
+                // if(list[i].dealer == 0){
1074
+                //   list[i].dealer = ""
1075
+                // }
1076
+                // if(list[i].manufacturer == 0){
1077
+                //   list[i].manufacturer = ""
1078
+                // }  
1079
+                // list[i].good_name = list[i].info.good_name
1080
+                // list[i].specification_name = list[i].info.specification_name
1081
+                // list[i].packing_unit = list[i].info.packing_unit
1116
                 this.tableList.push(list[i])
1082
                 this.tableList.push(list[i])
1117
               }
1083
               }
1118
              
1084
              

+ 28 - 16
src/xt_pages/stock/stockOutOrderAdd.vue Ver arquivo

118
             </template>
118
             </template>
119
           </el-table-column>
119
           </el-table-column>
120
           
120
           
121
-          <el-table-column  width="150" align="center">
121
+          <!-- <el-table-column  width="150" align="center">
122
              <template slot="header" slot-scope="scope">
122
              <template slot="header" slot-scope="scope">
123
               <span>批号<span style="color: red">*</span></span>
123
               <span>批号<span style="color: red">*</span></span>
124
             </template>
124
             </template>
125
             <template slot-scope="scope">
125
             <template slot-scope="scope">
126
               <el-form-item  
126
               <el-form-item  
127
                 :rules="tableRules.number">
127
                 :rules="tableRules.number">
128
-                <el-select v-model="scope.row.number" filterable placeholder="请选择" @change="changeNumberList(scope.row)">
128
+                <el-select v-model="scope.row.number" filterable placeholder="请选择" @change="changeNumberList(scope.row,scope.$index)">
129
                   <el-option
129
                   <el-option
130
                     v-for="(item,index) in numberList"
130
                     v-for="(item,index) in numberList"
131
                     :key="index"
131
                     :key="index"
135
                 </el-select>
135
                 </el-select>
136
               </el-form-item>
136
               </el-form-item>
137
             </template>
137
             </template>
138
-          </el-table-column>
138
+          </el-table-column> -->
139
 
139
 
140
          <el-table-column  width="150" align="center">
140
          <el-table-column  width="150" align="center">
141
             <template slot="header" slot-scope="scope">
141
             <template slot="header" slot-scope="scope">
296
 
296
 
297
 <script>
297
 <script>
298
 import { uParseTime } from "@/utils/tools";
298
 import { uParseTime } from "@/utils/tools";
299
-import { getSalesReturnConfig, postWarehouseOut,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber } from "@/api/stock";
299
+import {  postWarehouseOut,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber } from "@/api/stock";
300
 
300
 
301
 import BreadCrumb from "../components/bread-crumb";
301
 import BreadCrumb from "../components/bread-crumb";
302
 import StockInDialog from './Dialog/stockInDialog'
302
 import StockInDialog from './Dialog/stockInDialog'
327
       tableRules: {
327
       tableRules: {
328
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
328
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
329
         count: [{ required: true, message: "数量不能为空", trigge: "blur" }],
329
         count: [{ required: true, message: "数量不能为空", trigge: "blur" }],
330
-        number:[{ required: true, message: "批号不能为空",trigge:"blur"}],
330
+        // number:[{ required: true, message: "批号不能为空",trigge:"blur"}],
331
       },
331
       },
332
       ruleForm: {
332
       ruleForm: {
333
         manufacturer: [
333
         manufacturer: [
463
       tempObj["product_date"] = ""
463
       tempObj["product_date"] = ""
464
       tempObj["license_number"] = ""
464
       tempObj["license_number"] = ""
465
       tempObj["warehouse_info_id"] = 0
465
       tempObj["warehouse_info_id"] = 0
466
+     
466
       this.recordInfo.recordData.push(tempObj);
467
       this.recordInfo.recordData.push(tempObj);
467
     },
468
     },
468
     handleDelete: function(index, row) {
469
     handleDelete: function(index, row) {
590
            
591
            
591
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
592
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
592
           }
593
           }
593
-          console.log("批次好",this.numberList)
594
           for(let i=0;i<this.recordInfo.recordData.length;i++){
594
           for(let i=0;i<this.recordInfo.recordData.length;i++){
595
             for(let j=0;j<this.manufacturerList.length;j++){
595
             for(let j=0;j<this.manufacturerList.length;j++){
596
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
596
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
612
           const params = {
612
           const params = {
613
             stockOut: this.recordInfo.recordData
613
             stockOut: this.recordInfo.recordData
614
           };
614
           };
615
-          console.log("2323223223",this.recordInfo.recordData);
616
-     
615
+ 
617
           postWarehouseOut(
616
           postWarehouseOut(
618
             params,
617
             params,
619
             this.warehouse_out_time,
618
             this.warehouse_out_time,
622
             this.type
621
             this.type
623
           ).then(response => {
622
           ).then(response => {
624
             if (response.data.state == 0) {
623
             if (response.data.state == 0) {
625
-              // this.$message.error(response.data.msg);
626
               this.$message.error("库存不足")
624
               this.$message.error("库存不足")
627
               return false;
625
               return false;
628
             } else {
626
             } else {
629
                var msg = response.data.data.msg
627
                var msg = response.data.data.msg
630
                var good_name = response.data.data.good_name
628
                var good_name = response.data.data.good_name
631
                var specification_name = response.data.data.specification_name
629
                var specification_name = response.data.data.specification_name
632
-               var str = good_name +"*" + specification_name +"该批次无库存,请入库"
633
-               console.log("msg222222222",msg)
630
+               var str = good_name +"*" + specification_name +"无库存,请入库"
631
+             
634
                if(msg == 1){
632
                if(msg == 1){
635
                   this.$message.error(str)
633
                   this.$message.error(str)
636
                }
634
                }
694
       this.currentIndex = val
692
       this.currentIndex = val
695
     },
693
     },
696
     handleSelect(val){
694
     handleSelect(val){
697
-       console.log("val2222222222",val)
695
+       
696
+        var arr = []
697
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
698
+           arr.push(this.recordInfo.recordData[i].good_id)
699
+        }
700
+       
701
+        var str = arr.join(",")
702
+        console.log("str",str,"good_id",val.id)
703
+        if(str.indexOf(val.id)!=-1){
704
+          this.$message.error("该耗材已存在列表中")
705
+          return
706
+        }
698
         //获取当前耗材的批号
707
         //获取当前耗材的批号
699
         this.getStockBatchNumber(val.id)
708
         this.getStockBatchNumber(val.id)
700
         for(let i=0;i<this.recordInfo.recordData.length;i++){
709
         for(let i=0;i<this.recordInfo.recordData.length;i++){
739
     getDataConfig(module, filed_name) {
748
     getDataConfig(module, filed_name) {
740
       return getDataConfig(module, filed_name)
749
       return getDataConfig(module, filed_name)
741
     },
750
     },
742
-    changeNumberList(val){
743
-       console.log("val232332323223232332",val)
751
+    changeNumberList(val,index){
752
+
744
        for(let i=0;i<this.recordInfo.recordData.length;i++){
753
        for(let i=0;i<this.recordInfo.recordData.length;i++){
745
-         if(val.good_id == this.recordInfo.recordData[i].good_id){
746
-            this.recordInfo.recordData[i].warehouse_info_id = val.number
754
+        //  if(val.good_id == this.recordInfo.recordData[i].good_id){
755
+        //     this.recordInfo.recordData[i].warehouse_info_id = val.number
756
+        //  }
757
+         if(index == i){
758
+          this.recordInfo.recordData[i].warehouse_info_id = val.number
747
          }
759
          }
748
        }  
760
        }  
749
       console.log("表格",this.recordInfo.recordData)
761
       console.log("表格",this.recordInfo.recordData)

+ 50 - 13
src/xt_pages/stock/stockOutOrderEdit.vue Ver arquivo

98
             </template>
98
             </template>
99
           </el-table-column>
99
           </el-table-column>
100
 
100
 
101
-          <el-table-column width="140" align="center">
101
+          <!-- <el-table-column width="140" align="center">
102
             <template slot="header" slot-scope="scope">
102
             <template slot="header" slot-scope="scope">
103
               <span>批号<span style="color: red"></span></span>
103
               <span>批号<span style="color: red"></span></span>
104
             </template>
104
             </template>
105
             <template slot-scope="scope">
105
             <template slot-scope="scope">
106
               <el-form-item style="padding-top: 20px">
106
               <el-form-item style="padding-top: 20px">
107
-                <!-- <el-input placeholder="请输入批号" v-model="scope.row.number"  :disabled="stockShow"></el-input> -->
108
-               <el-select v-model="scope.row.number" filterable placeholder="请选择" :disabled="stockTrue">
107
+               <el-select v-model="scope.row.number" filterable placeholder="请选择" :disabled="stockTrue" @change="changeNumberList(scope.row,scope.$index)">
109
                   <el-option
108
                   <el-option
110
                     v-for="(item,index) in numberList"
109
                     v-for="(item,index) in numberList"
111
                     :key="index"
110
                     :key="index"
112
                     :label="item.number"
111
                     :label="item.number"
113
-                    :value="item.number">
112
+                    :value="item.id">
114
                   </el-option>
113
                   </el-option>
115
                 </el-select>
114
                 </el-select>
116
               </el-form-item>
115
               </el-form-item>
117
             </template>
116
             </template>
118
-          </el-table-column>
117
+          </el-table-column> -->
119
          
118
          
120
           <el-table-column width="150" align="center">
119
           <el-table-column width="150" align="center">
121
             <template slot="header" slot-scope="scope">
120
             <template slot="header" slot-scope="scope">
122
               <span>单价<span style="color: red">*</span></span>
121
               <span>单价<span style="color: red">*</span></span>
123
             </template>
122
             </template>
124
             <template slot-scope="scope">
123
             <template slot-scope="scope">
125
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
124
+         
126
               <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
125
               <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
127
                             style="padding-top: 17px">
126
                             style="padding-top: 17px">
128
                 <el-input type="number" v-model="scope.row.price"  :disabled="stockShow"></el-input>
127
                 <el-input type="number" v-model="scope.row.price"  :disabled="stockShow"></el-input>
252
 <script>
251
 <script>
253
   import { uParseTime } from '@/utils/tools'
252
   import { uParseTime } from '@/utils/tools'
254
 
253
 
255
-  import { deleteWarehouseOutInfo, editWarehouseoutInfo, getSalesReturnConfig, getWarehouseOutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getSingleOutOrderDetail,getStockBatchNumber } from '@/api/stock'
254
+  import { deleteWarehouseOutInfo, editWarehouseoutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getSingleOutOrderDetail,getStockBatchNumber } from '@/api/stock'
256
   import BreadCrumb from '../components/bread-crumb'
255
   import BreadCrumb from '../components/bread-crumb'
257
   import StockInDialog from './Dialog/stockInDialog'
256
   import StockInDialog from './Dialog/stockInDialog'
258
 
257
 
401
         return name;
400
         return name;
402
       }, 
401
       }, 
403
       handleEdit: function(index, row) {
402
       handleEdit: function(index, row) {
403
+        console.log("hhh2322332323",this.recordInfo.recordData)
404
         this.stockTrue = false
404
         this.stockTrue = false
405
         if(this.stockShow == true){
405
         if(this.stockShow == true){
406
          this.$message.error("自动出库数据无法编辑")
406
          this.$message.error("自动出库数据无法编辑")
526
         this.$refs['tableForm'].validate((valid) => {
526
         this.$refs['tableForm'].validate((valid) => {
527
           if (valid) {
527
           if (valid) {
528
             const array = this.recordInfo.recordData
528
             const array = this.recordInfo.recordData
529
+            console.log("2332232323232323",array)
529
             for (let i = 0; i < array.length; i++) {
530
             for (let i = 0; i < array.length; i++) {
530
               if (array[i].good_type_id == 0) {
531
               if (array[i].good_type_id == 0) {
531
                 this.$message.error('商品类型不能为空')
532
                 this.$message.error('商品类型不能为空')
558
                     this.recordInfo.recordData[i].dealer = this.dealerList[z].id
559
                     this.recordInfo.recordData[i].dealer = this.dealerList[z].id
559
                 }
560
                 }
560
               }
561
               }
562
+
563
+            for(let y=0;y<this.numberList.length;y++){
564
+               if(this.recordInfo.recordData[i].number == this.numberList[y].id){
565
+                   this.recordInfo.recordData[i].number = this.numberList[y].number
566
+               }
567
+             }
561
             }
568
             }
562
             const params = {
569
             const params = {
563
-              'stockOut': this.recordInfo.recordData
570
+              'warehouse_out_time':this.warehouse_out_time,
571
+              'stockOut': this.recordInfo.recordData,
572
+              "warehout_id":parseInt(this.$route.query.id),
564
             }
573
             }
565
            
574
            
566
             console.log("stockout",params,this.$route.query.id)
575
             console.log("stockout",params,this.$route.query.id)
567
-            
568
-            editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
576
+            var warehout_id = parseInt(this.$route.query.id)
577
+            editWarehouseoutInfo(params, this.warehouse_out_time, warehout_id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
569
               if (response.data.state == 0) {
578
               if (response.data.state == 0) {
570
                 this.$message.error(response.data.msg)
579
                 this.$message.error(response.data.msg)
571
                 return false
580
                 return false
579
                   this.$message.error("该耗材无库存,请入库")
588
                   this.$message.error("该耗材无库存,请入库")
580
                 }
589
                 }
581
 
590
 
591
+                 var msg = response.data.data.msg
592
+                  var good_name = response.data.data.good_name
593
+                  var specification_name = response.data.data.specification_name
594
+                  var str = good_name +"*" + specification_name +"无库存,请入库"
595
+                
596
+                  if(msg == 7){
597
+                      this.$message.error(str)
598
+                  }
599
+
582
                 if(response.data.data.msg == 6){
600
                 if(response.data.data.msg == 6){
583
                   this.$message.error("该耗材的退库数量大于入库数量,无法出库,请新增出库另一个批次")
601
                   this.$message.error("该耗材的退库数量大于入库数量,无法出库,请新增出库另一个批次")
584
                 }
602
                 }
636
       this.currentIndex = val
654
       this.currentIndex = val
637
     },
655
     },
638
     handleSelect(val){
656
     handleSelect(val){
639
-       console.log("val22222",val)
657
+        var arr = []
658
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
659
+           arr.push(this.recordInfo.recordData[i].good_id)
660
+        }
661
+        var str = arr.join(",")
662
+        console.log("str",str,"good_id",val.id)
663
+        if(str.indexOf(val.id)!=-1){
664
+          this.$message.error("该耗材已存在列表中")
665
+          return
666
+        }
640
         this.getStockBatchNumber(val.id)
667
         this.getStockBatchNumber(val.id)
641
         for(let i=0;i<this.recordInfo.recordData.length;i++){
668
         for(let i=0;i<this.recordInfo.recordData.length;i++){
642
           if(this.currentIndex == i){
669
           if(this.currentIndex == i){
647
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
674
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
648
             this.recordInfo.recordData[i].remark = val.remark
675
             this.recordInfo.recordData[i].remark = val.remark
649
             this.recordInfo.recordData[i].license_number = ""
676
             this.recordInfo.recordData[i].license_number = ""
677
+            this.recordInfo.recordData[i].warehouse_info_id = 0
650
             if(val.packing_price == 0){
678
             if(val.packing_price == 0){
651
                this.recordInfo.recordData[i].price = ""
679
                this.recordInfo.recordData[i].price = ""
652
             }else{
680
             }else{
716
             console.log("list2243444",list)
744
             console.log("list2243444",list)
717
             this.numberList = list
745
             this.numberList = list
718
           }
746
           }
719
-      })
720
-      }
747
+       })
748
+      },
749
+     changeNumberList(val,index){
750
+       console.log("val232332323223232332",val,index)
751
+       for(let i=0;i<this.recordInfo.recordData.length;i++){
752
+         if(index == i){
753
+            this.recordInfo.recordData[i].warehouse_info_id = val.number
754
+         }
755
+       }  
756
+      console.log("表格",this.recordInfo.recordData)
757
+     }
721
     },
758
     },
722
     created() {
759
     created() {
723
       var nowDate = new Date();
760
       var nowDate = new Date();

+ 56 - 123
src/xt_pages/stock/stockQuery.vue Ver arquivo

103
         </el-table-column>
103
         </el-table-column>
104
        <el-table-column label="入库数量" align="center">
104
        <el-table-column label="入库数量" align="center">
105
          <template slot-scope="scope">
105
          <template slot-scope="scope">
106
-          
107
-          <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span>
106
+           <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span>
108
          </template>
107
          </template>
109
        </el-table-column>
108
        </el-table-column>
110
        <el-table-column label="出库数量" align="center">
109
        <el-table-column label="出库数量" align="center">
111
          <template slot-scope="scope">
110
          <template slot-scope="scope">
112
-            {{getAutoCount(scope.row.id) + getOutCount(scope.row.id)}}
111
+          <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4">
112
+            <span>
113
+              {{getWareInfo(scope.row.xt_warehouse_info) - getOverFlushInfo(scope.row.xt_warehouse_info) + getCancelSotckInfo(scope.row.cancel_stock_info) }}
114
+            </span>
115
+          </span>
116
+          <span v-else>{{getAutoCount(scope.row.id) + getOutCount(scope.row.id)}} </span> 
113
          </template>
117
          </template>
114
        </el-table-column>
118
        </el-table-column>
115
 
119
 
116
        <el-table-column label="剩余库存量" align="center">
120
        <el-table-column label="剩余库存量" align="center">
117
          <template slot-scope="scope">
121
          <template slot-scope="scope">
118
-          <span v-if="getWareInfo(scope.row.xt_warehouse_info) > 0">{{getWareInfo(scope.row.xt_warehouse_info) - getAutoCount(scope.row.id) - getOutCount(scope.row.id) + getCancelCount(scope.row.id) }}</span> 
122
+          <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4">{{getOverFlushInfo(scope.row.xt_warehouse_info)}}</span>
123
+          <span v-else>{{getWareInfo(scope.row.xt_warehouse_info) - getAutoCount(scope.row.id) - getOutCount(scope.row.id) + getCancelCount(scope.row.id) }}</span> 
119
          </template>
124
          </template>
120
        </el-table-column>
125
        </el-table-column>
121
        <el-table-column label="操作" align="center" width="260px">
126
        <el-table-column label="操作" align="center" width="260px">
152
 </template>
157
 </template>
153
 
158
 
154
 <script>
159
 <script>
155
-import { uParseTime } from "@/utils/tools";
156
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
160
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
157
 import {
161
 import {
158
-  GetAllGoodInfo,
159
   GetAllGoodType,
162
   GetAllGoodType,
160
-  getAllStockQueryList,
161
   getAllStockList,
163
   getAllStockList,
162
   getStockDrugCount
164
   getStockDrugCount
163
 } from "@/api/stock";
165
 } from "@/api/stock";
165
 export default {
167
 export default {
166
   name: "stockIn",
168
   name: "stockIn",
167
   created() {
169
   created() {
170
+    this.org_id =  this.$store.getters.xt_user.org_id
171
+
168
     var start_time =  window.sessionStorage.getItem('start_time')
172
     var start_time =  window.sessionStorage.getItem('start_time')
169
     var end_time =  window.sessionStorage.getItem('end_time')
173
     var end_time =  window.sessionStorage.getItem('end_time')
170
-    console.log("start_time",start_time,end_time)
174
+   
171
     if(start_time !=null){
175
     if(start_time !=null){
172
       this.start_time = start_time
176
       this.start_time = start_time
173
     }
177
     }
174
     if(end_time!=null){
178
     if(end_time!=null){
175
       this.end_time = end_time
179
       this.end_time = end_time
176
     }
180
     }
177
-   
178
     window.sessionStorage.removeItem('start_time')
181
     window.sessionStorage.removeItem('start_time')
179
     window.sessionStorage.removeItem('end_time')
182
     window.sessionStorage.removeItem('end_time')
180
-    var nowDate = new Date();
181
-    var nowYear = nowDate.getFullYear();
182
-    var nowMonth = nowDate.getMonth() + 1;
183
-    var nowDay = nowDate.getDate();
184
-    // this.end_time =
185
-    //   nowYear +
186
-    //   "-" +
187
-    //   (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
188
-    //   "-" +
189
-    //   (nowDay < 10 ? "0" + nowDay : nowDay);
190
-    // nowDate.setMonth(nowDate.getMonth() - 1);
191
-    // nowYear = nowDate.getFullYear();
192
-    // nowMonth = nowDate.getMonth() + 1;
193
-    // nowDay = nowDate.getDate();
194
-    // this.start_time = nowYear +"-" +(nowMonth < 10 ? "0" + nowMonth : nowMonth) +"-" +(nowDay < 10 ? "0" + nowDay : nowDay);
195
-    this.GetAllGoodInfo();
196
     this.GetAllGoodType();
183
     this.GetAllGoodType();
197
     this.getlist()
184
     this.getlist()
198
     this.getStockDrugCount()
185
     this.getStockDrugCount()
229
       countList:[],
216
       countList:[],
230
       outCountList:[],
217
       outCountList:[],
231
       autoCountList:[],
218
       autoCountList:[],
232
-      cancelCountList:[]
219
+      cancelCountList:[],
220
+      org_id:0,
233
     };
221
     };
234
   },
222
   },
235
   methods: {
223
   methods: {
236
-    GetAllStockQuery: function() {
237
-      console.log(this.keywords);
238
-      const Params = {
239
-        page: this.page,
240
-        limit: this.limit,
241
-        keyword: this.keywords,
242
-        start_time:this.start_time,
243
-        end_time:this.end_time,
244
-        type_name:this.type_name,
245
-      };
246
-
247
-      this.WarehouseInfo.loading = true;
248
-      this.WarehouseInfo.warehouseInfoDate = [];
249
-      getAllStockQueryList(Params).then(response => {
250
-        if (response.data.state == 0) {
251
-          this.WarehouseInfo.loading = false;
252
-          this.$message.error(response.data.msg);
253
-          return false;
254
-        } else {
255
-          this.WarehouseInfo.loading = false;
256
-          this.total = response.data.data.total;
257
-          for (let i = 0; i < response.data.data.list.length; i++) {
258
-           this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
259
-          }
260
-        }
261
-        console.log("数据源头",this.WarehouseInfo.warehouseInfoDate)
262
-
263
-         for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
264
-            this.WarehouseInfo.warehouseInfoDate[i].type_name = this.WarehouseInfo.warehouseInfoDate[i].type.type_name
265
-
266
-            this.WarehouseInfo.warehouseInfoDate[i].stockInCount = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i])
267
-
268
-            this.WarehouseInfo.warehouseInfoDate[i].salesReturnCount = this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i])
269
-
270
-            this.WarehouseInfo.warehouseInfoDate[i].realCount = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) -  this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i])
271
-
272
-            this.WarehouseInfo.warehouseInfoDate[i].stockOutCount = this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i])
273
-
274
-            this.WarehouseInfo.warehouseInfoDate[i].cancelStockCount = this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
275
-
276
-            this.WarehouseInfo.warehouseInfoDate[i].realOutCount =  this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) -  this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
277
-
278
-            this.WarehouseInfo.warehouseInfoDate[i].overplus = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) -this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i]) - this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) + this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
279
-
280
-            if(this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info.length>0){
281
-              this.WarehouseInfo.warehouseInfoDate[i].price = this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price
282
-              this.WarehouseInfo.warehouseInfoDate[i].all_price = (this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) * this.WarehouseInfo.warehouseInfoDate[i].query_warehousing_info[0].price).toFixed(2)
283
-            }else{
284
-             this.WarehouseInfo.warehouseInfoDate[i].price = ""
285
-             this.WarehouseInfo.warehouseInfoDate[i].all_price = ""
286
-            }
287
-
288
-
289
-         }
290
-
291
-       
292
-      });
293
-    },
294
-
224
+  
295
     GetAllGoodType: function() {
225
     GetAllGoodType: function() {
296
       GetAllGoodType().then(response => {
226
       GetAllGoodType().then(response => {
297
         if (response.data.state == 0) {
227
         if (response.data.state == 0) {
307
             this.goodType.push(response.data.data.goodType[i]);
237
             this.goodType.push(response.data.data.goodType[i]);
308
             this.types.push(response.data.data.goodType[i])
238
             this.types.push(response.data.data.goodType[i])
309
           }
239
           }
310
-
311
-          console.log("商品类型",this.types)
312
         }
240
         }
313
       });
241
       });
314
     },
242
     },
329
     },
257
     },
330
     handleSizeChange(val) {
258
     handleSizeChange(val) {
331
       this.limit = val;
259
       this.limit = val;
332
-
333
       this.getlist()
260
       this.getlist()
334
       this.getStockDrugCount()
261
       this.getStockDrugCount()
335
       
262
       
336
     },
263
     },
337
     handleCurrentChange(val) {
264
     handleCurrentChange(val) {
338
       this.page = val;
265
       this.page = val;
339
-       this.getlist()
340
-        this.getStockDrugCount()
266
+      this.getlist()
267
+      this.getStockDrugCount()
341
     },
268
     },
342
     calculate: function(val) {
269
     calculate: function(val) {
343
       return Math.round(parseFloat(val) * 100) / 100;
270
       return Math.round(parseFloat(val) * 100) / 100;
344
     },
271
     },
345
     startTimeChange: function(val) {
272
     startTimeChange: function(val) {
346
       window.sessionStorage.removeItem('start_time')
273
       window.sessionStorage.removeItem('start_time')
347
-     
348
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
274
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
349
-      console.log("ime2222",time)
350
       if (time > 0) {
275
       if (time > 0) {
351
         this.$message.error("开始时间不能大于结束时间");
276
         this.$message.error("开始时间不能大于结束时间");
352
         this.start_time = "";
277
         this.start_time = "";
360
     endTimeChange: function(val) {
285
     endTimeChange: function(val) {
361
       window.sessionStorage.removeItem('end_time')
286
       window.sessionStorage.removeItem('end_time')
362
       var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
287
       var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
363
-      console.log("ime2222",time)
364
       if (time < 0) {
288
       if (time < 0) {
365
         this.$message.error("结束时间不能小于开始时间");
289
         this.$message.error("结束时间不能小于开始时间");
366
         this.end_time = "";
290
         this.end_time = "";
400
       }
324
       }
401
       return total;
325
       return total;
402
     },
326
     },
403
-    showStockInDetailDialog: function(val) {},
404
-    showSaleReturnDetailDialog: function() {},
405
-    showStockOutDetailDialog: function() {},
406
-    showCancelStockDetailDialog: function() {},
407
     search: function() {
327
     search: function() {
408
       this.getlist()
328
       this.getlist()
409
       this.getStockDrugCount()
329
       this.getStockDrugCount()
421
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
341
            this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
422
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
342
            this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
423
            this.tableList[i].inCount =  this.getWareInfo(this.tableList[i].xt_warehouse_info)
343
            this.tableList[i].inCount =  this.getWareInfo(this.tableList[i].xt_warehouse_info)
424
-          this.tableList[i].outCount =  this.getAutoCount(this.tableList[i].id) + this.getOutCount(this.tableList[i].id)
425
-          // 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)
426
-          // this.tableList[i].overplus = this.getOverplus(this.tableList[i].xt_warehouse_info)
344
+           this.tableList[i].outCount =  this.getAutoCount(this.tableList[i].id) + this.getOutCount(this.tableList[i].id)
427
           if(this.getWareInfo(this.tableList[i].xt_warehouse_info) > 0){
345
           if(this.getWareInfo(this.tableList[i].xt_warehouse_info) > 0){
428
             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)
346
             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)
429
           }else{
347
           }else{
431
           }
349
           }
432
           
350
           
433
          }
351
          }
434
-         console.log("table",this.tableList)
435
          const data = this.formatJson(filterVal, this.tableList)
352
          const data = this.formatJson(filterVal, this.tableList)
436
          excel.export_json_to_excel({
353
          excel.export_json_to_excel({
437
            header: tHeader,
354
            header: tHeader,
454
 
371
 
455
       },
372
       },
456
 
373
 
457
-      getUnit(id){
458
-
459
-        var name = ""
460
-        for(let i=0;i<this.$store.getters.good_unit.length;i++){
461
-           if(id == this.$store.getters.good_unit[i].id){
462
-              name = this.$store.getters.good_unit[i].name
463
-           }
464
-        }
465
-        return name
466
-      },
374
+    getUnit(id){
375
+      var name = ""
376
+      for(let i=0;i<this.$store.getters.good_unit.length;i++){
377
+          if(id == this.$store.getters.good_unit[i].id){
378
+            name = this.$store.getters.good_unit[i].name
379
+          }
380
+      }
381
+      return name
382
+    },
467
 
383
 
468
-      getTimestamp(time) {
384
+    getTimestamp(time) {
469
       // 把时间日期转成时间戳
385
       // 把时间日期转成时间戳
470
       return new Date(time).getTime() / 1000;
386
       return new Date(time).getTime() / 1000;
471
     },
387
     },
478
       }
394
       }
479
       return name
395
       return name
480
     },
396
     },
481
-    getlist(){
397
+  getlist(){
482
       const params = {
398
       const params = {
483
         page: this.page,
399
         page: this.page,
484
         limit: this.limit,
400
         limit: this.limit,
487
         end_time:this.end_time,
403
         end_time:this.end_time,
488
         type:this.type_name,
404
         type:this.type_name,
489
       };
405
       };
490
-     console.log("params",params)
491
-      getAllStockList(params).then(response=>{
406
+    getAllStockList(params).then(response=>{
492
          if(response.data.state == 1){
407
          if(response.data.state == 1){
493
           var list = response.data.data.list
408
           var list = response.data.data.list
494
-          console.log("list22222",list)
409
+          console.log("总库存数量",list)
495
           this.tableList = list
410
           this.tableList = list
496
           var total = response.data.data.total
411
           var total = response.data.data.total
497
-          console.log("total",total)
498
           this.total = total
412
           this.total = total
499
-           var manufacturerList = response.data.data.manufacturerList
500
-           this.manufacturerList = manufacturerList
413
+          var manufacturerList = response.data.data.manufacturerList
414
+          this.manufacturerList = manufacturerList
501
          }
415
          }
502
       })
416
       })
503
     },
417
     },
546
         }
460
         }
547
       getStockDrugCount(params).then(response=>{
461
       getStockDrugCount(params).then(response=>{
548
          if(response.data.state == 1){
462
          if(response.data.state == 1){
549
-         
550
            var outlist = response.data.data.outList
463
            var outlist = response.data.data.outList
551
-           console.log("出库数量",outlist)
464
+          //  console.log("出库数量",outlist)
552
            this.outCountList = outlist
465
            this.outCountList = outlist
553
            var autoCount = response.data.data.autoCount
466
            var autoCount = response.data.data.autoCount
554
-           console.log("autoCount",autoCount)
467
+          //  console.log("autoCount",autoCount)
555
            this.autoCountList = autoCount
468
            this.autoCountList = autoCount
556
            var totalCount = response.data.data.totalCount
469
            var totalCount = response.data.data.totalCount
557
-           console.log("totalcount",totalCount)
470
+          //  console.log("totalcount",totalCount)
558
            this.cancelCountList = totalCount
471
            this.cancelCountList = totalCount
559
          }
472
          }
560
       })
473
       })
636
        total = ""
549
        total = ""
637
      }
550
      }
638
      return total
551
      return total
552
+   },
553
+   getOverFlushInfo(arr){
554
+     var total = 0
555
+     if(arr.length >0){
556
+      for(let i=0;i<arr.length;i++){
557
+        total += arr[i].stock_count
558
+      }
559
+     }
560
+     return total
561
+   },
562
+   getCancelSotckInfo(arr){
563
+     console.log("2332323232322332",arr)
564
+     var cancle_toal = 0
565
+     if(arr.length >0){
566
+      for(let z=0;z<arr.length;z++){
567
+        cancle_toal += arr[z].count
568
+      }
569
+     }
570
+     console.log("total",cancle_toal)
571
+     return cancle_toal
639
    }
572
    }
640
   }
573
   }
641
 };
574
 };

+ 1 - 0
src/xt_pages/user/patients.vue Ver arquivo

407
             <span>{{ scope.row.created_time | parseTime('{y}-{m}-{d}') }}</span>
407
             <span>{{ scope.row.created_time | parseTime('{y}-{m}-{d}') }}</span>
408
           </template>
408
           </template>
409
         </el-table-column>
409
         </el-table-column>
410
+        
410
         <el-table-column label="转归" align="center">
411
         <el-table-column label="转归" align="center">
411
           <template slot-scope="scope">
412
           <template slot-scope="scope">
412
             <span>{{ LapsetoInfo(scope.row) }}</span>
413
             <span>{{ LapsetoInfo(scope.row) }}</span>