XMLWAN пре 2 година
родитељ
комит
30b6a1bfea
38 измењених фајлова са 2460 додато и 565 уклоњено
  1. 56 8
      src/api/drug/drug_stock.js
  2. 55 7
      src/api/stock.js
  3. 2 2
      src/xt_pages/data/basicConfig.vue
  4. 5 6
      src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue
  5. 1 4
      src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue
  6. 234 65
      src/xt_pages/hospitalStation/components/deskPrescription.vue
  7. 6 4
      src/xt_pages/hospitalStation/components/prescriptionTable.vue
  8. 20 10
      src/xt_pages/hospitalStation/doctorDesk.vue
  9. 2 1
      src/xt_pages/outpatientCharges/components/dayPrescriptionTable.vue
  10. 251 69
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue
  11. 6 4
      src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue
  12. 23 15
      src/xt_pages/outpatientDoctorStation/doctorDesk.vue
  13. 39 1
      src/xt_pages/stock/cancelStockOrder.vue
  14. 113 37
      src/xt_pages/stock/cancelStockOrderAdd.vue
  15. 106 33
      src/xt_pages/stock/cancelStockOrderEdit.vue
  16. 25 2
      src/xt_pages/stock/detail/print.vue
  17. 37 1
      src/xt_pages/stock/drugs/cancelDrugStockOrder.vue
  18. 128 16
      src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue
  19. 113 26
      src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue
  20. 83 66
      src/xt_pages/stock/drugs/components/drugOutDetail.vue
  21. 44 1
      src/xt_pages/stock/drugs/drugStockInOrder.vue
  22. 120 5
      src/xt_pages/stock/drugs/drugStockInOrderAdd.vue
  23. 121 55
      src/xt_pages/stock/drugs/drugStockInOrderEdit.vue
  24. 66 14
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  25. 134 13
      src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue
  26. 14 7
      src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue
  27. 105 14
      src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue
  28. 45 5
      src/xt_pages/stock/stockInOrder.vue
  29. 104 10
      src/xt_pages/stock/stockInOrderAdd.vue
  30. 117 8
      src/xt_pages/stock/stockInOrderEdit.vue
  31. 43 6
      src/xt_pages/stock/stockOutOrder.vue
  32. 136 15
      src/xt_pages/stock/stockOutOrderAdd.vue
  33. 1 0
      src/xt_pages/stock/stockOutOrderDetailPrint.vue
  34. 79 6
      src/xt_pages/stock/stockOutOrderEdit.vue
  35. 19 19
      src/xt_pages/stock/stockPrint.vue
  36. 2 2
      src/xt_pages/stock/stockQuery.vue
  37. 3 6
      src/xt_pages/supply/components/addGoodOrder.vue
  38. 2 2
      src/xt_pages/user/dialysisRecord.vue

+ 56 - 8
src/api/drug/drug_stock.js Прегледај датотеку

1
 import request from '@/utils/request'
1
 import request from '@/utils/request'
2
 
2
 
3
-export function postDrugWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type, storehouse_id) {
3
+export function postDrugWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type, storehouse_id, warehousing_id) {
4
   return request({
4
   return request({
5
-    url: '/api/drugwarehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
5
+    url: '/api/drugwarehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id + '&warehousing_id=' + warehousing_id,
6
     method: 'post',
6
     method: 'post',
7
     data: params
7
     data: params
8
   })
8
   })
72
   })
72
   })
73
 }
73
 }
74
 
74
 
75
-export function postDrugWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type, storehouse_id) {
75
+export function postDrugWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type, storehouse_id, warehouse_out_id) {
76
   return request({
76
   return request({
77
-    url: '/api/drugwarehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
77
+    url: '/api/drugwarehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type + '&storehouse_id=' + storehouse_id + '&warehouse_out_id=' + warehouse_out_id,
78
     method: 'post',
78
     method: 'post',
79
     data: params
79
     data: params
80
   })
80
   })
321
   })
321
   })
322
 }
322
 }
323
 
323
 
324
-export function postDrugCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id) {
324
+export function postDrugCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id, cancelstock_id) {
325
   return request({
325
   return request({
326
-    url: '/api/drugcancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
326
+    url: '/api/drugcancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id + '&cancelstock_id=' + cancelstock_id,
327
     method: 'post',
327
     method: 'post',
328
     data: params
328
     data: params
329
   })
329
   })
582
   })
582
   })
583
 }
583
 }
584
 
584
 
585
-export function GetAllConfigOne() {
585
+export function GetAllConfigOne(params) {
586
   return request({
586
   return request({
587
     url: '/api/drugstock/config/list',
587
     url: '/api/drugstock/config/list',
588
-    method: 'get'
588
+    method: 'get',
589
+    params: params
590
+  })
591
+}
592
+
593
+export function toCheckWarehousingInfo(params) {
594
+  return request({
595
+    url: '/api/drug/checkwarehouseinginfo',
596
+    method: 'get',
597
+    params: params
598
+  })
599
+}
600
+
601
+export function toReturnCheckWarehousing(params) {
602
+  return request({
603
+    url: '/api/drug/returncheckwarehouseinginfo',
604
+    method: 'Get',
605
+    params: params
606
+  })
607
+}
608
+export function toCheckDrugOut(params) {
609
+  return request({
610
+    url: '/api/drug/tocheckdrugout',
611
+    method: 'Get',
612
+    params: params
613
+  })
614
+}
615
+
616
+export function toReturnCheck(params) {
617
+  return request({
618
+    url: '/api/drug/toreturncheck',
619
+    method: 'get',
620
+    params: params
621
+  })
622
+}
623
+
624
+export function checkCancelDrugStock(params) {
625
+  return request({
626
+    url: '/api/drug/checkcanceldrugstock',
627
+    method: 'get',
628
+    params: params
629
+  })
630
+}
631
+
632
+export function returnDrugCancelStock(params) {
633
+  return request({
634
+    url: '/api/drug/returndrugcancelstock',
635
+    method: 'Get',
636
+    params: params
589
   })
637
   })
590
 }
638
 }

+ 55 - 7
src/api/stock.js Прегледај датотеку

201
   })
201
   })
202
 }
202
 }
203
 
203
 
204
-export function postWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type, storehouse_id) {
204
+export function postWarehouse(data, warehousing_time, type, storehouse_id, warehousing_info_id) {
205
   return request({
205
   return request({
206
-    url: '/api/warehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
206
+    url: '/api/warehouse/create?warehousing_time=' + warehousing_time + '&type=' + type + '&storehouse_id=' + storehouse_id + '&warehousing_info_id=' + warehousing_info_id,
207
     method: 'post',
207
     method: 'post',
208
-    data: params
208
+    data: data
209
   })
209
   })
210
 }
210
 }
211
 
211
 
490
   })
490
   })
491
 }
491
 }
492
 
492
 
493
-export function editCancelStockInfo(params, cancel_stock_time, id, type, manufacturer_id, dealer_id) {
493
+export function editCancelStockInfo(params, cancel_stock_time, id, type, manufacturer_id, dealer_id, storehouse_id) {
494
   return request({
494
   return request({
495
-    url: '/api/cancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
495
+    url: '/api/cancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&storehouse_id=' + storehouse_id,
496
     method: 'post',
496
     method: 'post',
497
     data: params
497
     data: params
498
   })
498
   })
522
   })
522
   })
523
 }
523
 }
524
 
524
 
525
-export function postCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id) {
525
+export function postCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id, cancel_stock_id) {
526
   return request({
526
   return request({
527
-    url: '/api/cancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
527
+    url: '/api/cancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id + '&cancel_stock_id=' + cancel_stock_id,
528
     method: 'post',
528
     method: 'post',
529
     data: params
529
     data: params
530
   })
530
   })
1009
     params: params
1009
     params: params
1010
   })
1010
   })
1011
 }
1011
 }
1012
+
1013
+export function checkWarehouseOut(params) {
1014
+  return request({
1015
+    url: '/api/stock/checkwarehouseout',
1016
+    method: 'get',
1017
+    params: params
1018
+  })
1019
+}
1020
+
1021
+export function returnCheckWarehouseOut(params) {
1022
+  return request({
1023
+    url: '/api/stock/returncheckwarehouseout',
1024
+    method: 'get',
1025
+    params: params
1026
+  })
1027
+}
1028
+
1029
+export function toCheckWarehouseInfo(params) {
1030
+  return request({
1031
+    url: '/api/stock/tocheckwarehouseinfo',
1032
+    method: 'get',
1033
+    params: params
1034
+  })
1035
+}
1036
+
1037
+export function toReturnCheckWarehouseInfo(params) {
1038
+  return request({
1039
+    url: '/api/stock/returncheckwarehouseinfo',
1040
+    method: 'get',
1041
+    params: params
1042
+  })
1043
+}
1044
+
1045
+export function checkStockWarehouseInfo(params) {
1046
+  return request({
1047
+    url: '/api/stock/checkstockwarehouseinfo',
1048
+    method: 'get',
1049
+    params: params
1050
+  })
1051
+}
1052
+
1053
+export function checkRturnStockWarehouseInfo(params) {
1054
+  return request({
1055
+    url: '/api/stock/checkreturnstockwarehouseinfo',
1056
+    method: 'get',
1057
+    params: params
1058
+  })
1059
+}

+ 2 - 2
src/xt_pages/data/basicConfig.vue Прегледај датотеку

39
             <p style="margin-top:20px;">耗材先出库再执行:
39
             <p style="margin-top:20px;">耗材先出库再执行:
40
                 <el-switch v-model="is_open_is_type" @change="changeFuncType"></el-switch>
40
                 <el-switch v-model="is_open_is_type" @change="changeFuncType"></el-switch>
41
             </p>
41
             </p>
42
-            <!-- <p style="margin-top:20px;">药品在保存处方时出库:
42
+            <p style="margin-top:20px;">药品在保存处方时出库:
43
                 <el-switch v-model="drug_out_open" @change="changeDrugOpen"></el-switch>
43
                 <el-switch v-model="drug_out_open" @change="changeDrugOpen"></el-switch>
44
-            </p> -->
44
+            </p>
45
         </div>
45
         </div>
46
 
46
 
47
 
47
 

+ 5 - 6
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue Прегледај датотеку

280
         </el-table-column>
280
         </el-table-column>
281
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士"><!--bug642-->
281
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士"><!--bug642-->
282
           <template slot-scope="scope">
282
           <template slot-scope="scope">
283
-            <span v-if="scope.row.parent_id == 0">
283
+            <span>
284
               {{getXuserName(scope.row.execution_staff)}}
284
               {{getXuserName(scope.row.execution_staff)}}
285
             </span>
285
             </span>
286
-            <span v-else></span>
287
           </template>
286
           </template>
288
         </el-table-column>
287
         </el-table-column>
289
         <el-table-column
288
         <el-table-column
294
           label="核对人员"
293
           label="核对人员"
295
         >
294
         >
296
           <template slot-scope="scope">
295
           <template slot-scope="scope">
297
-            <span v-if="scope.row.parent_id == 0">
296
+            <span>
298
               {{getXuserName(scope.row.checker)}}
297
               {{getXuserName(scope.row.checker)}}
299
             </span>
298
             </span>
300
-            <span v-else></span>
299
+           
301
           </template>
300
           </template>
302
         </el-table-column>
301
         </el-table-column>
303
       </el-table>
302
       </el-table>
385
         </el-table-column>
384
         </el-table-column>
386
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
385
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
387
           <template slot-scope="scope">
386
           <template slot-scope="scope">
388
-            <span v-if="scope.row.parent_id == 0">
387
+            <span>
389
               {{getXuserName(scope.row.execution_staff)}}
388
               {{getXuserName(scope.row.execution_staff)}}
390
             </span>
389
             </span>
391
-            <span v-else>{{getXuserName(scope.row.execution_staff)}}</span>
390
+            <!-- <span v-else>{{getXuserName(scope.row.execution_staff)}}</span> -->
392
           </template>
391
           </template>
393
         </el-table-column>
392
         </el-table-column>
394
         <el-table-column
393
         <el-table-column

+ 1 - 4
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue Прегледај датотеку

411
                             ></el-input>
411
                             ></el-input>
412
                         </el-form-item>
412
                         </el-form-item>
413
                     </el-col>
413
                     </el-col>
414
-                    <el-col
415
-                            :span="8"
416
-                            v-if="anticoagulant.gaijiliang != -1 && isShows('钙剂量')"
417
-                    >
414
+                    <el-col :span="8" v-if="isShows('钙剂量')" >
418
                         <el-form-item label="钙剂量(ml) : ">
415
                         <el-form-item label="钙剂量(ml) : ">
419
                             <el-input
416
                             <el-input
420
                                     type="number"
417
                                     type="number"

+ 234 - 65
src/xt_pages/hospitalStation/components/deskPrescription.vue Прегледај датотеку

169
             <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables"
169
             <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables"
170
                                 :prescription="curPrescriptions"
170
                                 :prescription="curPrescriptions"
171
                                 :preDrugs="preDrugs"
171
                                 :preDrugs="preDrugs"
172
+                                v-bind="$attrs"
173
+                                v-on="$listeners"
172
                                 :activeType="customTabIndex"></prescription-table>
174
                                 :activeType="customTabIndex"></prescription-table>
173
 
175
 
174
 
176
 
291
                     </el-table-column>
293
                     </el-table-column>
292
                     <el-table-column label="库存" width="60">
294
                     <el-table-column label="库存" width="60">
293
                       <template slot-scope="scope">
295
                       <template slot-scope="scope">
294
-                                          <span
295
-                                              v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10188 || org_id == 10245 || org_id == 9919 || org_id ==10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
296
-                                              <span
297
-                                                  v-if="scope.row.count/scope.row.min_number>0">{{ Math.floor(scope.row.count / scope.row.min_number) }}{{ scope.row.max_unit }}</span>
298
-                                              <span
299
-                                                  v-if="scope.row.count%scope.row.min_number>0"> {{ scope.row.count % scope.row.min_number }}{{ scope.row.min_unit }}</span>
300
-                                            </span>
301
-                        <span v-else> {{ scope.row.total }}{{ scope.row.total ? scope.row.min_unit : '' }}</span>
296
+                        <!-- <span
297
+                            v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10188 || org_id == 10245 || org_id == 9919 || org_id ==10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
298
+                            <span
299
+                                v-if="scope.row.count/scope.row.min_number>0">{{ Math.floor(scope.row.count / scope.row.min_number) }}{{ scope.row.max_unit }}</span>
300
+                            <span
301
+                                v-if="scope.row.count%scope.row.min_number>0"> {{ scope.row.count % scope.row.min_number }}{{ scope.row.min_unit }}</span>
302
+                          </span>
303
+                        <span v-else> {{ scope.row.total }}{{ scope.row.total ? scope.row.min_unit : '' }}</span> -->
304
+                          <span v-if="scope.row.sum_count >0 && scope.row.max_unit!=scope.row.min_unit && scope.row.sum_count/scope.row.min_number >0">{{Math.floor(scope.row.sum_count/scope.row.min_number)}}{{scope.row.max_unit}}</span>
305
+                          <span v-if="scope.row.sum_count >0 && scope.row.max_unit!=scope.row.min_unit && scope.row.sum_count%scope.row.min_number >0">{{Math.floor(scope.row.sum_count%scope.row.min_number)}}{{scope.row.min_unit}}</span>
306
+                          <span v-if="scope.row.sum_count >0 && scope.row.max_unit == scope.row.min_unit">{{scope.row.sum_count}}{{scope.row.max_unit}}</span>
302
                       </template>
307
                       </template>
303
                     </el-table-column>
308
                     </el-table-column>
304
                     <el-table-column label="单价" width="40">
309
                     <el-table-column label="单价" width="40">
390
                     </el-table-column>
395
                     </el-table-column>
391
                     <el-table-column label="库存" width="40">
396
                     <el-table-column label="库存" width="40">
392
                       <template slot-scope="scope">
397
                       <template slot-scope="scope">
393
-                                                <span
394
-                                                    v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9919 || org_id ==10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
395
-                                                    {{ scope.row.stock_count }}
396
-                                                </span>
397
-                        <span v-else> {{ scope.row.total }}</span>
398
+                          <!-- <span
399
+                              v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9919 || org_id ==10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
400
+                              {{ scope.row.stock_count }}
401
+                          </span> -->
402
+                        <!-- <span v-else> {{ scope.row.total }}</span> -->
403
+                         <span v-if="scope.row.type == 3 && scope.row.good_info.sum_count > 0">{{scope.row.good_info.sum_count}}</span>
398
                       </template>
404
                       </template>
399
                     </el-table-column>
405
                     </el-table-column>
400
                     <el-table-column label="单价" width="40">
406
                     <el-table-column label="单价" width="40">
2196
       }
2202
       }
2197
     },
2203
     },
2198
     open(index, isLoading) {
2204
     open(index, isLoading) {
2205
+     
2199
       if (!isLoading) {
2206
       if (!isLoading) {
2200
         if (this.dayorMonth == 'day') {
2207
         if (this.dayorMonth == 'day') {
2201
           if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2208
           if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2384
                 'prescriptions': this.prescriptions
2391
                 'prescriptions': this.prescriptions
2385
               }
2392
               }
2386
               isLoading = true
2393
               isLoading = true
2387
-              console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2394
+             
2388
               let num = 0
2395
               let num = 0
2389
               // this.prescriptions.map(item => {
2396
               // this.prescriptions.map(item => {
2390
               //   if (item.advices.length > 0) {
2397
               //   if (item.advices.length > 0) {
2399
               //   }
2406
               //   }
2400
               // })
2407
               // })
2401
               if (num == 0) {
2408
               if (num == 0) {
2409
+                  var arr = []//新增处方
2410
+                  var arr_one = []
2411
+                for(let i=0;i<this.prescriptions.length;i++){
2412
+                  if(this.prescriptions[i].id == 0){ 
2413
+                  
2414
+                    for(let j=0;j<this.prescriptions[i].advices.length;j++){
2415
+                       arr.push(this.prescriptions[i].advices[j])
2416
+                    }
2417
+
2418
+                    if(arr.length > 0){
2419
+                      let objInfo = {};
2420
+                      arr.forEach((item, index) => {
2421
+                      let { id } = item.id;
2422
+                      if (!objInfo[id]) {
2423
+                          objInfo[id] = {
2424
+                            drug_id:item.drug.id,
2425
+                            child: [],
2426
+                            sum_count:item.drug.sum_count,
2427
+                            out_count:0,
2428
+                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit
2429
+                          };
2430
+                        }
2431
+                      });
2432
+                      let newArr = Object.values(objInfo);
2433
+                      console.log("newArr",newArr)
2434
+                      
2435
+                      for(let i=0;i<arr.length;i++){
2436
+                        for(let j=0;j<newArr.length;j++){
2437
+                          if(arr[i].id == newArr[j].drug_id){
2438
+                            newArr[j].child.push(arr[i])
2439
+                          }
2440
+                        }
2441
+                      }
2442
+                      
2443
+                      if(newArr.length >0){
2444
+                        for(let i=0;i<newArr.length;i++){
2445
+                          for(let j=0;j<newArr[i].child.length;j++){
2446
+                            if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.max_unit){
2447
+                                newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number) * newArr[i].child[j].drug.min_number
2448
+                            }  
2449
+                            newArr[i].out_count +=  newArr[i].child[j].prescribing_number_total
2450
+                          }
2451
+                        }
2452
+                      }
2453
+                      
2454
+                      if(newArr.length > 0){
2455
+                        for(let i=0;i<newArr.length;i++){
2456
+                          if(newArr[i].out_count > newArr[i].sum_count){
2457
+                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2458
+                            isLoading = false
2459
+                            this.$emit('editKeepLoad', false)
2460
+                            return
2461
+                          }
2462
+                        }
2463
+                      }
2464
+                      console.log("newArr",newArr )
2465
+                    }
2466
+                  }
2402
 
2467
 
2468
+                  if(this.prescriptions[i].id > 0){ //修改处方
2469
+                   
2470
+                     for(let j=0;j<this.prescriptions[i].advices.length;j++){
2471
+                       if(this.prescriptions[i].advices[j].advice_id == 0){ //新增列
2472
+                         arr_one.push(this.prescriptions[i].advices[j])
2473
+                       }
2474
+                     }
2475
+
2476
+                     if(arr_one.length > 0){
2477
+                      let objInfo = {};
2478
+                      arr_one.forEach((item, index) => {
2479
+                      let { id } = item.id;
2480
+                      if (!objInfo[id]) {
2481
+                          objInfo[id] = {
2482
+                            drug_id:item.drug.id,
2483
+                            child: [],
2484
+                            sum_count:item.drug.sum_count,
2485
+                            out_count:0,
2486
+                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit
2487
+                          };
2488
+                        }
2489
+                      });
2490
+                      let newArr = Object.values(objInfo);
2491
+                      console.log("newArr",newArr)
2492
+                      
2493
+                      for(let i=0;i<arr_one.length;i++){
2494
+                        for(let j=0;j<newArr.length;j++){
2495
+                          if(arr_one[i].id == newArr[j].drug_id){
2496
+                            newArr[j].child.push(arr_one[i])
2497
+                          }
2498
+                        }
2499
+                      }
2500
+                      
2501
+                      if(newArr.length >0){
2502
+                        for(let i=0;i<newArr.length;i++){
2503
+                          for(let j=0;j<newArr[i].child.length;j++){
2504
+                            //  newArr[i].child[j].prescribing_number_total = 0
2505
+                            if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.max_unit && newArr[i].child[j].drug.max_unit!=newArr[i].child[j].drug.min_unit){
2506
+                                newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number) * newArr[i].child[j].drug.min_number
2507
+                            }
2508
+                            if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.min_unit && newArr[i].child[j].drug.max_unit!=newArr[i].child[j].drug.min_unit){
2509
+                              newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number)
2510
+                             } 
2511
+                             if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.max_unit && newArr[i].child[j].drug.max_unit ==newArr[i].child[j].drug.min_unit){
2512
+                                newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number)
2513
+                             } 
2514
+                          }
2515
+                        }
2516
+                         console.log("wodeshju",newArr)
2517
+                         for(let i=0;i<newArr.length;i++){
2518
+                          for(let j=0;j<newArr[i].child.length;j++){
2519
+                             newArr[i].out_count +=  newArr[i].child[j].prescribing_number_total
2520
+                          }
2521
+                        }
2522
+                      }
2523
+                      
2524
+                      if(newArr.length > 0){
2525
+                        for(let i=0;i<newArr.length;i++){
2526
+                          if(newArr[i].out_count > newArr[i].sum_count){
2527
+                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2528
+                            isLoading = false
2529
+                            this.$emit('editKeepLoad', false)
2530
+                            return
2531
+                          }
2532
+                        }
2533
+                      }
2534
+                      console.log("newArr",newArr )
2535
+                    }
2536
+                  }
2537
+                }
2403
                 createHisPrescription(data, params).then(response => {
2538
                 createHisPrescription(data, params).then(response => {
2404
                   if (response.data.state == 1) {
2539
                   if (response.data.state == 1) {
2405
                     this.$emit('change', this.patientInfo.id)
2540
                     this.$emit('change', this.patientInfo.id)
2406
                     this.$message.success('保存成功')
2541
                     this.$message.success('保存成功')
2407
                     this.$emit('editKeepLoad', false)
2542
                     this.$emit('editKeepLoad', false)
2543
+                    this.$parent.getInitData()
2544
+                    this.$parent.getInitDataOne()
2408
                   } else {
2545
                   } else {
2409
                     this.$message.error(response.data.msg)
2546
                     this.$message.error(response.data.msg)
2410
                     this.$emit('editKeepLoad', false)
2547
                     this.$emit('editKeepLoad', false)
2618
             this.curPrescriptions = []
2755
             this.curPrescriptions = []
2619
             this.curStatus = 0
2756
             this.curStatus = 0
2620
           }
2757
           }
2758
+          this.$parent.getInitDataOne(this.prescriptions)
2621
         } else {
2759
         } else {
2622
           let params = {
2760
           let params = {
2623
             'id': id
2761
             'id': id
2656
                 this.curPrescriptions = []
2794
                 this.curPrescriptions = []
2657
                 this.curStatus = 0
2795
                 this.curStatus = 0
2658
               }
2796
               }
2797
+              this.$parent.getInitData()
2798
+              this.$parent.getInitDataOne(this.prescriptions)
2799
+
2659
             } else {
2800
             } else {
2660
               this.$message.success(response.data.msg)
2801
               this.$message.success(response.data.msg)
2661
             }
2802
             }
2743
       this.$refs.additionalCharges.show()
2884
       this.$refs.additionalCharges.show()
2744
     },
2885
     },
2745
     selectDrugs(selection, row) {
2886
     selectDrugs(selection, row) {
2746
-      if (this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340) {
2747
-        if (row.count <= 0) {
2748
-          if (selection) {
2749
-            selection.forEach(row => {
2750
-              if (row.count <= 0) {
2751
-                this.$refs.multipleTable.toggleRowSelection(row)
2752
-              }
2753
-            })
2754
-          } else {
2755
-            this.$refs.multipleTable.clearSelection()
2756
-          }
2757
-          this.$message.error(row.drug_name + '库存不足')
2758
-          return
2759
-        }
2760
-      } else {
2761
-        if (row.total <= 0) {
2887
+      // if (this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340) {
2888
+      //   if (row.count <= 0) {
2889
+      //     if (selection) {
2890
+      //       selection.forEach(row => {
2891
+      //         if (row.count <= 0) {
2892
+      //           this.$refs.multipleTable.toggleRowSelection(row)
2893
+      //         }
2894
+      //       })
2895
+      //     } else {
2896
+      //       this.$refs.multipleTable.clearSelection()
2897
+      //     }
2898
+      //     this.$message.error(row.drug_name + '库存不足')
2899
+      //     return
2900
+      //   }
2901
+      // } else {
2902
+      //   if (row.total <= 0) {
2903
+      //     if (selection) {
2904
+      //       selection.forEach(row => {
2905
+      //         if (row.total <= 0) {
2906
+      //           this.$refs.multipleTable.toggleRowSelection(row)
2907
+      //         }
2908
+      //       })
2909
+      //     } else {
2910
+      //       this.$refs.multipleTable.clearSelection()
2911
+      //     }
2912
+      //     this.$message.error(row.drug_name + '库存不足')
2913
+      //     return
2914
+      //   }
2915
+      // }
2916
+       if (row.sum_count <= 0) {
2762
           if (selection) {
2917
           if (selection) {
2763
             selection.forEach(row => {
2918
             selection.forEach(row => {
2764
-              if (row.total <= 0) {
2919
+              if (row.sum_count <= 0) {
2765
                 this.$refs.multipleTable.toggleRowSelection(row)
2920
                 this.$refs.multipleTable.toggleRowSelection(row)
2766
               }
2921
               }
2767
             })
2922
             })
2770
           }
2925
           }
2771
           this.$message.error(row.drug_name + '库存不足')
2926
           this.$message.error(row.drug_name + '库存不足')
2772
           return
2927
           return
2773
-        }
2774
-      }
2928
+       }
2775
       this.curDrugs = selection
2929
       this.curDrugs = selection
2776
     },
2930
     },
2777
 
2931
 
3031
     },
3185
     },
3032
     selectChange(selection, row) {
3186
     selectChange(selection, row) {
3033
       console.log('row', row)
3187
       console.log('row', row)
3034
-      if (this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 10188  || this.org_id == 9956 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340) {
3035
-        if (row.stock_count <= 0) {
3036
-          if (row.type == 3) {
3037
-            if (selection) {
3038
-              selection.forEach(row => {
3039
-                if (row.stock_count <= 0) {
3040
-                  this.$refs.tables.toggleRowSelection(row)
3041
-                }
3042
-              })
3043
-            } else {
3044
-              this.$refs.tables.clearSelection()
3045
-            }
3046
-            this.$message.error(row.project_name + '库存不足')
3047
-            return
3048
-          }
3049
-        }
3050
-      } else {
3051
-        if (row.total <= 0) {
3052
-          if (row.type == 3) {
3053
-            if (selection) {
3054
-              selection.forEach(row => {
3055
-                if (row.total <= 0) {
3056
-                  this.$refs.tables.toggleRowSelection(row)
3057
-                }
3058
-              })
3059
-            } else {
3060
-              this.$refs.tables.clearSelection()
3061
-            }
3062
-            this.$message.error(row.project_name + '库存不足')
3063
-            return
3188
+      // if (this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 10188  || this.org_id == 9956 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340) {
3189
+      //   if (row.stock_count <= 0) {
3190
+      //     if (row.type == 3) {
3191
+      //       if (selection) {
3192
+      //         selection.forEach(row => {
3193
+      //           if (row.stock_count <= 0) {
3194
+      //             this.$refs.tables.toggleRowSelection(row)
3195
+      //           }
3196
+      //         })
3197
+      //       } else {
3198
+      //         this.$refs.tables.clearSelection()
3199
+      //       }
3200
+      //       this.$message.error(row.project_name + '库存不足')
3201
+      //       return
3202
+      //     }
3203
+      //   }
3204
+      // } else {
3205
+      //   if (row.total <= 0) {
3206
+      //     if (row.type == 3) {
3207
+      //       if (selection) {
3208
+      //         selection.forEach(row => {
3209
+      //           if (row.total <= 0) {
3210
+      //             this.$refs.tables.toggleRowSelection(row)
3211
+      //           }
3212
+      //         })
3213
+      //       } else {
3214
+      //         this.$refs.tables.clearSelection()
3215
+      //       }
3216
+      //       this.$message.error(row.project_name + '库存不足')
3217
+      //       return
3218
+      //     }
3219
+      //   }
3220
+
3221
+      // }
3222
+       if (row.stock_count <= 0) {
3223
+        if (row.type == 3) {
3224
+          if (selection) {
3225
+            selection.forEach(row => {
3226
+              if (row.stock_count <= 0) {
3227
+                this.$refs.tables.toggleRowSelection(row)
3228
+              }
3229
+            })
3230
+          } else {
3231
+            this.$refs.tables.clearSelection()
3064
           }
3232
           }
3233
+          this.$message.error(row.project_name + '库存不足')
3234
+          return
3065
         }
3235
         }
3066
-
3067
-      }
3236
+       }
3068
       this.teamList.push(row)
3237
       this.teamList.push(row)
3069
     },
3238
     },
3070
     getlist() {
3239
     getlist() {

+ 6 - 4
src/xt_pages/hospitalStation/components/prescriptionTable.vue Прегледај датотеку

360
                   temp2.splice(index, 1)
360
                   temp2.splice(index, 1)
361
                   this.prescription.advices = temp2
361
                   this.prescription.advices = temp2
362
                   this.$message.success(response.data.data.msg)
362
                   this.$message.success(response.data.data.msg)
363
+                  this.$emit("getSunziValue",temp2)
363
                 }
364
                 }
364
               })
365
               })
365
 
366
 
442
 
443
 
443
       },
444
       },
444
       getAllChange(scope) {
445
       getAllChange(scope) {
446
+        console.log("2332323232我的",scope.row.drug)
445
         if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
447
         if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
446
           if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
448
           if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
447
             scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
449
             scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
460
         }
462
         }
461
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
463
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
462
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
464
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
463
-          if (scope.row.prescribing_number > scope.row.drug.total) {
465
+          if (scope.row.prescribing_number > scope.row.drug.sum_count) {
464
             this.$message.error(scope.row.drug_name + '库存不足')
466
             this.$message.error(scope.row.drug_name + '库存不足')
465
           }
467
           }
466
         } else {
468
         } else {
467
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
469
+          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
468
             this.$message.error(scope.row.drug_name + '库存不足')
470
             this.$message.error(scope.row.drug_name + '库存不足')
469
           }
471
           }
470
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
472
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
504
       },
506
       },
505
       changePrescribingNumber(scope) {
507
       changePrescribingNumber(scope) {
506
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
508
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
507
-          if (parseInt(scope.row.prescribing_number) > scope.row.drug.total) {
509
+          if (parseInt(scope.row.prescribing_number) > scope.row.drug.sum_count) {
508
             this.$message.error(scope.row.drug_name + '库存不足')
510
             this.$message.error(scope.row.drug_name + '库存不足')
509
           }
511
           }
510
         } else {
512
         } else {
511
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
513
+          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
512
             this.$message.error(scope.row.drug_name + '库存不足')
514
             this.$message.error(scope.row.drug_name + '库存不足')
513
           }
515
           }
514
         }
516
         }

+ 20 - 10
src/xt_pages/hospitalStation/doctorDesk.vue Прегледај датотеку

122
                                    ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
122
                                    ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
123
                                    :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
123
                                    :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
124
                                    :org_id="org_id" @editKeepLoad="editKeepLoad"
124
                                    :org_id="org_id" @editKeepLoad="editKeepLoad"
125
+                                   v-on:getSunziValue="getSunziValue"
125
                                    v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
126
                                    v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
126
 
127
 
127
 
128
 
334
         fullHeight: document.documentElement.clientHeight,
335
         fullHeight: document.documentElement.clientHeight,
335
         month_prescriptions: [],
336
         month_prescriptions: [],
336
         isloading: false,
337
         isloading: false,
338
+        loading:false,
337
         prescriptions: [
339
         prescriptions: [
338
           {
340
           {
339
             name: '处方1',
341
             name: '处方1',
399
       }
401
       }
400
     },
402
     },
401
     methods: {
403
     methods: {
404
+     getSunziValue(val){
405
+       console.log("孙子发来的信息",val)
406
+       this.getInitData()
407
+     },
402
       editKeepLoad(data){
408
       editKeepLoad(data){
403
         this.saveLoading = data
409
         this.saveLoading = data
404
       },
410
       },
990
             return false
996
             return false
991
           } else {
997
           } else {
992
             var drugs = response.data.data.drugs
998
             var drugs = response.data.data.drugs
993
-            for(let i=0;i<drugs.length;i++){
994
-                drugs[i].count = 0
995
-              if(drugs[i].stock_in.length > 0){
996
-                 for(let j=0;j<drugs[i].stock_in.length;j++){
997
-                    drugs[i].count += (drugs[i].stock_in[j].stock_max_number * drugs[i].min_number + drugs[i].stock_in[j].stock_min_number)
998
-                 }
999
-              }
1000
-            }
999
+            // for(let i=0;i<drugs.length;i++){
1000
+            //     drugs[i].count = 0
1001
+            //   if(drugs[i].stock_in.length > 0){
1002
+            //      for(let j=0;j<drugs[i].stock_in.length;j++){
1003
+            //         drugs[i].count += (drugs[i].stock_in[j].stock_max_number * drugs[i].min_number + drugs[i].stock_in[j].stock_min_number)
1004
+            //      }
1005
+            //   }
1006
+            // }
1001
 
1007
 
1002
             this.drugs = drugs
1008
             this.drugs = drugs
1003
-            console.log("所有药品信息",this.drugs)
1009
+           
1004
             this.allDrugs = response.data.data.drugs
1010
             this.allDrugs = response.data.data.drugs
1005
             this.advices_template = response.data.data.advices_template
1011
             this.advices_template = response.data.data.advices_template
1006
-
1012
+          
1007
             this.department = response.data.data.department
1013
             this.department = response.data.data.department
1008
             this.sick = response.data.data.sick
1014
             this.sick = response.data.data.sick
1015
+          
1009
             this.diagnoses = response.data.data.diagnose
1016
             this.diagnoses = response.data.data.diagnose
1010
             this.additions = response.data.data.additions
1017
             this.additions = response.data.data.additions
1011
 
1018
 
1013
         })
1020
         })
1014
 
1021
 
1015
       },
1022
       },
1023
+      getInitDataOne(val){
1024
+        this.prescriptions = val
1025
+      },
1016
       getList() {
1026
       getList() {
1017
         let params = {
1027
         let params = {
1018
           'record_date': this.record_date,
1028
           'record_date': this.record_date,

+ 2 - 1
src/xt_pages/outpatientCharges/components/dayPrescriptionTable.vue Прегледај датотеку

261
           }
261
           }
262
         })
262
         })
263
 
263
 
264
-      },deleteDrug:function(index, row){
264
+      },
265
+      deleteDrug:function(index, row){
265
         if(this.prescription.order_status == 2){
266
         if(this.prescription.order_status == 2){
266
           this.$message.error('该处方已经结算,无法删除')
267
           this.$message.error('该处方已经结算,无法删除')
267
           return
268
           return

+ 251 - 69
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Прегледај датотеку

164
                         <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables"
164
                         <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables"
165
                                             :prescription="curPrescriptions"
165
                                             :prescription="curPrescriptions"
166
                                             :preDrugs="preDrugs"
166
                                             :preDrugs="preDrugs"
167
-                                            :activeType="customTabIndex"></prescription-table>
167
+                                            :activeType="customTabIndex"
168
+                                            v-on="$listeners"
169
+                                            v-bind="$attrs"
170
+                                            ></prescription-table>
168
 
171
 
169
 
172
 
170
                     </el-tabs>
173
                     </el-tabs>
285
                                         </el-table-column>
288
                                         </el-table-column>
286
                                         <el-table-column label="库存" width="60">
289
                                         <el-table-column label="库存" width="60">
287
                                             <template slot-scope="scope">
290
                                             <template slot-scope="scope">
288
-                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9919 || org_id == 10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id ==9956 || org_id == 10188 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 ||org_id ==10340">
291
+                                               <!-- <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9919 || org_id == 10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id ==9956 || org_id == 10188 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==record_date ||org_id ==10340">
289
                                                <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>
292
                                                <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>
290
                                                <span v-if="scope.row.count%scope.row.min_number>0"> {{scope.row.count%scope.row.min_number}}{{scope.row.min_unit}}</span>
293
                                                <span v-if="scope.row.count%scope.row.min_number>0"> {{scope.row.count%scope.row.min_number}}{{scope.row.min_unit}}</span>
291
                                               </span>
294
                                               </span>
292
-                                              <span v-else> {{scope.row.total}}{{scope.row.total?scope.row.min_unit:''}}</span>
293
-
295
+                                              <span v-else> {{scope.row.total}}{{scope.row.total?scope.row.min_unit:''}}</span> -->
296
+                                               <span v-if="scope.row.sum_count >0 && scope.row.max_unit!=scope.row.min_unit && scope.row.sum_count/scope.row.min_number >0">{{Math.floor(scope.row.sum_count/scope.row.min_number)}}{{scope.row.max_unit}}</span>
297
+                                               <span v-if="scope.row.sum_count >0 && scope.row.max_unit!=scope.row.min_unit && scope.row.sum_count%scope.row.min_number >0">{{Math.floor(scope.row.sum_count%scope.row.min_number)}}{{scope.row.min_unit}}</span>
298
+                                               <span v-if="scope.row.sum_count >0 && scope.row.max_unit == scope.row.min_unit">{{scope.row.sum_count}}{{scope.row.max_unit}}</span>
294
                                             </template>
299
                                             </template>
295
                                         </el-table-column>
300
                                         </el-table-column>
296
                                         <el-table-column label="单价" width="40">
301
                                         <el-table-column label="单价" width="40">
382
                                         </el-table-column>
387
                                         </el-table-column>
383
                                         <el-table-column label="库存" width="40">
388
                                         <el-table-column label="库存" width="40">
384
                                             <template slot-scope="scope">
389
                                             <template slot-scope="scope">
385
-                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9919 || org_id == 10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10188 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
390
+                                              <!-- <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9919 || org_id == 10106 || org_id == 9504 || org_id ==10215 || org_id == 10188 || org_id == 10265 || org_id == 10164 || org_id == 9956 || org_id == 10188 || org_id == 10191 || org_id == 10278 || org_id == 10217 || org_id ==10210 || org_id ==10318 || org_id ==10340">
386
                                                    {{scope.row.stock_count}}
391
                                                    {{scope.row.stock_count}}
387
                                               </span>
392
                                               </span>
388
-                                              <span v-else> {{ scope.row.total }}</span>
393
+                                              <span v-else> {{ scope.row.total }}</span> -->
394
+                                              <span v-if="scope.row.type == 3 && scope.row.good_info.sum_count > 0">{{scope.row.good_info.sum_count}}</span>
389
                                             </template>
395
                                             </template>
390
                                         </el-table-column>
396
                                         </el-table-column>
391
                                         <el-table-column label="单价" width="40">
397
                                         <el-table-column label="单价" width="40">
1291
         })
1297
         })
1292
 
1298
 
1293
       }, saveTemplate(val) {
1299
       }, saveTemplate(val) {
1300
+        
1294
         let params = {
1301
         let params = {
1295
           name: val.name,
1302
           name: val.name,
1296
           mode: val.mode,
1303
           mode: val.mode,
1299
         let data = {
1306
         let data = {
1300
           'prescriptions': val.prescriptions
1307
           'prescriptions': val.prescriptions
1301
         }
1308
         }
1309
+      
1302
         createdTemplate(params, data).then(response => {
1310
         createdTemplate(params, data).then(response => {
1303
           if (response.data.state == 1) {
1311
           if (response.data.state == 1) {
1304
             this.$refs.saveTemplate.hide()
1312
             this.$refs.saveTemplate.hide()
1305
-
1306
             this.$message.success('保存成功')
1313
             this.$message.success('保存成功')
1314
+          
1307
           } else {
1315
           } else {
1308
             this.$message.error(response.data.msg)
1316
             this.$message.error(response.data.msg)
1309
           }
1317
           }
1807
       },
1815
       },
1808
 
1816
 
1809
       tabclickEvent(val) {
1817
       tabclickEvent(val) {
1818
+       
1810
         for (let i = 0; i < this.prescriptions.length; i++) {
1819
         for (let i = 0; i < this.prescriptions.length; i++) {
1811
           if (this.prescriptions[i].name == val.name) {
1820
           if (this.prescriptions[i].name == val.name) {
1812
             this.prescription_id = this.prescriptions[i].id
1821
             this.prescription_id = this.prescriptions[i].id
2187
         }
2196
         }
2188
       },
2197
       },
2189
       open(index, isLoading) {
2198
       open(index, isLoading) {
2199
+
2200
+        if(this.curStatus == 0){
2201
+          this.prescriptions = []
2202
+        }
2190
         if(!isLoading){
2203
         if(!isLoading){
2191
           if (this.dayorMonth == 'day') {
2204
           if (this.dayorMonth == 'day') {
2192
             if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2205
             if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2381
               }
2394
               }
2382
               isLoading = true
2395
               isLoading = true
2383
               console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2396
               console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2397
+              console.log('this.prescriptionsthis.prescriptions', params)
2384
               let num = 0
2398
               let num = 0
2385
               // this.prescriptions.map(item => {
2399
               // this.prescriptions.map(item => {
2386
               //   if (item.advices.length > 0) {
2400
               //   if (item.advices.length > 0) {
2395
               //   }
2409
               //   }
2396
               // })
2410
               // })
2397
               if (num == 0) {
2411
               if (num == 0) {
2412
+                var arr = []//新增处方
2413
+                var arr_one = []
2414
+                console.log("ooo233323233232323232",this.prescriptions)
2415
+                for(let i=0;i<this.prescriptions.length;i++){
2416
+                  if(this.prescriptions[i].id == 0){ 
2417
+                    for(let j=0;j<this.prescriptions[i].advices.length;j++){
2418
+                       arr.push(this.prescriptions[i].advices[j])
2419
+                    }
2420
+                    console.log("arr99999999999999",arr)
2421
+                    if(arr.length > 0){
2422
+                      let objInfo = {};
2423
+                      arr.forEach((item, index) => {
2424
+                      let { id } = item.id;
2425
+                      if (!objInfo[id]) {
2426
+                          objInfo[id] = {
2427
+                            drug_id:item.drug.id,
2428
+                            child: [],
2429
+                            sum_count:item.drug.sum_count,
2430
+                            out_count:0,
2431
+                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit,
2432
+
2433
+                          };
2434
+                        }
2435
+                      });
2436
+                      let newArr = Object.values(objInfo);
2437
+                   
2438
+                      
2439
+                      for(let i=0;i<arr.length;i++){
2440
+                        for(let j=0;j<newArr.length;j++){
2441
+                          if(arr[i].id == newArr[j].drug_id){
2442
+                            newArr[j].child.push(arr[i])
2443
+                          }
2444
+                        }
2445
+                      }
2446
+                      console.log("河滨232332newArr",newArr)
2447
+                      if(newArr.length >0){
2448
+                        for(let i=0;i<newArr.length;i++){
2449
+                          for(let j=0;j<newArr[i].child.length;j++){
2450
+                            //  newArr[i].child[j].prescribing_number_total = 0
2451
+                            if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.max_unit && newArr[i].child[j].drug.max_unit!=newArr[i].child[j].drug.min_unit){
2452
+                                newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number) * newArr[i].child[j].drug.min_number
2453
+                            }
2454
+                            if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.min_unit && newArr[i].child[j].drug.max_unit!=newArr[i].child[j].drug.min_unit){
2455
+                              newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number)
2456
+                             } 
2457
+                             if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.max_unit && newArr[i].child[j].drug.max_unit ==newArr[i].child[j].drug.min_unit){
2458
+                                newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number)
2459
+                             } 
2460
+                          }
2461
+                        }
2462
+                         console.log("wodeshju",newArr)
2463
+                         for(let i=0;i<newArr.length;i++){
2464
+                          for(let j=0;j<newArr[i].child.length;j++){
2465
+                             newArr[i].out_count +=  newArr[i].child[j].prescribing_number_total
2466
+                          }
2467
+                        }
2468
+                      }
2469
+                      
2470
+                      if(newArr.length > 0){
2471
+                        for(let i=0;i<newArr.length;i++){
2472
+                          if(newArr[i].out_count > newArr[i].sum_count){
2473
+                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2474
+                            isLoading = false
2475
+                            this.$emit('editKeepLoad', false)
2476
+                            return
2477
+                          }
2478
+                        }
2479
+                      }
2480
+                      console.log("newArr",newArr )
2481
+                    }
2482
+                  }
2398
 
2483
 
2484
+                  if(this.prescriptions[i].id > 0){ //修改处方
2485
+                     
2486
+                     for(let j=0;j<this.prescriptions[i].advices.length;j++){
2487
+                       if(this.prescriptions[i].advices[j].advice_id == 0){ //新增列
2488
+                         arr_one.push(this.prescriptions[i].advices[j])
2489
+                       }
2490
+                     }
2491
+                     console.log("ara23322323233232",arr)
2492
+                     if(arr_one.length > 0){
2493
+                      let objInfo = {};
2494
+                      arr_one.forEach((item, index) => {
2495
+                      let { id } = item.id;
2496
+                      if (!objInfo[id]) {
2497
+                          objInfo[id] = {
2498
+                            drug_id:item.drug.id,
2499
+                            child: [],
2500
+                            sum_count:item.drug.sum_count,
2501
+                            out_count:0,
2502
+                            str:item.drug.drug_name + " "+item.drug.dose + item.drug.dose_unit + "*" + item.drug.min_number + item.drug.min_unit+"/"+item.drug.max_unit
2503
+                          };
2504
+                        }
2505
+                      });
2506
+                      let newArr = Object.values(objInfo);
2507
+                      console.log("newArr",newArr)
2508
+                      
2509
+                      for(let i=0;i<arr_one.length;i++){
2510
+                        for(let j=0;j<newArr.length;j++){
2511
+                          if(arr_one[i].id == newArr[j].drug_id){
2512
+                            newArr[j].child.push(arr_one[i])
2513
+                          }
2514
+                        }
2515
+                      }
2516
+                      
2517
+                      if(newArr.length >0){
2518
+                        for(let i=0;i<newArr.length;i++){
2519
+                          for(let j=0;j<newArr[i].child.length;j++){
2520
+                            if(newArr[i].child[j].prescribing_number_unit == newArr[i].child[j].drug.max_unit){
2521
+                                newArr[i].child[j].prescribing_number_total = parseInt(newArr[i].child[j].prescribing_number) * newArr[i].child[j].drug.min_number
2522
+                            }  
2523
+                            newArr[i].out_count +=  newArr[i].child[j].prescribing_number_total
2524
+                          }
2525
+                        }
2526
+                      }
2527
+                      console.log("new233223322323",newArr)
2528
+                      if(newArr.length > 0){
2529
+                        for(let i=0;i<newArr.length;i++){
2530
+                          if(newArr[i].out_count > newArr[i].sum_count){
2531
+                            this.$message.error(newArr[i].str + "库存不足,保存失败!")
2532
+                            isLoading = false
2533
+                            this.$emit('editKeepLoad', false)
2534
+                            return
2535
+                          }
2536
+                        }
2537
+                      }
2538
+                      console.log("newArr",newArr )
2539
+                    }
2540
+                  }
2541
+                }
2542
+               
2399
                 createHisPrescription(data, params).then(response => {
2543
                 createHisPrescription(data, params).then(response => {
2400
                   if (response.data.state == 1) {
2544
                   if (response.data.state == 1) {
2401
                     this.$emit('change', this.patientInfo.id)
2545
                     this.$emit('change', this.patientInfo.id)
2402
-                    this.$message.success('保存成功')
2546
+                    this.$message.success('保存成功!')
2403
                     this.$emit('editKeepLoad', false)
2547
                     this.$emit('editKeepLoad', false)
2548
+                    this.$parent.getInitData()
2404
                   } else {
2549
                   } else {
2405
                     this.$message.error(response.data.msg)
2550
                     this.$message.error(response.data.msg)
2406
                     this.$emit('editKeepLoad', false)
2551
                     this.$emit('editKeepLoad', false)
2552
+                    
2407
                   }
2553
                   }
2408
                 })
2554
                 })
2409
               }
2555
               }
2566
 
2712
 
2567
       },
2713
       },
2568
       removeTab(targetName) {
2714
       removeTab(targetName) {
2715
+        console.log("处方了免费打打啊发发大发阿道夫")
2569
         if (this.curPrescriptions.order_status == 2 || this.curPrescriptions.order_status == 5) {
2716
         if (this.curPrescriptions.order_status == 2 || this.curPrescriptions.order_status == 5) {
2570
           this.$message.error('该处方已经结算或者记账,无法删除')
2717
           this.$message.error('该处方已经结算或者记账,无法删除')
2571
           return
2718
           return
2598
             }
2745
             }
2599
             this.editableTabsValue = activeName
2746
             this.editableTabsValue = activeName
2600
             this.prescriptions = tabs.filter(tab => tab.name !== targetName)
2747
             this.prescriptions = tabs.filter(tab => tab.name !== targetName)
2601
-
2748
+           
2602
             for (let i = 0; i < this.prescriptions.length; i++) {
2749
             for (let i = 0; i < this.prescriptions.length; i++) {
2603
               if (activeName == this.prescriptions[i].name) {
2750
               if (activeName == this.prescriptions[i].name) {
2604
                 this.curPrescriptions = this.prescriptions[i]
2751
                 this.curPrescriptions = this.prescriptions[i]
2610
                 }
2757
                 }
2611
               }
2758
               }
2612
             }
2759
             }
2760
+            console.log("oo233232233232323",this.prescriptions)
2613
             if (this.prescriptions.length == 0) {
2761
             if (this.prescriptions.length == 0) {
2614
               this.curPrescriptions = []
2762
               this.curPrescriptions = []
2615
               this.curStatus = 0
2763
               this.curStatus = 0
2616
             }
2764
             }
2765
+            this.$parent.getInitDataOne(this.prescriptions)
2617
           } else {
2766
           } else {
2618
             let params = {
2767
             let params = {
2619
               'id': id
2768
               'id': id
2620
             }
2769
             }
2621
             delHisPrescription(params).then(response => {
2770
             delHisPrescription(params).then(response => {
2622
               if (response.data.state == 1) {
2771
               if (response.data.state == 1) {
2623
-                this.$message.success('删除成功')
2772
+                this.$message.success('删除成功!')
2624
                 let tabs = this.prescriptions
2773
                 let tabs = this.prescriptions
2625
                 let activeName = this.editableTabsValue
2774
                 let activeName = this.editableTabsValue
2775
+                console.log("targetName",targetName)
2776
+                console.log("activeName",activeName)
2626
                 if (activeName === targetName) {
2777
                 if (activeName === targetName) {
2627
                   tabs.forEach((tab, index) => {
2778
                   tabs.forEach((tab, index) => {
2628
                     if (tab.name === targetName) {
2779
                     if (tab.name === targetName) {
2636
                 }
2787
                 }
2637
                 this.editableTabsValue = activeName
2788
                 this.editableTabsValue = activeName
2638
                 this.prescriptions = tabs.filter(tab => tab.name !== targetName)
2789
                 this.prescriptions = tabs.filter(tab => tab.name !== targetName)
2639
-
2790
+               
2640
                 for (let i = 0; i < this.prescriptions.length; i++) {
2791
                 for (let i = 0; i < this.prescriptions.length; i++) {
2641
                   if (activeName == this.prescriptions[i].name) {
2792
                   if (activeName == this.prescriptions[i].name) {
2642
                     this.curPrescriptions = this.prescriptions[i]
2793
                     this.curPrescriptions = this.prescriptions[i]
2648
                     }
2799
                     }
2649
                   }
2800
                   }
2650
                 }
2801
                 }
2802
+              
2651
                 if (this.prescriptions.length == 0) {
2803
                 if (this.prescriptions.length == 0) {
2652
                   this.curPrescriptions = []
2804
                   this.curPrescriptions = []
2653
                   this.curStatus = 0
2805
                   this.curStatus = 0
2654
                 }
2806
                 }
2807
+                
2808
+                this.$parent.getInitData()
2809
+                this.$parent.getInitDataOne(this.prescriptions)
2810
+                console.log("删除后的数据是",this.prescriptions)
2655
               } else {
2811
               } else {
2656
-                this.$message.success(response.data.msg)
2812
+                this.$message.error(response.data.msg)
2657
               }
2813
               }
2658
             })
2814
             })
2659
           }
2815
           }
2739
         this.$refs.additionalCharges.show()
2895
         this.$refs.additionalCharges.show()
2740
       },
2896
       },
2741
       selectDrugs(selection, row) {
2897
       selectDrugs(selection, row) {
2742
-        console.log('selection', selection)
2743
-        console.log('row', row)
2744
-        if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10188 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id ==10215 || this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10188 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340){
2745
-            if (row.count <= 0) {
2746
-              if (selection) {
2747
-                selection.forEach(row => {
2748
-                  if (row.count <= 0) {
2749
-                    this.$refs.multipleTable.toggleRowSelection(row)
2750
-                  }
2751
-                })
2752
-              } else {
2753
-                this.$refs.multipleTable.clearSelection()
2754
-              }
2755
-              this.$message.error(row.drug_name + '库存不足')
2756
-              return
2757
-            }
2758
-        }else{
2759
-           if (row.total <= 0) {
2760
-              if (selection) {
2761
-                selection.forEach(row => {
2762
-                  if (row.total <= 0) {
2763
-                    this.$refs.multipleTable.toggleRowSelection(row)
2764
-                  }
2765
-                })
2766
-              } else {
2767
-                this.$refs.multipleTable.clearSelection()
2898
+        //console.log("row233232233232",row)
2899
+        // if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10188 || this.org_id == 10245 || this.org_id == 9919 || this.org_id == 10106 || this.org_id == 9504 || this.org_id ==10215 || this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10188 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340){
2900
+        //     if (row.count <= 0) {
2901
+        //       if (selection) {
2902
+        //         selection.forEach(row => {
2903
+        //           if (row.count <= 0) {
2904
+        //             this.$refs.multipleTable.toggleRowSelection(row)
2905
+        //           }
2906
+        //         })
2907
+        //       } else {
2908
+        //         this.$refs.multipleTable.clearSelection()
2909
+        //       }
2910
+        //       this.$message.error(row.drug_name + '库存不足')
2911
+        //       return
2912
+        //     }
2913
+        // }else{
2914
+        //    if (row.total <= 0) {
2915
+        //       if (selection) {
2916
+        //         selection.forEach(row => {
2917
+        //           if (row.total <= 0) {
2918
+        //             this.$refs.multipleTable.toggleRowSelection(row)
2919
+        //           }
2920
+        //         })
2921
+        //       } else {
2922
+        //         this.$refs.multipleTable.clearSelection()
2923
+        //       }
2924
+        //       this.$message.error(row.drug_name + '库存不足')
2925
+        //       return
2926
+        //     }
2927
+        // }
2928
+
2929
+        if (row.sum_count <= 0) {
2930
+          if (selection) {
2931
+            selection.forEach(row => {
2932
+              if (row.sum_count <= 0) {
2933
+                this.$refs.multipleTable.toggleRowSelection(row)
2768
               }
2934
               }
2769
-              this.$message.error(row.drug_name + '库存不足')
2770
-              return
2771
-            }
2772
-        }
2935
+            })
2936
+          } else {
2937
+            this.$refs.multipleTable.clearSelection()
2938
+          }
2939
+          this.$message.error(row.drug_name + '库存不足')
2940
+          return
2941
+         }
2773
 
2942
 
2774
         this.curDrugs = selection
2943
         this.curDrugs = selection
2775
       },
2944
       },
2844
 
3013
 
2845
           return
3014
           return
2846
         }
3015
         }
2847
-        console.log('this.teamList', this.teamList)
2848
-        console.log('this.curPrescriptions.project', this.curPrescriptions.project)
3016
+
2849
         for (let i = 0; i < this.teamList.length; i++) {
3017
         for (let i = 0; i < this.teamList.length; i++) {
2850
           for (let a = 0; a < this.curPrescriptions.project.length; a++) {
3018
           for (let a = 0; a < this.curPrescriptions.project.length; a++) {
2851
             if (this.teamList[i].id == this.curPrescriptions.project[a].project_id && this.teamList[i].type == this.curPrescriptions.project[a].type) {
3019
             if (this.teamList[i].id == this.curPrescriptions.project[a].project_id && this.teamList[i].type == this.curPrescriptions.project[a].type) {
2888
             var temp2 = this.deepClone(this.teamList)
3056
             var temp2 = this.deepClone(this.teamList)
2889
 
3057
 
2890
             var temp3 = this.deepClone(templateDrugs)
3058
             var temp3 = this.deepClone(templateDrugs)
2891
-            console.log('hhhhhhhhhhhhhh', temp)
2892
-            console.log('hhhh23', temp2)
2893
-            console.log('hhhh23', temp3)
3059
+           
2894
             if (temp3.length > 0) {
3060
             if (temp3.length > 0) {
2895
               for (let b = 0; b < temp3.length; b++) {
3061
               for (let b = 0; b < temp3.length; b++) {
2896
                 let obj = {
3062
                 let obj = {
2950
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
3116
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
2951
                   obj.prescribing_number = 1
3117
                   obj.prescribing_number = 1
2952
                 }
3118
                 }
2953
-                console.log('obj', obj)
3119
+               
2954
                 this.prescriptions[i].advices.push(obj)
3120
                 this.prescriptions[i].advices.push(obj)
2955
               }
3121
               }
2956
               this.curStatus = 1
3122
               this.curStatus = 1
3021
       },
3187
       },
3022
       selectChange(selection, row) {
3188
       selectChange(selection, row) {
3023
         console.log('row', row)
3189
         console.log('row', row)
3024
-        if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id ==3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10188 || this.org_id ==10245 || this.org_id == 9919  || this.org_id == 10106 || this.org_id == 9504 || this.org_id ==10215 ||  this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10188 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340){
3025
-           if (row.stock_count <= 0) {
3190
+        // if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id ==3877 || this.org_id == 10028 || this.org_id == 10243 || this.org_id == 10188 || this.org_id ==10245 || this.org_id == 9919  || this.org_id == 10106 || this.org_id == 9504 || this.org_id ==10215 ||  this.org_id == 10188 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 9956 || this.org_id == 10188 || this.org_id == 10191 || this.org_id == 10278 || this.org_id == 10217 || this.org_id ==10210 || this.org_id ==10318 || this.org_id ==10340){
3191
+        //    if (row.stock_count <= 0) {
3192
+        //     if (row.type == 3) {
3193
+        //       if (selection) {
3194
+        //         selection.forEach(row => {
3195
+        //           if (row.stock_count <= 0) {
3196
+        //             this.$refs.tables.toggleRowSelection(row)
3197
+        //           }
3198
+        //         })
3199
+        //       } else {
3200
+        //         this.$refs.tables.clearSelection()
3201
+        //       }
3202
+        //       this.$message.error(row.project_name + '库存不足')
3203
+        //       return
3204
+        //     }
3205
+        //   }
3206
+        // }else{
3207
+        //    if (row.total <= 0) {
3208
+        //     if (row.type == 3) {
3209
+        //       if (selection) {
3210
+        //         selection.forEach(row => {
3211
+        //           if (row.total <= 0) {
3212
+        //             this.$refs.tables.toggleRowSelection(row)
3213
+        //           }
3214
+        //         })
3215
+        //       } else {
3216
+        //         this.$refs.tables.clearSelection()
3217
+        //       }
3218
+        //       this.$message.error(row.project_name + '库存不足')
3219
+        //       return
3220
+        //     }
3221
+        //   }
3222
+
3223
+        // }
3224
+
3225
+         if (row.stock_count <= 0) {
3026
             if (row.type == 3) {
3226
             if (row.type == 3) {
3027
               if (selection) {
3227
               if (selection) {
3028
                 selection.forEach(row => {
3228
                 selection.forEach(row => {
3035
               }
3235
               }
3036
               this.$message.error(row.project_name + '库存不足')
3236
               this.$message.error(row.project_name + '库存不足')
3037
               return
3237
               return
3038
-            }
3039
-          }
3040
-        }else{
3041
-           if (row.total <= 0) {
3042
-            if (row.type == 3) {
3043
-              if (selection) {
3044
-                selection.forEach(row => {
3045
-                  if (row.total <= 0) {
3046
-                    this.$refs.tables.toggleRowSelection(row)
3047
-                  }
3048
-                })
3049
-              } else {
3050
-                this.$refs.tables.clearSelection()
3051
-              }
3052
-              this.$message.error(row.project_name + '库存不足')
3053
-              return
3054
-            }
3055
           }
3238
           }
3056
-
3057
-        }
3239
+         }
3058
 
3240
 
3059
         this.teamList.push(row)
3241
         this.teamList.push(row)
3060
       },
3242
       },

+ 6 - 4
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue Прегледај датотеку

232
         }
232
         }
233
       }
233
       }
234
     },
234
     },
235
+
235
     data() {
236
     data() {
236
       return {
237
       return {
237
         advices: [],
238
         advices: [],
348
                   temp2.splice(index, 1)
349
                   temp2.splice(index, 1)
349
                   this.prescription.advices = temp2
350
                   this.prescription.advices = temp2
350
                   this.$message.success(response.data.data.msg)
351
                   this.$message.success(response.data.data.msg)
352
+                  this.$emit("getSunziValue",temp2)
351
                 }
353
                 }
352
               })
354
               })
353
 
355
 
452
         }
454
         }
453
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
455
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
454
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
456
           // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
455
-          if (scope.row.prescribing_number > scope.row.drug.total) {
457
+          if (scope.row.prescribing_number > scope.row.drug.sum_count) {
456
             this.$message.error(scope.row.drug_name + '库存不足')
458
             this.$message.error(scope.row.drug_name + '库存不足')
457
           }
459
           }
458
         } else {
460
         } else {
459
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
461
+          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
460
             this.$message.error(scope.row.drug_name + '库存不足')
462
             this.$message.error(scope.row.drug_name + '库存不足')
461
           }
463
           }
462
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
464
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
546
 
548
 
547
 
549
 
548
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
550
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
549
-          if (parseInt(scope.row.prescribing_number) > scope.row.drug.total) {
551
+          if (parseInt(scope.row.prescribing_number) > scope.row.drug.sum_count) {
550
             this.$message.error(scope.row.drug_name + '库存不足')
552
             this.$message.error(scope.row.drug_name + '库存不足')
551
           }
553
           }
552
         } else {
554
         } else {
553
-          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
555
+          if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.sum_count) {
554
             this.$message.error(scope.row.drug_name + '库存不足')
556
             this.$message.error(scope.row.drug_name + '库存不足')
555
           }
557
           }
556
         }
558
         }

+ 23 - 15
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Прегледај датотеку

155
                            :month_prescriptions="month_prescriptions"
155
                            :month_prescriptions="month_prescriptions"
156
                            :org_id="org_id"
156
                            :org_id="org_id"
157
                            ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
157
                            ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
158
+                           v-on:getSunziValue = "getSunziValue"
158
                            :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)" @editKeepLoad="editKeepLoad"
159
                            :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)" @editKeepLoad="editKeepLoad"
159
                            v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
160
                            v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
160
 
161
 
425
       org_id: 0
426
       org_id: 0
426
     }
427
     }
427
   },
428
   },
429
+
428
   methods: {
430
   methods: {
431
+    getSunziValue(val){
432
+    //  this.drugs=[]
433
+     this.getInitData()
434
+    },
429
     editKeepLoad(data) {
435
     editKeepLoad(data) {
430
       this.saveLoading = data
436
       this.saveLoading = data
431
     },
437
     },
1222
           return false
1228
           return false
1223
         } else {
1229
         } else {
1224
           var drugs = response.data.data.drugs
1230
           var drugs = response.data.data.drugs
1225
-          for (let i = 0; i < drugs.length; i++) {
1226
-            drugs[i].count = 0
1227
-            if (drugs[i].stock_in != null) {
1228
-              if (drugs[i].stock_in.length > 0) {
1229
-                for (let j = 0; j < drugs[i].stock_in.length; j++) {
1230
-                  drugs[i].count += (drugs[i].stock_in[j].stock_max_number * drugs[i].min_number + drugs[i].stock_in[j].stock_min_number)
1231
-                }
1232
-              }
1233
-            }
1234
-          }
1235
-          // if(drugs.){
1236
-
1231
+          console.log("232323322323332",this.prescriptions)
1232
+          // for (let i = 0; i < drugs.length; i++) {
1233
+          //   drugs[i].count = 0
1234
+          //   if (drugs[i].stock_in != null) {
1235
+          //     if (drugs[i].stock_in.length > 0) {
1236
+          //       for (let j = 0; j < drugs[i].stock_in.length; j++) {
1237
+          //         drugs[i].count += (drugs[i].stock_in[j].stock_max_number * drugs[i].min_number + drugs[i].stock_in[j].stock_min_number)
1238
+          //       }
1239
+          //     }
1240
+          //   }
1237
           // }
1241
           // }
1242
+       
1238
           this.drugs = drugs
1243
           this.drugs = drugs
1239
-          console.log('五一劳动节2332323322332', this.drugs)
1244
+        
1240
 
1245
 
1241
           this.allDrugs = response.data.data.drugs
1246
           this.allDrugs = response.data.data.drugs
1242
           this.advices_template = response.data.data.advices_template
1247
           this.advices_template = response.data.data.advices_template
1243
-
1248
+         
1244
           this.department = response.data.data.department
1249
           this.department = response.data.data.department
1245
           this.sick = response.data.data.sick
1250
           this.sick = response.data.data.sick
1246
           this.diagnoses = response.data.data.diagnose
1251
           this.diagnoses = response.data.data.diagnose
4591
       this.$refs.prescriptions.open_three()
4596
       this.$refs.prescriptions.open_three()
4592
     },
4597
     },
4593
     open(index) {
4598
     open(index) {
4594
-
4599
+    
4595
       this.index = index
4600
       this.index = index
4596
       if (index == 1) {
4601
       if (index == 1) {
4597
         this.$refs.prescriptions.open(1, this.saveLoading)
4602
         this.$refs.prescriptions.open(1, this.saveLoading)
4951
         }
4956
         }
4952
       })
4957
       })
4953
 
4958
 
4959
+    },
4960
+    getInitDataOne(val){
4961
+      this.prescriptions = val
4954
     }
4962
     }
4955
   },
4963
   },
4956
   created() {
4964
   created() {

+ 39 - 1
src/xt_pages/stock/cancelStockOrder.vue Прегледај датотеку

83
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
83
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
84
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
84
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
85
         <el-button size="small" type="primary" @click="toExport">导出</el-button>
85
         <el-button size="small" type="primary" @click="toExport">导出</el-button>
86
+
87
+        <span>&nbsp;&nbsp;</span>
88
+        <label class="title"><span class="name">审核状态</span> :</label>
89
+        <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
90
+            <el-option
91
+              v-for="(option, index) in checkList"
92
+              :key="index"
93
+              :label="option.name"
94
+              :value="option.id">
95
+            </el-option>
96
+        </el-select>  
86
       </div>
97
       </div>
87
 
98
 
88
       <el-row :gutter="12" style="margin-top: 10px">
99
       <el-row :gutter="12" style="margin-top: 10px">
126
             </template>
137
             </template>
127
           </el-table-column>
138
           </el-table-column>
128
 
139
 
140
+          <el-table-column label="审核状态" align="center">
141
+            <template slot-scope="scope">
142
+              <span v-if="scope.row.is_check == 1">已审核</span>
143
+              <span v-if="scope.row.is_check == 2">未审核</span>
144
+            </template>
145
+          </el-table-column>
146
+
129
           <el-table-column label="操作" align="center">
147
           <el-table-column label="操作" align="center">
130
             <template slot-scope="scope">
148
             <template slot-scope="scope">
131
               <el-tooltip
149
               <el-tooltip
345
       exportList:[],
363
       exportList:[],
346
       houseList:[],
364
       houseList:[],
347
       storehouse_id:0,
365
       storehouse_id:0,
366
+      check_type:0,
367
+      checkList:[
368
+       {id:0,name:"全部"},
369
+       {id:1,name:"已审核"},
370
+       {id:2,name:"未审核"},
371
+      ]
348
     };
372
     };
349
   },
373
   },
350
   methods: {
374
   methods: {
357
         type: this.type,
381
         type: this.type,
358
         keywords: this.searchKey,
382
         keywords: this.searchKey,
359
         storehouse_id:this.storehouse_id,
383
         storehouse_id:this.storehouse_id,
384
+        check_type:this.check_type,
360
       };
385
       };
361
       this.cancelStockDate = [];
386
       this.cancelStockDate = [];
362
       getCancelStockList(Params).then(response => {
387
       getCancelStockList(Params).then(response => {
386
         end_time: this.end_time,
411
         end_time: this.end_time,
387
         type: this.type,
412
         type: this.type,
388
         storehouse_id:this.storehouse_id,
413
         storehouse_id:this.storehouse_id,
414
+        check_type:this.check_type,
389
       };
415
       };
390
       this.cancelStockDate = [];
416
       this.cancelStockDate = [];
391
       getCancelStockList(Params).then(response => {
417
       getCancelStockList(Params).then(response => {
508
     },
534
     },
509
     handleEdit: function(index, row) {
535
     handleEdit: function(index, row) {
510
 
536
 
511
-      this.$router.push({"path":"/stock/cancel/cancelstockorderedit?id="+row.id})
537
+      this.$router.push({"path":"/stock/cancel/cancelstockorderedit?id="+row.id+"&is_check="+row.is_check+"&type="+row.type})
512
     },
538
     },
513
     handleDelete: function(index, row) {
539
     handleDelete: function(index, row) {
540
+      if(row.is_check == 1){
541
+        this.$message.error("已审核的单据不能删除!")
542
+        return false
543
+      }
514
       const ids = [];
544
       const ids = [];
515
       ids.push(row.id);
545
       ids.push(row.id);
516
       const idStr = ids.join(",");
546
       const idStr = ids.join(",");
566
       this.getCancelExportList()
596
       this.getCancelExportList()
567
     },
597
     },
568
     batchDelete() {
598
     batchDelete() {
599
+     
569
       if (this.selectedTableData.length <= 0) {
600
       if (this.selectedTableData.length <= 0) {
570
         this.$message.error("请选择要删除的记录");
601
         this.$message.error("请选择要删除的记录");
571
         return;
602
         return;
572
       }
603
       }
573
       const ids = [];
604
       const ids = [];
574
       for (let i = 0; i < this.selectedTableData.length; i++) {
605
       for (let i = 0; i < this.selectedTableData.length; i++) {
606
+        if(this.selectedTableData[i].is_check == 1){
607
+          this.$message.error("已审核的单据不能删除!");  
608
+          return
609
+        }
575
         ids.push(this.selectedTableData[i].id);
610
         ids.push(this.selectedTableData[i].id);
576
       }
611
       }
577
       const idStr = ids.join(",");
612
       const idStr = ids.join(",");
699
     },
734
     },
700
     changeStoreHouse(){
735
     changeStoreHouse(){
701
       this.GetCancelStock()
736
       this.GetCancelStock()
737
+    },
738
+    changeCheckType(){
739
+     this.GetCancelStock()
702
     }
740
     }
703
   }
741
   }
704
 };
742
 };

+ 113 - 37
src/xt_pages/stock/cancelStockOrderAdd.vue Прегледај датотеку

19
           type="primary"
19
           type="primary"
20
           @click="submit()"
20
           @click="submit()"
21
           class="filter-item"
21
           class="filter-item"
22
-          >保 存</el-button
22
+          >保 存</el-button>
23
+
24
+          <el-button
25
+          size="small"
26
+          type="primary"
27
+          @click="toCheck()"
28
+          class="filter-item"
29
+          v-show="showCheck"
30
+          >审核</el-button
23
         >
31
         >
24
       </div>
32
       </div>
25
     </div>
33
     </div>
154
           </el-table-column>
162
           </el-table-column>
155
           <el-table-column width="200" align="center">
163
           <el-table-column width="200" align="center">
156
             <template slot="header" slot-scope="scope">
164
             <template slot="header" slot-scope="scope">
157
-              <span>批次<span style="color: red"></span></span>
165
+              <span>批次<span style="color: red">*</span></span>
158
             </template>
166
             </template>
159
             <template slot-scope="scope">
167
             <template slot-scope="scope">
160
               <el-form-item
168
               <el-form-item
161
-                :prop="'recordData.' + scope.$index + '.return_count'"
169
+                :prop="'recordData.' + scope.$index + '.number'"
162
                 style="padding-top: 17px"
170
                 style="padding-top: 17px"
171
+                :rules="tableRules.number"
163
               >
172
               >
164
                <el-select v-model="scope.row.number" filterable placeholder="请选择">
173
                <el-select v-model="scope.row.number" filterable placeholder="请选择">
165
                   <el-option
174
                   <el-option
292
 
301
 
293
 <script>
302
 <script>
294
 import { uParseTime } from "@/utils/tools";
303
 import { uParseTime } from "@/utils/tools";
295
-import { postCancelStock,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber } from "@/api/stock";
304
+import { postCancelStock,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber,checkStockWarehouseInfo } from "@/api/stock";
296
 import BreadCrumb from "../components/bread-crumb";
305
 import BreadCrumb from "../components/bread-crumb";
297
 import StockInDialog from './Dialog/stockInDialog'
306
 import StockInDialog from './Dialog/stockInDialog'
298
 
307
 
322
       },
331
       },
323
       tableRules: {
332
       tableRules: {
324
         return_count: [
333
         return_count: [
325
-          { required: true, message: "数量不能为空", trigge: "blur" }
334
+          { required: true, message: "数量不能为空", trigger: "blur" }
326
         
335
         
327
         ],
336
         ],
328
-        // price: [
329
-        //   { required: true, message: "单价不能为空", trigge: "blur" }
330
-        // ]
337
+        price: [
338
+          { required: true, message: "单价不能为空", trigger: "blur" }
339
+        ],
340
+        number: [
341
+          { required: true, message: "批次不能为空", trigger: "blur" }
342
+        ]
331
       },
343
       },
332
       ruleForm: {
344
       ruleForm: {
333
         manufacturer: [
345
         manufacturer: [
358
       manufacturerList:[],
370
       manufacturerList:[],
359
       list:[],
371
       list:[],
360
       storehouse_id:"",
372
       storehouse_id:"",
373
+      cancel_stock_id:0,
374
+      showCheck:false,
361
     };
375
     };
362
   },
376
   },
363
   methods: {
377
   methods: {
453
       tempObj["total"] = ""
467
       tempObj["total"] = ""
454
       tempObj["warehouse_info_id"] =  0
468
       tempObj["warehouse_info_id"] =  0
455
       tempObj["xt_warehouse_info"] = []
469
       tempObj["xt_warehouse_info"] = []
470
+      tempObj["id"] = 0
456
       this.recordInfo.recordData.push(tempObj);
471
       this.recordInfo.recordData.push(tempObj);
457
     },
472
     },
458
     handleDelete: function(index, row) {
473
     handleDelete: function(index, row) {
461
         return;
476
         return;
462
       } else {
477
       } else {
463
         this.recordInfo.recordData.splice(index, 1);
478
         this.recordInfo.recordData.splice(index, 1);
479
+        if(row.id > 0){
480
+          const params = {
481
+            id: row.id
482
+          }
483
+          this.$confirm('确认删除该退库信息记录?', '删除退库信息记录', {
484
+            confirmButtonText: '确定',
485
+            cancelButtonText: '取消',
486
+            type: 'warning'
487
+          }).then(() => {
488
+            deleteCancelStockInfo(params).then(response => {
489
+              if (response.data.state == 0) {
490
+                this.$message.error(response.data.msg)
491
+                return false
492
+              } else {
493
+                this.$message.success('删除成功')
494
+                this.recordInfo.recordData.splice(index, 1)
495
+              }
496
+            })
497
+          }).catch(() => {
498
+          })
499
+        }
464
       }
500
       }
465
     },
501
     },
466
     calculate: function(val) {
502
     calculate: function(val) {
571
                   this.recordInfo.recordData[i].number = this.recordInfo.recordData[i].xt_warehouse_info[j].number
607
                   this.recordInfo.recordData[i].number = this.recordInfo.recordData[i].xt_warehouse_info[j].number
572
                   this.recordInfo.recordData[i].warehouse_info_id = this.recordInfo.recordData[i].xt_warehouse_info[j].id
608
                   this.recordInfo.recordData[i].warehouse_info_id = this.recordInfo.recordData[i].xt_warehouse_info[j].id
573
                }
609
                }
610
+               this.recordInfo.recordData[i].return_count = this.recordInfo.recordData[i].return_count.toString()
574
             }     
611
             }     
575
           }
612
           }
576
           const loading = this.$loading({
613
           const loading = this.$loading({
582
           const params = {
619
           const params = {
583
             cancelStock: this.recordInfo.recordData
620
             cancelStock: this.recordInfo.recordData
584
           };
621
           };
585
-         
586
           postCancelStock(
622
           postCancelStock(
587
             params,
623
             params,
588
             this.return_time,
624
             this.return_time,
590
             this.form.dealer,
626
             this.form.dealer,
591
             this.type,
627
             this.type,
592
             this.storehouse_id,
628
             this.storehouse_id,
629
+            this.cancel_stock_id
593
           ).then(response => {
630
           ).then(response => {
594
             if (response.data.state == 0) {
631
             if (response.data.state == 0) {
595
               this.$message.error(response.data.msg);
632
               this.$message.error(response.data.msg);
596
               loading.close()
633
               loading.close()
597
               return false;
634
               return false;
598
             } else {
635
             } else {
599
-             var msg =  response.data.data.msg
600
-             var good_name = response.data.data.good_name
601
-             var specification_name = response.data.data.specification_name
602
-             var storehose_name = response.data.data.storehouse_name
603
-            var str = storehose_name + " " + good_name +"*" + specification_name +"该批次退库数量大于出库数量"
604
-             if (msg == 1){
605
-                this.$message.error("无出库记录")
606
-                return
607
-             }
608
-             if(msg == 2){
609
-               this.$message.error(str)
610
-             }
611
-              if(msg == 4){
612
-               this.$message.error(str)
613
-             }
614
-             if(msg == 5){
615
-              this.$message.error(str)
616
-             }
617
-             if(msg == 3){
618
-               this.$notify({
619
-                title: "成功",
620
-                message: "退库成功",
621
-                type: "success",
622
-                duration: 2000
623
-              });
636
+             this.$message.success("保存成功!")
637
+             var cancelStock = response.data.data.cancelStock
638
+             this.cancel_stock_id = cancelStock.id
639
+             var list = response.data.data.list
640
+             var manufacturerList = response.data.data.manufacturerList
641
+             var dealerList = response.data.data.dealerList
642
+             for(let i=0;i<list.length;i++){
643
+               for(let j=0;j<dealerList.length;j++){
644
+                    if(list[i].dealer == dealerList[i].id){
645
+                      list[i].dealer = dealerList[i].dealer_name
646
+                    }
647
+                }
648
+                for(let s=0;s<manufacturerList.length;s++){
649
+                  if(list[i].manufacturer == manufacturerList[s].id){
650
+                      list[i].manufacturer = manufacturerList[s].manufacturer_name
651
+                  }
652
+                } 
653
+                list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
654
+                list[i].product_date = this.getTimeOne(list[i].product_date)
655
+                list[i].good_name = list[i].GoodInfo.good_name
656
+                list[i].name = list[i].GoodInfo.specification_name
657
+                list[i].return_count = list[i].count
658
+              }
624
               this.recordInfo.recordData = [];
659
               this.recordInfo.recordData = [];
625
-              this.$router.back(-1);
626
-             }  
660
+              this.recordInfo.recordData = list
661
+              this.showCheck = true
662
+              // this.$router.back(-1);
663
+             
627
              loading.close()      
664
              loading.close()      
628
             }
665
             }
629
           });
666
           });
678
       this.currentIndex = val
715
       this.currentIndex = val
679
     },
716
     },
680
     handleSelect(val){
717
     handleSelect(val){
681
-     
718
+      console.log("val23233232",val)
682
       for(let i=0;i<this.recordInfo.recordData.length;i++){
719
       for(let i=0;i<this.recordInfo.recordData.length;i++){
683
         if(this.currentIndex == i){
720
         if(this.currentIndex == i){
721
+          this.recordInfo.recordData[i].register_account = val.number
684
           this.recordInfo.recordData[i].good_name = val.good_name
722
           this.recordInfo.recordData[i].good_name = val.good_name
685
           this.recordInfo.recordData[i].good_type_id = val.good_type_id
723
           this.recordInfo.recordData[i].good_type_id = val.good_type_id
686
           this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
724
           this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
718
         }
756
         }
719
      })
757
      })
720
     },
758
     },
759
+    getTimeOne(val) {
760
+        if(val < 0){
761
+          return ""
762
+        }
763
+        if(val == ""){
764
+        return ""
765
+        }else {
766
+        return uParseTime(val, '{y}-{m}-{d}')
767
+        }
768
+     },
769
+    toCheck(){
770
+       const loading = this.$loading({
771
+          lock: true,
772
+          text: 'Loading',
773
+          spinner: 'el-icon-loading',
774
+          background: 'rgba(0, 0, 0, 0.7)'
775
+        })
776
+       var params = {
777
+         cancel_stock_id:this.cancel_stock_id,
778
+       }
779
+      checkStockWarehouseInfo(params).then(response=>{
780
+         if(response.data.state == 1){
781
+          if(response.data.data.msg == 1){
782
+            this.$message.success("审核成功!")
783
+            loading.close()
784
+            this.$router.back(-1);
785
+          }
786
+          if(response.data.data.msg == 2){
787
+            var good_name = response.data.data.good_name
788
+            var specification_name = response.data.data.specification_name
789
+            var str = good_name + specification_name +"退库数量大于出库数量,审核失败!"
790
+            this.$message.error(str)
791
+            loading.close()
792
+          }
793
+         }
794
+      })
795
+    }
721
   },
796
   },
722
   created() {
797
   created() {
723
     var nowDate = new Date();
798
     var nowDate = new Date();
744
     tempObj["total"] = ""
819
     tempObj["total"] = ""
745
     tempObj["warehouse_info_id"] = 0
820
     tempObj["warehouse_info_id"] = 0
746
     tempObj["xt_warehouse_info"] = []
821
     tempObj["xt_warehouse_info"] = []
822
+    tempObj["id"] = 0
747
     this.recordInfo.recordData.push(tempObj);
823
     this.recordInfo.recordData.push(tempObj);
748
     this.GetConfigInfo();
824
     this.GetConfigInfo();
749
     this.propForm.goodUnit = this.$store.getters.good_unit;
825
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 106 - 33
src/xt_pages/stock/cancelStockOrderEdit.vue Прегледај датотеку

4
       <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
4
       <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
       <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
5
       <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
       <div style="float:right;">
6
       <div style="float:right;">
7
-        <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7
+        <el-button size="small"  @click="back()" class="filter-item">取 消</el-button>
8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
9
+        <el-button size="small"  type="primary" @click="toCheck()" class="filter-item" v-if="is_check == 2">审 核</el-button>
10
+        <el-button size="small"  type="primary" @click="toReturnCheck()" class="filter-item" v-if="is_check == 1">反 审 核</el-button>
9
       </div>
11
       </div>
10
     </div>
12
     </div>
11
     <div class="app-container">
13
     <div class="app-container">
29
         <label class="title"><span class="name">退库时间</span> : </label>
31
         <label class="title"><span class="name">退库时间</span> : </label>
30
         <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
32
         <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
31
                         type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
33
                         type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
32
-                        value-format="yyyy-MM-dd"></el-date-picker>
34
+                        value-format="yyyy-MM-dd" :disabled="disabled"></el-date-picker>
33
       </div>
35
       </div>
34
 
36
 
35
      
37
      
52
                     @select="handleSelect"
54
                     @select="handleSelect"
53
                     @input="changeGoodName(scope.$index)"
55
                     @input="changeGoodName(scope.$index)"
54
                     style="width:160px;"
56
                     style="width:160px;"
57
+                    :disabled="disabled"
55
                   >
58
                   >
56
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
59
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
57
                   <template slot-scope="{ item }">
60
                   <template slot-scope="{ item }">
70
             <template slot-scope="scope">
73
             <template slot-scope="scope">
71
 
74
 
72
               <el-form-item style="padding-top: 20px">
75
               <el-form-item style="padding-top: 20px">
73
-                <el-input placeholder="请输入规格名称" v-model="scope.row.name"></el-input>
76
+                <el-input placeholder="请输入规格名称" v-model="scope.row.name"  :disabled="disabled"></el-input>
74
               </el-form-item>
77
               </el-form-item>
75
 
78
 
76
             </template>
79
             </template>
84
             <template slot-scope="scope">
87
             <template slot-scope="scope">
85
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
88
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
86
                             style="padding-top: 17px">
89
                             style="padding-top: 17px">
87
-                <el-input type="number" v-model="scope.row.count"  oninput="value=value.replace(/\D|^0/g,'')"></el-input>
90
+                <el-input type="number" v-model="scope.row.count"  oninput="value=value.replace(/\D|^0/g,'')"  :disabled="disabled"></el-input>
88
               </el-form-item>
91
               </el-form-item>
89
             </template>
92
             </template>
90
           </el-table-column>
93
           </el-table-column>
102
                   placeholder="请输入单价"
105
                   placeholder="请输入单价"
103
                   type="number"
106
                   type="number"
104
                   v-model="scope.row.price"
107
                   v-model="scope.row.price"
108
+                  :disabled="disabled"
105
                 ></el-input>      
109
                 ></el-input>      
106
               </el-form-item>
110
               </el-form-item>
107
               <!-- {{scope.row.packing_unit}} -->
111
               <!-- {{scope.row.packing_unit}} -->
114
           </el-table-column>
118
           </el-table-column>
115
           <el-table-column width="200" align="center">
119
           <el-table-column width="200" align="center">
116
             <template slot="header" slot-scope="scope">
120
             <template slot="header" slot-scope="scope">
117
-              <span>批次<span style="color: red"></span></span>
121
+              <span>批次<span style="color: red">*</span></span>
118
             </template>
122
             </template>
119
             <template slot-scope="scope">
123
             <template slot-scope="scope">
120
               <el-form-item
124
               <el-form-item
121
-                :prop="'recordData.' + scope.$index + '.return_count'"
125
+                :prop="'recordData.' + scope.$index + '.number'"
122
                 style="padding-top: 17px"
126
                 style="padding-top: 17px"
127
+                :rules="tableRules.number"
123
               >
128
               >
124
-               <el-select v-model="scope.row.number" filterable placeholder="请选择" >
129
+               <el-select v-model="scope.row.number" filterable placeholder="请选择"  :disabled="disabled" >
125
                   <el-option
130
                   <el-option
126
                     v-for="(item,index) in scope.row.xt_warehouse_info"
131
                     v-for="(item,index) in scope.row.xt_warehouse_info"
127
                     :key="index"
132
                     :key="index"
141
                 :prop="'recordData.' + scope.$index + '.return_count'"
146
                 :prop="'recordData.' + scope.$index + '.return_count'"
142
                 style="padding-top: 17px"
147
                 style="padding-top: 17px"
143
               >
148
               >
144
-              <el-input v-model="scope.row.register_account"></el-input>
149
+              <el-input v-model="scope.row.register_account"  :disabled="disabled"></el-input>
145
               </el-form-item>
150
               </el-form-item>
146
             </template>
151
             </template>
147
           </el-table-column>
152
           </el-table-column>
148
            <el-table-column label="生产厂家" width="160" align="center">
153
            <el-table-column label="生产厂家" width="160" align="center">
149
             <template slot-scope="scope">
154
             <template slot-scope="scope">
150
-               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
155
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商"  :disabled="disabled">
151
                 <el-option
156
                 <el-option
152
                   v-for="(option, index) in manufacturerList"
157
                   v-for="(option, index) in manufacturerList"
153
                   :key="index"
158
                   :key="index"
162
           <el-table-column label="生产日期" width="180" align="center">
167
           <el-table-column label="生产日期" width="180" align="center">
163
             <template slot-scope="scope">
168
             <template slot-scope="scope">
164
               <el-date-picker
169
               <el-date-picker
170
+               :disabled="disabled"
165
                 prefix-icon="el-icon-date"
171
                 prefix-icon="el-icon-date"
166
                 style="width: 145px"
172
                 style="width: 145px"
167
                 v-model="scope.row.product_date"
173
                 v-model="scope.row.product_date"
175
           <el-table-column label="有效日期" width="180" align="center">
181
           <el-table-column label="有效日期" width="180" align="center">
176
             <template slot-scope="scope">
182
             <template slot-scope="scope">
177
               <el-date-picker
183
               <el-date-picker
184
+               :disabled="disabled"
178
                 prefix-icon="el-icon-date"
185
                 prefix-icon="el-icon-date"
179
                 style="width: 145px"
186
                 style="width: 145px"
180
                 v-model="scope.row.expiry_date"
187
                 v-model="scope.row.expiry_date"
188
 
195
 
189
         <el-table-column label="经销商" width="160" align="center">
196
         <el-table-column label="经销商" width="160" align="center">
190
             <template slot-scope="scope">
197
             <template slot-scope="scope">
191
-                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
198
+                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商"  :disabled="disabled">
192
                 <el-option
199
                 <el-option
193
                   v-for="(option, index) in dealerList"
200
                   v-for="(option, index) in dealerList"
194
                   :key="index"
201
                   :key="index"
208
                 :rules="tableRules.return_count"
215
                 :rules="tableRules.return_count"
209
                 style="padding-top: 17px"
216
                 style="padding-top: 17px"
210
               >
217
               >
211
-              <el-input v-model="scope.row.remark"></el-input>
218
+              <el-input v-model="scope.row.remark"  :disabled="disabled"></el-input>
212
               </el-form-item>
219
               </el-form-item>
213
             </template>
220
             </template>
214
           </el-table-column>
221
           </el-table-column>
249
 <script>
256
 <script>
250
   import { uParseTime } from '@/utils/tools'
257
   import { uParseTime } from '@/utils/tools'
251
 
258
 
252
-  import { deleteCancelStockInfo, editCancelStockInfo, getCancelStockInfo,GetAllGoodInfoByID,GetAllConfig,postSearchGoodList,getStockBatchNumber  } from '@/api/stock'
259
+  import { deleteCancelStockInfo, editCancelStockInfo, getCancelStockInfo,GetAllGoodInfoByID,GetAllConfig,postSearchGoodList,getStockBatchNumber,checkStockWarehouseInfo,checkRturnStockWarehouseInfo  } from '@/api/stock'
253
   import BreadCrumb from '../components/bread-crumb'
260
   import BreadCrumb from '../components/bread-crumb'
254
   import StockInDialog from './Dialog/stockInDialog'
261
   import StockInDialog from './Dialog/stockInDialog'
255
 
262
 
285
         },
292
         },
286
         tableRules: {
293
         tableRules: {
287
           count: [
294
           count: [
288
-            { required: true, message: '数量不能为空', trigge: 'blur' }
295
+            { required: true, message: '数量不能为空', trigger: 'blur' }
296
+          ],
297
+          price: [
298
+            { required: true, message: '单价不能为空', trigger: 'blur' }
289
           ],
299
           ],
290
-          // price: [
291
-          //   { required: true, message: '单价不能为空', trigge: 'blur' }
292
-          // ]
300
+          number: [
301
+          { required: true, message: "批次不能为空", trigger: "blur" }
302
+          ]
293
 
303
 
294
         },
304
         },
295
         ruleForm: {
305
         ruleForm: {
327
         numberShow:true,
337
         numberShow:true,
328
         storehouse_id:"",
338
         storehouse_id:"",
329
         list:[],
339
         list:[],
340
+        is_check:0,
341
+        disabled:false,
330
       }
342
       }
331
     },
343
     },
332
     methods: {
344
     methods: {
400
           }
412
           }
401
         }
413
         }
402
         return name
414
         return name
403
-      }, handleEdit: function(index, row) {
415
+      },
416
+       handleEdit: function(index, row) {
417
+        if(this.is_check == 1){
418
+          this.$message.error("已审核的单据不能新增!")
419
+          return false
420
+        }
404
         const tempObj = {}
421
         const tempObj = {}
405
         tempObj['id'] = 0
422
         tempObj['id'] = 0
406
         tempObj['good_type_id'] = 0
423
         tempObj['good_type_id'] = 0
415
         tempObj["warehouse_info_id"] = 0
432
         tempObj["warehouse_info_id"] = 0
416
         tempObj["xt_warehouse_info"] = []
433
         tempObj["xt_warehouse_info"] = []
417
         this.recordInfo.recordData.push(tempObj)
434
         this.recordInfo.recordData.push(tempObj)
418
-      }, handleDelete: function(index, row) {
435
+      },
436
+       handleDelete: function(index, row) {
437
+        if(this.is_check == 1){
438
+          this.$message.error("已审核的单据不能删除!")
439
+          return false
440
+        }
419
         if (row.id == 0) {
441
         if (row.id == 0) {
420
           this.recordInfo.recordData.splice(index, 1)
442
           this.recordInfo.recordData.splice(index, 1)
421
         } else {
443
         } else {
422
           const params = {
444
           const params = {
423
             id: row.id
445
             id: row.id
424
           }
446
           }
425
-          this.$confirm('确认删除该退库商品信息记录?', '删除退库商品信息记录', {
447
+          this.$confirm('确认删除该退库商品记录?', '删除退库商品记录', {
426
             confirmButtonText: '确定',
448
             confirmButtonText: '确定',
427
             cancelButtonText: '取消',
449
             cancelButtonText: '取消',
428
             type: 'warning'
450
             type: 'warning'
549
             const params = {
571
             const params = {
550
               'cancelStock': this.recordInfo.recordData
572
               'cancelStock': this.recordInfo.recordData
551
             }
573
             }
552
-            
553
-           
554
-            editCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
574
+            console.log("param2322332332333wo",params)
575
+            editCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer,this.storehouse_id).then(response => {
555
               if (response.data.state == 0) {
576
               if (response.data.state == 0) {
556
                 this.$message.error(response.data.msg)
577
                 this.$message.error(response.data.msg)
557
                 loading.close()
578
                 loading.close()
572
                   this.$message.error("该批次退库数量大于入库数量")
593
                   this.$message.error("该批次退库数量大于入库数量")
573
                 }
594
                 }
574
                 if(msg == 3){
595
                 if(msg == 3){
575
-                  this.$notify({
576
-                    title: "成功",
577
-                    message: "退库成功",
578
-                    type: "success",
579
-                    duration: 2000
580
-                  });
581
-                  this.recordInfo.recordData = [];
582
-                  this.$router.back(-1);
596
+                  // this.$notify({
597
+                  //   title: "成功",
598
+                  //   message: "保存成功",
599
+                  //   type: "success",
600
+                  //   duration: 2000
601
+                  // });
602
+                 this.$message.success("保存成功!")
583
                 }  
603
                 }  
584
                 loading.close()       
604
                 loading.close()       
585
               }
605
               }
598
             this.$message.error(response.data.msg)
618
             this.$message.error(response.data.msg)
599
             return false
619
             return false
600
           } else {
620
           } else {
601
-            console.log("猎豹323c",response.data.data.list)
621
+           
602
             for (let i = 0; i < response.data.data.list.length; i++) {
622
             for (let i = 0; i < response.data.data.list.length; i++) {
603
               response.data.data.list[i].good_name = response.data.data.list[i].GoodInfo.good_name
623
               response.data.data.list[i].good_name = response.data.data.list[i].GoodInfo.good_name
604
               response.data.data.list[i].name = response.data.data.list[i].GoodInfo.specification_name + "/" + response.data.data.list[i].GoodInfo.packing_unit
624
               response.data.data.list[i].name = response.data.data.list[i].GoodInfo.specification_name + "/" + response.data.data.list[i].GoodInfo.packing_unit
629
           this.manufacturerList = response.data.data.manufacturerList
649
           this.manufacturerList = response.data.data.manufacturerList
630
           this.dealerList = []
650
           this.dealerList = []
631
           this.dealerList = response.data.data.dealerList
651
           this.dealerList = response.data.data.dealerList
632
-          console.log("供应商2332322332232323232323",this.dealerList)
652
+         
633
 
653
 
634
         })
654
         })
635
       },changeManufacturer(val) {
655
       },changeManufacturer(val) {
682
         //获取当前耗材的批号
702
         //获取当前耗材的批号
683
          for(let i=0;i<this.recordInfo.recordData.length;i++){
703
          for(let i=0;i<this.recordInfo.recordData.length;i++){
684
            if(this.currentIndex == i){
704
            if(this.currentIndex == i){
705
+              this.recordInfo.recordData[i].register_account = val.number
685
               this.recordInfo.recordData[i].good_type_id = val.id
706
               this.recordInfo.recordData[i].good_type_id = val.id
686
               this.recordInfo.recordData[i].good_name = val.good_name
707
               this.recordInfo.recordData[i].good_name = val.good_name
687
               this.recordInfo.recordData[i].good_type_id = val.good_type_id
708
               this.recordInfo.recordData[i].good_type_id = val.good_type_id
715
       getStockBatchNumber(params).then(response=>{
736
       getStockBatchNumber(params).then(response=>{
716
         if(response.data.state == 1){
737
         if(response.data.state == 1){
717
           var list = response.data.data.list
738
           var list = response.data.data.list
718
-          console.log("list2243444",list)
739
+         
719
           this.numberList = list
740
           this.numberList = list
720
         }
741
         }
721
       })
742
       })
726
       }
747
       }
727
       return Math.round(parseFloat(val) * 100) / 100;
748
       return Math.round(parseFloat(val) * 100) / 100;
728
      },
749
      },
750
+     toCheck(){
751
+       const loading = this.$loading({
752
+          lock: true,
753
+          text: 'Loading',
754
+          spinner: 'el-icon-loading',
755
+          background: 'rgba(0, 0, 0, 0.7)'
756
+        })
757
+       var params = {
758
+         cancel_stock_id:this.$route.query.id,
759
+       }
760
+      checkStockWarehouseInfo(params).then(response=>{
761
+         if(response.data.state == 1){
762
+          if(response.data.data.msg == 1){
763
+            this.$message.success("审核成功!")
764
+            this.$router.back(-1);
765
+            loading.close()
766
+          }
767
+          if(response.data.data.msg == 2){
768
+            var good_name = response.data.data.good_name
769
+            var specification_name = response.data.data.specification_name
770
+            var str = good_name + specification_name +"退库数量大于出库数量,审核失败!"
771
+            this.$message.error(str)
772
+            loading.close()
773
+          }
774
+         }
775
+      })
776
+    },
777
+    toReturnCheck(){
778
+      const loading = this.$loading({
779
+        lock: true,
780
+        text: 'Loading',
781
+        spinner: 'el-icon-loading',
782
+        background: 'rgba(0, 0, 0, 0.7)'
783
+      })
784
+      var params = {
785
+         cancel_stock_id:this.$route.query.id,
786
+       }
787
+       checkRturnStockWarehouseInfo(params).then(response=>{
788
+          if(response.data.state == 1){
789
+            this.$message.success("反审核成功!")
790
+            this.$router.back(-1);
791
+            loading.close()
792
+          }
793
+       })
794
+    }
729
     },
795
     },
730
     created() {
796
     created() {
731
       this.GetConfigInfo()
797
       this.GetConfigInfo()
732
       this.propForm.goodUnit = this.$store.getters.good_unit
798
       this.propForm.goodUnit = this.$store.getters.good_unit
733
       const order_id = this.$route.query.id
799
       const order_id = this.$route.query.id
734
       this.GetOrderDetail(order_id)
800
       this.GetOrderDetail(order_id)
801
+      this.is_check = this.$route.query.is_check
802
+      if(parseInt(this.$route.query.is_check) == 1){
803
+         this.disabled = true
804
+      }else{
805
+        this.disabled = false
806
+      }
807
+
735
     }
808
     }
736
 
809
 
737
   }
810
   }

+ 25 - 2
src/xt_pages/stock/detail/print.vue Прегледај датотеку

53
                 <span v-if="type == 2"> 
53
                 <span v-if="type == 2"> 
54
                   <span  v-if="org_id == 3907 || org_id == 9919 || org_id == 9583">{{getStockCount(item.good_id) }}</span> 
54
                   <span  v-if="org_id == 3907 || org_id == 9919 || org_id == 9583">{{getStockCount(item.good_id) }}</span> 
55
                    <span  v-if="org_id == 10265 || org_id == 10215">{{getMySelfCount(item.good_id) }}</span>   
55
                    <span  v-if="org_id == 10265 || org_id == 10215">{{getMySelfCount(item.good_id) }}</span>   
56
-                  <span v-if="org_id!=3907&&org_id!=10265&&org_id!=10285&&org_id!=9583&&org_id!=10215">{{getStockCount(item.good_id) }}</span>
56
+                   <span v-if="org_id == 10210">{{getWarehouseOut(item.good_id)}}</span>
57
+                  <span v-if="org_id!=3907&&org_id!=10265&&org_id!=10285&&org_id!=9583&&org_id!=10215&&org_id!=10210">{{getStockCount(item.good_id) }}</span>
57
                 </span>
58
                 </span>
58
                
59
                
59
                 <span v-if="type == 4"> {{ item.count }}</span>
60
                 <span v-if="type == 4"> {{ item.count }}</span>
165
         stockTotal:[],
166
         stockTotal:[],
166
         wareOutInfo:[],
167
         wareOutInfo:[],
167
         org_id:this.$store.getters.xt_user.org.id,
168
         org_id:this.$store.getters.xt_user.org.id,
168
-        informationList:[]
169
+        informationList:[],
170
+        wareOutList:[],
169
       }
171
       }
170
     },
172
     },
171
     methods: {
173
     methods: {
431
        }
433
        }
432
        return total
434
        return total
433
      },
435
      },
436
+     getPrintStockGood(){
437
+     
438
+      getPrintStockGood(this.queryParams).then(response=>{
439
+          if(response.data.state == 1){
440
+            var list =  response.data.data.list
441
+            console.log("list23323232323232",list)
442
+            this.wareOutList = list
443
+           
444
+          }
445
+      })
446
+    },
447
+    getWarehouseOut(good_id){
448
+      var total = 0
449
+      for(let i=0;i<this.wareOutList.length;i++){
450
+         if(this.wareOutList[i].good_id == good_id){
451
+            total += this.wareOutList[i].count
452
+         }
453
+      }
454
+      return total
455
+    }
434
     },
456
     },
435
     created() {
457
     created() {
436
       var xtuser = this.$store.getters.xt_user
458
       var xtuser = this.$store.getters.xt_user
437
       this.orgname = xtuser.org.org_name
459
       this.orgname = xtuser.org.org_name
438
       this.goodUnit = this.$store.getters.good_unit
460
       this.goodUnit = this.$store.getters.good_unit
439
       this.getGoodDetailPrintList()
461
       this.getGoodDetailPrintList()
462
+      this.getPrintStockGood()
440
     }
463
     }
441
 
464
 
442
   }
465
   }

+ 37 - 1
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue Прегледај датотеку

93
         <el-button size="small" type="primary" @click="toExport"
93
         <el-button size="small" type="primary" @click="toExport"
94
           >导出</el-button
94
           >导出</el-button
95
         >
95
         >
96
+        <span>&nbsp;&nbsp;</span>
97
+        <label class="title"><span class="name">审核状态</span> :</label>
98
+        <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
99
+            <el-option
100
+              v-for="(option, index) in checkList"
101
+              :key="index"
102
+              :label="option.name"
103
+              :value="option.id">
104
+            </el-option>
105
+        </el-select>  
96
       </div>
106
       </div>
97
 
107
 
98
       <el-table
108
       <el-table
135
           </template>
145
           </template>
136
         </el-table-column>
146
         </el-table-column>
137
 
147
 
148
+       <el-table-column label="审核状态" align="center">
149
+          <template slot-scope="scope">
150
+             <span v-if="scope.row.is_check == 1">已审核</span>
151
+             <span v-if="scope.row.is_check == 2">未审核</span>
152
+          </template>
153
+        </el-table-column>
154
+
138
         <el-table-column label="操作" align="center">
155
         <el-table-column label="操作" align="center">
139
           <template slot-scope="scope">
156
           <template slot-scope="scope">
140
             <el-tooltip
157
             <el-tooltip
366
       exportList: [],
383
       exportList: [],
367
       houseList: [],
384
       houseList: [],
368
       storehouse_id: 0,
385
       storehouse_id: 0,
386
+      check_type:0,
387
+      checkList:[
388
+       {id:0,name:"全部"},
389
+       {id:1,name:"已审核"},
390
+       {id:2,name:"未审核"},
391
+      ]
369
     };
392
     };
370
   },
393
   },
371
   methods: {
394
   methods: {
378
         type: this.type,
401
         type: this.type,
379
         keywords: this.searchKey,
402
         keywords: this.searchKey,
380
         storehouse_id: this.storehouse_id,
403
         storehouse_id: this.storehouse_id,
404
+        check_type:this.check_type,
381
       };
405
       };
382
       this.cancelStockDate = [];
406
       this.cancelStockDate = [];
383
       getDrugCancelStockList(Params).then((response) => {
407
       getDrugCancelStockList(Params).then((response) => {
406
         end_time: this.end_time,
430
         end_time: this.end_time,
407
         type: this.type,
431
         type: this.type,
408
         storehouse_id: this.storehouse_id,
432
         storehouse_id: this.storehouse_id,
433
+        check_type:this.check_type,
409
       };
434
       };
410
       this.cancelStockDate = [];
435
       this.cancelStockDate = [];
411
       getDrugCancelStockList(Params).then((response) => {
436
       getDrugCancelStockList(Params).then((response) => {
526
     },
551
     },
527
     handleEdit: function (index, row) {
552
     handleEdit: function (index, row) {
528
       this.$router.push({
553
       this.$router.push({
529
-        path: "/drugstock/cancel/edit?id=" + row.id + "&type=" + this.type,
554
+        path: "/drugstock/cancel/edit?id=" + row.id + "&type=" + this.type+"&is_check="+row.is_check,
530
       });
555
       });
531
     },
556
     },
532
     handleDelete: function (index, row) {
557
     handleDelete: function (index, row) {
558
+      if(row.is_check == 1){
559
+        this.$message.error("已审核的单据不能删除!")
560
+        return false
561
+      }
533
       const ids = [];
562
       const ids = [];
534
       ids.push(row.id);
563
       ids.push(row.id);
535
       const idStr = ids.join(",");
564
       const idStr = ids.join(",");
590
       }
619
       }
591
       const ids = [];
620
       const ids = [];
592
       for (let i = 0; i < this.selectedTableData.length; i++) {
621
       for (let i = 0; i < this.selectedTableData.length; i++) {
622
+        if(this.selectedTableData[i].is_check == 1){
623
+          this.$message.error("已审核的单位不能删除!")
624
+          return false
625
+        }
593
         ids.push(this.selectedTableData[i].id);
626
         ids.push(this.selectedTableData[i].id);
594
       }
627
       }
595
       const idStr = ids.join(",");
628
       const idStr = ids.join(",");
775
     changeStoreHouse() {
808
     changeStoreHouse() {
776
       this.GetCancelStock();
809
       this.GetCancelStock();
777
     },
810
     },
811
+    changeCheckType(){
812
+      this.GetCancelStock();
813
+    }
778
   },
814
   },
779
 };
815
 };
780
 </script>
816
 </script>

+ 128 - 16
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue Прегледај датотеку

21
           class="filter-item"
21
           class="filter-item"
22
           >保 存</el-button
22
           >保 存</el-button
23
         >
23
         >
24
+        <el-button
25
+          size="small"
26
+          type="primary"
27
+          @click="toCheck()"
28
+          class="filter-item"
29
+          v-show="showCheck"
30
+          >审 核</el-button
31
+        >
24
       </div>
32
       </div>
25
     </div>
33
     </div>
26
 
34
 
173
 
181
 
174
           <el-table-column width="200" align="center">
182
           <el-table-column width="200" align="center">
175
             <template slot="header" slot-scope="scope">
183
             <template slot="header" slot-scope="scope">
176
-              <span>批次<span style="color: red"></span></span>
184
+              <span>批次<span style="color: red">*</span></span>
177
             </template>
185
             </template>
178
             <template slot-scope="scope">
186
             <template slot-scope="scope">
179
               <el-form-item
187
               <el-form-item
180
-                :prop="'recordData.' + scope.$index + '.return_count'"
188
+                :prop="'recordData.' + scope.$index + '.batch_number'"
181
                 style="padding-top: 17px"
189
                 style="padding-top: 17px"
190
+                :rules="tableRules.batch_number"
182
               >
191
               >
183
                <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
192
                <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
184
                   <el-option
193
                   <el-option
312
 
321
 
313
 <script>
322
 <script>
314
 import { uParseTime } from "@/utils/tools";
323
 import { uParseTime } from "@/utils/tools";
315
-import {  postDrugCancelStock,GetAllConfig,GetAllDrugInfoByID,getDrugBatchNumber } from "@/api/drug/drug_stock";
324
+import {  postDrugCancelStock,GetAllConfig,GetAllDrugInfoByID,getDrugBatchNumber,checkCancelDrugStock,deleteDrugCancelStockInfo } from "@/api/drug/drug_stock";
316
 import BreadCrumb from "../../components/bread-crumb";
325
 import BreadCrumb from "../../components/bread-crumb";
317
 import DrugsStockDialog from './drugsStockDialog/index'
326
 import DrugsStockDialog from './drugsStockDialog/index'
318
 import {postSearchDrugList } from "@/api/data"
327
 import {postSearchDrugList } from "@/api/data"
344
       tableRules: {
353
       tableRules: {
345
         return_count: [
354
         return_count: [
346
           { required: true, message: "数量不能为空", trigger: "blur" }
355
           { required: true, message: "数量不能为空", trigger: "blur" }
356
+        ],
357
+        price: [
358
+          { required: true, message: "单价不能为空", trigger: "blur" }
359
+        ],
360
+        batch_number: [
361
+          { required: true, message: "批次不能为空", trigger: "blur" }
347
         ]
362
         ]
363
+
348
       },
364
       },
349
       ruleForm: {
365
       ruleForm: {
350
         manufacturer: [
366
         manufacturer: [
376
       unitList:[],
392
       unitList:[],
377
       list:[],
393
       list:[],
378
       storehouse_id:"",
394
       storehouse_id:"",
395
+      showCheck:false,
396
+      cancelstock_id:0,
379
     };
397
     };
380
   },
398
   },
381
   methods: {
399
   methods: {
481
       this.recordInfo.recordData.push(tempObj);
499
       this.recordInfo.recordData.push(tempObj);
482
     },
500
     },
483
     handleDelete: function(index, row) {
501
     handleDelete: function(index, row) {
502
+      console.log("index23322332232我的",index)
484
       if (this.recordInfo.recordData.length <= 1) {
503
       if (this.recordInfo.recordData.length <= 1) {
485
         this.$message.error("只有一条记录的时候无法删除");
504
         this.$message.error("只有一条记录的时候无法删除");
486
         return;
505
         return;
487
       } else {
506
       } else {
488
         this.recordInfo.recordData.splice(index, 1);
507
         this.recordInfo.recordData.splice(index, 1);
508
+        if(row.id > 0){
509
+          const params = {
510
+            id: row.id
511
+          }
512
+          this.$confirm('确认删除该退库商品信息记录?', '删除退库商品信息记录', {
513
+            confirmButtonText: '确定',
514
+            cancelButtonText: '取消',
515
+            type: 'warning'
516
+          }).then(() => {
517
+            deleteDrugCancelStockInfo(params).then(response => {
518
+              if (response.data.state == 0) {
519
+                this.$message.error(response.data.msg)
520
+                return false
521
+              } else {
522
+                this.$message.success('删除成功')
523
+                this.recordInfo.recordData.splice(index, 1)
524
+              }
525
+            })
526
+          }).catch(() => {
527
+          })
528
+        }
489
       }
529
       }
490
     },
530
     },
491
     calculate: function(val) {
531
     calculate: function(val) {
589
                   this.recordInfo.recordData[i].batch_number_id = this.recordInfo.recordData[i].drug_warehouse_info[j].id
629
                   this.recordInfo.recordData[i].batch_number_id = this.recordInfo.recordData[i].drug_warehouse_info[j].id
590
                }
630
                }
591
             }
631
             }
632
+            this.recordInfo.recordData[i].retail_price = this.recordInfo.recordData[i].retail_price.toString()
592
           }
633
           }
593
           const params = {
634
           const params = {
594
             cancelStock: this.recordInfo.recordData
635
             cancelStock: this.recordInfo.recordData
595
           };
636
           };
596
-         console.log("params2222",params,this.return_time)
637
+          console.log("param232222我的",params)
597
           
638
           
598
           postDrugCancelStock(
639
           postDrugCancelStock(
599
             params,
640
             params,
602
             this.form.dealer,
643
             this.form.dealer,
603
             this.type,
644
             this.type,
604
             this.storehouse_id,
645
             this.storehouse_id,
646
+            this.cancelstock_id,
605
           ).then(response => {
647
           ).then(response => {
606
             if (response.data.state == 0) {
648
             if (response.data.state == 0) {
607
               this.$message.error(response.data.msg);
649
               this.$message.error(response.data.msg);
608
               return false;
650
               return false;
609
             } else {
651
             } else {
610
               if(response.data.data.msg == 1){
652
               if(response.data.data.msg == 1){
611
-                this.$notify({
612
-                  title: "成功",
613
-                  message: "退库成功",
614
-                  type: "success",
615
-                  duration: 2000
616
-                });
617
-                this.recordInfo.recordData = [];
618
-                this.$router.back(-1);
653
+                this.$message.success("保存成功!")
654
+                var list = response.data.data.list
655
+                var manufacturerList = response.data.data.manufacturerList
656
+                var dealerList = response.data.data.dealerList
657
+                var drugTypeList = response.data.data.drugTypeList
658
+                this.cancelstock_id = response.data.data.cancelStock.id
659
+                for(let i=0;i<list.length;i++){
660
+                  for(let j=0;j<manufacturerList.length;j++){
661
+                    if(list[i].manufacturer_id == manufacturerList[j].id){
662
+                        list[i].manufacturer_id = manufacturerList[j].manufacturer_name
663
+                    }
664
+                  }
665
+                  for(let s=0;s<dealerList.length;s++){
666
+                    if(list[i].dealer_id == dealerList[s].id){
667
+                      list[i].dealer_id = dealerList[s].manufacturer_name
668
+                    }
669
+                  }
670
+
671
+                  list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
672
+                  list[i].product_date = this.getTimeOne(list[i].product_date)
673
+                  list[i].drug_name = list[i].BaseDrugLib.drug_name
674
+                  list[i].name = list[i].BaseDrugLib.dose + list[i].BaseDrugLib.dose_unit +"*"+list[i].BaseDrugLib.min_number +list[i].BaseDrugLib.min_unit+"/"+list[i].BaseDrugLib.max_unit
675
+                  for(let z=0;z<drugTypeList.length;z++){
676
+                    if(list[i].BaseDrugLib.drug_type == drugTypeList[z].value){
677
+                        list[i].drug_type = drugTypeList[z].name
678
+                    }
679
+                  }
680
+                  // list[i].last_price = list[i].price
681
+                  list[i].return_count = list[i].count.toString()
682
+                  
619
               }
683
               }
620
-              if(response.data.data.msg == 2){
621
-                this.$message.error("退库数量大于出库数量")
684
+              this.showCheck = true
685
+              this.recordInfo.recordData = []
686
+              this.recordInfo.recordData = list
687
+              // this.$router.back(-1)
688
+              console.log("列表23322323我的",this.recordInfo.recordData)
622
               }
689
               }
623
-             
624
             }
690
             }
625
           });
691
           });
626
         } else {
692
         } else {
678
         this.currentIndex = val
744
         this.currentIndex = val
679
       },
745
       },
680
       handleSelect(val){
746
       handleSelect(val){
681
-        console.log("val345555555555555555555",val)
747
+         console.log("val32323322323",val)
682
          var arr = []
748
          var arr = []
683
          for(let i=0;i<this.recordInfo.recordData.length;i++){
749
          for(let i=0;i<this.recordInfo.recordData.length;i++){
684
             arr.push(this.recordInfo.recordData[i].drug_id)
750
             arr.push(this.recordInfo.recordData[i].drug_id)
691
         //  this.getDrugBatchNumber(val.id)
757
         //  this.getDrugBatchNumber(val.id)
692
          for(let i=0;i<this.recordInfo.recordData.length;i++){
758
          for(let i=0;i<this.recordInfo.recordData.length;i++){
693
            if(i == this.currentIndex){
759
            if(i == this.currentIndex){
760
+             this.recordInfo.recordData[i].id = 0
761
+             this.recordInfo.recordData[i].register_account = val.number
694
              this.recordInfo.recordData[i].drug_id  = val.id
762
              this.recordInfo.recordData[i].drug_id  = val.id
695
              this.recordInfo.recordData[i].drug_name = val.drug_name
763
              this.recordInfo.recordData[i].drug_name = val.drug_name
696
              this.recordInfo.recordData[i].drug_type = val.drug_type
764
              this.recordInfo.recordData[i].drug_type = val.drug_type
730
       getDataConfig(module, filed_name){
798
       getDataConfig(module, filed_name){
731
        return getDataConfig(module, filed_name)
799
        return getDataConfig(module, filed_name)
732
       },
800
       },
801
+      getTimeOne(val) {
802
+       if(val < 0){
803
+          return ""
804
+        }
805
+        if(val == ""){
806
+        return ""
807
+        }else {
808
+        return uParseTime(val, '{y}-{m}-{d}')
809
+        }
810
+     },
811
+     toCheck(){
812
+        const loading = this.$loading({
813
+          lock: true,
814
+          text: "Loading",
815
+          spinner: "el-icon-loading",
816
+          background: "rgba(0, 0, 0, 0.7)",
817
+         });
818
+         var params = {
819
+           cancelstock_id:this.cancelstock_id,
820
+         }
821
+       checkCancelDrugStock(params).then(response=>{
822
+          if(response.data.state == 1){
823
+            var drug_name = response.data.data.drug_name   
824
+            var dose = response.data.data.dose
825
+            var dose_unit = response.data.data.dose_unit
826
+            var min_number = response.data.data.min_number
827
+            var min_unit =  response.data.data.min_unit
828
+            var max_unit = response.data.data.max_unit
829
+            var str = dose + dose_unit + "*" + min_number + min_unit +"/"+ max_unit
830
+            if(response.data.data.msg == 2){
831
+              this.$message.error(drug_name + str +"退库数量大于出库数量,审核失败!")
832
+              loading.close()
833
+              return
834
+            }
835
+            if(response.data.data.msg == 1){
836
+               this.$message.success("审核成功!")
837
+               loading.close()
838
+               this.$router.back(-1)
839
+               return
840
+            }
841
+          }
842
+       })
843
+     }
733
   },
844
   },
734
   created() {
845
   created() {
735
     var nowDate = new Date();
846
     var nowDate = new Date();
744
       (nowDay < 10 ? "0" + nowDay : nowDay);
855
       (nowDay < 10 ? "0" + nowDay : nowDay);
745
 
856
 
746
     const tempObj = {};
857
     const tempObj = {};
858
+    tempObj["id"] = 0;
747
     tempObj["drug_id"] = 0;
859
     tempObj["drug_id"] = 0;
748
     tempObj["return_count"] = "";
860
     tempObj["return_count"] = "";
749
     tempObj["price"] = "";
861
     tempObj["price"] = "";

+ 113 - 26
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue Прегледај датотеку

6
       <div style="float:right;">
6
       <div style="float:right;">
7
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
9
+        <el-button size="small"  type="primary" @click="toCheck" v-if="is_check == 2" class="filter-item" >审 核</el-button>
10
+        <el-button size="small"  type="primary" @click="toReturnCheck" v-if="is_check == 1" class="filter-item" >反审核</el-button>
9
       </div>
11
       </div>
10
     </div>
12
     </div>
11
     <div class="app-container">
13
     <div class="app-container">
53
                     @select="handleSelect"
55
                     @select="handleSelect"
54
                     @input="changeDrugName(scope.$index)"
56
                     @input="changeDrugName(scope.$index)"
55
                     style="width:160px;"
57
                     style="width:160px;"
58
+                    :disabled="disabled"
56
                   >
59
                   >
57
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
60
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
58
                   <template slot-scope="{ item }">
61
                   <template slot-scope="{ item }">
69
             <template slot-scope="scope">
72
             <template slot-scope="scope">
70
               <el-form-item style="padding-top: 20px">
73
               <el-form-item style="padding-top: 20px">
71
                 <el-input
74
                 <el-input
75
+                
72
                   :disabled="true"
76
                   :disabled="true"
73
                   placeholder="请输入规格&单位"
77
                   placeholder="请输入规格&单位"
74
                   v-model="scope.row.name"
78
                   v-model="scope.row.name"
89
               >
93
               >
90
               <div style="display:flex;">
94
               <div style="display:flex;">
91
                 <el-input
95
                 <el-input
96
+                :disabled="disabled"
92
                  oninput="value=value.replace(/\D|^0/g,'')"
97
                  oninput="value=value.replace(/\D|^0/g,'')"
93
                   style="width:100px"
98
                   style="width:100px"
94
                   placeholder="请输入退库数量"
99
                   placeholder="请输入退库数量"
95
                   type="number"
100
                   type="number"
96
                   v-model="scope.row.count"
101
                   v-model="scope.row.count"
97
                 ></el-input>
102
                 ></el-input>
98
-                 <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
103
+                 <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px" :disabled="disabled">
99
                     <el-option
104
                     <el-option
100
                       v-for="(option, index) in unitList"
105
                       v-for="(option, index) in unitList"
101
                       :key="index"
106
                       :key="index"
119
                 style="padding-top: 17px"
124
                 style="padding-top: 17px"
120
               >
125
               >
121
                 <el-input
126
                 <el-input
127
+                 :disabled="disabled"
122
                   placeholder="请输入单价"
128
                   placeholder="请输入单价"
123
                   type="number"
129
                   type="number"
124
                   v-model="scope.row.price"
130
                   v-model="scope.row.price"
135
 
141
 
136
           <el-table-column width="200" align="center">
142
           <el-table-column width="200" align="center">
137
             <template slot="header" slot-scope="scope">
143
             <template slot="header" slot-scope="scope">
138
-              <span>批次<span style="color: red"></span></span>
144
+              <span>批次<span style="color: red">*</span></span>
139
             </template>
145
             </template>
140
             <template slot-scope="scope">
146
             <template slot-scope="scope">
141
               <el-form-item
147
               <el-form-item
142
-                :prop="'recordData.' + scope.$index + '.return_count'"
148
+                :prop="'recordData.' + scope.$index + '.batch_number'"
143
                 style="padding-top: 17px"
149
                 style="padding-top: 17px"
150
+                :rules="tableRules.batch_number"
144
               >
151
               >
145
-               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" :disabled="canCelShow">
152
+               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" :disabled="disabled" >
146
                   <el-option
153
                   <el-option
147
-                    v-for="(item,index) in numberList"
154
+                    v-for="(item,index) in scope.row.drug_warehouse_info"
148
                     :key="index"
155
                     :key="index"
149
                     :label="item.batch_number"
156
                     :label="item.batch_number"
150
                     :value="item.id">
157
                     :value="item.id">
163
                 :prop="'recordData.' + scope.$index + '.register_account'"
170
                 :prop="'recordData.' + scope.$index + '.register_account'"
164
                 style="padding-top: 17px"
171
                 style="padding-top: 17px"
165
               >
172
               >
166
-              <el-input v-model="scope.row.register_account"></el-input>
173
+              <el-input v-model="scope.row.register_account" :disabled="disabled"></el-input>
167
               </el-form-item>
174
               </el-form-item>
168
             </template>
175
             </template>
169
           </el-table-column>
176
           </el-table-column>
170
            <el-table-column label="生产厂家" width="160" align="center">
177
            <el-table-column label="生产厂家" width="160" align="center">
171
             <template slot-scope="scope">
178
             <template slot-scope="scope">
172
-               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
179
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商" :disabled="disabled">
173
                 <el-option
180
                 <el-option
174
                   v-for="(option, index) in manufacturerList"
181
                   v-for="(option, index) in manufacturerList"
175
                   :key="index"
182
                   :key="index"
191
                 placeholder="选择日期时间"
198
                 placeholder="选择日期时间"
192
                 format="yyyy-MM-dd"
199
                 format="yyyy-MM-dd"
193
                 value-format="yyyy-MM-dd"
200
                 value-format="yyyy-MM-dd"
201
+                :disabled="disabled"
194
               ></el-date-picker>
202
               ></el-date-picker>
195
             </template>
203
             </template>
196
           </el-table-column>
204
           </el-table-column>
204
                 placeholder="选择日期时间"
212
                 placeholder="选择日期时间"
205
                 format="yyyy-MM-dd"
213
                 format="yyyy-MM-dd"
206
                 value-format="yyyy-MM-dd"
214
                 value-format="yyyy-MM-dd"
215
+                :disabled="disabled"
207
               ></el-date-picker>
216
               ></el-date-picker>
208
             </template>
217
             </template>
209
           </el-table-column>
218
           </el-table-column>
211
 
220
 
212
         <el-table-column label="经销商" width="160" align="center">
221
         <el-table-column label="经销商" width="160" align="center">
213
             <template slot-scope="scope">
222
             <template slot-scope="scope">
214
-                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
223
+                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商" :disabled="disabled">
215
                 <el-option
224
                 <el-option
216
                   v-for="(option, index) in dealerList"
225
                   v-for="(option, index) in dealerList"
217
                   :key="index"
226
                   :key="index"
230
                 :prop="'recordData.' + scope.$index + '.remark'"
239
                 :prop="'recordData.' + scope.$index + '.remark'"
231
                 style="padding-top: 17px"
240
                 style="padding-top: 17px"
232
               >
241
               >
233
-              <el-input v-model="scope.row.remark"></el-input>
242
+              <el-input v-model="scope.row.remark" :disabled="disabled"></el-input>
234
               </el-form-item>
243
               </el-form-item>
235
             </template>
244
             </template>
236
           </el-table-column>
245
           </el-table-column>
278
 <script>
287
 <script>
279
   import { uParseTime } from '@/utils/tools'
288
   import { uParseTime } from '@/utils/tools'
280
 
289
 
281
-  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber  } from '@/api/drug/drug_stock'
290
+  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber,checkCancelDrugStock,returnDrugCancelStock  } from '@/api/drug/drug_stock'
282
   import BreadCrumb from '../../components/bread-crumb'
291
   import BreadCrumb from '../../components/bread-crumb'
283
   import DrugsStockDialog from './drugsStockDialog/index'
292
   import DrugsStockDialog from './drugsStockDialog/index'
284
   import {postSearchDrugList} from "@/api/data"
293
   import {postSearchDrugList} from "@/api/data"
315
         tableRules: {
324
         tableRules: {
316
           count: [
325
           count: [
317
             { required: true, message: '数量不能为空', trigger: 'blur' }
326
             { required: true, message: '数量不能为空', trigger: 'blur' }
327
+          ],
328
+          price: [
329
+            { required: true, message: "单价不能为空", trigger: "blur" }
330
+          ],
331
+          batch_number: [
332
+            { required: true, message: "批次不能为空", trigger: "blur" }
318
           ]
333
           ]
319
-
320
         },
334
         },
321
         ruleForm: {
335
         ruleForm: {
322
           manufacturer: [
336
           manufacturer: [
353
         canCelShow:true,
367
         canCelShow:true,
354
         storehouse_id:"",
368
         storehouse_id:"",
355
         houseList:[],
369
         houseList:[],
370
+        is_check:0,
371
+        disabled:false,
356
       }
372
       }
357
     },
373
     },
358
     methods: {
374
     methods: {
440
         return name;
456
         return name;
441
       }, 
457
       }, 
442
       handleEdit: function(index, row) {
458
       handleEdit: function(index, row) {
459
+        if(this.is_check == 1){
460
+          this.$message.error("已审核的数据不能新增!")
461
+          return false
462
+        }
443
         this.canCelShow = false
463
         this.canCelShow = false
444
         const tempObj = {}
464
         const tempObj = {}
445
         tempObj['id'] = 0
465
         tempObj['id'] = 0
454
         tempObj["expiry_date"] = ""
474
         tempObj["expiry_date"] = ""
455
         tempObj["batch_number"] = ""
475
         tempObj["batch_number"] = ""
456
         tempObj["batch_number_id"] = 0
476
         tempObj["batch_number_id"] = 0
457
-         tempObj["count"] = 0
477
+        tempObj["count"] = 0
478
+        tempObj["drug_warehouse_info"] = []
458
         this.recordInfo.recordData.push(tempObj)
479
         this.recordInfo.recordData.push(tempObj)
459
-      }, handleDelete: function(index, row) {
480
+      },
481
+       handleDelete: function(index, row) {
482
+        if(this.is_check == 1){
483
+          this.$message.error("已审核的数据不能删除!")
484
+          return false
485
+        }
460
         if (row.id == 0) {
486
         if (row.id == 0) {
461
           this.recordInfo.recordData.splice(index, 1)
487
           this.recordInfo.recordData.splice(index, 1)
462
         } else {
488
         } else {
553
             }
579
             }
554
 
580
 
555
             for(let i=0;i<this.recordInfo.recordData.length;i++){
581
             for(let i=0;i<this.recordInfo.recordData.length;i++){
556
-              for(let j=0;j<this.numberList.length;j++){
557
-                 if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
558
-                   this.recordInfo.recordData[i].batch_number = this.numberList[j].batch_number
559
-                   this.recordInfo.recordData[i].batch_number_id = this.numberList[j].id
582
+              for(let j=0;j<this.recordInfo.recordData[i].drug_warehouse_info.length;j++){
583
+                 if(this.recordInfo.recordData[i].batch_number ==this.recordInfo.recordData[i].drug_warehouse_info[j].id){
584
+                   this.recordInfo.recordData[i].batch_number = this.recordInfo.recordData[i].drug_warehouse_info[j].batch_number
585
+                   this.recordInfo.recordData[i].batch_number_id = this.recordInfo.recordData[i].drug_warehouse_info[j].id
560
                  }
586
                  }
561
               }
587
               }
562
               this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
588
               this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
573
                 return false
599
                 return false
574
               } else {
600
               } else {
575
                 if (response.data.data.msg == 1){
601
                 if (response.data.data.msg == 1){
576
-                   this.$message.success('退库成功')
577
-                   this.$router.back(-1)
578
-                }
579
-                if(response.data.data.msg == 2){
580
-                   this.$message.error("该批次退库数量大于入库数量,请更改批次")
581
-                }
582
-                if(response.data.data.msg == 4){
583
-                  this.$message.error("该批次退库数量大于出库数量,请更改批次")
602
+                   this.$message.success('保存成功')
603
+                  //  this.$router.back(-1)
584
                 }
604
                 }
605
+                // if(response.data.data.msg == 2){
606
+                //    this.$message.error("该批次退库数量大于入库数量,请更改批次")
607
+                // }
608
+                // if(response.data.data.msg == 4){
609
+                //   this.$message.error("该批次退库数量大于出库数量,请更改批次")
610
+                // }
585
               
611
               
586
               }
612
               }
587
             })
613
             })
689
             this.$message.error("该药品已存在列表中")
715
             this.$message.error("该药品已存在列表中")
690
             return
716
             return
691
          }
717
          }
692
-         this.getDrugBatchNumber(val.id)
718
+        // this.getDrugBatchNumber(val.id)
693
 
719
 
694
          for(let i=0;i<this.recordInfo.recordData.length;i++){
720
          for(let i=0;i<this.recordInfo.recordData.length;i++){
695
            if(i == this.currentIndex){
721
            if(i == this.currentIndex){
722
+             this.recordInfo.recordData[i].register_account = val.number
696
              this.recordInfo.recordData[i].drug_id  = val.id
723
              this.recordInfo.recordData[i].drug_id  = val.id
697
              this.recordInfo.recordData[i].drug_name = val.drug_name
724
              this.recordInfo.recordData[i].drug_name = val.drug_name
698
              this.recordInfo.recordData[i].drug_type = val.drug_type
725
              this.recordInfo.recordData[i].drug_type = val.drug_type
703
              this.recordInfo.recordData[i].number =  val.number
730
              this.recordInfo.recordData[i].number =  val.number
704
              this.recordInfo.recordData[i].max_unit = val.max_unit
731
              this.recordInfo.recordData[i].max_unit = val.max_unit
705
              this.recordInfo.recordData[i].min_unit = val.min_unit
732
              this.recordInfo.recordData[i].min_unit = val.min_unit
733
+             this.recordInfo.recordData[i].drug_warehouse_info = val.drug_warehouse_info
706
              if(val.dealer == 0){
734
              if(val.dealer == 0){
707
                this.recordInfo.recordData[i].dealer = ""
735
                this.recordInfo.recordData[i].dealer = ""
708
              }else{
736
              }else{
730
       getDataConfig(module, filed_name){
758
       getDataConfig(module, filed_name){
731
        return getDataConfig(module, filed_name)
759
        return getDataConfig(module, filed_name)
732
       },
760
       },
761
+      toCheck(){
762
+        const loading = this.$loading({
763
+          lock: true,
764
+          text: "Loading",
765
+          spinner: "el-icon-loading",
766
+          background: "rgba(0, 0, 0, 0.7)",
767
+         });
768
+         var params = {
769
+           cancelstock_id:parseInt(this.$route.query.id),
770
+         }
771
+       checkCancelDrugStock(params).then(response=>{
772
+          if(response.data.state == 1){
773
+            var drug_name = response.data.data.drug_name   
774
+            var dose = response.data.data.dose
775
+            var dose_unit = response.data.data.dose_unit
776
+            var min_number = response.data.data.min_number
777
+            var min_unit =  response.data.data.min_unit
778
+            var max_unit = response.data.data.max_unit
779
+            var str = dose + dose_unit + "*" + min_number + min_unit +"/"+ max_unit
780
+            if(response.data.data.msg == 2){
781
+              this.$message.error(drug_name + str +"退库数量大于出库数量,审核失败!")
782
+              loading.close()
783
+              return
784
+            }
785
+            if(response.data.data.msg == 1){
786
+               this.$message.success("审核成功!")
787
+               loading.close()
788
+               this.$router.back(-1)
789
+               return
790
+            }
791
+          }
792
+       })
793
+     },
794
+     toReturnCheck(){
795
+       const loading = this.$loading({
796
+          lock: true,
797
+          text: "Loading",
798
+          spinner: "el-icon-loading",
799
+          background: "rgba(0, 0, 0, 0.7)",
800
+         });
801
+        var params = {
802
+          cancelstock_id:parseInt(this.$route.query.id),
803
+         }
804
+        returnDrugCancelStock(params).then(response=>{
805
+           if(response.data.state == 1){
806
+             this.$message.success("反审核成功!")
807
+             this.$router.back(-1)
808
+             loading.close()
809
+           }
810
+        })
811
+      }
733
     },
812
     },
734
     created() {
813
     created() {
735
       this.GetConfigInfo()
814
       this.GetConfigInfo()
736
       this.propForm.goodUnit = this.$store.getters.good_unit
815
       this.propForm.goodUnit = this.$store.getters.good_unit
737
       const order_id = this.$route.query.id
816
       const order_id = this.$route.query.id
738
       this.GetOrderDetail(order_id)
817
       this.GetOrderDetail(order_id)
818
+      this.is_check = parseInt(this.$route.query.is_check)
819
+      if(this.is_check == 1){
820
+        this.disabled = true
821
+        this.canCelShow = true
822
+      }else{
823
+        this.disabled =false
824
+        this.canCelShow = false
825
+      }
739
     }
826
     }
740
 
827
 
741
   }
828
   }

+ 83 - 66
src/xt_pages/stock/drugs/components/drugOutDetail.vue Прегледај датотеку

22
       type="primary"
22
       type="primary"
23
       >汇总导出
23
       >汇总导出
24
     </el-button>
24
     </el-button>
25
-   
25
+
26
     <div class="cell clearfix">
26
     <div class="cell clearfix">
27
        <label class="title"><span class="name">仓库</span> :</label>
27
        <label class="title"><span class="name">仓库</span> :</label>
28
       <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
28
       <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
32
             :label="option.storehouse_name"
32
             :label="option.storehouse_name"
33
             :value="option.id">
33
             :value="option.id">
34
           </el-option>
34
           </el-option>
35
-      </el-select>  
35
+      </el-select>
36
       <el-input
36
       <el-input
37
         size="small"
37
         size="small"
38
         style="width: 200px;"
38
         style="width: 200px;"
76
           value-format="yyyy-MM-dd"
76
           value-format="yyyy-MM-dd"
77
           @change="endTimeChange"
77
           @change="endTimeChange"
78
         ></el-date-picker>
78
         ></el-date-picker>
79
-     
79
+
80
     </div>
80
     </div>
81
 
81
 
82
-  
82
+
83
     <el-row :gutter="12" style="margin-top: 10px">
83
     <el-row :gutter="12" style="margin-top: 10px">
84
       <el-table
84
       <el-table
85
         :data="tableData"
85
         :data="tableData"
122
           </template>
122
           </template>
123
         </el-table-column>
123
         </el-table-column>
124
 
124
 
125
-       
125
+
126
         <el-table-column label="操作时间" align="center">
126
         <el-table-column label="操作时间" align="center">
127
           <template slot-scope="scope">
127
           <template slot-scope="scope">
128
            <span>{{getTime(scope.row.ctime)}}</span>
128
            <span>{{getTime(scope.row.ctime)}}</span>
140
         </el-table-column>
140
         </el-table-column>
141
         <el-table-column label="出货价" align="center">
141
         <el-table-column label="出货价" align="center">
142
           <template slot-scope="scope">
142
           <template slot-scope="scope">
143
-           <span v-if="org_id == 9919">{{scope.row.last_price}} </span> 
143
+           <span v-if="org_id == 9919">{{scope.row.last_price}} </span>
144
            <span v-else>
144
            <span v-else>
145
              <span v-if="scope.row.price >0"> {{scope.row.price}}</span>
145
              <span v-if="scope.row.price >0"> {{scope.row.price}}</span>
146
             <span v-if="scope.row.price  == 0"> {{getPrice(scope.row.drug_id)}}</span>
146
             <span v-if="scope.row.price  == 0"> {{getPrice(scope.row.drug_id)}}</span>
149
         </el-table-column>
149
         </el-table-column>
150
         <el-table-column label="数量" align="center">
150
         <el-table-column label="数量" align="center">
151
           <template slot-scope="scope">
151
           <template slot-scope="scope">
152
-            {{scope.row.count}} 
152
+            {{scope.row.count}}
153
           </template>
153
           </template>
154
         </el-table-column>
154
         </el-table-column>
155
          <el-table-column label="单位" align="center">
155
          <el-table-column label="单位" align="center">
156
           <template slot-scope="scope">
156
           <template slot-scope="scope">
157
-            {{scope.row.count_unit}} 
157
+            {{scope.row.count_unit}}
158
           </template>
158
           </template>
159
         </el-table-column>
159
         </el-table-column>
160
         <el-table-column label="总价" align="center">
160
         <el-table-column label="总价" align="center">
161
           <template slot-scope="scope">
161
           <template slot-scope="scope">
162
             <span v-if="scope.row.is_total !=1">
162
             <span v-if="scope.row.is_total !=1">
163
-              <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span> 
164
-              <span v-if="org_id == 10210 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span> 
165
-              <span v-if="org_id == 9671 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span> 
163
+              <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span>
164
+              <span v-if="org_id == 10210 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span>
165
+              <span v-if="org_id == 9671 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span>
166
               <span v-if ="org_id!=9919 && org_id!=10210 && org_id!=9671">
166
               <span v-if ="org_id!=9919 && org_id!=10210 && org_id!=9671">
167
                  {{scope.row.total_price}}
167
                  {{scope.row.total_price}}
168
                </span>
168
                </span>
200
 
200
 
201
   created() {
201
   created() {
202
     this.org_id = this.$store.getters.xt_user.org.id
202
     this.org_id = this.$store.getters.xt_user.org.id
203
-   
203
+
204
     var nowDate = new Date();
204
     var nowDate = new Date();
205
     var nowYear = nowDate.getFullYear();
205
     var nowYear = nowDate.getFullYear();
206
     var nowMonth = nowDate.getMonth() + 1;
206
     var nowMonth = nowDate.getMonth() + 1;
224
     var start_time = window.sessionStorage.getItem('start_out_time')
224
     var start_time = window.sessionStorage.getItem('start_out_time')
225
      var end_time =  window.sessionStorage.getItem('end_out_time')
225
      var end_time =  window.sessionStorage.getItem('end_out_time')
226
     if(start_time!=null){
226
     if(start_time!=null){
227
-       this.start_time = start_time   
227
+       this.start_time = start_time
228
     }
228
     }
229
     if(end_time!=null){
229
     if(end_time!=null){
230
-     
230
+
231
       this.end_time = end_time
231
       this.end_time = end_time
232
     }
232
     }
233
-    
233
+
234
     this.getDrugOutOrderPrint()
234
     this.getDrugOutOrderPrint()
235
     this.GetConfigInfo();
235
     this.GetConfigInfo();
236
     this.fetchAllAdminUsers();
236
     this.fetchAllAdminUsers();
237
     this.getlist()
237
     this.getlist()
238
     this.getBaseDrugLibList()
238
     this.getBaseDrugLibList()
239
- 
239
+
240
   },
240
   },
241
   data() {
241
   data() {
242
     return {
242
     return {
327
     },
327
     },
328
     fetchAllAdminUsers() {
328
     fetchAllAdminUsers() {
329
       fetchAllAdminUsers().then(response => {
329
       fetchAllAdminUsers().then(response => {
330
-       
330
+
331
         if (response.data.state == 1) {
331
         if (response.data.state == 1) {
332
           this.adminUserOptions = response.data.data.users;
332
           this.adminUserOptions = response.data.data.users;
333
         }
333
         }
384
         }
384
         }
385
       });
385
       });
386
     },
386
     },
387
-   
387
+
388
     getTime: function(val) {
388
     getTime: function(val) {
389
       if (val == 0) {
389
       if (val == 0) {
390
         return "";
390
         return "";
407
          page:this.page,
407
          page:this.page,
408
          limit:this.limit,
408
          limit:this.limit,
409
          storehouse_id:this.storehouse_id,
409
          storehouse_id:this.storehouse_id,
410
-      }  
410
+      }
411
       getDrugOutDetail(params).then(response=>{
411
       getDrugOutDetail(params).then(response=>{
412
         this.tableData = []
412
         this.tableData = []
413
         this.tableList = []
413
         this.tableList = []
428
                order[i].total_price = order[i].count * order[i].last_price
428
                order[i].total_price = order[i].count * order[i].last_price
429
                total_price += order[i].count * order[i].last_price
429
                total_price += order[i].count * order[i].last_price
430
              }else{
430
              }else{
431
-               console.log("555555555555",order[i])
431
+              
432
                if(order[i].price > 0){
432
                if(order[i].price > 0){
433
-                console.log("近来33232323322323")
433
+                
434
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
434
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
435
                    order[i].total_price = order[i].count * order[i].price
435
                    order[i].total_price = order[i].count * order[i].price
436
                  }
436
                  }
437
-                 if(order[i].count_unit == order[i].max_unit){
437
+                 if(order[i].count_unit == order[i].max_unit && order[i].max_unit !=order[i].min_unit){
438
+                   if(order[i].is_sys == 0){
439
+                     order[i].total_price += order[i].count * order[i].price
440
+                   }else{
441
+                     order[i].total_price += order[i].count * order[i].price * order[i].min_number
442
+                   }
443
+                 }
444
+
445
+                if(order[i].count_unit == order[i].max_unit && order[i].max_unit ==order[i].min_unit){
438
                    if(order[i].is_sys == 0){
446
                    if(order[i].is_sys == 0){
439
                      order[i].total_price += order[i].count * order[i].price
447
                      order[i].total_price += order[i].count * order[i].price
440
                    }else{
448
                    }else{
443
                  }
451
                  }
444
 
452
 
445
                 total_price += order[i].total_price
453
                 total_price += order[i].total_price
446
-                
454
+
447
                }
455
                }
448
 
456
 
449
                if(order[i].price ==0 ){
457
                if(order[i].price ==0 ){
450
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
458
                  if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
451
                     order[i].total_price = order[i].count * this.getPrice(order[i].drug_id)
459
                     order[i].total_price = order[i].count * this.getPrice(order[i].drug_id)
452
-                  
460
+
453
                     order[i].price = this.getPrice(order[i].drug_id)
461
                     order[i].price = this.getPrice(order[i].drug_id)
454
                  }
462
                  }
455
-                
456
-                if(order[i].count_unit == order[i].max_unit){
463
+
464
+                if(order[i].count_unit == order[i].max_unit && order[i].max_unit!=order[i].min_unit){
457
                    if(order[i].is_sys == 0){
465
                    if(order[i].is_sys == 0){
458
-                     order[i].total_price += order[i].count * this.getPrice(order[i].drug_id) 
466
+                     order[i].total_price += order[i].count * this.getPrice(order[i].drug_id)
459
                    }else{
467
                    }else{
460
                      order[i].total_price += order[i].count * this.getPrice(order[i].drug_id) * order[i].min_number
468
                      order[i].total_price += order[i].count * this.getPrice(order[i].drug_id) * order[i].min_number
461
                    }
469
                    }
462
                    order[i].price = this.getPrice(order[i].drug_id)
470
                    order[i].price = this.getPrice(order[i].drug_id)
463
                 }
471
                 }
472
+
473
+                 if(order[i].count_unit == order[i].max_unit && order[i].max_unit==order[i].min_unit){
474
+                   if(order[i].is_sys == 0){
475
+                     order[i].total_price += order[i].count * this.getPrice(order[i].drug_id)
476
+                   }else{
477
+                     order[i].total_price += order[i].count * this.getPrice(order[i].drug_id) * order[i].min_number
478
+                   }
479
+                   order[i].price = this.getPrice(order[i].drug_id)
480
+                 }
464
                 total_price +=order[i].total_price
481
                 total_price +=order[i].total_price
465
-               } 
466
-               
482
+               }
483
+
467
              }
484
              }
468
-            
485
+
469
           }
486
           }
470
            console.log("toal_p3232332332233232",total_price)
487
            console.log("toal_p3232332332233232",total_price)
471
            order.push({
488
            order.push({
475
             ctime:"",
492
             ctime:"",
476
             total_price:total_price,
493
             total_price:total_price,
477
           });
494
           });
478
-         
495
+
479
           for(let i=0;i<order.length;i++){
496
           for(let i=0;i<order.length;i++){
480
             order[i].total_price = order[i].total_price.toFixed(2)
497
             order[i].total_price = order[i].total_price.toFixed(2)
481
           }
498
           }
482
-       
499
+
483
           console.log("233223322323322332232323",order)
500
           console.log("233223322323322332232323",order)
484
           this.tableData = order
501
           this.tableData = order
485
 
502
 
523
                 }
540
                 }
524
               }
541
               }
525
              }
542
              }
526
-            
543
+
527
           })
544
           })
528
           let list = Object.values(objInfo);
545
           let list = Object.values(objInfo);
529
-          
546
+
530
           for(let i=0;i<order.length;i++){
547
           for(let i=0;i<order.length;i++){
531
             list.map(item=>{
548
             list.map(item=>{
532
               if(order[i].drug_id == item.drug_id){
549
               if(order[i].drug_id == item.drug_id){
534
               }
551
               }
535
             })
552
             })
536
           }
553
           }
537
-          
538
-         
554
+
555
+
539
           for(let i=0;i<list.length;i++){
556
           for(let i=0;i<list.length;i++){
540
             for(let j=0;j<list[i].child.length;j++){
557
             for(let j=0;j<list[i].child.length;j++){
541
               if(list[i].child[j].count!=null || list[i].child[j].count != "" || list[i].child[j].count!=0){
558
               if(list[i].child[j].count!=null || list[i].child[j].count != "" || list[i].child[j].count!=0){
547
            for(let i=0;i<list.length;i++){
564
            for(let i=0;i<list.length;i++){
548
               list[i].total_price = list[i].count * list[i].price
565
               list[i].total_price = list[i].count * list[i].price
549
             }
566
             }
550
-          
551
-          this.tableList = list 
567
+
568
+          this.tableList = list
552
           var total = response.data.data.total
569
           var total = response.data.data.total
553
           this.total = total
570
           this.total = total
554
-        } 
555
-      }) 
571
+        }
572
+      })
556
     },
573
     },
557
 
574
 
558
    select(){
575
    select(){
559
-       
576
+
560
    },
577
    },
561
 
578
 
562
     getAdminUser(id){
579
     getAdminUser(id){
570
     },
587
     },
571
 
588
 
572
      exportList(){
589
      exportList(){
573
-    
590
+
574
         for(let i=0;i<this.tablePrint.length;i++){
591
         for(let i=0;i<this.tablePrint.length;i++){
575
           this.tablePrint[i].index = i+1
592
           this.tablePrint[i].index = i+1
576
         }
593
         }
577
         for(let i=0;i<this.tablePrint.length;i++){
594
         for(let i=0;i<this.tablePrint.length;i++){
578
            if(this.org_id == 9919){
595
            if(this.org_id == 9919){
579
-           
596
+
580
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
597
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
581
              this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
598
              this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
582
              this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
599
              this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
585
               this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
602
               this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
586
               this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
603
               this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
587
               this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
604
               this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
588
-              this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price) 
605
+              this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
589
            }
606
            }
590
         }
607
         }
591
-  
592
-       
608
+
609
+
593
        import('@/vendor/Export2Excel').then(excel => {
610
        import('@/vendor/Export2Excel').then(excel => {
594
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
611
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
595
        const filterVal = ['index','drug_name', 'unit', 'min_unit','count','min_price','total_price','remark']
612
        const filterVal = ['index','drug_name', 'unit', 'min_unit','count','min_price','total_price','remark']
600
        obj.total_price = obj.total_price.toFixed(2)
617
        obj.total_price = obj.total_price.toFixed(2)
601
        this.tablePrint.push(obj)
618
        this.tablePrint.push(obj)
602
        const data = this.formatJson(filterVal, this.tablePrint)
619
        const data = this.formatJson(filterVal, this.tablePrint)
603
-  
604
-       
620
+
621
+
605
        excel.export_json_to_excel({
622
        excel.export_json_to_excel({
606
            header: tHeader,
623
            header: tHeader,
607
            data,
624
            data,
610
           this.downloadLoading = false
627
           this.downloadLoading = false
611
         })
628
         })
612
        },
629
        },
613
-      
630
+
614
      formatJson(filterVal, jsonData) {
631
      formatJson(filterVal, jsonData) {
615
         return jsonData.map(v => filterVal.map(j => v[j]));
632
         return jsonData.map(v => filterVal.map(j => v[j]));
616
      },
633
      },
641
               }else{
658
               }else{
642
                 this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].last_price)
659
                 this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].last_price)
643
               }
660
               }
644
-              
661
+
645
             }else{
662
             }else{
646
               this.tableData[i].total = (this.tableData[i].count * this.tableData[i].price)
663
               this.tableData[i].total = (this.tableData[i].count * this.tableData[i].price)
647
               if(this.tableData[i].count_unit == this.tableData[i].min_unit && this.tableData[i].max_unit!=this.tableData[i].min_unit){
664
               if(this.tableData[i].count_unit == this.tableData[i].min_unit && this.tableData[i].max_unit!=this.tableData[i].min_unit){
654
          }
671
          }
655
        }
672
        }
656
        const data = this.formatJson(filterVal, this.tableData)
673
        const data = this.formatJson(filterVal, this.tableData)
657
-  
658
-     
674
+
675
+
659
        excel.export_json_to_excel({
676
        excel.export_json_to_excel({
660
            header: tHeader,
677
            header: tHeader,
661
            data,
678
            data,
662
            filename: '药品出库明细'
679
            filename: '药品出库明细'
663
          })
680
          })
664
           this.downloadLoading = false
681
           this.downloadLoading = false
665
-      }) 
682
+      })
666
     },
683
     },
667
 
684
 
668
     getBaseDrugLibList() {
685
     getBaseDrugLibList() {
685
             for (let i = 0; i < response.data.data.list.length; i++) {
702
             for (let i = 0; i < response.data.data.list.length; i++) {
686
               this.drugList.push(response.data.data.list[i])
703
               this.drugList.push(response.data.data.list[i])
687
             }
704
             }
688
- 
705
+
689
           }
706
           }
690
         })
707
         })
691
       },
708
       },
694
          start_time:this.start_time,
711
          start_time:this.start_time,
695
          end_time:this.end_time,
712
          end_time:this.end_time,
696
          order_type:2,
713
          order_type:2,
697
-      }  
714
+      }
698
      getDrugOutOrderPrint(params).then(response=>{
715
      getDrugOutOrderPrint(params).then(response=>{
699
         if(response.data.state == 1){
716
         if(response.data.state == 1){
700
             var list = response.data.data.list
717
             var list = response.data.data.list
744
               }
761
               }
745
             })
762
             })
746
             }
763
             }
747
-           
764
+
748
             let newArr = Object.values(objInfo);
765
             let newArr = Object.values(objInfo);
749
             for(let i=0;i<newArr.length;i++){
766
             for(let i=0;i<newArr.length;i++){
750
               for(let j=0;j<list.length;j++){
767
               for(let j=0;j<list.length;j++){
754
               }
771
               }
755
             }
772
             }
756
            this.tablePrint = newArr
773
            this.tablePrint = newArr
757
-          
774
+
758
         }
775
         }
759
      })
776
      })
760
     },
777
     },
793
           }else{
810
           }else{
794
             arr[i].count = arr[i].count
811
             arr[i].count = arr[i].count
795
           }
812
           }
796
-        }  
813
+        }
797
         for(let j=0;j<arr.length;j++){
814
         for(let j=0;j<arr.length;j++){
798
           total +=arr[j].count
815
           total +=arr[j].count
799
         }
816
         }
800
-        
817
+
801
         return (total*min_price).toFixed(2)
818
         return (total*min_price).toFixed(2)
802
       },
819
       },
803
 
820
 
809
           }else{
826
           }else{
810
             arr[i].count = arr[i].count
827
             arr[i].count = arr[i].count
811
           }
828
           }
812
-        }  
829
+        }
813
         for(let j=0;j<arr.length;j++){
830
         for(let j=0;j<arr.length;j++){
814
           total +=arr[j].count
831
           total +=arr[j].count
815
         }
832
         }
816
-     
833
+
817
         return total*min_price
834
         return total*min_price
818
       },
835
       },
819
       getCountSix(drug_id,val){
836
       getCountSix(drug_id,val){
820
-     
821
-        var count = 0 
837
+
838
+        var count = 0
822
         for(let i=0;i<val.length;i++){
839
         for(let i=0;i<val.length;i++){
823
           count+= val[i].count
840
           count+= val[i].count
824
         }
841
         }
825
         return count
842
         return count
826
       },
843
       },
827
       getCountSenven(drug_id,val,price){
844
       getCountSenven(drug_id,val,price){
828
-        var count = 0 
845
+        var count = 0
829
         for(let i=0;i<val.length;i++){
846
         for(let i=0;i<val.length;i++){
830
           count+= val[i].count
847
           count+= val[i].count
831
         }
848
         }
832
         return (count*price).toFixed(2)
849
         return (count*price).toFixed(2)
833
       },
850
       },
834
       getCountSenvenOne(drug_id,val,price){
851
       getCountSenvenOne(drug_id,val,price){
835
-        var count = 0 
852
+        var count = 0
836
         for(let i=0;i<val.length;i++){
853
         for(let i=0;i<val.length;i++){
837
           count+= val[i].count
854
           count+= val[i].count
838
         }
855
         }
872
      changeHouseList(){
889
      changeHouseList(){
873
        this.houseList = []
890
        this.houseList = []
874
        this.getlist()
891
        this.getlist()
875
-     } 
892
+     }
876
   }
893
   }
877
 };
894
 };
878
 </script>
895
 </script>

+ 44 - 1
src/xt_pages/stock/drugs/drugStockInOrder.vue Прегледај датотеку

96
           >导出</el-button
96
           >导出</el-button
97
         >
97
         >
98
       </div>
98
       </div>
99
+      
100
+      <span>&nbsp;&nbsp;</span>
101
+      <label class="title"><span class="name">审核状态</span> :</label>
102
+      <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
103
+          <el-option
104
+            v-for="(option, index) in checkList"
105
+            :key="index"
106
+            :label="option.name"
107
+            :value="option.id">
108
+          </el-option>
109
+      </el-select>  
110
+     
111
+     
99
 
112
 
100
       <el-table
113
       <el-table
101
         :data="Warehouse.warehouseDate"
114
         :data="Warehouse.warehouseDate"
147
           </template>
160
           </template>
148
         </el-table-column>
161
         </el-table-column>
149
 
162
 
163
+        <el-table-column label="审核状态" align="center">
164
+          <template slot-scope="scope">
165
+            <span v-if="scope.row.is_check == 1">已审核</span>
166
+            <span v-if="scope.row.is_check == 2">未审核</span>
167
+          </template>
168
+        </el-table-column>
169
+
150
         <el-table-column label="操作" align="center" width="240">
170
         <el-table-column label="操作" align="center" width="240">
151
           <template slot-scope="scope">
171
           <template slot-scope="scope">
152
             <el-tooltip
172
             <el-tooltip
480
       exportList: [],
500
       exportList: [],
481
       houseList: [],
501
       houseList: [],
482
       storehouse_id: 0,
502
       storehouse_id: 0,
503
+      check_type:0,
504
+      checkList:[
505
+       {id:0,name:"全部"},
506
+       {id:1,name:"已审核"},
507
+       {id:2,name:"未审核"},
508
+      ]
483
     };
509
     };
484
   },
510
   },
485
 
511
 
493
         type: this.type,
519
         type: this.type,
494
         keywords: this.searchKey,
520
         keywords: this.searchKey,
495
         storehouse_id: this.storehouse_id,
521
         storehouse_id: this.storehouse_id,
522
+        check_type:this.check_type,
496
       };
523
       };
497
       this.Warehouse.warehouseDate = [];
524
       this.Warehouse.warehouseDate = [];
498
       getDrugWarehouseList(Params).then((response) => {
525
       getDrugWarehouseList(Params).then((response) => {
518
         type: this.type,
545
         type: this.type,
519
         keywords: this.searchKey,
546
         keywords: this.searchKey,
520
         storehouse_id: this.storehouse_id,
547
         storehouse_id: this.storehouse_id,
548
+        check_type:this.check_type,
521
       };
549
       };
522
       this.Warehouse.warehouseDate = [];
550
       this.Warehouse.warehouseDate = [];
523
       getDrugWarehouseList(Params).then((response) => {
551
       getDrugWarehouseList(Params).then((response) => {
679
           type: this.type,
707
           type: this.type,
680
           supply_warehouse_id: row.supply_warehouse_id,
708
           supply_warehouse_id: row.supply_warehouse_id,
681
           is_sys: row.is_sys,
709
           is_sys: row.is_sys,
710
+          is_check:row.is_check,
682
         },
711
         },
683
       });
712
       });
684
     },
713
     },
718
         this.$message.error("自动入库数据不能删除!");
747
         this.$message.error("自动入库数据不能删除!");
719
         return false;
748
         return false;
720
       }
749
       }
750
+      if(row.is_check == 1){
751
+        this.$message.error("已审核的单据不能删除")
752
+        return false
753
+      }
721
       const ids = [];
754
       const ids = [];
722
       ids.push(row.id);
755
       ids.push(row.id);
723
       const idStr = ids.join(",");
756
       const idStr = ids.join(",");
779
       const ids = [];
812
       const ids = [];
780
       const idOne = [];
813
       const idOne = [];
781
       for (let i = 0; i < this.selectedTableData.length; i++) {
814
       for (let i = 0; i < this.selectedTableData.length; i++) {
815
+        if(this.selectedTableData[i].is_check == 1){
816
+          this.$message.error("已审核单据不能删除!")
817
+          return false
818
+        }
782
         if (this.selectedTableData[i].is_sys == 13) {
819
         if (this.selectedTableData[i].is_sys == 13) {
783
           this.$message.error("调拨入库数据不能删除!");
820
           this.$message.error("调拨入库数据不能删除!");
784
           return false;
821
           return false;
785
         }
822
         }
786
         ids.push(this.selectedTableData[i].id);
823
         ids.push(this.selectedTableData[i].id);
787
-        idOne.push(this.selectedTableData[i].supply_warehouse_id);
824
+        if(this.selectedTableData[i].supply_warehouse_id >0){
825
+          idOne.push(this.selectedTableData[i].supply_warehouse_id);
826
+        }
827
+      
788
       }
828
       }
789
 
829
 
790
       for (let i = 0; i < idOne.length; i++) {
830
       for (let i = 0; i < idOne.length; i++) {
1014
     changeStoreHouse() {
1054
     changeStoreHouse() {
1015
       this.GetWarehouse();
1055
       this.GetWarehouse();
1016
     },
1056
     },
1057
+    changeCheckType(){
1058
+      this.GetWarehouse();
1059
+    }
1017
   },
1060
   },
1018
 };
1061
 };
1019
 </script>
1062
 </script>

+ 120 - 5
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Прегледај датотеку

15
           class="filter-item"
15
           class="filter-item"
16
           >保 存</el-button
16
           >保 存</el-button
17
         >
17
         >
18
+        <el-button
19
+          size="small"
20
+          type="primary"
21
+          @click="toCheck()"
22
+          v-show ="showCheck"
23
+          class="filter-item"
24
+          >审核</el-button
25
+        >
26
+       <!-- <el-button
27
+          size="small"
28
+          type="primary"
29
+          @click="toReturnCheck()"
30
+          v-show ="showReturnCheck"
31
+          class="filter-item"
32
+          >反审核</el-button
33
+        > -->
18
       </div>
34
       </div>
19
     </div>
35
     </div>
20
     <div class="app-container" v-loading="loading">
36
     <div class="app-container" v-loading="loading">
396
   GetAllConfig,
412
   GetAllConfig,
397
   GetAllDrugInfoByID,
413
   GetAllDrugInfoByID,
398
   postDrugWarehouse,
414
   postDrugWarehouse,
415
+  toCheckWarehousingInfo,
416
+  toReturnCheckWarehousing
399
 } from "@/api/drug/drug_stock";
417
 } from "@/api/drug/drug_stock";
400
 import BreadCrumb from "../../components/bread-crumb";
418
 import BreadCrumb from "../../components/bread-crumb";
401
 import DrugsStockDialog from "./drugsStockDialog/index";
419
 import DrugsStockDialog from "./drugsStockDialog/index";
438
       tableRules: {
456
       tableRules: {
439
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
457
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
440
         warehousing_count: [
458
         warehousing_count: [
441
-          { required: true, message: "数量不能为空", trigge: "blur" },
459
+          { required: true, message: "数量不能为空", trigger: "blur" },
442
         ],
460
         ],
443
 
461
 
444
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
462
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
517
       loading: false,
535
       loading: false,
518
       list: [],
536
       list: [],
519
       storehouse_id: "",
537
       storehouse_id: "",
538
+      warehousing_id:0,
539
+      showCheck:false,
540
+      showReturnCheck:false,
520
     };
541
     };
521
   },
542
   },
522
   methods: {
543
   methods: {
663
     },
684
     },
664
     handleEdit: function (index, row) {
685
     handleEdit: function (index, row) {
665
       const tempObj = {};
686
       const tempObj = {};
687
+      tempObj["id"] = 0;
666
       tempObj["drug_name"] = "";
688
       tempObj["drug_name"] = "";
667
       tempObj["drug_id"] = 0;
689
       tempObj["drug_id"] = 0;
668
       tempObj["number"] = "";
690
       tempObj["number"] = "";
706
         return "";
728
         return "";
707
       }
729
       }
708
     },
730
     },
731
+   getTimeOne(val) {
732
+        if(val < 0){
733
+          return ""
734
+        }
735
+        if(val == ""){
736
+        return ""
737
+        }else {
738
+        return uParseTime(val, '{y}-{m}-{d}')
739
+        }
740
+     },
709
     showDialog(index, row) {
741
     showDialog(index, row) {
710
       const loading = this.$loading({
742
       const loading = this.$loading({
711
         lock: true,
743
         lock: true,
800
             this.$message.success("请添加入库商品");
832
             this.$message.success("请添加入库商品");
801
             return;
833
             return;
802
           }
834
           }
835
+        
803
           for (let i = 0; i < this.recordInfo.recordData.length; i++) {
836
           for (let i = 0; i < this.recordInfo.recordData.length; i++) {
804
             if (this.recordInfo.recordData[i].dealer == "") {
837
             if (this.recordInfo.recordData[i].dealer == "") {
805
               this.recordInfo.recordData[i].dealer = 0;
838
               this.recordInfo.recordData[i].dealer = 0;
840
             this.form.manufacturer,
873
             this.form.manufacturer,
841
             this.form.dealer,
874
             this.form.dealer,
842
             this.type,
875
             this.type,
843
-            this.storehouse_id
876
+            this.storehouse_id,
877
+            this.warehousing_id,
844
           ).then((response) => {
878
           ).then((response) => {
845
             if (response.data.state == 0) {
879
             if (response.data.state == 0) {
846
               this.loading = false;
880
               this.loading = false;
848
               return false;
882
               return false;
849
             } else {
883
             } else {
850
               this.loading = false;
884
               this.loading = false;
851
-              this.$message.success("入库成功");
885
+              this.$message.success("保存成功");
852
               this.listLoading = false;
886
               this.listLoading = false;
853
-              this.$router.back(-1);
887
+              var info = response.data.data.info
888
+              this.warehousing_id = info.id
889
+              var list = response.data.data.list
890
+              var manufacturerList = response.data.data.manufacturerList
891
+              var dealerList = response.data.data.dealerList
892
+              var drugTypeList = response.data.data.drugTypeList
893
+              for(let i=0;i<list.length;i++){
894
+                for(let j=0;j<manufacturerList.length;j++){
895
+                   if(list[i].manufacturer_id == manufacturerList[j].id){
896
+                      list[i].manufacturer_id = manufacturerList[j].manufacturer_name
897
+                   }
898
+                }
899
+                for(let s=0;s<dealerList.length;s++){
900
+                  if(list[i].dealer_id == dealerList[s].id){
901
+                     list[i].dealer_id = dealerList[s].manufacturer_name
902
+                  }
903
+                }
904
+
905
+                list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
906
+                list[i].product_date = this.getTimeOne(list[i].product_date)
907
+                list[i].drug_name = list[i].drug.drug_name
908
+                list[i].name = list[i].drug.dose + list[i].drug.dose_unit +"*"+list[i].drug.min_number +list[i].drug.min_unit+"/"+list[i].drug.max_unit
909
+                for(let z=0;z<drugTypeList.length;z++){
910
+                   if(list[i].drug.drug_type == drugTypeList[z].value){
911
+                      list[i].drug_type = drugTypeList[z].name
912
+                   }
913
+                }
914
+                list[i].last_price = list[i].price
915
+                list[i].warehousing_count = list[i].warehousing_count.toString()
916
+              }
917
+              this.recordInfo.recordData = []
918
+              this.recordInfo.recordData = list
919
+              this.showCheck = true
920
+              this.showReturnCheck = false
921
+              // this.$router.back(-1);
854
             }
922
             }
855
           });
923
           });
856
         } else {
924
         } else {
969
         }
1037
         }
970
       }
1038
       }
971
     },
1039
     },
1040
+    toCheck(){
1041
+      const loading = this.$loading({
1042
+        lock: true,
1043
+        text: "Loading",
1044
+        spinner: "el-icon-loading",
1045
+        background: "rgba(0, 0, 0, 0.7)",
1046
+      });
1047
+       var params = {
1048
+         warehousing_id:this.warehousing_id,
1049
+       }
1050
+      toCheckWarehousingInfo(params).then(response=>{
1051
+         if(response.data.state == 1){
1052
+           var list = response.data.data.list
1053
+           this.$message.success("审核成功!")
1054
+           this.$router.back(-1);
1055
+           this.showCheck = false
1056
+           this.showReturnCheck = true
1057
+           loading.close()
1058
+         }else{
1059
+          this.$message.error("审核失败!")
1060
+          loading.close()
1061
+         }
1062
+      })
1063
+    },
1064
+    toReturnCheck(){
1065
+       const loading = this.$loading({
1066
+        lock: true,
1067
+        text: "Loading",
1068
+        spinner: "el-icon-loading",
1069
+        background: "rgba(0, 0, 0, 0.7)",
1070
+      });
1071
+        var params = {
1072
+          warehousing_id:this.warehousing_id,
1073
+        }
1074
+      toReturnCheckWarehousing(params).then(response=>{
1075
+         if(response.data.state == 1){
1076
+          var list = response.data.data.list
1077
+           this.$message.success("反审核成功!")
1078
+           this.showCheck = true
1079
+           this.showReturnCheck = false
1080
+           loading.close()
1081
+         }else{
1082
+          this.$message.error("反审核失败!")
1083
+          loading.close()
1084
+         }
1085
+      })
1086
+    }
972
   },
1087
   },
973
   created() {
1088
   created() {
974
     if (this.$route.path == "/Pharmacy/in/add") {
1089
     if (this.$route.path == "/Pharmacy/in/add") {
991
       "-" +
1106
       "-" +
992
       (nowDay < 10 ? "0" + nowDay : nowDay);
1107
       (nowDay < 10 ? "0" + nowDay : nowDay);
993
     const tempObj = {};
1108
     const tempObj = {};
994
-
1109
+    tempObj["id"] = 0;
995
     tempObj["drug_id"] = 0;
1110
     tempObj["drug_id"] = 0;
996
     tempObj["drug_name"] = "";
1111
     tempObj["drug_name"] = "";
997
     tempObj["dosage"] = "";
1112
     tempObj["dosage"] = "";

+ 121 - 55
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Прегледај датотеку

18
           size="small"
18
           size="small"
19
           type="primary"
19
           type="primary"
20
           @click="submit()"
20
           @click="submit()"
21
+          v-if="is_check == 2"
21
           class="filter-item"
22
           class="filter-item"
22
           >保 存</el-button
23
           >保 存</el-button
23
         >
24
         >
25
+        <el-button
26
+          size="small"
27
+          type="primary"
28
+          v-if="is_check == 2"
29
+          @click="toCheck()"
30
+          class="filter-item"
31
+          >审核</el-button
32
+        >
33
+        <el-button
34
+          size="small"
35
+          type="primary"
36
+          v-if="is_check == 1"
37
+          @click="toReturnCheck()"
38
+          class="filter-item"
39
+          >反审核</el-button
40
+        >
24
       </div>
41
       </div>
25
     </div>
42
     </div>
26
 
43
 
206
                   placeholder="请输入拆零零售价"
223
                   placeholder="请输入拆零零售价"
207
                   type="number"
224
                   type="number"
208
                   v-model="scope.row.retail_price"
225
                   v-model="scope.row.retail_price"
226
+                  :disabled="disabled"
209
                 ></el-input>
227
                 ></el-input>
210
                
228
                
211
               </el-form-item>
229
               </el-form-item>
226
                     placeholder="请输入单价"
244
                     placeholder="请输入单价"
227
                     type="number"
245
                     type="number"
228
                     v-model="scope.row.last_price"
246
                     v-model="scope.row.last_price"
247
+                    :disabled="disabled"
229
                   ></el-input>
248
                   ></el-input>
230
                 
249
                 
231
                 </el-form-item>
250
                 </el-form-item>
377
   GetAllDrugInfoByID,
396
   GetAllDrugInfoByID,
378
   getDrugWarehouseInfoList,
397
   getDrugWarehouseInfoList,
379
   DeleteDrugWarehouseInfoItem,
398
   DeleteDrugWarehouseInfoItem,
380
-  EditDrugWarehouse
399
+  EditDrugWarehouse,
400
+  toCheckWarehousingInfo,
401
+  toReturnCheckWarehousing
381
 } from "@/api/drug/drug_stock";
402
 } from "@/api/drug/drug_stock";
382
 import BreadCrumb from "../../components/bread-crumb";
403
 import BreadCrumb from "../../components/bread-crumb";
383
 import DrugsStockDialog from './drugsStockDialog/index'
404
 import DrugsStockDialog from './drugsStockDialog/index'
469
       disabled:false,
490
       disabled:false,
470
       storehouse_id:"",
491
       storehouse_id:"",
471
       list:[],
492
       list:[],
493
+      is_check:0,
494
+      drug_waresing_id:0,
472
     };
495
     };
473
   },
496
   },
474
   methods: {
497
   methods: {
565
       return name;
588
       return name;
566
     },
589
     },
567
     handleEdit: function(index, row) {
590
     handleEdit: function(index, row) {
591
+      if(parseInt(this.$route.query.is_check) == 1){
592
+        this.$message.error("已审核的单据不能新增!")
593
+        return false
594
+      }
568
       if(parseInt(this.$route.query.is_sys)==13){
595
       if(parseInt(this.$route.query.is_sys)==13){
569
         this.$message.error("调拨入库数据不能新增!")
596
         this.$message.error("调拨入库数据不能新增!")
570
         return false
597
         return false
580
       tempObj["product_date"] = "";
607
       tempObj["product_date"] = "";
581
       tempObj["expiry_date"] = "";
608
       tempObj["expiry_date"] = "";
582
       tempObj["warehousing_count"] = "";
609
       tempObj["warehousing_count"] = "";
610
+      tempObj["last_price"] = "";
583
       tempObj["price"] = "";
611
       tempObj["price"] = "";
584
       tempObj["remark"] = "";
612
       tempObj["remark"] = "";
585
       tempObj["dealer"] = "";
613
       tempObj["dealer"] = "";
590
       this.recordInfo.recordData.push(tempObj);
618
       this.recordInfo.recordData.push(tempObj);
591
     },
619
     },
592
     handleDelete: function(index, row) {
620
     handleDelete: function(index, row) {
621
+      if(parseInt(this.$route.query.is_check) == 1){
622
+        this.$message.error("已审核的单据不能删除!")
623
+        return false
624
+      }
593
       if(parseInt(this.$route.query.is_sys)==13){
625
       if(parseInt(this.$route.query.is_sys)==13){
594
         this.$message.error("调拨入库数据不能删除!")
626
         this.$message.error("调拨入库数据不能删除!")
595
         return false
627
         return false
636
         return "";
668
         return "";
637
       }
669
       }
638
     },
670
     },
639
-    // showDialog(index, row) {
640
-    //   this.currentIndex = index;
641
-    //   const loading = this.$loading({
642
-    //     lock: true,
643
-    //     text: "Loading",
644
-    //     spinner: "el-icon-loading",
645
-    //     background: "rgba(0, 0, 0, 0.7)"
646
-    //   });
647
-
648
-    //   const params = {
649
-    //     manufacturer_id: this.form.manufacturer,
650
-    //     dealer_id: this.form.dealer
651
-    //   };
652
-    //   GetAllDrugInfoByID(params).then(response => {
653
-    //     if (response.data.state == 0) {
654
-    //       this.$message.error(response.data.msg);
655
-    //       return false;
656
-    //     } else {
657
-    //       if (response.data.data.drugs.length <= 0) {
658
-    //         this.$message.error("该厂商或经销商没有药品信息");
659
-    //         loading.close();
660
-
661
-    //         return;
662
-    //       }
663
-    //       this.$refs.dialog.show();
664
-    //       for (let i = 0; i < response.data.data.drugs.length; i++) {
665
-    //         this.propForm.goods.push(
666
-    //           response.data.data.drugs[i]
667
-    //         );
668
-    //       }
669
-    //       const obj = {};
670
-    //       this.propForm.goods = this.propForm.goods.reduce(
671
-    //         (cur, next) => {
672
-    //           obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
673
-    //           return cur;
674
-    //         },
675
-    //         []
676
-    //       ); // 设置cur默认类型为数组,并且初始值为空的数组
677
-    //     }
678
-
679
-    //     for (let i = 0; i < this.propForm.goods.length; i++) {
680
-    //       for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
681
-    //         var respObj = this.propForm.goods[i].drug_specs[a];
682
-    //         respObj["isSelected"] = false;
683
-    //       }
684
-    //     }
685
-    //     loading.close();
686
-    //   });
687
-    // },
671
+    
688
     back() {
672
     back() {
689
       this.$router.go(-1);
673
       this.$router.go(-1);
690
     },
674
     },
749
               return false;
733
               return false;
750
             } else {
734
             } else {
751
               this.loading = false
735
               this.loading = false
752
-              this.$message.success("入库成功");
736
+              this.$message.success("保存成功");
737
+              var list = response.data.data.list
738
+              var manufacturerList = response.data.data.manufacturerList
739
+              var dealerList = response.data.data.dealerList
740
+              var drugTypeList = response.data.data.drugTypeList
741
+              for(let i=0;i<list.length;i++){
742
+                for(let j=0;j<manufacturerList.length;j++){
743
+                   if(list[i].manufacturer_id == manufacturerList[j].id){
744
+                      list[i].manufacturer_id = manufacturerList[j].manufacturer_name
745
+                   }
746
+                }
747
+                for(let s=0;s<dealerList.length;s++){
748
+                  if(list[i].dealer_id == dealerList[s].id){
749
+                     list[i].dealer_id = dealerList[s].manufacturer_name
750
+                  }
751
+                }
752
+
753
+                list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
754
+                list[i].product_date = this.getTimeOne(list[i].product_date)
755
+                list[i].drug_name = list[i].drug.drug_name
756
+                list[i].name = list[i].drug.dose + list[i].drug.dose_unit +"*"+list[i].drug.min_number +list[i].drug.min_unit+"/"+list[i].drug.max_unit
757
+                for(let z=0;z<drugTypeList.length;z++){
758
+                   if(list[i].drug.drug_type == drugTypeList[z].value){
759
+                      list[i].drug_type = drugTypeList[z].name
760
+                   }
761
+                }
762
+                list[i].last_price = list[i].price
763
+                list[i].warehousing_count = list[i].warehousing_count.toString()
764
+              }
765
+              this.recordInfo.recordData = []
766
+              this.recordInfo.recordData = list
753
               this.listLoading = false
767
               this.listLoading = false
754
-              this.$router.back(-1);
755
             }
768
             }
756
           });
769
           });
757
         } else {
770
         } else {
916
            }
929
            }
917
         }
930
         }
918
       },
931
       },
919
-    
920
-
932
+     toCheck(){
933
+       const loading = this.$loading({
934
+        lock: true,
935
+        text: "Loading",
936
+        spinner: "el-icon-loading",
937
+        background: "rgba(0, 0, 0, 0.7)",
938
+      });
939
+       var params = {
940
+         warehousing_id:parseInt(this.$route.query.id),
941
+       }
942
+      toCheckWarehousingInfo(params).then(response=>{
943
+         if(response.data.state == 1){
944
+           var list = response.data.data.list
945
+           this.$message.success("审核成功!")
946
+           this.$router.back(-1);
947
+           loading.close()
948
+         }else{
949
+          this.$message.error("审核失败!")
950
+          loading.close()
951
+         }
952
+      })
953
+    },
954
+    toReturnCheck(){
955
+       const loading = this.$loading({
956
+        lock: true,
957
+        text: "Loading",
958
+        spinner: "el-icon-loading",
959
+        background: "rgba(0, 0, 0, 0.7)",
960
+      });
961
+        var params = {
962
+          warehousing_id:parseInt(this.$route.query.id),
963
+        }
964
+      toReturnCheckWarehousing(params).then(response=>{
965
+         if(response.data.state == 1){
966
+           this.$message.success(response.data.data.msg)
967
+           this.$router.back(-1);
968
+           loading.close()
969
+         }else{
970
+            this.$message.error(response.data.msg)
971
+            loading.close()
972
+            this.$router.back(-1);
973
+         }
974
+      })
975
+    },
976
+   getTimeOne(val) {
977
+        if(val < 0){
978
+          return ""
979
+        }
980
+        if(val == ""){
981
+        return ""
982
+        }else {
983
+        return uParseTime(val, '{y}-{m}-{d}')
984
+        }
985
+    },
921
   },
986
   },
922
   created() {
987
   created() {
923
    
988
    
925
     this.propForm.goodUnit = this.$store.getters.good_unit;
990
     this.propForm.goodUnit = this.$store.getters.good_unit;
926
     const order_id = this.$route.query.id;
991
     const order_id = this.$route.query.id;
927
     this.GetOrderDetail(order_id);
992
     this.GetOrderDetail(order_id);
993
+    this.is_check = parseInt(this.$route.query.is_check)
928
     this.unitList =  getDataConfig('hemodialysis','units')
994
     this.unitList =  getDataConfig('hemodialysis','units')
929
     if( parseInt(this.$route.query.supply_warehouse_id)>0){
995
     if( parseInt(this.$route.query.supply_warehouse_id)>0){
930
       this.disabled = true
996
       this.disabled = true
931
     }
997
     }
932
-    if(parseInt(this.$route.query.is_sys) == 13){
998
+    if(parseInt(this.$route.query.is_sys) == 13 || this.is_check == 1 ){
933
       this.disabled = true
999
       this.disabled = true
934
     }
1000
     }
935
 
1001
 

+ 66 - 14
src/xt_pages/stock/drugs/drugStockOutOrder.vue Прегледај датотеку

76
             @change="endTimeChange"
76
             @change="endTimeChange"
77
           ></el-date-picker>
77
           ></el-date-picker>
78
         </div>
78
         </div>
79
+
80
+
79
       </div>
81
       </div>
80
 
82
 
81
       <div class="cell clearfix">
83
       <div class="cell clearfix">
93
           >导出</el-button
95
           >导出</el-button
94
         >
96
         >
95
 
97
 
96
-        <!-- <span>&nbsp;&nbsp;</span>
98
+        <span>&nbsp;&nbsp;</span>
97
         <label class="title"><span class="name">出库方式</span> :</label>
99
         <label class="title"><span class="name">出库方式</span> :</label>
98
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
100
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
99
             <el-option
101
             <el-option
102
               :label="option.name"
104
               :label="option.name"
103
               :value="option.id">
105
               :value="option.id">
104
             </el-option>
106
             </el-option>
105
-        </el-select>  -->
107
+        </el-select> 
108
+
109
+      <span>&nbsp;&nbsp;</span>
110
+      <label class="title"><span class="name">审核状态</span> :</label>
111
+      <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
112
+          <el-option
113
+            v-for="(option, index) in checkList"
114
+            :key="index"
115
+            :label="option.name"
116
+            :value="option.id">
117
+          </el-option>
118
+      </el-select>  
106
       </div>
119
       </div>
107
 
120
 
108
       <el-table
121
       <el-table
147
           </template>
160
           </template>
148
         </el-table-column>
161
         </el-table-column>
149
 
162
 
150
-        <el-table-column min-width="35" align="center">
163
+        <el-table-column min-width="40" align="center">
151
           <template slot="header" slot-scope="scope">
164
           <template slot="header" slot-scope="scope">
152
             <span>出库方式</span>
165
             <span>出库方式</span>
153
           </template>
166
           </template>
158
           </template>
171
           </template>
159
         </el-table-column>
172
         </el-table-column>
160
 
173
 
174
+        <el-table-column min-width="40" align="center">
175
+          <template slot="header" slot-scope="scope">
176
+            <span>审核状态</span>
177
+          </template>
178
+          <template slot-scope="scope">
179
+            <span v-if="scope.row.is_check == 1">已审核</span>
180
+            <span v-if="scope.row.is_check == 2">未审核</span>
181
+          
182
+          </template>
183
+        </el-table-column>
184
+
161
         <el-table-column label="操作" align="center" width="240">
185
         <el-table-column label="操作" align="center" width="240">
162
           <template slot-scope="scope">
186
           <template slot-scope="scope">
163
             <el-tooltip
187
             <el-tooltip
588
         { id: 2, name: "自动出库" },
612
         { id: 2, name: "自动出库" },
589
         { id: 3, name: "调拨出库" },
613
         { id: 3, name: "调拨出库" },
590
       ],
614
       ],
615
+      check_type:0,
616
+      checkList:[
617
+       {id:0,name:"全部"},
618
+       {id:1,name:"已审核"},
619
+       {id:2,name:"未审核"},
620
+      ]
591
     };
621
     };
592
   },
622
   },
593
   methods: {
623
   methods: {
601
         keywords: this.searchKey,
631
         keywords: this.searchKey,
602
         storehouse_id: this.storehouse_id,
632
         storehouse_id: this.storehouse_id,
603
         way_type: this.way_type,
633
         way_type: this.way_type,
634
+        check_type:this.check_type,
604
       };
635
       };
605
       this.warehouseOutDate = [];
636
       this.warehouseOutDate = [];
606
       getDrugWarehouseOutList(Params).then((response) => {
637
       getDrugWarehouseOutList(Params).then((response) => {
612
           for (let i = 0; i < response.data.data.list.length; i++) {
643
           for (let i = 0; i < response.data.data.list.length; i++) {
613
             this.warehouseOutDate.push(response.data.data.list[i]);
644
             this.warehouseOutDate.push(response.data.data.list[i]);
614
           }
645
           }
615
-          this.houseList = response.data.data.houseList;
646
+          var obj = { id: 0, storehouse_name: "全部" };
647
+          this.houseList = [];
648
+          this.houseList.push(obj);
649
+          for (let i = 0; i < response.data.data.houseList.length; i++) {
650
+            this.houseList.push(response.data.data.houseList[i]);
651
+          }
616
         }
652
         }
617
       });
653
       });
618
     },
654
     },
641
         keywords: this.searchKey,
677
         keywords: this.searchKey,
642
         storehouse_id: this.storehouse_id,
678
         storehouse_id: this.storehouse_id,
643
         way_type: this.way_type,
679
         way_type: this.way_type,
680
+        check_type:this.check_type,
644
       };
681
       };
645
       this.warehouseOutDate = [];
682
       this.warehouseOutDate = [];
646
       getDrugWarehouseOutList(Params).then((response) => {
683
       getDrugWarehouseOutList(Params).then((response) => {
755
           "&is_sys=" +
792
           "&is_sys=" +
756
           row.is_sys +
793
           row.is_sys +
757
           "&supply_cancel_out_id=" +
794
           "&supply_cancel_out_id=" +
758
-          row.supply_cancel_out_id,
795
+          row.supply_cancel_out_id+"&is_check="+row.is_check
796
+          
759
       });
797
       });
760
     },
798
     },
761
     handleSearch(val) {
799
     handleSearch(val) {
774
         this.$message.error("采购出库数据不能删除!");
812
         this.$message.error("采购出库数据不能删除!");
775
         return;
813
         return;
776
       }
814
       }
815
+      if(row.is_check == 1){
816
+       this.$message.error("已审核的单据不能删除!")
817
+       return false
818
+      }
777
       const ids = [];
819
       const ids = [];
778
       ids.push(row.id);
820
       ids.push(row.id);
779
       const idStr = ids.join(",");
821
       const idStr = ids.join(",");
837
       const ids = [];
879
       const ids = [];
838
       const idsOne = [];
880
       const idsOne = [];
839
       for (let i = 0; i < this.selectedTableData.length; i++) {
881
       for (let i = 0; i < this.selectedTableData.length; i++) {
882
+        if(this.selectedTableData[i].is_check == 1){
883
+          this.$message.error("已审核单据不能删除!")
884
+          return false
885
+        }
840
         if (this.selectedTableData[i].is_sys == 1) {
886
         if (this.selectedTableData[i].is_sys == 1) {
841
           this.$message.error("自动出库数据不能删除!");
887
           this.$message.error("自动出库数据不能删除!");
842
           return false;
888
           return false;
847
         }
893
         }
848
         if (this.selectedTableData[i].is_sys == 0) {
894
         if (this.selectedTableData[i].is_sys == 0) {
849
           ids.push(this.selectedTableData[i].id);
895
           ids.push(this.selectedTableData[i].id);
850
-          idsOne.push(this.selectedTableData[i].supply_cancel_out_id);
896
+          if(this.selectedTableData[i].supply_cancel_out_id >0){
897
+             idsOne.push(this.selectedTableData[i].supply_cancel_out_id);
898
+          }
899
+        
851
         }
900
         }
852
       }
901
       }
853
       if (idsOne.length > 0) {
902
       if (idsOne.length > 0) {
1071
           this.tableShow = true;
1120
           this.tableShow = true;
1072
           this.tableList = [];
1121
           this.tableList = [];
1073
           var list = response.data.data.list;
1122
           var list = response.data.data.list;
1074
-          console.log("lisrt233232323232233223", list);
1123
+          // console.log("lisrt233232323232233223", list);
1075
           this.manufacturerList = response.data.data.manufacturerList;
1124
           this.manufacturerList = response.data.data.manufacturerList;
1076
           this.dealerList = response.data.data.dealerList;
1125
           this.dealerList = response.data.data.dealerList;
1077
           var drugFlowList = response.data.data.drugFlowList;
1126
           var drugFlowList = response.data.data.drugFlowList;
1123
             }
1172
             }
1124
           }
1173
           }
1125
           this.tableList = list;
1174
           this.tableList = list;
1126
-          console.log("单价23323232323232232332232323233223", this.tableList);
1175
+          // console.log("单价23323232323232232332232323233223", this.tableList);
1127
         }
1176
         }
1128
       });
1177
       });
1129
     },
1178
     },
1139
       getAutoDrugDetail(params).then((response) => {
1188
       getAutoDrugDetail(params).then((response) => {
1140
         if (response.data.state == 1) {
1189
         if (response.data.state == 1) {
1141
           this.userList = response.data.data.list;
1190
           this.userList = response.data.data.list;
1142
-          console.log("自动出库数据", this.userList);
1191
+          // console.log("自动出库数据", this.userList);
1143
           if (val.is_sys == 1) {
1192
           if (val.is_sys == 1) {
1144
             this.drugDialogVisible = true;
1193
             this.drugDialogVisible = true;
1145
           }
1194
           }
1291
       return total_price;
1340
       return total_price;
1292
     },
1341
     },
1293
     getDrugBatchNumber(drugid, count) {
1342
     getDrugBatchNumber(drugid, count) {
1294
-      console.log("drug_id2323", drugid);
1295
-      console.log("count", count);
1296
-      console.log("hhhhhhhhhhh", this.batchNumberList);
1343
+      // console.log("drug_id2323", drugid);
1344
+      // console.log("count", count);
1345
+      // console.log("hhhhhhhhhhh", this.batchNumberList);
1297
       var arr = [];
1346
       var arr = [];
1298
       for (let i = 0; i < this.batchNumberList.length; i++) {
1347
       for (let i = 0; i < this.batchNumberList.length; i++) {
1299
         if (
1348
         if (
1313
       getExportOutOrderDrugList(params).then((response) => {
1362
       getExportOutOrderDrugList(params).then((response) => {
1314
         if (response.data.state == 1) {
1363
         if (response.data.state == 1) {
1315
           var list = response.data.data.list;
1364
           var list = response.data.data.list;
1316
-          console.log("list22222", list);
1365
+          // console.log("list22222", list);
1317
           this.exportList = list;
1366
           this.exportList = list;
1318
           this.manufacturerList = response.data.data.manufacturerList;
1367
           this.manufacturerList = response.data.data.manufacturerList;
1319
           this.dealerList = response.data.data.dealerList;
1368
           this.dealerList = response.data.data.dealerList;
1325
         this.$message.error("请勾选出库单");
1374
         this.$message.error("请勾选出库单");
1326
         return;
1375
         return;
1327
       }
1376
       }
1328
-      console.log("hh2323232322323", this.exportList);
1377
+      // console.log("hh2323232322323", this.exportList);
1329
       for (let i = 0; i < this.exportList.length; i++) {
1378
       for (let i = 0; i < this.exportList.length; i++) {
1330
         if (this.exportList[i].dealer == 0) {
1379
         if (this.exportList[i].dealer == 0) {
1331
           this.exportList[i].dealer = "";
1380
           this.exportList[i].dealer = "";
1458
     changeWay() {
1507
     changeWay() {
1459
       this.GetWarehouseOut();
1508
       this.GetWarehouseOut();
1460
     },
1509
     },
1510
+    changeCheckType(){
1511
+      this.GetWarehouseOut();
1512
+    }
1461
   },
1513
   },
1462
 };
1514
 };
1463
 </script>
1515
 </script>

+ 134 - 13
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Прегледај датотеку

21
           class="filter-item"
21
           class="filter-item"
22
           >保 存</el-button
22
           >保 存</el-button
23
         >
23
         >
24
+         <el-button
25
+          size="small"
26
+          type="primary"
27
+          v-show="showCheck"
28
+          class="filter-item"
29
+          @click="toCheck"
30
+          >审 核</el-button
31
+        >
32
+
33
+        <!-- <el-button
34
+          size="small"
35
+          type="primary"
36
+          v-show="showReturnCheck"
37
+          @click="toReturnCheck"
38
+          class="filter-item"
39
+          >反 审 核</el-button
40
+        > -->
24
       </div>
41
       </div>
25
     </div>
42
     </div>
26
 
43
 
407
   GetAllConfig,
424
   GetAllConfig,
408
   GetAllDrugInfoByID,
425
   GetAllDrugInfoByID,
409
   getDrugBatchNumber,
426
   getDrugBatchNumber,
427
+  toCheckDrugOut,
428
+  toReturnCheck
410
 } from "@/api/drug/drug_stock";
429
 } from "@/api/drug/drug_stock";
411
 
430
 
412
 import BreadCrumb from "../../components/bread-crumb";
431
 import BreadCrumb from "../../components/bread-crumb";
480
       storehouse_id: "",
499
       storehouse_id: "",
481
       list: [],
500
       list: [],
482
       doctorList: [],
501
       doctorList: [],
502
+      showCheck:false,
503
+      showReturnCheck:false,
504
+      warehouse_out_id:0,
483
     };
505
     };
484
   },
506
   },
485
   methods: {
507
   methods: {
549
     },
571
     },
550
     handleEdit: function (index, row) {
572
     handleEdit: function (index, row) {
551
       const tempObj = {};
573
       const tempObj = {};
574
+      tempObj["id"] = 0;
552
       tempObj["drug_id"] = 0;
575
       tempObj["drug_id"] = 0;
553
       tempObj["count"] = "";
576
       tempObj["count"] = "";
554
       tempObj["price"] = "";
577
       tempObj["price"] = "";
730
             this.form.dealer,
753
             this.form.dealer,
731
             this.form.manufacturer,
754
             this.form.manufacturer,
732
             this.type,
755
             this.type,
733
-            this.storehouse_id
756
+            this.storehouse_id,
757
+            this.warehouse_out_id,
734
           ).then((response) => {
758
           ).then((response) => {
735
             if (response.data.state == 0) {
759
             if (response.data.state == 0) {
736
               this.$message.error("库存不足");
760
               this.$message.error("库存不足");
746
               var min_number = response.data.data.min_number;
770
               var min_number = response.data.data.min_number;
747
               var min_unit = response.data.data.min_unit;
771
               var min_unit = response.data.data.min_unit;
748
               var max_unit = response.data.data.max_unit;
772
               var max_unit = response.data.data.max_unit;
749
-              var str =
750
-                drug_name +
751
-                " " +
752
-                dose +
753
-                dose_unit +
754
-                "*" +
755
-                min_number +
756
-                min_unit +
757
-                "/" +
758
-                max_unit;
773
+              var str = drug_name +" " +dose +dose_unit +"*" + min_number + min_unit +"/" + max_unit;
774
+              var warehousingOutInfo = response.data.data.warehousingOutInfo
775
+              var warehouseOut = response.data.data.warehouseOut
776
+              this.warehouse_out_id = warehouseOut.id
777
+              var dealerList = response.data.data.dealerList
778
+              var manufacturerList = response.data.data.manufacturerList
779
+              var drugTypeList = response.data.data.drugTypeList
780
+              for(let i=0;i<warehousingOutInfo.length;i++){
781
+                for(let j=0;j<dealerList.length;j++){
782
+                   if(warehousingOutInfo[i].dealer == dealerList[j].id){
783
+                      warehousingOutInfo[i].dealer = dealerList[j].dealer_name
784
+                   }   
785
+                }
786
+
787
+                for(let z=0;z<manufacturerList.length;z++){
788
+                  if(warehousingOutInfo[i].manufacturer == manufacturerList[z].id){
789
+                     warehousingOutInfo[i].manufacturer = manufacturerList[z].manufacturer_name
790
+                  }
791
+                }
792
+                warehousingOutInfo[i].drug_name = warehousingOutInfo[i].drug.drug_name
793
+                warehousingOutInfo[i].name = warehousingOutInfo[i].drug.dose + warehousingOutInfo[i].drug.dose_unit +"*"+warehousingOutInfo[i].drug.min_number +warehousingOutInfo[i].drug.min_unit+"/"+warehousingOutInfo[i].drug.max_unit
794
+                warehousingOutInfo[i].product_date = this.getTimeOne(warehousingOutInfo[i].product_date)
795
+                warehousingOutInfo[i].expiry_date =  this.getTimeOne(warehousingOutInfo[i].expiry_date)
796
+                warehousingOutInfo[i].last_price = warehousingOutInfo[i].price
797
+                warehousingOutInfo[i].max_unit = warehousingOutInfo[i].count_unit
798
+                warehousingOutInfo[i].count = warehousingOutInfo[i].count.toString()
759
 
799
 
800
+                for(let z=0;z<drugTypeList.length;z++){
801
+                   if(warehousingOutInfo[i].drug.drug_type == drugTypeList[z].value){
802
+                      warehousingOutInfo[i].drug_type = drugTypeList[z].name
803
+                   }
804
+                }
805
+              }
760
               if (msg == 1) {
806
               if (msg == 1) {
761
                 this.$message.error(str + "库存不足");
807
                 this.$message.error(str + "库存不足");
762
               } else {
808
               } else {
763
                 loading.close();
809
                 loading.close();
764
-                this.$message.success("出库成功");
810
+                this.$message.success("保存成功");
765
                 this.recordInfo.recordData = [];
811
                 this.recordInfo.recordData = [];
766
-                this.$router.back(-1);
812
+                this.recordInfo.recordData = warehousingOutInfo
813
+                this.showCheck = true
814
+               
767
               }
815
               }
768
             }
816
             }
769
           });
817
           });
1051
       }
1099
       }
1052
       console.log("count_toal23233232", count_total);
1100
       console.log("count_toal23233232", count_total);
1053
     },
1101
     },
1102
+     getTimeOne(val) {
1103
+        if(val < 0){
1104
+          return ""
1105
+        }
1106
+        if(val == ""){
1107
+        return ""
1108
+        }else {
1109
+        return uParseTime(val, '{y}-{m}-{d}')
1110
+        }
1111
+     },
1112
+    toCheck(){
1113
+       const loading = this.$loading({
1114
+        lock: true,
1115
+        text: "Loading",
1116
+        spinner: "el-icon-loading",
1117
+        background: "rgba(0, 0, 0, 0.7)",
1118
+      });
1119
+       var params = {
1120
+        warehouse_out_id:this.warehouse_out_id
1121
+       }
1122
+      toCheckDrugOut(params).then(response=>{
1123
+        if(response.data.state == 1){
1124
+          var warehousingOutInfoList = response.data.data.warehousingOutInfoList
1125
+          var msg =response.data.data.msg
1126
+          if(msg == 1){
1127
+            this.$message.success("审核成功!")
1128
+            this.showCheck = false
1129
+            this.showReturnCheck = true
1130
+            this.$router.back(-1)
1131
+          }
1132
+          if(msg == 2){
1133
+            var drug_name = response.data.data.drug_name
1134
+            var dose = response.data.data.dose
1135
+            var dose_unit = response.data.data.dose_unit
1136
+            var min_number = response.data.data.min_number
1137
+            var min_unit = response.data.data.min_unit
1138
+            var max_unit = response.data.data.max_unit
1139
+            var str = drug_name +" " +dose +dose_unit +"*" + min_number + min_unit +"/" + max_unit;
1140
+            this.$message.error(str+"库存不足,审核失败!")
1141
+          }
1142
+          loading.close()
1143
+        }else{
1144
+          this.$message.error("审核失败!")
1145
+          loading.close()
1146
+        }
1147
+      })
1148
+    },
1149
+    toReturnCheck(){
1150
+       const loading = this.$loading({
1151
+        lock: true,
1152
+        text: "Loading",
1153
+        spinner: "el-icon-loading",
1154
+        background: "rgba(0, 0, 0, 0.7)",
1155
+      });
1156
+       var params = {
1157
+        warehouse_out_id:this.warehouse_out_id
1158
+       }
1159
+      toReturnCheck(params).then(response=>{
1160
+        if(response.data.state == 1){
1161
+          var out = response.data.data.out
1162
+          this.$message.success("反审核成功!")
1163
+          this.showCheck = true
1164
+          this.showReturnCheck = false
1165
+          loading.close()
1166
+          this.$router.back(-1)
1167
+        }else{
1168
+          this.$message.error("反审核失败!")
1169
+          loading.close()
1170
+          this.$router.back(-1)
1171
+        }
1172
+      })
1173
+    }
1054
   },
1174
   },
1055
   created() {
1175
   created() {
1056
     if (this.$route.path == "/Pharmacy/out/add") {
1176
     if (this.$route.path == "/Pharmacy/out/add") {
1072
       "-" +
1192
       "-" +
1073
       (nowDay < 10 ? "0" + nowDay : nowDay);
1193
       (nowDay < 10 ? "0" + nowDay : nowDay);
1074
     const tempObj = {};
1194
     const tempObj = {};
1195
+    tempObj["id"] = 0;
1075
     tempObj["drug_id"] = 0;
1196
     tempObj["drug_id"] = 0;
1076
     tempObj["max_unit"] = "";
1197
     tempObj["max_unit"] = "";
1077
     (tempObj["min_unit"] = ""), (tempObj["return_count"] = 0);
1198
     (tempObj["min_unit"] = ""), (tempObj["return_count"] = 0);

+ 14 - 7
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue Прегледај датотеку

7
     </div>
7
     </div>
8
     <div class="app-container ">
8
     <div class="app-container ">
9
       <div id="dialysis-print-box">
9
       <div id="dialysis-print-box">
10
-        <div v-if="org_id!=9671 && org_id!=10210">
10
+        <div v-if="orgId!=9675 && orgId!=9671 && orgId!=10210">
11
         <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
11
         <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
12
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
12
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
13
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
13
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
78
       </div> 
78
       </div> 
79
 
79
 
80
 
80
 
81
-      <div v-if="org_id == 9671 || org_id == 10210">
81
+      <div v-if="orgId == 9675 || orgId == 10210 || orgId == 9671">
82
        <div class="dialysis-print-order" v-for="(it,index) in tableData" :key="index" >
82
        <div class="dialysis-print-order" v-for="(it,index) in tableData" :key="index" >
83
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
83
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
84
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
84
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
117
                   {{item.price}}
117
                   {{item.price}}
118
               </td>
118
               </td>
119
              <td  style="line-height:50px">
119
              <td  style="line-height:50px">
120
-                {{(item.count * item.price).toFixed(2)}}
120
+                <span v-if="item.count_unit == item.min_unit">
121
+                   {{(item.count/item.min_number * item.price).toFixed(2)}}
122
+                </span>
123
+                <span v-else> {{(item.count * item.price).toFixed(2)}}</span>
124
+               
121
              </td>
125
              </td>
122
-             <td>{{item.batch_number}}</td>
126
+             <td>{{item.drug_warehouse_info.batch_number}}</td>
123
              <td>{{(getTime(item.product_date))}}</td>
127
              <td>{{(getTime(item.product_date))}}</td>
124
-             <td>{{(getTime(item.expire_date))}}</td>
128
+             <td>{{(getTime(item.expiry_date))}}</td>
125
             </tr>
129
             </tr>
130
+
126
              <tr>
131
              <tr>
127
                <td style="line-height:50px">合计</td>
132
                <td style="line-height:50px">合计</td>
128
                <td colspan="7"></td>
133
                <td colspan="7"></td>
129
-               <td>{{getTotalPrince(it.xt_drug_warehouse_out_info).toFixed(2)}}</td>
134
+               <td>{{getTotalPrice(it.xt_drug_warehouse_out_info)}}</td>
130
              </tr>
135
              </tr>
131
             </tbody>
136
             </tbody>
132
           </table>
137
           </table>
401
             var manufacturerList = response.data.data.manufacturerList
406
             var manufacturerList = response.data.data.manufacturerList
402
            
407
            
403
             this.manufactureList = manufacturerList
408
             this.manufactureList = manufacturerList
404
-
409
+            
405
             this.tableList = info
410
             this.tableList = info
406
             this.tableData = response.data.data.drug_warhouse_out
411
             this.tableData = response.data.data.drug_warhouse_out
412
+            console.log("nfo32323223323223232323",this.tableData)
407
             this.loading = false
413
             this.loading = false
408
           }
414
           }
409
         })
415
         })
588
     line-height: 30px;
594
     line-height: 30px;
589
   }
595
   }
590
 </style>
596
 </style>
597
+

+ 105 - 14
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Прегледај датотеку

11
       ></bread-crumb>
11
       ></bread-crumb>
12
 
12
 
13
       <div style="float: right">
13
       <div style="float: right">
14
-        <el-button size="small" @click="back()" class="filter-item"
15
-          >取 消</el-button
16
-        >
14
+        <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
17
         <el-button
15
         <el-button
18
           size="small"
16
           size="small"
19
           type="primary"
17
           type="primary"
20
           @click="submit()"
18
           @click="submit()"
19
+          v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0"
21
           class="filter-item"
20
           class="filter-item"
22
           >保 存</el-button
21
           >保 存</el-button
23
         >
22
         >
23
+        <el-button
24
+          size="small"
25
+          type="primary"
26
+          v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0"
27
+          class="filter-item"
28
+          @click="toCheck"
29
+          >审 核</el-button
30
+        >
31
+        <el-button
32
+          size="small"
33
+          type="primary"
34
+          v-if="is_check == 1 && parseInt(this.$route.query.is_sys) == 0"
35
+          @click="toReturnCheck"
36
+          class="filter-item"
37
+          >反 审 核</el-button
38
+        >
24
       </div>
39
       </div>
25
     </div>
40
     </div>
26
 
41
 
441
   GetAllConfigOne,
456
   GetAllConfigOne,
442
   GetAllDrugInfoByID,
457
   GetAllDrugInfoByID,
443
   getDrugBatchNumber,
458
   getDrugBatchNumber,
459
+  toCheckDrugOut,
460
+  toReturnCheck,
444
 } from "@/api/drug/drug_stock";
461
 } from "@/api/drug/drug_stock";
445
 import BreadCrumb from "../../components/bread-crumb";
462
 import BreadCrumb from "../../components/bread-crumb";
446
 import DrugsStockDialog from "./drugsStockDialog/index";
463
 import DrugsStockDialog from "./drugsStockDialog/index";
511
       numberList: [],
528
       numberList: [],
512
       houstList: [],
529
       houstList: [],
513
       storehouse_id: "",
530
       storehouse_id: "",
531
+      is_check:0,
532
+      order_id:0,
514
     };
533
     };
515
   },
534
   },
516
   methods: {
535
   methods: {
611
         this.$message.error("采购出库数据不能新增!");
630
         this.$message.error("采购出库数据不能新增!");
612
         return;
631
         return;
613
       }
632
       }
633
+      if(this.is_check == 1){
634
+        this.$message.error("已审核的单据不能新增!");
635
+        return;
636
+      }
614
       this.unitShow = false;
637
       this.unitShow = false;
615
       if (this.drug_show == true) {
638
       if (this.drug_show == true) {
616
         this.$message.error("自动出库数据不能编辑");
639
         this.$message.error("自动出库数据不能编辑");
623
       tempObj["count"] = "";
646
       tempObj["count"] = "";
624
       tempObj["max_unit"] = "";
647
       tempObj["max_unit"] = "";
625
       tempObj["min_unit"] = "";
648
       tempObj["min_unit"] = "";
626
-      tempObj["price"] = "";
649
+      tempObj["price"] = 0;
627
       tempObj["remark"] = "";
650
       tempObj["remark"] = "";
628
       tempObj["batch_number"] = "";
651
       tempObj["batch_number"] = "";
629
       tempObj["number"] = "";
652
       tempObj["number"] = "";
632
       tempObj["manufacturer"] = "";
655
       tempObj["manufacturer"] = "";
633
       tempObj["warehouse_info_id"] = 0;
656
       tempObj["warehouse_info_id"] = 0;
634
       tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name;
657
       tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name;
635
-      tempObj["last_price"] = "";
658
+      tempObj["last_price"] = 0;
636
       tempObj["stock_count"] = "";
659
       tempObj["stock_count"] = "";
637
       tempObj["total_count"] = 0;
660
       tempObj["total_count"] = 0;
638
       tempObj["max_unit_fisrt"] = 0;
661
       tempObj["max_unit_fisrt"] = 0;
644
         this.$message.error("调拨出库数据不能删除!");
667
         this.$message.error("调拨出库数据不能删除!");
645
         return;
668
         return;
646
       }
669
       }
670
+     if(parseInt(this.$route.query.is_check) == 1){
671
+        this.$message.error("已审核的单据不能删除!")
672
+        return false
673
+      }
647
       if (row.supply_cancel_out_id > 0) {
674
       if (row.supply_cancel_out_id > 0) {
648
         this.$message.error("采购出库数据不能删除!");
675
         this.$message.error("采购出库数据不能删除!");
649
         return;
676
         return;
653
         this.$message.error("采购出库数据不能编辑");
680
         this.$message.error("采购出库数据不能编辑");
654
         return;
681
         return;
655
       }
682
       }
683
+      if (this.is_checks == 2) {
684
+        this.$message.error("已审核的单据不能删除!");
685
+        return;
686
+      }
656
       if (row.id == 0) {
687
       if (row.id == 0) {
657
         this.recordInfo.recordData.splice(index, 1);
688
         this.recordInfo.recordData.splice(index, 1);
658
       } else {
689
       } else {
818
           const params = {
849
           const params = {
819
             stockOut: this.recordInfo.recordData,
850
             stockOut: this.recordInfo.recordData,
820
           };
851
           };
821
-
822
           editDrugWarehouseoutInfo(
852
           editDrugWarehouseoutInfo(
823
             params,
853
             params,
824
             this.warehouse_out_time,
854
             this.warehouse_out_time,
851
                 "/" +
881
                 "/" +
852
                 max_unit;
882
                 max_unit;
853
               loading.close();
883
               loading.close();
884
+
854
               if (msg == 1) {
885
               if (msg == 1) {
855
                 this.$message.error(str + "库存不足,请入库");
886
                 this.$message.error(str + "库存不足,请入库");
856
                 loading.close();
887
                 loading.close();
857
               } else {
888
               } else {
858
-                this.$message.success("出库成功");
889
+                this.$message.success("保存成功");
859
                 this.recordInfo.recordData = [];
890
                 this.recordInfo.recordData = [];
860
-                this.$router.back(-1);
861
                 loading.close();
891
                 loading.close();
892
+                this.GetOrderDetail(this.order_id)
862
               }
893
               }
863
             }
894
             }
864
           });
895
           });
949
               response.data.data.list[i].last_price;
980
               response.data.data.list[i].last_price;
950
             this.recordInfo.recordData.push(response.data.data.list[i]);
981
             this.recordInfo.recordData.push(response.data.data.list[i]);
951
           }
982
           }
952
-          console.log(
953
-            "我爱的我的2级大风32323232323",
954
-            this.recordInfo.recordData
955
-          );
983
+
956
           for (let j = 0; j < this.recordInfo.recordData.length; j++) {
984
           for (let j = 0; j < this.recordInfo.recordData.length; j++) {
957
             for (let i = 0; i < manulist.length; i++) {
985
             for (let i = 0; i < manulist.length; i++) {
958
               if (
986
               if (
1190
       }
1218
       }
1191
       console.log("count_toal23233232", count_total);
1219
       console.log("count_toal23233232", count_total);
1192
     },
1220
     },
1221
+   toCheck(){
1222
+     const loading = this.$loading({
1223
+        lock: true,
1224
+        text: "Loading",
1225
+        spinner: "el-icon-loading",
1226
+        background: "rgba(0, 0, 0, 0.7)",
1227
+      });
1228
+      var params = {
1229
+      warehouse_out_id:parseInt(this.$route.query.id)
1230
+      }
1231
+
1232
+    toCheckDrugOut(params).then(response=>{
1233
+      if(response.data.state == 1){
1234
+        var warehousingOutInfoList = response.data.data.warehousingOutInfoList
1235
+        var msg =response.data.data.msg
1236
+        if(msg == 1){
1237
+          this.$message.success("审核成功!")
1238
+          this.showCheck = false
1239
+          this.showReturnCheck = true
1240
+          this.$router.back(-1)
1241
+        }
1242
+        if(msg == 2){
1243
+          var drug_name = response.data.data.drug_name
1244
+          var dose = response.data.data.dose
1245
+          var dose_unit = response.data.data.dose_unit
1246
+          var min_number = response.data.data.min_number
1247
+          var min_unit = response.data.data.min_unit
1248
+          var max_unit = response.data.data.max_unit
1249
+          var str = drug_name +" " +dose +dose_unit +"*" + min_number + min_unit +"/" + max_unit;
1250
+          this.$message.error(str+"库存不足,审核失败!")
1251
+        }
1252
+        loading.close()
1253
+       }
1254
+     })
1255
+    },
1256
+    toReturnCheck(){
1257
+       
1258
+       const loading = this.$loading({
1259
+        lock: true,
1260
+        text: "Loading",
1261
+        spinner: "el-icon-loading",
1262
+        background: "rgba(0, 0, 0, 0.7)",
1263
+      });
1264
+       var params = {
1265
+        warehouse_out_id:parseInt(this.$route.query.id)
1266
+       }
1267
+      toReturnCheck(params).then(response=>{
1268
+        if(response.data.state == 1){
1269
+          var out = response.data.data.out
1270
+          this.$message.success("反审核成功!")
1271
+          this.showCheck = true
1272
+          this.showReturnCheck = false
1273
+          loading.close()
1274
+          this.$router.back(-1)
1275
+        }else{
1276
+          this.$message.error("审核失败!")
1277
+          loading.close()
1278
+          this.$router.back(-1)
1279
+        }
1280
+      })
1281
+    }
1193
   },
1282
   },
1194
   created() {
1283
   created() {
1195
     this.drugTypeList = getDictionaryDataConfig("system", "drug_type");
1284
     this.drugTypeList = getDictionaryDataConfig("system", "drug_type");
1196
-    // this.GetConfigInfo()
1285
+
1197
     this.propForm.goodUnit = this.$store.getters.good_unit;
1286
     this.propForm.goodUnit = this.$store.getters.good_unit;
1198
     const order_id = this.$route.query.id;
1287
     const order_id = this.$route.query.id;
1288
+    this.order_id = order_id
1199
     this.GetOrderDetail(order_id);
1289
     this.GetOrderDetail(order_id);
1200
     var sys = this.$route.query.is_sys;
1290
     var sys = this.$route.query.is_sys;
1201
     if (sys == 0) {
1291
     if (sys == 0) {
1207
     if (sys == 12) {
1297
     if (sys == 12) {
1208
       this.drug_show = true;
1298
       this.drug_show = true;
1209
     }
1299
     }
1210
-    if (parseInt(this.$route.query.supply_cancel_out_id) > 0) {
1300
+    if (parseInt(this.$route.query.supply_cancel_out_id) > 0 || parseInt(this.$route.query.is_check) == 1) {
1211
       this.drug_show = true;
1301
       this.drug_show = true;
1212
     }
1302
     }
1303
+    this.is_check =  parseInt(this.$route.query.is_check)
1213
     this.unitList = getDataConfig("hemodialysis", "units");
1304
     this.unitList = getDataConfig("hemodialysis", "units");
1214
   },
1305
   },
1215
 };
1306
 };

+ 45 - 5
src/xt_pages/stock/stockInOrder.vue Прегледај датотеку

87
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
87
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
88
 
88
 
89
         <el-button size="small" type="primary" @click="toExport">导出</el-button>
89
         <el-button size="small" type="primary" @click="toExport">导出</el-button>
90
+         
91
+          <span>&nbsp;&nbsp;</span>
92
+          <label class="title"><span class="name">审核状态</span> :</label>
93
+          <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
94
+              <el-option
95
+                v-for="(option, index) in checkList"
96
+                :key="index"
97
+                :label="option.name"
98
+                :value="option.id">
99
+              </el-option>
100
+          </el-select>  
90
       </div>
101
       </div>
91
 
102
 
92
       <el-table
103
       <el-table
139
           </template>
150
           </template>
140
         </el-table-column>
151
         </el-table-column>
141
 
152
 
153
+        <el-table-column label="审核状态" align="center">
154
+          <template slot-scope="scope">
155
+            <span v-if="scope.row.is_check == 1">已审核</span>
156
+            <span v-if="scope.row.is_check == 2">未审核</span>
157
+          </template>
158
+        </el-table-column>
159
+
142
         <el-table-column label="操作" align="center" width="260px">
160
         <el-table-column label="操作" align="center" width="260px">
143
           <template slot-scope="scope">
161
           <template slot-scope="scope">
144
             <el-tooltip
162
             <el-tooltip
806
       checkAllStatus:false,
824
       checkAllStatus:false,
807
       list:[],
825
       list:[],
808
       storehouse_id:0,
826
       storehouse_id:0,
827
+      check_type:0,
828
+      checkList:[
829
+       {id:0,name:"全部"},
830
+       {id:1,name:"已审核"},
831
+       {id:2,name:"未审核"},
832
+      ]
809
     };
833
     };
810
 
834
 
811
 
835
 
812
   },
836
   },
813
   methods: {
837
   methods: {
838
+    changeCheckType(){
839
+      this.GetWarehouse()
840
+    },
814
      changeCheck() {
841
      changeCheck() {
815
       this.$refs.multipleTable.clearSelection();
842
       this.$refs.multipleTable.clearSelection();
816
       if (this.checkAllStatus) {
843
       if (this.checkAllStatus) {
826
         type: this.type,
853
         type: this.type,
827
         keywords: this.searchKey,
854
         keywords: this.searchKey,
828
         storehouse_id:this.storehouse_id,
855
         storehouse_id:this.storehouse_id,
856
+        check_type:this.check_type,
829
       };
857
       };
830
       this.Warehouse.warehouseDate = [];
858
       this.Warehouse.warehouseDate = [];
831
       getWarehouseList(Params).then(response => {
859
       getWarehouseList(Params).then(response => {
851
         end_time: this.end_time,
879
         end_time: this.end_time,
852
         type: this.type,
880
         type: this.type,
853
         storehouse_id:this.storehouse_id,
881
         storehouse_id:this.storehouse_id,
882
+        check_type:this.check_type,
854
       };
883
       };
855
 
884
 
856
       this.Warehouse.warehouseDate = [];
885
       this.Warehouse.warehouseDate = [];
1096
       }
1125
       }
1097
     },
1126
     },
1098
     handleEdit: function(index, row) {
1127
     handleEdit: function(index, row) {
1099
-      this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id+"&is_sys="+row.is_sys})
1128
+      
1129
+      this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id+"&is_sys="+row.is_sys+"&is_check="+row.is_check+"&type="+row.type})
1100
     },
1130
     },
1101
     handleDelete: function(index, row) {
1131
     handleDelete: function(index, row) {
1102
       if(row.is_sys== 12){
1132
       if(row.is_sys== 12){
1107
         this.$message.error("采购入库单不能删除!")
1137
         this.$message.error("采购入库单不能删除!")
1108
         return false
1138
         return false
1109
       }
1139
       }
1140
+      if(row.is_check == 1){
1141
+        this.$message.error("已审核的单据不能删除!")
1142
+        return false
1143
+      }
1110
       const ids = [];
1144
       const ids = [];
1111
       ids.push(row.id);
1145
       ids.push(row.id);
1112
       const idStr = ids.join(",");
1146
       const idStr = ids.join(",");
1164
       const ids = [];
1198
       const ids = [];
1165
       const idOne = []
1199
       const idOne = []
1166
       for (let i = 0; i < this.selectedTableData.length; i++) {
1200
       for (let i = 0; i < this.selectedTableData.length; i++) {
1201
+        if(this.selectedTableData[i].is_check == 1){
1202
+          this.$message.error("已审核单据不能删除!")
1203
+          return false
1204
+        }
1167
         if(this.selectedTableData[i].is_sys ==12){
1205
         if(this.selectedTableData[i].is_sys ==12){
1168
           this.$message.error("调拨入库数据不能删除!")
1206
           this.$message.error("调拨入库数据不能删除!")
1169
           return false
1207
           return false
1170
         }
1208
         }
1171
         ids.push(this.selectedTableData[i].id);
1209
         ids.push(this.selectedTableData[i].id);
1172
-        idOne.push(this.selectedTableData[i].supply_warehouse_id)
1210
+        if(this.selectedTableData[i].supply_warehouse_id >0){
1211
+          idOne.push(this.selectedTableData[i].supply_warehouse_id)
1212
+        }
1213
+       
1173
       }
1214
       }
1174
       for(let i=0;i<idOne.length;i++){
1215
       for(let i=0;i<idOne.length;i++){
1175
         if(idOne[i] >0){
1216
         if(idOne[i] >0){
1186
         confirmButtonText: "确定",
1227
         confirmButtonText: "确定",
1187
         cancelButtonText: "取消",
1228
         cancelButtonText: "取消",
1188
         type: "warning"
1229
         type: "warning"
1189
-      })
1190
-        .then(() => {
1230
+      }).then(() => {
1191
           deleteWarehouseInfo(params).then(response => {
1231
           deleteWarehouseInfo(params).then(response => {
1192
             if (response.data.state == 0) {
1232
             if (response.data.state == 0) {
1193
               this.$message.error(response.data.msg);
1233
               this.$message.error(response.data.msg);
1403
               this.$message.error(response.data.msg);
1443
               this.$message.error(response.data.msg);
1404
               return false;
1444
               return false;
1405
             } else {
1445
             } else {
1406
-              this.$message.success("入库成功");
1446
+              this.$message.success("保存成功");
1407
               this.dialogVisible = false
1447
               this.dialogVisible = false
1408
               this.editDialogVisible = false
1448
               this.editDialogVisible = false
1409
 
1449
 

+ 104 - 10
src/xt_pages/stock/stockInOrderAdd.vue Прегледај датотеку

8
       <div style="float:right;">
8
       <div style="float:right;">
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
         <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
10
         <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
11
+        <el-button size="small" type="primary" v-show="showCheck" @click="toCheck()" class="filter-item">审 核</el-button>
12
+        <!-- <el-button size="small" type="primary" v-show="showReturnCheck" @click="toReturnCheck()" class="filter-item">反 审 核</el-button> -->
11
       </div>
13
       </div>
12
     </div>
14
     </div>
13
     <div class="app-container" v-loading="loading">
15
     <div class="app-container" v-loading="loading">
266
     getWarehouseInfoByOrdeNumber,
268
     getWarehouseInfoByOrdeNumber,
267
     modifyWarehouseInfo,
269
     modifyWarehouseInfo,
268
     postWarehouse,
270
     postWarehouse,
269
-    postSearchGoodList
271
+    postSearchGoodList,
272
+    toCheckWarehouseInfo,
273
+    toReturnCheckWarehouseInfo
270
   } from '@/api/stock'
274
   } from '@/api/stock'
271
   import BreadCrumb from '../components/bread-crumb'
275
   import BreadCrumb from '../components/bread-crumb'
272
 
276
 
313
             { required: true, message: '零售价不能为空', trigger: 'blur' }
317
             { required: true, message: '零售价不能为空', trigger: 'blur' }
314
           ],
318
           ],
315
           warehousing_count: [
319
           warehousing_count: [
316
-            { required: true, message: '数量不能为空', trigge: 'blur' }
320
+            { required: true, message: '数量不能为空', trigger: 'blur' }
317
           ],
321
           ],
318
 
322
 
319
           good_id: [
323
           good_id: [
320
             { validator: checkGoodId, trigger: 'blur' }
324
             { validator: checkGoodId, trigger: 'blur' }
321
           ],
325
           ],
322
           number:[
326
           number:[
323
-            { required: true, message: '批号不能为空', trigge: 'blur' }
327
+            { required: true, message: '批号不能为空', trigger: 'blur' }
324
           ],
328
           ],
325
           expiry_date:[
329
           expiry_date:[
326
-            { required: true, message: '有效日期不能为空', trigge: 'blur' }
330
+            { required: true, message: '有效日期不能为空', trigger: 'blur' }
327
           ],
331
           ],
328
 
332
 
329
         },
333
         },
390
         loading:false,
394
         loading:false,
391
         list:[],
395
         list:[],
392
         storehouse_id:"",
396
         storehouse_id:"",
397
+        showCheck:false,
398
+        showReturnCheck:false,
399
+        warehousing_info_id:0,
393
       }
400
       }
394
     },
401
     },
395
     methods: {
402
     methods: {
544
         tempObj['name'] = ''
551
         tempObj['name'] = ''
545
         tempObj['license_number'] = ""
552
         tempObj['license_number'] = ""
546
         tempObj["packing_price"] = ""
553
         tempObj["packing_price"] = ""
554
+        tempObj["id"] = 0
547
         this.recordInfo.recordData.push(tempObj)
555
         this.recordInfo.recordData.push(tempObj)
548
       }, handleDelete: function(index, row) {
556
       }, handleDelete: function(index, row) {
549
         if (this.recordInfo.recordData.length <= 1) {
557
         if (this.recordInfo.recordData.length <= 1) {
715
                     this.recordInfo.recordData[i].dealer = this.dealerList[j].id
723
                     this.recordInfo.recordData[i].dealer = this.dealerList[j].id
716
                  }
724
                  }
717
               }
725
               }
726
+              this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString()
718
             }
727
             }
719
             const loading = this.$loading({
728
             const loading = this.$loading({
720
               lock: true,
729
               lock: true,
725
             const params = {
734
             const params = {
726
               'stockIn': this.recordInfo.recordData
735
               'stockIn': this.recordInfo.recordData
727
             }
736
             }
728
-           
729
-            postWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type,this.storehouse_id).then(response => {
737
+            console.log("param232232323232323w",params)
738
+            postWarehouse(params, this.warehousing_time, this.type,this.storehouse_id,this.warehousing_info_id).then(response => {
730
               if (response.data.state == 0) {
739
               if (response.data.state == 0) {
731
                 this.loading = false
740
                 this.loading = false
732
                 this.$message.error(response.data.msg)
741
                 this.$message.error(response.data.msg)
735
               } else {
744
               } else {
736
                 loading.close()
745
                 loading.close()
737
                 this.loading = false
746
                 this.loading = false
738
-                this.$message.success('入库成功')
739
-                this.$router.back(-1)
747
+                this.$message.success('保存成功')
748
+                var list = response.data.data.list
749
+                console.log("list2332323323",list)
750
+                var dealerList = response.data.data.dealerList
751
+                var manufacturerList = response.data.data.manufacturerList
752
+                var info =  response.data.data.info
753
+                this.warehousing_info_id  = info.id
754
+                for(let i=0;i<list.length;i++){
755
+                  for(let j=0;j<dealerList.length;j++){
756
+                     if(list[i].dealer == dealerList[i].id){
757
+                        list[i].dealer = dealerList[i].dealer_name
758
+                     }
759
+                  }
760
+                  for(let s=0;s<manufacturerList.length;s++){
761
+                    if(list[i].manufacturer == manufacturerList[s].id){
762
+                       list[i].manufacturer = manufacturerList[s].manufacturer_name
763
+                    }
764
+                  } 
765
+                  list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
766
+                  list[i].product_date = this.getTimeOne(list[i].product_date)
767
+                  list[i].good_name = list[i].GoodInfo.good_name
768
+                  list[i].name = list[i].GoodInfo.specification_name +"/"+ list[i].GoodInfo.packing_unit
769
+                }
770
+                this.recordInfo.recordData = []
771
+                this.recordInfo.recordData = list
772
+                this.showCheck = true
773
+                // this.$router.back(-1)
740
               }
774
               }
741
             })
775
             })
742
           } else {
776
           } else {
797
       handleSelect(val){
831
       handleSelect(val){
798
          for(let i=0;i<this.recordInfo.recordData.length;i++){
832
          for(let i=0;i<this.recordInfo.recordData.length;i++){
799
            if(this.currentIndex == i){
833
            if(this.currentIndex == i){
834
+              this.recordInfo.recordData[i].id = 0
800
               this.recordInfo.recordData[i].good_type_id = val.id
835
               this.recordInfo.recordData[i].good_type_id = val.id
801
               this.recordInfo.recordData[i].good_name = val.good_name
836
               this.recordInfo.recordData[i].good_name = val.good_name
802
               this.recordInfo.recordData[i].good_type_id = val.good_type_id
837
               this.recordInfo.recordData[i].good_type_id = val.good_type_id
803
               this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
838
               this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
804
-             // this.recordInfo.recordData[i].number =  val.number
839
+           
805
               this.recordInfo.recordData[i].manufacturer = val.manufacturer
840
               this.recordInfo.recordData[i].manufacturer = val.manufacturer
806
               this.recordInfo.recordData[i].remark = val.remark
841
               this.recordInfo.recordData[i].remark = val.remark
807
               this.recordInfo.recordData[i].license_number = val.number
842
               this.recordInfo.recordData[i].license_number = val.number
830
            }
865
            }
831
          }
866
          }
832
       },
867
       },
833
-   
868
+     getTimeOne(val) {
869
+        if(val < 0){
870
+          return ""
871
+        }
872
+        if(val == ""){
873
+        return ""
874
+        }else {
875
+        return uParseTime(val, '{y}-{m}-{d}')
876
+        }
877
+     },
878
+     toCheck(){
879
+        const loading = this.$loading({
880
+          lock: true,
881
+          text: 'Loading',
882
+          spinner: 'el-icon-loading',
883
+          background: 'rgba(0, 0, 0, 0.7)'
884
+        })
885
+        
886
+        var params = {
887
+          warehousing_info_id:this.warehousing_info_id,
888
+        }
889
+       toCheckWarehouseInfo(params).then(response=>{
890
+          if(response.data.state == 1){
891
+            var list = response.data.data.list
892
+            this.$message.success("审核成功!")
893
+            this.showCheck = false
894
+            this.showReturnCheck = true
895
+            this.$router.back(-1)
896
+            loading.close()
897
+          }else{
898
+            this.$message.error("审核失败")
899
+            loading.close()
900
+          }
901
+       })
902
+     },
903
+     toReturnCheck(){
904
+       const loading = this.$loading({
905
+          lock: true,
906
+          text: 'Loading',
907
+          spinner: 'el-icon-loading',
908
+          background: 'rgba(0, 0, 0, 0.7)'
909
+        })
910
+       var params = {
911
+          warehousing_info_id:this.warehousing_info_id,
912
+        }
913
+       toReturnCheckWarehouseInfo(params).then(response=>{
914
+          if(response.data.state == 1){
915
+             var list = response.data.data.list
916
+             this.$message.success("反审核成功!")
917
+             this.showCheck = true
918
+             this.showReturnCheck = false
919
+             loading.close()
920
+             this.$router.back(-1)
921
+          }else{
922
+            this.$message.error("反审核失败!")
923
+            loading.close()
924
+          }
925
+       })
926
+     }
834
     }
927
     }
835
     ,
928
     ,
836
     created() {
929
     created() {
861
       tempObj['name'] = ''
954
       tempObj['name'] = ''
862
       tempObj['license_number'] = ''
955
       tempObj['license_number'] = ''
863
       tempObj['packing_price']= ''
956
       tempObj['packing_price']= ''
957
+      tempObj['id']= 0
864
       this.recordInfo.recordData.push(tempObj)
958
       this.recordInfo.recordData.push(tempObj)
865
       this.GetConfigInfo()
959
       this.GetConfigInfo()
866
       this.propForm.goodUnit = this.$store.getters.good_unit
960
       this.propForm.goodUnit = this.$store.getters.good_unit

+ 117 - 8
src/xt_pages/stock/stockInOrderEdit.vue Прегледај датотеку

18
           size="small"
18
           size="small"
19
           type="primary"
19
           type="primary"
20
           @click="submit()"
20
           @click="submit()"
21
+          v-if="is_check == 2"
21
           class="filter-item"
22
           class="filter-item"
22
           >保 存</el-button
23
           >保 存</el-button
23
         >
24
         >
25
+        <el-button
26
+          size="small"
27
+          type="primary"
28
+          @click="toCheck()"
29
+          v-if="is_check == 2"
30
+          class="filter-item"
31
+          >审核</el-button
32
+        >
33
+        <el-button
34
+          size="small"
35
+          type="primary"
36
+          v-if="is_check == 1"
37
+          @click="toReturnCheck()"
38
+          class="filter-item"
39
+          >反审核</el-button
40
+        >
24
       </div>
41
       </div>
25
     </div>
42
     </div>
26
 
43
 
142
             
159
             
143
               <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
160
               <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
144
                             style="padding-top: 20px">
161
                             style="padding-top: 20px">
145
-                <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price"></el-input>
162
+                <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price" :disabled ="disabled"></el-input>
146
               </el-form-item>
163
               </el-form-item>
147
 
164
 
148
 
165
 
160
                 style="padding-top: 20px"
177
                 style="padding-top: 20px"
161
               >
178
               >
162
                 <el-input
179
                 <el-input
180
+                 :disabled ="disabled"
163
                   placeholder="请输入单价"
181
                   placeholder="请输入单价"
164
                   type="number"
182
                   type="number"
165
                   v-model="scope.row.price"
183
                   v-model="scope.row.price"
333
   GetAllGoodInfoByID,
351
   GetAllGoodInfoByID,
334
   DeleteWarehouseInfoItem,
352
   DeleteWarehouseInfoItem,
335
   EditWarehouse,
353
   EditWarehouse,
336
-  postSearchGoodList
354
+  postSearchGoodList,
355
+  toCheckWarehouseInfo,
356
+  toReturnCheckWarehouseInfo
337
 } from "@/api/stock";
357
 } from "@/api/stock";
338
 import BreadCrumb from "../components/bread-crumb";
358
 import BreadCrumb from "../components/bread-crumb";
339
 
359
 
377
           { required: true, message: '零售价不能为空', trigger: 'blur' }
397
           { required: true, message: '零售价不能为空', trigger: 'blur' }
378
         ],
398
         ],
379
         warehousing_count: [
399
         warehousing_count: [
380
-          { required: true, message: "数量不能为空", trigge: "blur" }
400
+          { required: true, message: "数量不能为空", trigger: "blur" }
381
         ],
401
         ],
382
 
402
 
383
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
403
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
418
       disabled:false,
438
       disabled:false,
419
       storehouse_id:0,
439
       storehouse_id:0,
420
       list:[],
440
       list:[],
441
+      is_check:0,
442
+      order_id:0,
421
     };
443
     };
422
   },
444
   },
423
   methods: {
445
   methods: {
519
         this.$message.error("调拨入库数据不能新增!")
541
         this.$message.error("调拨入库数据不能新增!")
520
         return false
542
         return false
521
       }
543
       }
544
+      if(parseInt(this.$route.query.is_check) == 1){
545
+        this.$message.error("已审核的单据不能新增!")
546
+        return false
547
+      }
522
       const tempObj = {};
548
       const tempObj = {};
523
       tempObj["id"] = 0;
549
       tempObj["id"] = 0;
524
       tempObj["good_type_id"] = 0;
550
       tempObj["good_type_id"] = 0;
544
         this.$message.error("采购入库数据不能删除!")
570
         this.$message.error("采购入库数据不能删除!")
545
         return false
571
         return false
546
       }
572
       }
573
+     if(parseInt(this.$route.query.is_check) == 1){
574
+        this.$message.error("已审核的单据不能删除!")
575
+        return false
576
+      }
547
       if (row.id == 0) {
577
       if (row.id == 0) {
548
         this.recordInfo.recordData.splice(index, 1);
578
         this.recordInfo.recordData.splice(index, 1);
549
       } else {
579
       } else {
686
                   this.recordInfo.recordData[i].dealer = this.dealerList[z].id
716
                   this.recordInfo.recordData[i].dealer = this.dealerList[z].id
687
                }
717
                }
688
              }
718
              }
719
+             this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString() 
689
           }
720
           }
690
          
721
          
691
           const params = {
722
           const params = {
692
             stockIn: this.recordInfo.recordData
723
             stockIn: this.recordInfo.recordData
693
           };
724
           };
694
-          
725
+          console.log("param22332322332",params)
695
           const loading = this.$loading({
726
           const loading = this.$loading({
696
             lock: true,
727
             lock: true,
697
             text: 'Loading',
728
             text: 'Loading',
715
             } else {
746
             } else {
716
               loading.close()
747
               loading.close()
717
               this.loading = false
748
               this.loading = false
718
-              this.$message.success("入库成功");
719
-              this.$router.back(-1);
749
+              var list = response.data.data.list
750
+              var manufacturerList = response.data.data.manufacturerList
751
+              var dealerList = response.data.data.dealerList
752
+              for(let i=0;i<list.length;i++){
753
+                for(let j=0;j<dealerList.length;j++){
754
+                 if(list[i].dealer == dealerList[i].id){
755
+                    list[i].dealer = dealerList[i].dealer_name
756
+                  }
757
+                }
758
+                for(let s=0;s<manufacturerList.length;s++){
759
+                  if(list[i].manufacturer == manufacturerList[s].id){
760
+                    list[i].manufacturer = manufacturerList[s].manufacturer_name
761
+                  }
762
+                } 
763
+                list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
764
+                list[i].product_date = this.getTimeOne(list[i].product_date)
765
+                list[i].good_name = list[i].GoodInfo.good_name
766
+                list[i].name = list[i].GoodInfo.specification_name
767
+               }
768
+              this.recordInfo.recordData = []
769
+              this.recordInfo.recordData = list
770
+              this.$message.success("保存成功");
720
             }
771
             }
721
           });
772
           });
722
         } else {
773
         } else {
860
           }
911
           }
861
         }
912
         }
862
      
913
      
863
-    }
914
+    },
915
+    toCheck(){
916
+        const loading = this.$loading({
917
+          lock: true,
918
+          text: 'Loading',
919
+          spinner: 'el-icon-loading',
920
+          background: 'rgba(0, 0, 0, 0.7)'
921
+        })
922
+        var params = {
923
+          warehousing_info_id:this.order_id,
924
+        }
925
+       toCheckWarehouseInfo(params).then(response=>{
926
+          if(response.data.state == 1){
927
+            var list = response.data.data.list
928
+            this.$message.success("审核成功!")
929
+            loading.close()
930
+            this.$router.back(-1)
931
+          }else{
932
+            this.$message.error("审核失败!")
933
+            loading.close()
934
+          }
935
+       })
936
+     },
937
+     toReturnCheck(){
938
+       const loading = this.$loading({
939
+          lock: true,
940
+          text: 'Loading',
941
+          spinner: 'el-icon-loading',
942
+          background: 'rgba(0, 0, 0, 0.7)'
943
+        })
944
+       var params = {
945
+          warehousing_info_id:this.order_id,
946
+        }
947
+
948
+       toReturnCheckWarehouseInfo(params).then(response=>{
949
+          if(response.data.state == 1){
950
+             this.$message.success(response.data.data.msg)
951
+             loading.close()
952
+             this.$router.back(-1)
953
+          }else{
954
+            this.$message.error(response.data.msg)
955
+            loading.close()
956
+            this.$router.back(-1)
957
+          }
958
+       })
959
+     },
960
+     getTimeOne(val) {
961
+        if(val < 0){
962
+          return ""
963
+        }
964
+        if(val == ""){
965
+        return ""
966
+        }else {
967
+        return uParseTime(val, '{y}-{m}-{d}')
968
+        }
969
+     },
864
   },
970
   },
865
   created() {
971
   created() {
866
     this.GetConfigInfo();
972
     this.GetConfigInfo();
867
     this.propForm.goodUnit = this.$store.getters.good_unit;
973
     this.propForm.goodUnit = this.$store.getters.good_unit;
868
     const order_id = this.$route.query.id;
974
     const order_id = this.$route.query.id;
975
+    this.order_id = order_id
869
     var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
976
     var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
870
     var is_sys = parseInt(this.$route.query.is_sys)
977
     var is_sys = parseInt(this.$route.query.is_sys)
978
+    this.is_check = parseInt(this.$route.query.is_check)
979
+   
871
     if(supply_warehouse_id > 0){
980
     if(supply_warehouse_id > 0){
872
       this.disabled = true
981
       this.disabled = true
873
     }
982
     }
874
-    if(is_sys == 12){
983
+    if(is_sys == 12 || this.is_check == 1){
875
       this.disabled = true
984
       this.disabled = true
876
     }
985
     }
877
     this.GetOrderDetail(order_id);
986
     this.GetOrderDetail(order_id);

+ 43 - 6
src/xt_pages/stock/stockOutOrder.vue Прегледај датотеку

82
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
82
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
83
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
83
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
84
         <el-button size="small" type="primary" @click="toExport">导出</el-button>
84
         <el-button size="small" type="primary" @click="toExport">导出</el-button>
85
-        <!-- <span>&nbsp;&nbsp;</span>
85
+        <span>&nbsp;&nbsp;</span>
86
         <label class="title"><span class="name">出库方式</span> :</label>
86
         <label class="title"><span class="name">出库方式</span> :</label>
87
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
87
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
88
             <el-option
88
             <el-option
91
               :label="option.name"
91
               :label="option.name"
92
               :value="option.id">
92
               :value="option.id">
93
             </el-option>
93
             </el-option>
94
-        </el-select>  -->
94
+        </el-select> 
95
+         <span>&nbsp;&nbsp;</span>
96
+          <label class="title"><span class="name">审核状态</span> :</label>
97
+          <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
98
+              <el-option
99
+                v-for="(option, index) in checkList"
100
+                :key="index"
101
+                :label="option.name"
102
+                :value="option.id">
103
+              </el-option>
104
+          </el-select> 
95
       </div>
105
       </div>
96
 
106
 
97
       <el-table
107
       <el-table
142
             <span v-if="scope.row.is_sys == 12">调拨出库</span>
152
             <span v-if="scope.row.is_sys == 12">调拨出库</span>
143
           </template>
153
           </template>
144
         </el-table-column>
154
         </el-table-column>
155
+
156
+        <el-table-column label="审核状态" align="center">
157
+          <template slot-scope="scope">
158
+            <span v-if="scope.row.is_check == 1">已审核</span>
159
+            <span v-if="scope.row.is_check == 2">未审核</span>
160
+          </template>
161
+        </el-table-column>
145
        
162
        
146
 
163
 
147
         <el-table-column label="操作" align="center" width="300px">
164
         <el-table-column label="操作" align="center" width="300px">
846
         { id:1,name:"手动出库"},
863
         { id:1,name:"手动出库"},
847
         { id:2,name:"自动出库"},
864
         { id:2,name:"自动出库"},
848
         { id:3,name:"调拨出库"}
865
         { id:3,name:"调拨出库"}
866
+      ],
867
+      check_type:0,
868
+      checkList:[
869
+       {id:0,name:"全部"},
870
+       {id:1,name:"已审核"},
871
+       {id:2,name:"未审核"},
849
       ]
872
       ]
850
     };
873
     };
851
   },
874
   },
860
         keywords: this.searchKey,
883
         keywords: this.searchKey,
861
         storehouse_id:this.storehouse_id,
884
         storehouse_id:this.storehouse_id,
862
         way_type:this.way_type,
885
         way_type:this.way_type,
886
+        check_type:this.check_type,
863
       };
887
       };
864
       this.warehouseOutDate = [];
888
       this.warehouseOutDate = [];
865
       getWarehouseOutList(Params).then(response => {
889
       getWarehouseOutList(Params).then(response => {
889
         type: this.type,
913
         type: this.type,
890
         storehouse_id:this.storehouse_id,
914
         storehouse_id:this.storehouse_id,
891
         way_type:this.way_type,
915
         way_type:this.way_type,
916
+        check_type:this.check_type,
892
       };
917
       };
893
       this.warehouseOutDate = [];
918
       this.warehouseOutDate = [];
894
       getWarehouseOutList(Params).then(response => {
919
       getWarehouseOutList(Params).then(response => {
1021
       }
1046
       }
1022
     },
1047
     },
1023
     handleEdit: function(index, row) {
1048
     handleEdit: function(index, row) {
1024
-      this.$router.push({path:'/stock/stockoutorderedit?id='+row.id+"&is_sys="+row.is_sys+"&supply_cancel_out_id="+row.supply_cancel_out_id})
1049
+      this.$router.push({path:'/stock/stockoutorderedit?id='+row.id+"&is_sys="+row.is_sys+"&supply_cancel_out_id="+row.supply_cancel_out_id+"&is_check="+row.is_check+"&type="+row.type})
1025
        
1050
        
1026
     },
1051
     },
1027
     handleDelete: function(index, row) {
1052
     handleDelete: function(index, row) {
1033
         this.$message.error("采购出库数据不能删除!")
1058
         this.$message.error("采购出库数据不能删除!")
1034
         return false
1059
         return false
1035
       }
1060
       }
1061
+      if(row.is_check == 1){
1062
+        this.$message.error("已审核的单据不能删除!")
1063
+        return false
1064
+      }
1036
       const ids = [];
1065
       const ids = [];
1037
       ids.push(row.id);
1066
       ids.push(row.id);
1038
       const idStr = ids.join(",");
1067
       const idStr = ids.join(",");
1092
 
1121
 
1093
     },
1122
     },
1094
     batchDelete() {
1123
     batchDelete() {
1095
-     
1096
-      
1097
       if (this.selectedTableData.length <= 0) {
1124
       if (this.selectedTableData.length <= 0) {
1098
         this.$message.error("请选择要删除的记录");
1125
         this.$message.error("请选择要删除的记录");
1099
         return;
1126
         return;
1101
       const ids = [];
1128
       const ids = [];
1102
       const idOne = []
1129
       const idOne = []
1103
       for (let i = 0; i < this.selectedTableData.length; i++) {
1130
       for (let i = 0; i < this.selectedTableData.length; i++) {
1131
+        if(this.selectedTableData[i].is_check == 1){
1132
+          this.$message.error("已审核单据不能删除")
1133
+          return false
1134
+        }
1104
         if(this.selectedTableData[i].is_sys == 1){
1135
         if(this.selectedTableData[i].is_sys == 1){
1105
           this.$message.error("自动出库数据不能删除!")
1136
           this.$message.error("自动出库数据不能删除!")
1106
           return false
1137
           return false
1111
         }
1142
         }
1112
          if(this.selectedTableData[i].is_sys == 0){
1143
          if(this.selectedTableData[i].is_sys == 0){
1113
            ids.push(this.selectedTableData[i].id);
1144
            ids.push(this.selectedTableData[i].id);
1114
-           idOne.push(this.selectedTableData[i].supply_cancel_out_id)
1145
+           if(this.selectedTableData[i].supply_cancel_out_id > 0){
1146
+             idOne.push(this.selectedTableData[i].supply_cancel_out_id)
1147
+           }
1148
+           
1115
          }
1149
          }
1116
       }
1150
       }
1117
       if(idOne.length >0){
1151
       if(idOne.length >0){
1767
    },
1801
    },
1768
    changeWay(){
1802
    changeWay(){
1769
      this.GetWarehouseOut()
1803
      this.GetWarehouseOut()
1804
+   },
1805
+   changeCheckType(){
1806
+    this.GetWarehouseOut()
1770
    }
1807
    }
1771
   }
1808
   }
1772
 };
1809
 };

+ 136 - 15
src/xt_pages/stock/stockOutOrderAdd.vue Прегледај датотеку

21
           class="filter-item"
21
           class="filter-item"
22
           >保 存</el-button
22
           >保 存</el-button
23
         >
23
         >
24
+        <el-button
25
+          size="small"
26
+          type="primary"
27
+          @click="toCheck()"
28
+          class="filter-item"
29
+          v-show="showCheck"
30
+          >审核</el-button
31
+        >
32
+        <!-- <el-button
33
+          size="small"
34
+          type="primary"
35
+          @click="toReturnCheck()"
36
+          class="filter-item"
37
+          v-show="showReturnCheck"
38
+          >反审核</el-button
39
+        > -->
24
       </div>
40
       </div>
25
     </div>
41
     </div>
26
 
42
 
159
               >
175
               >
160
                 <el-input
176
                 <el-input
161
                  @input="getSupplyCount(scope.row.count,scope.row.stock_count,scope.$index)"
177
                  @input="getSupplyCount(scope.row.count,scope.row.stock_count,scope.$index)"
162
-                 oninput="value=value.replace(/\D|^0/g,'')"
178
+                  oninput="value=value.replace(/\D|^0/g,'')"
163
                   placeholder="请输入出库数量"
179
                   placeholder="请输入出库数量"
164
                   type="number"
180
                   type="number"
165
                   v-model="scope.row.count"
181
                   v-model="scope.row.count"
340
 
356
 
341
 <script>
357
 <script>
342
 import { uParseTime } from "@/utils/tools";
358
 import { uParseTime } from "@/utils/tools";
343
-import {  postWarehouseOut,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber } from "@/api/stock";
359
+import {  postWarehouseOut,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber,checkWarehouseOut } from "@/api/stock";
344
 
360
 
345
 import BreadCrumb from "../components/bread-crumb";
361
 import BreadCrumb from "../components/bread-crumb";
346
 import StockInDialog from './Dialog/stockInDialog'
362
 import StockInDialog from './Dialog/stockInDialog'
370
       },
386
       },
371
       tableRules: {
387
       tableRules: {
372
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
388
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
373
-        count: [{ required: true, message: "数量不能为空", trigge: "blur" }],
374
-        // number:[{ required: true, message: "批号不能为空",trigge:"blur"}],
389
+        count: [{ required: true, message: "数量不能为空", trigger: "blur" }],
375
       },
390
       },
376
       ruleForm: {
391
       ruleForm: {
377
         manufacturer: [
392
         manufacturer: [
403
       storehouse_id:"",
418
       storehouse_id:"",
404
       list:[],
419
       list:[],
405
       doctorList:[],
420
       doctorList:[],
421
+      showCheck:false,
422
+      showReturnCheck:false,
423
+      warehouseOut:{},
424
+      warehouseOut_id:0,
425
+      is_check:0,
406
     };
426
     };
407
   },
427
   },
408
   methods: {
428
   methods: {
515
       tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
535
       tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
516
       tempObj["buy_price"]= ""
536
       tempObj["buy_price"]= ""
517
       tempObj["stock_count"] = ""
537
       tempObj["stock_count"] = ""
538
+      tempObj["id"] = 0
518
       this.recordInfo.recordData.push(tempObj);
539
       this.recordInfo.recordData.push(tempObj);
519
     },
540
     },
520
     handleDelete: function(index, row) {
541
     handleDelete: function(index, row) {
541
         return "";
562
         return "";
542
       }
563
       }
543
     },
564
     },
565
+   getTimeOne(val) {
566
+      if(val < 0){
567
+        return ""
568
+      }
569
+      if(val == ""){
570
+      return ""
571
+      }else {
572
+      return uParseTime(val, '{y}-{m}-{d}')
573
+      }
574
+    },
544
     showDialog(index, row) {
575
     showDialog(index, row) {
545
       const loading = this.$loading({
576
       const loading = this.$loading({
546
         lock: true,
577
         lock: true,
645
              this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString()
676
              this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString()
646
 
677
 
647
              this.recordInfo.recordData[i].buy_price = this.recordInfo.recordData[i].buy_price.toString()
678
              this.recordInfo.recordData[i].buy_price = this.recordInfo.recordData[i].buy_price.toString()
679
+              
680
+              this.recordInfo.recordData[i].count = this.recordInfo.recordData[i].count.toString()
681
+             
648
           }
682
           }
649
        
683
        
650
           for(let i=0;i<this.recordInfo.recordData.length;i++){
684
           for(let i=0;i<this.recordInfo.recordData.length;i++){
677
             stockOut: this.recordInfo.recordData
711
             stockOut: this.recordInfo.recordData
678
           };
712
           };
679
          
713
          
680
-         
681
           const loading = this.$loading({
714
           const loading = this.$loading({
682
             lock: true,
715
             lock: true,
683
             text: 'Loading',
716
             text: 'Loading',
690
             this.form.dealer,
723
             this.form.dealer,
691
             this.form.manufacturer,
724
             this.form.manufacturer,
692
             this.type,
725
             this.type,
693
-            this.storehouse_id
726
+            this.storehouse_id,
727
+            this.warehouseOut_id
694
           ).then(response => {
728
           ).then(response => {
695
             if (response.data.state == 0) {
729
             if (response.data.state == 0) {
696
               this.$message.error("库存不足")
730
               this.$message.error("库存不足")
702
                var specification_name = response.data.data.specification_name
736
                var specification_name = response.data.data.specification_name
703
                var storehose_name = response.data.data.storehose_name
737
                var storehose_name = response.data.data.storehose_name
704
                var str = storehose_name + " " + good_name +"*" + specification_name +"无库存,请入库"
738
                var str = storehose_name + " " + good_name +"*" + specification_name +"无库存,请入库"
705
-             
739
+               var warehouseOut =  response.data.data.warehouseOut
740
+               this.warehouseOut = warehouseOut
741
+              this.warehouseOut_id = warehouseOut.id
742
+               
706
                if(msg == 1){
743
                if(msg == 1){
707
                   this.$message.error(str)
744
                   this.$message.error(str)
708
                }
745
                }
709
               
746
               
710
                if(msg == 2){
747
                if(msg == 2){
711
-                 this.$message.success("出库成功");
748
+                 this.$message.success("保存成功");
712
                  this.recordInfo.recordData = [];
749
                  this.recordInfo.recordData = [];
713
-                 this.$router.back(-1);
750
+                 var warehouseOutInfoList =  response.data.data.warehouseOutInfoList
751
+                 var manufacturerList = response.data.data.manufacturerList
752
+                 var dealerList = response.data.data.dealerList
753
+                
754
+                 var doctorList = response.data.data.doctorList
755
+                 for(let i=0;i<warehouseOutInfoList.length;i++){
756
+                    for(let j=0;j<manufacturerList.length;j++){
757
+                       if(warehouseOutInfoList[i].manufacturer_id == manufacturerList[i].id){
758
+                          warehouseOutInfoList[i].manufacturer_id = manufacturerList[i].manufacturer_name
759
+                       }
760
+                    }
761
+                    for(let z=0;z<dealerList.length;z++){
762
+                      if(warehouseOutInfoList[i].dealer_id == dealerList[z].id){
763
+                         warehouseOutInfoList[i].dealer_id = dealerList[z].dealer_name
764
+                      }
765
+                    }
766
+                    for(let s=0;s<doctorList.length;s++){
767
+                       if(warehouseOutInfoList[i].admin_user_id == doctorList[s].admin_user_id){
768
+                          warehouseOutInfoList[i].admin_user_id = doctorList[s].user_name
769
+                       }
770
+                    }
771
+                    warehouseOutInfoList[i].good_name = warehouseOutInfoList[i].GoodInfo.good_name
772
+                   
773
+                    warehouseOutInfoList[i].name =  warehouseOutInfoList[i].GoodInfo.specification_name +"/"+ warehouseOutInfoList[i].GoodInfo.packing_unit
774
+                    warehouseOutInfoList[i].expiry_date = this.getTimeOne(warehouseOutInfoList[i].expiry_date)
775
+                    warehouseOutInfoList[i].product_date = this.getTimeOne(warehouseOutInfoList[i].product_date)
776
+                   
777
+                 }
778
+                 this.recordInfo.recordData = warehouseOutInfoList
779
+                
780
+                 this.showCheck = true
714
                }
781
                }
715
                loading.close()
782
                loading.close()
716
              
783
              
767
       this.currentIndex = val
834
       this.currentIndex = val
768
     },
835
     },
769
     handleSelect(val){
836
     handleSelect(val){
770
-      //  console.log("val232332322323323232323",val)
771
         var arr = []
837
         var arr = []
772
-       
773
         for(let i=0;i<this.recordInfo.recordData.length;i++){
838
         for(let i=0;i<this.recordInfo.recordData.length;i++){
774
            arr.push(this.recordInfo.recordData[i].good_id)
839
            arr.push(this.recordInfo.recordData[i].good_id)
775
         }
840
         }
776
-       
777
         var str = arr.join(",")
841
         var str = arr.join(",")
778
        
842
        
779
         if(str.indexOf(val.id)!=-1){
843
         if(str.indexOf(val.id)!=-1){
789
 
853
 
790
         for(let i=0;i<this.recordInfo.recordData.length;i++){
854
         for(let i=0;i<this.recordInfo.recordData.length;i++){
791
           if(this.currentIndex == i){
855
           if(this.currentIndex == i){
792
-           
793
-            this.recordInfo.recordData[i].good_type_id = val.id
856
+            this.recordInfo.recordData[i].id = 0
794
             this.recordInfo.recordData[i].good_name = val.good_name
857
             this.recordInfo.recordData[i].good_name = val.good_name
795
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
858
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
796
             this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
859
             this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
860
         }
923
         }
861
       }
924
       }
862
  
925
  
926
+    },
927
+    toCheck(){
928
+       const loading = this.$loading({
929
+          lock: true,
930
+          text: 'Loading',
931
+          spinner: 'el-icon-loading',
932
+          background: 'rgba(0, 0, 0, 0.7)'
933
+        })
934
+       var params = {
935
+         id:this.warehouseOut.id
936
+       }
937
+      checkWarehouseOut(params).then(response=>{
938
+        if(response.data.state == 1){
939
+          var msg = response.data.data.msg
940
+          var good_name = response.data.data.good_name
941
+          var specification_name = response.data.data.specification_name
942
+          var storehose_name = response.data.data.storehose_name
943
+          var str = storehose_name + " " + good_name +"*" + specification_name +"库存不足,请入库"
944
+          if(msg == 1){
945
+            this.$message.error(str)
946
+            loading.close()
947
+           } 
948
+           if(msg == 2){
949
+            this.$message.success("审核成功!")
950
+            this.recordInfo.recordData = [];
951
+            this.$router.back(-1);
952
+            this.showCheck = false
953
+            this.showReturnCheck = true
954
+            loading.close()
955
+           }
956
+        }else{
957
+          this.$message.error("审核失败!")
958
+          loading.close()
959
+        }
960
+      }) 
961
+    },
962
+    toReturnCheck(){
963
+       const loading = this.$loading({
964
+          lock: true,
965
+          text: 'Loading',
966
+          spinner: 'el-icon-loading',
967
+          background: 'rgba(0, 0, 0, 0.7)'
968
+        })
969
+       var params = {
970
+         id:this.warehouseOut_id,
971
+       }
972
+      returnCheckWarehouseOut(params).then(response=>{
973
+         if(response.data.state == 1){
974
+            var list = response.dat.data.list
975
+            this.$message.success("反审核成功")
976
+             this.showCheck = true
977
+            this.showReturnCheck = false
978
+            loading.close()
979
+         }else{
980
+          this.$message.error("反审核失败!")
981
+          loading.close()
982
+         }
983
+      })
863
     }
984
     }
864
     
985
     
865
   },
986
   },
890
     tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
1011
     tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
891
     tempObj["buy_price"]= ""
1012
     tempObj["buy_price"]= ""
892
     tempObj["stock_count"] = ""
1013
     tempObj["stock_count"] = ""
1014
+    tempObj["id"] = 0
893
     this.recordInfo.recordData.push(tempObj);
1015
     this.recordInfo.recordData.push(tempObj);
894
     this.GetConfigInfo();
1016
     this.GetConfigInfo();
895
-  
896
     this.propForm.goodUnit = this.$store.getters.good_unit;
1017
     this.propForm.goodUnit = this.$store.getters.good_unit;
897
     this.unitList =  getDataConfig('hemodialysis','units')
1018
     this.unitList =  getDataConfig('hemodialysis','units')
898
  
1019
  

+ 1 - 0
src/xt_pages/stock/stockOutOrderDetailPrint.vue Прегледај датотеку

395
       }
395
       }
396
       return total;
396
       return total;
397
     },
397
     },
398
+  
398
     },
399
     },
399
     created(){
400
     created(){
400
       this.orgName = this.$store.getters.xt_user.org.org_name;
401
       this.orgName = this.$store.getters.xt_user.org.org_name;

+ 79 - 6
src/xt_pages/stock/stockOutOrderEdit.vue Прегледај датотеку

7
 
7
 
8
       <div style="float:right;">
8
       <div style="float:right;">
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
-        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0">保 存</el-button>
11
+       <el-button size="small" type="primary" @click="toCheck()" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">审 核</el-button>
12
+       <el-button size="small" type="primary" @click="toReturnCheck()" v-if="is_check == 1 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">反 审 核</el-button>
11
       </div>
13
       </div>
12
     </div>
14
     </div>
13
 
15
 
257
             <span>批准文号<span style="color: red"></span></span>
259
             <span>批准文号<span style="color: red"></span></span>
258
           </template>
260
           </template>
259
           <template slot-scope="scope">
261
           <template slot-scope="scope">
260
-              <el-input placeholder="请输入批准文号" v-model="scope.row.license_number" ></el-input>
262
+              <el-input placeholder="请输入批准文号" v-model="scope.row.license_number" :disabled="stockShow"></el-input>
261
           </template>
263
           </template>
262
         </el-table-column>
264
         </el-table-column>
263
 
265
 
313
 <script>
315
 <script>
314
   import { uParseTime } from '@/utils/tools'
316
   import { uParseTime } from '@/utils/tools'
315
 
317
 
316
-  import { deleteWarehouseOutInfo, editWarehouseoutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getSingleOutOrderDetail,getStockBatchNumber } from '@/api/stock'
318
+  import { deleteWarehouseOutInfo, editWarehouseoutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getSingleOutOrderDetail,getStockBatchNumber,checkWarehouseOut,returnCheckWarehouseOut } from '@/api/stock'
317
   import BreadCrumb from '../components/bread-crumb'
319
   import BreadCrumb from '../components/bread-crumb'
318
   import StockInDialog from './Dialog/stockInDialog'
320
   import StockInDialog from './Dialog/stockInDialog'
319
 
321
 
386
         storelist:[],
388
         storelist:[],
387
         storehouse_id:"",
389
         storehouse_id:"",
388
         doctorList:[],
390
         doctorList:[],
391
+        showCheck:false,
392
+        showReturnCheck:false,
389
       }
393
       }
390
     },
394
     },
391
     methods: {
395
     methods: {
473
           this.$message.error("采购出库数据不能新增!")
477
           this.$message.error("采购出库数据不能新增!")
474
           return
478
           return
475
         }
479
         }
480
+        if(this.is_check == 1){
481
+          this.$message.error("已审核的数据不能新增")
482
+          return
483
+        }
476
         this.stockTrue = false
484
         this.stockTrue = false
477
         if(this.stockShow == true){
485
         if(this.stockShow == true){
478
          this.$message.error("自动出库数据无法编辑")
486
          this.$message.error("自动出库数据无法编辑")
504
           return
512
           return
505
         }
513
         }
506
 
514
 
515
+        if(this.is_check == 1){
516
+          this.$message.error("已审核的数据不能删除!")
517
+          return
518
+        }
519
+
507
         if(this.stockShow == true){
520
         if(this.stockShow == true){
508
          this.$message.error("自动出库数据无法删除")
521
          this.$message.error("自动出库数据无法删除")
509
          return
522
          return
685
               } else {
698
               } else {
686
                 if(response.data.data.msg == 1){
699
                 if(response.data.data.msg == 1){
687
                   this.$message.success('保存成功')
700
                   this.$message.success('保存成功')
688
-                  this.$router.back(-1)
701
+                  // this.$router.back(-1)
689
                   loading.close()
702
                   loading.close()
690
                 }
703
                 }
691
 
704
 
892
           return
905
           return
893
         }
906
         }
894
       }
907
       }
895
-     }
908
+     },
909
+     toCheck(){
910
+       const loading = this.$loading({
911
+          lock: true,
912
+          text: "Loading",
913
+          spinner: "el-icon-loading",
914
+          background: "rgba(0, 0, 0, 0.7)"
915
+        });
916
+       var params = {
917
+         id:parseInt(this.$route.query.id)
918
+       }
919
+      checkWarehouseOut(params).then(response=>{
920
+        if(response.data.state == 1){
921
+          var msg = response.data.data.msg
922
+          var good_name = response.data.data.good_name
923
+          var specification_name = response.data.data.specification_name
924
+          var storehose_name = response.data.data.storehose_name
925
+          var str = storehose_name + " " + good_name +"*" + specification_name +"库存不足,请入库"
926
+          if(msg == 1){
927
+            this.$message.error(str)
928
+            loading.close()
929
+           } 
930
+           if(msg == 2){
931
+            this.$message.success("审核成功!")
932
+            this.recordInfo.recordData = [];
933
+            this.is_check = 1
934
+            this.$router.back(-1);
935
+            loading.close()
936
+           }
937
+        }else{
938
+          this.$message.error("审核失败!")
939
+          loading.close()
940
+        }
941
+      }) 
942
+    },
943
+    toReturnCheck(){
944
+       const loading = this.$loading({
945
+          lock: true,
946
+          text: "Loading",
947
+          spinner: "el-icon-loading",
948
+          background: "rgba(0, 0, 0, 0.7)"
949
+        });
950
+       var params = {
951
+         id:parseInt(this.$route.query.id),
952
+       }
953
+      returnCheckWarehouseOut(params).then(response=>{
954
+         if(response.data.state == 1){
955
+            var list = response.data.data.list
956
+            this.$message.success("反审核成功")
957
+            this.is_check = 2
958
+            this.$router.back(-1);
959
+            loading.close()
960
+         }else{
961
+           this.$message.error("反审核失败!")
962
+           loading.close()
963
+         }
964
+      })
965
+    }
966
+
896
     },
967
     },
897
     created() {
968
     created() {
898
       // var nowDate = new Date();
969
       // var nowDate = new Date();
905
       //   (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
976
       //   (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
906
       //   "-" +
977
       //   "-" +
907
       //   (nowDay < 10 ? "0" + nowDay : nowDay);
978
       //   (nowDay < 10 ? "0" + nowDay : nowDay);
979
+      this.is_check = parseInt(this.$route.query.is_check) 
908
       this.propForm.goodUnit = this.$store.getters.good_unit
980
       this.propForm.goodUnit = this.$store.getters.good_unit
909
       const order_id = this.$route.query.id
981
       const order_id = this.$route.query.id
982
+      
910
       this.getSingleOutOrderDetail(order_id)
983
       this.getSingleOutOrderDetail(order_id)
911
       var is_sys = this.$route.query.is_sys
984
       var is_sys = this.$route.query.is_sys
912
       if(is_sys == 0){
985
       if(is_sys == 0){
913
         this.stockShow = false
986
         this.stockShow = false
914
       }
987
       }
915
-      if(is_sys == 1){
988
+      if(is_sys == 1 ||  this.is_check == 1){
916
         this.stockShow = true
989
         this.stockShow = true
917
       }
990
       }
918
       if(is_sys == 12){
991
       if(is_sys == 12){

+ 19 - 19
src/xt_pages/stock/stockPrint.vue Прегледај датотеку

37
                             </thead>
37
                             </thead>
38
                             <tbody>
38
                             <tbody>
39
                                 <tr v-for='(item,index) in tableList' :key="index">
39
                                 <tr v-for='(item,index) in tableList' :key="index">
40
-                                   <td>{{getGoodType(item.good_type_id)}}</td>
41
-                                   <td>{{item.good_name }}</td>
42
-                                   <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
43
-                                   <td>{{item.social_security_directory_code}}</td>
44
-                                   <td>{{item.buy_price}}</td>
45
-                                   <td>{{getManufacture(item.manufacturer)}}</td>
46
-                                   <td>
40
+                                   <td  style="text-align:center">{{getGoodType(item.good_type_id)}}</td>
41
+                                   <td  style="text-align:center">{{item.good_name }}</td>
42
+                                   <td  style="text-align:center"><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
43
+                                   <td  style="text-align:center">{{item.social_security_directory_code}}</td>
44
+                                   <td  style="text-align:center">{{item.buy_price}}</td>
45
+                                   <td  style="text-align:center">{{getManufacture(item.manufacturer)}}</td>
46
+                                   <td  style="text-align:center">
47
                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
47
                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
48
                                    </td>
48
                                    </td>
49
-                                   <td v-if="end_time == ''">
49
+                                   <td v-if="end_time == ''"  style="text-align:center">
50
                                       <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id== 10245 || org_id == 9779 || org_id == 10290 || org_id == 10265">
50
                                       <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id== 10245 || org_id == 9779 || org_id == 10290 || org_id == 10265">
51
                                         <span>
51
                                         <span>
52
-                                          {{getWareInfo(item.xt_warehouse_info) - getOverFlushInfo(item.xt_warehouse_info) + getCancelSotckInfo(item.cancel_stock_info)}}
52
+                                          {{getWareInfo(item.xt_warehouse_info) - getOverFlushInfo(item.xt_warehouse_info) + getCancelSotckInfo(item.cancel_stock_info)}} 
53
                                         </span>
53
                                         </span>
54
                                       </span>
54
                                       </span>
55
                                       <span v-else>{{getAutoCount(item.id) + getOutCount(item.id)}} </span>
55
                                       <span v-else>{{getAutoCount(item.id) + getOutCount(item.id)}} </span>
56
                                    </td>
56
                                    </td>
57
 
57
 
58
-                                   <td v-if="end_time!=''">
59
-                                    {{getAutoCount(item.id) + getOutCount(item.id)}} 
58
+                                   <td v-if="end_time!=''"  style="text-align:center">
59
+                                    {{getAutoCount(item.id) + getOutCount(item.id)}}
60
                                    </td>
60
                                    </td>
61
-                                  
62
-                                   <td v-if="end_time == ''">
63
-                                     <span v-if="org_id == 9671 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9779 || org_id == 10290 || org_id == 10265 || org_id == 10210">
64
-                                        {{getOverFlushInfo(item.xt_warehouse_info)}}
61
+
62
+
63
+                                   <td v-if="end_time == ''"  style="text-align:center">
64
+                                     <span v-if="org_id == 9671 ||  org_id == 9675 || org_id == 10138 || org_id == 10028 || org_id == 9675 || org_id == 4 || org_id == 3877 || org_id == 10243 || org_id == 10088 || org_id == 10245 || org_id == 9779 || org_id == 10290 || org_id == 10265 || org_id == 10210">
65
+                                        {{getOverFlushInfo(item.xt_warehouse_info)}} 
65
                                      </span>
66
                                      </span>
66
                                      <span v-else>
67
                                      <span v-else>
67
                                        {{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}
68
                                        {{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}
68
                                      </span>
69
                                      </span>
69
                                    </td>
70
                                    </td>
70
-                                   <td v-if="end_time!=''">
71
+                                   <td v-if="end_time!=''" style="text-align:center">
71
                                     {{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}
72
                                     {{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}
72
                                    </td>
73
                                    </td>
73
                                 </tr>
74
                                 </tr>
315
         total += arr[i].stock_count
316
         total += arr[i].stock_count
316
       }
317
       }
317
      }
318
      }
318
-     console.log("totla23323232",total)
319
      return total
319
      return total
320
    },
320
    },
321
    getCancelSotckInfo(arr){
321
    getCancelSotckInfo(arr){
330
    },
330
    },
331
     created(){
331
     created(){
332
       this.org_id =  this.$store.getters.xt_user.org_id
332
       this.org_id =  this.$store.getters.xt_user.org_id
333
-     
333
+
334
       var starttime =  this.$route.query.start_time
334
       var starttime =  this.$route.query.start_time
335
       this.start_time = starttime
335
       this.start_time = starttime
336
       var endtime =  this.$route.query.end_time
336
       var endtime =  this.$route.query.end_time
371
       border: 1px solid;
371
       border: 1px solid;
372
       border-collapse: collapse;
372
       border-collapse: collapse;
373
       padding: 2px;
373
       padding: 2px;
374
-      
374
+
375
 
375
 
376
       thead {
376
       thead {
377
         tr {
377
         tr {

+ 2 - 2
src/xt_pages/stock/stockQuery.vue Прегледај датотеку

184
 
184
 
185
        <el-table-column label="总库存量" align="center">
185
        <el-table-column label="总库存量" align="center">
186
          <template slot-scope="scope">
186
          <template slot-scope="scope">
187
-           <span v-if="org_id == 9675 || org_id == 3907 || org_id == 9583">
187
+           <span v-if="org_id == 3907 || org_id == 9583">
188
               {{
188
               {{
189
               getWareInfo(scope.row.xt_warehouse_info) -
189
               getWareInfo(scope.row.xt_warehouse_info) -
190
               getAutoCount(scope.row.id) -
190
               getAutoCount(scope.row.id) -
192
               getCancelCount(scope.row.id)
192
               getCancelCount(scope.row.id)
193
               }}
193
               }}
194
            </span>
194
            </span>
195
-           <span v-if="org_id != 9675 && org_id != 3907 && org_id != 9583">
195
+           <span v-if="org_id != 3907 && org_id != 9583">
196
                {{getOverFlushInfo(scope.row.xt_warehouse_info)}}
196
                {{getOverFlushInfo(scope.row.xt_warehouse_info)}}
197
            </span>
197
            </span>
198
          </template>
198
          </template>

+ 3 - 6
src/xt_pages/supply/components/addGoodOrder.vue Прегледај датотеку

1328
     },
1328
     },
1329
     MofyGoodOrder() {
1329
     MofyGoodOrder() {
1330
       var id = this.warese_out_id;
1330
       var id = this.warese_out_id;
1331
-      console.log("采购单ID",id)
1332
       var warehousing_id = this.id
1331
       var warehousing_id = this.id
1333
-      console.log("采购订单ID",warehousing_id)
1334
       var params = {
1332
       var params = {
1335
         id: id,
1333
         id: id,
1336
         warehousing_id:warehousing_id,
1334
         warehousing_id:warehousing_id,
1347
           }
1345
           }
1348
           if (msg == 2) {
1346
           if (msg == 2) {
1349
             var cancelList = response.data.data.cancelList
1347
             var cancelList = response.data.data.cancelList
1350
-            console.log("cancelLIST2332322332232323",cancelList)
1351
             this.orderList = cancelList
1348
             this.orderList = cancelList
1352
             this.$refs.Popup.dialogVisible = true
1349
             this.$refs.Popup.dialogVisible = true
1353
             return
1350
             return
1354
           }
1351
           }
1355
 
1352
 
1356
           var purcaseOrder = response.data.data.purcaseOrder;
1353
           var purcaseOrder = response.data.data.purcaseOrder;
1357
-          console.log("采购订单", purcaseOrder);
1354
+         
1358
           var goodOrder = response.data.data.goodOrder;
1355
           var goodOrder = response.data.data.goodOrder;
1359
-          console.log("采购单", goodOrder);
1356
+          
1360
           var drugList = response.data.data.drugList;
1357
           var drugList = response.data.data.drugList;
1361
-          console.log("druglist23323223", drugList);
1358
+          
1362
           var ids = "";
1359
           var ids = "";
1363
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据,未入库
1360
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据,未入库
1364
           if (goodOrder.length == 0) {
1361
           if (goodOrder.length == 0) {

+ 2 - 2
src/xt_pages/user/dialysisRecord.vue Прегледај датотеку

576
       var dl = this.doctorOptions.length;
576
       var dl = this.doctorOptions.length;
577
       if (dl > 0) {
577
       if (dl > 0) {
578
         for (let index = 0; index < dl; index++) {
578
         for (let index = 0; index < dl; index++) {
579
-          if ((this.doctorOptions[index].id = creater)) {
579
+          if ((this.doctorOptions[index].id == creater)) {
580
             return this.doctorOptions[index].name;
580
             return this.doctorOptions[index].name;
581
           }
581
           }
582
         }
582
         }
588
       if (dl > 0) {
588
       if (dl > 0) {
589
         for (let index = 0; index < dl; index++) {
589
         for (let index = 0; index < dl; index++) {
590
 
590
 
591
-          if (this.nurseOptions[index].id = start_nurse) {
591
+          if (this.nurseOptions[index].id == start_nurse) {
592
 
592
 
593
             return this.nurseOptions[index].name;
593
             return this.nurseOptions[index].name;
594
           }
594
           }