Browse Source

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx 2 years ago
parent
commit
a664d3e739
51 changed files with 2743 additions and 690 deletions
  1. 56 8
      src/api/drug/drug_stock.js
  2. 63 8
      src/api/stock.js
  3. 12 12
      src/router/modules/patient.js
  4. 2 2
      src/xt_pages/data/basicConfig.vue
  5. 1 3
      src/xt_pages/data/components/consumables.vue
  6. 15 2
      src/xt_pages/data/components/drugs.vue
  7. 1 1
      src/xt_pages/dialysis/bloodPresssWatch.vue
  8. 3 0
      src/xt_pages/dialysis/details/assessmentAfter.vue
  9. 2 2
      src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue
  10. 8 9
      src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue
  11. 11 9
      src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue
  12. 40 5
      src/xt_pages/dialysis/details/dialog/monitor_dialog.vue
  13. 10 7
      src/xt_pages/dialysis/details/dialysisMonitoring.vue
  14. 9 11
      src/xt_pages/dialysis/template/DialysisPrintOrderFiftyFour.vue
  15. 28 13
      src/xt_pages/dialysis/template/DialysisPrintOrderFiftyThree.vue
  16. 17 4
      src/xt_pages/dialysis/template/dialysisPrintOrderTwelve.vue
  17. 235 66
      src/xt_pages/hospitalStation/components/deskPrescription.vue
  18. 6 4
      src/xt_pages/hospitalStation/components/prescriptionTable.vue
  19. 20 10
      src/xt_pages/hospitalStation/doctorDesk.vue
  20. 2 1
      src/xt_pages/outpatientCharges/components/dayPrescriptionTable.vue
  21. 252 70
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue
  22. 7 5
      src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue
  23. 23 15
      src/xt_pages/outpatientDoctorStation/doctorDesk.vue
  24. 39 1
      src/xt_pages/stock/cancelStockOrder.vue
  25. 113 37
      src/xt_pages/stock/cancelStockOrderAdd.vue
  26. 106 33
      src/xt_pages/stock/cancelStockOrderEdit.vue
  27. 21 0
      src/xt_pages/stock/detail/print.vue
  28. 37 1
      src/xt_pages/stock/drugs/cancelDrugStockOrder.vue
  29. 128 16
      src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue
  30. 115 26
      src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue
  31. 50 1
      src/xt_pages/stock/drugs/drugStockInOrder.vue
  32. 123 9
      src/xt_pages/stock/drugs/drugStockInOrderAdd.vue
  33. 121 55
      src/xt_pages/stock/drugs/drugStockInOrderEdit.vue
  34. 67 15
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  35. 134 13
      src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue
  36. 6 5
      src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue
  37. 105 14
      src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue
  38. 2 1
      src/xt_pages/stock/drugs/inventoryDetails.vue
  39. 80 22
      src/xt_pages/stock/drugs/print.vue
  40. 2 2
      src/xt_pages/stock/inventoryDetails.vue
  41. 44 18
      src/xt_pages/stock/print_all.vue
  42. 46 6
      src/xt_pages/stock/stockInOrder.vue
  43. 132 37
      src/xt_pages/stock/stockInOrderAdd.vue
  44. 117 8
      src/xt_pages/stock/stockInOrderEdit.vue
  45. 46 4
      src/xt_pages/stock/stockOutOrder.vue
  46. 176 55
      src/xt_pages/stock/stockOutOrderAdd.vue
  47. 1 0
      src/xt_pages/stock/stockOutOrderDetailPrint.vue
  48. 79 6
      src/xt_pages/stock/stockOutOrderEdit.vue
  49. 2 2
      src/xt_pages/stock/stockQuery.vue
  50. 3 6
      src/xt_pages/supply/components/addGoodOrder.vue
  51. 25 30
      src/xt_pages/user/dialysisSolution.vue

+ 56 - 8
src/api/drug/drug_stock.js View File

@@ -1,8 +1,8 @@
1 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 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 6
     method: 'post',
7 7
     data: params
8 8
   })
@@ -72,9 +72,9 @@ export function getDrugWarehouseOutInfoList(params) {
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 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 78
     method: 'post',
79 79
     data: params
80 80
   })
@@ -321,9 +321,9 @@ export function deleteDrugCancelStockInfo(params) {
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 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 327
     method: 'post',
328 328
     data: params
329 329
   })
@@ -582,9 +582,57 @@ export function getDrugOutOrderPrint(params) {
582 582
   })
583 583
 }
584 584
 
585
-export function GetAllConfigOne() {
585
+export function GetAllConfigOne(params) {
586 586
   return request({
587 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
 }

+ 63 - 8
src/api/stock.js View File

@@ -201,11 +201,11 @@ export function GetAllGoodInfo(params) {
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 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 207
     method: 'post',
208
-    data: params
208
+    data: data
209 209
   })
210 210
 }
211 211
 
@@ -490,9 +490,9 @@ export function getCancelStockList(params) {
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 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 496
     method: 'post',
497 497
     data: params
498 498
   })
@@ -522,9 +522,9 @@ export function deleteCancelStockInfo(params) {
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 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 528
     method: 'post',
529 529
     data: params
530 530
   })
@@ -578,7 +578,6 @@ export function GetOutStockTotalCount(params) {
578 578
 }
579 579
 
580 580
 export function postGoodInformation(params) {
581
-  console.log('PARMAS22', params)
582 581
   return request({
583 582
     url: '/api/good/postgoodinformation',
584 583
     method: 'Post',
@@ -1009,3 +1008,59 @@ export function getmanufacturername(params) {
1009 1008
     params: params
1010 1009
   })
1011 1010
 }
1011
+
1012
+export function checkWarehouseOut(params) {
1013
+  return request({
1014
+    url: '/api/stock/checkwarehouseout',
1015
+    method: 'get',
1016
+    params: params
1017
+  })
1018
+}
1019
+
1020
+export function returnCheckWarehouseOut(params) {
1021
+  return request({
1022
+    url: '/api/stock/returncheckwarehouseout',
1023
+    method: 'get',
1024
+    params: params
1025
+  })
1026
+}
1027
+
1028
+export function toCheckWarehouseInfo(params) {
1029
+  return request({
1030
+    url: '/api/stock/tocheckwarehouseinfo',
1031
+    method: 'get',
1032
+    params: params
1033
+  })
1034
+}
1035
+
1036
+export function toReturnCheckWarehouseInfo(params) {
1037
+  return request({
1038
+    url: '/api/stock/returncheckwarehouseinfo',
1039
+    method: 'get',
1040
+    params: params
1041
+  })
1042
+}
1043
+
1044
+export function checkStockWarehouseInfo(params) {
1045
+  return request({
1046
+    url: '/api/stock/checkstockwarehouseinfo',
1047
+    method: 'get',
1048
+    params: params
1049
+  })
1050
+}
1051
+
1052
+export function checkRturnStockWarehouseInfo(params) {
1053
+  return request({
1054
+    url: '/api/stock/checkreturnstockwarehouseinfo',
1055
+    method: 'get',
1056
+    params: params
1057
+  })
1058
+}
1059
+
1060
+export function getPrintList(params) {
1061
+  return request({
1062
+    url: '/api/stock/getprintlist',
1063
+    method: 'get',
1064
+    params: params
1065
+  })
1066
+}

+ 12 - 12
src/router/modules/patient.js View File

@@ -226,17 +226,17 @@ export default {
226 226
       noCache: true
227 227
     }
228 228
   },
229
-  {
230
-    path: '/patient/patient/templateSummary/print_1',
231
-    component: () => import('@/xt_pages/user/templateSummaryPrint_1'),
232
-    hidden: true,
233
-    is_menu: false,
234
-    name: 'templateSummary_1',
235
-    meta: {
236
-      title: 'templateSummary_1',
237
-      noCache: true
238
-    }
239
-  },
229
+  // {
230
+  //   path: '/patient/patient/templateSummary/print_1',
231
+  //   component: () => import('@/xt_pages/user/templateSummaryPrint_1'),
232
+  //   hidden: true,
233
+  //   is_menu: false,
234
+  //   name: 'templateSummary_1',
235
+  //   meta: {
236
+  //     title: 'templateSummary_1',
237
+  //     noCache: true
238
+  //   }
239
+  // },
240 240
   {
241 241
     path: '/patient/patient/hospitalSummary/print',
242 242
     component: () => import('@/xt_pages/user/hospitalSummaryPrint'),
@@ -247,7 +247,7 @@ export default {
247 247
       title: 'templateSummary',
248 248
       noCache: true
249 249
     }
250
-  },
250
+  }
251 251
 
252 252
   ]
253 253
 }

+ 2 - 2
src/xt_pages/data/basicConfig.vue View File

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

+ 1 - 3
src/xt_pages/data/components/consumables.vue View File

@@ -1451,9 +1451,7 @@
1451 1451
        let params = {
1452 1452
           'goods':tableData
1453 1453
         };
1454
-
1455
-
1456
-
1454
+        console.log("param2332323223",params)
1457 1455
         postGoodInformation(params).then(response=>{
1458 1456
            if(response.data.state == 1){
1459 1457
              var msg =  response.data.data.msg;

+ 15 - 2
src/xt_pages/data/components/drugs.vue View File

@@ -118,6 +118,11 @@
118 118
           <div>{{scope.row.medical_insurance_number}}</div>
119 119
         </template>
120 120
       </el-table-column>
121
+      <el-table-column prop="date" label="批准文号" width="100" align="center">
122
+        <template slot-scope="scope">
123
+          <div>{{scope.row.number}}</div>
124
+        </template>
125
+      </el-table-column>
121 126
       <el-table-column prop="date" label="药品本位码" width="100" align="center">
122 127
         <template slot-scope="scope">
123 128
           <div>{{scope.row.code}}</div>
@@ -1109,9 +1114,17 @@
1109 1114
 
1110 1115
 
1111 1116
           if (results[i]['*拆零零售价'] === undefined) {
1112
-                obj['retail_price'] = ''
1117
+                obj['min_price'] = ''
1113 1118
               } else {
1114 1119
            if (key == '*拆零零售价') {
1120
+               obj['min_price'] = results[i][key].replace(/\s/g,"")
1121
+              }
1122
+           }
1123
+
1124
+            if (results[i]['*包装零售价'] === undefined) {
1125
+                obj['retail_price'] = ''
1126
+              } else {
1127
+           if (key == '*包装零售价') {
1115 1128
                obj['retail_price'] = results[i][key].replace(/\s/g,"")
1116 1129
               }
1117 1130
            }
@@ -1430,7 +1443,7 @@
1430 1443
         }
1431 1444
        }
1432 1445
        for(let i=0;i<tableData.length;i++){
1433
-          tableData[i].dose = parseInt(tableData[i].dose)
1446
+          tableData[i].dose = tableData[i].dose.toString()
1434 1447
        }
1435 1448
        let params = {
1436 1449
           'drugs':tableData

+ 1 - 1
src/xt_pages/dialysis/bloodPresssWatch.vue View File

@@ -90,7 +90,7 @@
90 90
           >
91 91
         </div>
92 92
       </template>
93
-      <template v-if="this.template_id == 6 || this.template_id == 48">
93
+      <template v-if="this.template_id == 6 || this.template_id == 48 || this.template_id == 0">
94 94
         <el-button
95 95
           size="small"
96 96
           icon="el-icon-printer"

+ 3 - 0
src/xt_pages/dialysis/details/assessmentAfter.vue View File

@@ -714,6 +714,9 @@ export default {
714 714
         case 2:
715 715
           return 'ml'
716 716
           break
717
+        case 3:
718
+          return 'kg'
719
+          break
717 720
       }
718 721
     },
719 722
     getSealingFluidDisposeName: function(id) {

+ 2 - 2
src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue View File

@@ -377,7 +377,7 @@
377 377
                 :value="item.id"
378 378
                 :key="item.id"
379 379
               ></el-option>
380
-            </el-select>
380
+            </el-select> 
381 381
           </el-form-item>
382 382
         </el-col>
383 383
 
@@ -690,7 +690,7 @@ export default {
690 690
       symptomsOptions: [],
691 691
       internalFistulaOptions: [],
692 692
       vascularAccessOptions: [],
693
-      unit: [{ id: 1, name: 'g' }, { id: 2, name: 'ml' }],
693
+      unit: [{ id: 1, name: 'g' }, { id: 2, name: 'ml' },{ id: 3, name: 'kg' }],
694 694
       actualTreatmentHourShow: '',
695 695
       vascularAccessDescOptions: [],
696 696
       catheterOptions: [],

+ 8 - 9
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

@@ -223,9 +223,10 @@
223 223
         :cell-class-name="adviceNameShow"
224 224
         :modal-append-to-body="false"
225 225
         highlight-current-row
226
-        @selection-change="handleSelectionChange"
226
+        
227 227
       >
228
-        <el-table-column type="selection"  width="55"></el-table-column>
228
+      <!-- @selection-change="handleSelectionChange" -->
229
+        <!-- <el-table-column type="selection"  width="55"></el-table-column> -->
229 230
        <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
230 231
           <template slot-scope="scope">
231 232
             <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
@@ -300,15 +301,13 @@
300 301
               {{getXuserName(scope.row.checker)}}
301 302
             </span>
302 303
 
304
+
303 305
           </template>
304 306
         </el-table-column>
305 307
       </el-table>
306 308
 
307 309
 
308 310
 
309
-
310
-
311
-
312 311
       <el-table
313 312
         v-if="his_is_open  == 1 || is_advice_open == 1"
314 313
         :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
@@ -322,15 +321,15 @@
322 321
         :cell-class-name="adviceNameShow"
323 322
         :modal-append-to-body="false"
324 323
         highlight-current-row
325
-        @selection-change="handleSelectionChange"
326 324
       >
327
-        <el-table-column type="selection"  width="55"></el-table-column>
325
+        <!-- <el-table-column type="selection"  width="55"></el-table-column> -->
328 326
         <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
329 327
           <template slot-scope="scope">
330 328
             <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
331 329
           </template>
332 330
         </el-table-column>
333 331
 
332
+
334 333
         <!--===================================-->
335 334
 <!--        <el-table-column prop="date" label="调试" align="center" min-width="26px">-->
336 335
 <!--          <template slot-scope="scope">-->
@@ -388,10 +387,10 @@
388 387
         </el-table-column>
389 388
         <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
390 389
           <template slot-scope="scope">
391
-            <span v-if="scope.row.parent_id == 0">
390
+            <span>
392 391
               {{getXuserName(scope.row.execution_staff)}}
393 392
             </span>
394
-            <span v-else>{{getXuserName(scope.row.execution_staff)}}</span>
393
+            <!-- <span v-else>{{getXuserName(scope.row.execution_staff)}}</span> -->
395 394
           </template>
396 395
         </el-table-column>
397 396
         <el-table-column

+ 11 - 9
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue View File

@@ -200,7 +200,7 @@
200 200
                     </el-col>
201 201
 
202 202
                     <el-col :span="8" v-if="anticoagulant.shouji != -1 && isShows('首剂')">
203
-                        <div v-if="this.$store.getters.xt_user.template_info.org_id != 10157">
203
+                        <div v-if="this.$store.getters.xt_user.template_info.org_id != 10157 && this.$store.getters.xt_user.template_info.template_id!=54">
204 204
                           <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
205 205
                             <el-form-item
206 206
                                     v-if='this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987'
@@ -261,16 +261,16 @@
261 261
 
262 262
                     <el-col :span="8" v-if="anticoagulant.weichi != -1 && isShows('维持')">
263 263
                         <div v-if="this.$store.getters.xt_user.template_info.org_id != 10157">
264
-                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
264
+                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45 && this.$store.getters.xt_user.template_info.template_id != 54">
265 265
                             <el-form-item :label="'维持(' + anticoagulant.weichi_unit + ') : '"
266
-                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987">
266
+                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38 && this.$store.getters.xt_user.template_info.org_id != 9987  && this.$store.getters.xt_user.template_info.org_id != 54">
267 267
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
268 268
                                           v-model="dialysisPrescription.anticoagulant_weichi"></el-input>
269 269
                                 <el-input type="number" disabled v-if="dialysisPrescription.anticoagulant == 1"
270 270
                                           v-model="dialysisPrescription.no_anticoagulant_weichi"></el-input>
271 271
                             </el-form-item>
272 272
                             <el-form-item :label="'维持(mg/h) : '"
273
-                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.org_id == 9987  ">
273
+                                          v-if="anticoagulant.weichi != -1 && this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38 || this.$store.getters.xt_user.template_info.org_id == 9987 || this.$store.getters.xt_user.template_info.org_id == 54  ">
274 274
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
275 275
                                           v-model="dialysisPrescription.anticoagulant_weichi"></el-input>
276 276
                                 <el-input type="number" disabled v-if="dialysisPrescription.anticoagulant == 1"
@@ -313,9 +313,9 @@
313 313
 
314 314
                     <el-col :span="8" v-if="anticoagulant.zongliang != -1 && isShows('总量')">
315 315
                         <div v-if="this.$store.getters.xt_user.template_info.org_id != 10157">
316
-                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45">
316
+                          <div v-if="this.$store.getters.xt_user.template_info.org_id != 10101 && this.$store.getters.xt_user.template_info.template_id != 45 && this.$store.getters.xt_user.template_info.template_id != 54">
317 317
                             <el-form-item
318
-                                    v-if='this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38  && this.$store.getters.xt_user.template_info.org_id != 9987'
318
+                                    v-if='this.$store.getters.xt_user.template_info.template_id != 21 && this.$store.getters.xt_user.template_info.template_id != 23 && this.$store.getters.xt_user.template_info.template_id != 38  && this.$store.getters.xt_user.template_info.org_id != 9987 && this.$store.getters.xt_user.template_info.template_id != 54'
319 319
                                     :label="'总量(' + anticoagulant.zongliang_unit + ') : '">
320 320
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
321 321
                                           v-model="dialysisPrescription.anticoagulant_zongliang"></el-input>
@@ -323,7 +323,7 @@
323 323
                                           v-model="dialysisPrescription.no_anticoagulant_zongliang"></el-input>
324 324
                             </el-form-item>
325 325
                             <el-form-item
326
-                                    v-if='this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38||  this.$store.getters.xt_user.template_info.org_id == 9987'
326
+                                    v-if='this.$store.getters.xt_user.template_info.template_id == 21 || this.$store.getters.xt_user.template_info.template_id == 23 || this.$store.getters.xt_user.template_info.template_id == 38||  this.$store.getters.xt_user.template_info.org_id == 9987 || this.$store.getters.xt_user.template_info.template_id == 54'
327 327
                                     :label="'总量(mg) : '">
328 328
                                 <el-input type="number" v-if="dialysisPrescription.anticoagulant != 1"
329 329
                                           v-model="dialysisPrescription.anticoagulant_zongliang"></el-input>
@@ -413,7 +413,9 @@
413 413
                     <el-col
414 414
                             :span="8"
415 415
                             v-if="isShows('钙剂量')"
416
-                    >
416
+                    ></el-col>
417
+                    
418
+                    <el-col :span="8" v-if="isShows('钙剂量')" >
417 419
                         <el-form-item label="钙剂量(ml) : ">
418 420
                             <el-input
419 421
                                     type="number"
@@ -1422,7 +1424,7 @@
1422 1424
               this.irrigations[i].name = this.irrigations[i].specification_name
1423 1425
             }
1424 1426
             this.InnerDialogProps.values = this.irrigations
1425
-            this.InnerDialogProps.titles = '透析器'
1427
+            this.InnerDialogProps.titles = '灌流器'
1426 1428
             this.InnerDialogProps.type = 'irrigations'
1427 1429
             this.InnerDialogProps.selected = this.dialysisPrescription.dialysis_irrigation
1428 1430
             this.InnerDialogProps.isShowTextArea = false

+ 40 - 5
src/xt_pages/dialysis/details/dialog/monitor_dialog.vue View File

@@ -232,6 +232,7 @@
232 232
                 template_id == 48 ||
233 233
                 template_id == 51 ||
234 234
                 template_id == 53 ||
235
+                template_id == 54 ||
235 236
                 org_id == 10210 ||
236 237
                 org_id == 9555)
237 238
             "
@@ -285,6 +286,7 @@
285 286
               template_id != 48 &&
286 287
               template_id != 51 &&
287 288
               template_id != 53 &&
289
+              template_id != 54 &&
288 290
               org_id!= 10210 &&
289 291
               org_id != 9555
290 292
             "
@@ -331,6 +333,7 @@
331 333
                 template_id == 46 ||
332 334
                 template_id == 48 ||
333 335
                 template_id == 53 ||
336
+                template_id == 54 ||
334 337
                 template_id == 47)
335 338
             "
336 339
           >
@@ -374,6 +377,7 @@
374 377
               template_id != 44 &&
375 378
               template_id != 46 &&
376 379
               template_id != 53 &&
380
+              template_id != 54 &&
377 381
               template_id != 48 &&
378 382
               template_id != 47
379 383
             "
@@ -431,6 +435,7 @@
431 435
                 template_id == 29 ||
432 436
                 template_id == 48 ||
433 437
                 template_id == 53 ||
438
+                template_id == 54 ||
434 439
                 template_id == 47)
435 440
             "
436 441
           >
@@ -454,6 +459,7 @@
454 459
               template_id != 29 &&
455 460
               template_id != 48 &&
456 461
               template_id != 53 &&
462
+              template_id != 54 &&
457 463
               template_id != 47
458 464
             "
459 465
           >
@@ -494,6 +500,7 @@
494 500
                 template_id == 26 ||
495 501
                 template_id == 29 ||
496 502
                 template_id == 53 ||
503
+                template_id == 54 ||
497 504
                 template_id == 48)
498 505
             "
499 506
           >
@@ -521,6 +528,7 @@
521 528
               template_id != 29 &&
522 529
               template_id != 43 &&
523 530
               template_id != 53 &&
531
+              template_id != 54 &&
524 532
               template_id != 48
525 533
             "
526 534
           >
@@ -686,18 +694,31 @@
686 694
             </template>
687 695
           </el-table-column>
688 696
 
689
-          <el-table-column
690
-            prop="heparin"
697
+         <el-table-column
698
+            prop="displacement_flow_quantity"
691 699
             align="center"
692 700
             label="累计血容量(ml)"
693
-            width="140"
694
-            v-if="isShow('累计血容量')"
701
+            width="100"
702
+            v-if="isShow('累计血容量') && template_id != 41"
703
+          >
704
+             <template slot-scope="scope">
705
+              {{ scope.row.accumulated_blood_volume }}
706
+            </template>
707
+          </el-table-column>
708
+          <el-table-column
709
+            prop="displacement_flow_quantity"
710
+            align="center"
711
+            label="累计血容量(L)"
712
+            width="100"
713
+            v-if="isShow('累计血容量') && template_id == 41"
695 714
           >
696 715
             <template slot-scope="scope">
697 716
               {{ scope.row.accumulated_blood_volume }}
698 717
             </template>
699 718
           </el-table-column>
700 719
 
720
+
721
+
701 722
           <el-table-column
702 723
             prop="heparin"
703 724
             align="center"
@@ -995,6 +1016,7 @@
995 1016
                 template_id == 46 ||
996 1017
                 template_id == 48 ||
997 1018
                 template_id == 53 ||
1019
+                template_id == 54 ||
998 1020
                 template_id == 47)
999 1021
             "
1000 1022
           >
@@ -1032,6 +1054,7 @@
1032 1054
               template_id != 46 &&
1033 1055
               template_id != 48 &&
1034 1056
               template_id != 53 &&
1057
+              template_id != 54 &&
1035 1058
               template_id != 47
1036 1059
             "
1037 1060
           >
@@ -1076,6 +1099,7 @@
1076 1099
                 template_id == 48 ||
1077 1100
                 template_id == 51 ||
1078 1101
                 template_id == 53 ||
1102
+                template_id == 54 ||
1079 1103
                 org_id == 10210 ||
1080 1104
                 org_id == 9555)
1081 1105
             "
@@ -1121,6 +1145,7 @@
1121 1145
               template_id != 51 &&
1122 1146
               template_id == 48 &&
1123 1147
               template_id == 53 &&
1148
+              template_id == 54 &&
1124 1149
               org_id !=  10210 &&
1125 1150
               org_id != 9555
1126 1151
             "
@@ -1156,6 +1181,7 @@
1156 1181
               template_id != 46 &&
1157 1182
               template_id != 47 &&
1158 1183
               template_id != 48 &&
1184
+              template_id != 54 &&
1159 1185
               template_id != 53
1160 1186
             "
1161 1187
           >
@@ -1176,6 +1202,7 @@
1176 1202
                 template_id == 46 ||
1177 1203
                 template_id == 47 ||
1178 1204
                 template_id == 53 ||
1205
+                template_id == 54 ||
1179 1206
                 template_id == 48)
1180 1207
             "
1181 1208
           >
@@ -1201,6 +1228,7 @@
1201 1228
               template_id != 43 &&
1202 1229
               template_id != 46 &&
1203 1230
               template_id != 53 &&
1231
+              template_id != 54 &&
1204 1232
               template_id != 48
1205 1233
             "
1206 1234
           >
@@ -1223,6 +1251,7 @@
1223 1251
                 template_id == 29 ||
1224 1252
                 template_id == 46 ||
1225 1253
                 template_id == 53 ||
1254
+                template_id == 54 ||
1226 1255
                 template_id == 48)
1227 1256
             "
1228 1257
           >
@@ -1339,7 +1368,13 @@
1339 1368
             </el-form-item>
1340 1369
           </el-col>
1341 1370
 
1342
-          <el-col :span="8" v-if="isShow('累计血容量')">
1371
+          <el-col :span="8" v-if="isShow('累计血容量') && template_id == 41">
1372
+            <el-form-item label="累计血容量(L):">
1373
+              <el-input v-model="form.accumulated_blood_volume"></el-input>
1374
+            </el-form-item>
1375
+          </el-col>
1376
+         
1377
+          <el-col :span="8" v-if="isShow('累计血容量') && template_id  != 41">
1343 1378
             <el-form-item label="累计血容量(ml):">
1344 1379
               <el-input v-model="form.accumulated_blood_volume"></el-input>
1345 1380
             </el-form-item>

+ 10 - 7
src/xt_pages/dialysis/details/dialysisMonitoring.vue View File

@@ -14,17 +14,17 @@
14 14
           <th width="76px">静脉压/动脉压({{monitores[0]&&monitores[0]['venous_pressure_type'] == 2 ? 'kpa' : 'mmHg'}})</th>
15 15
           <th v-if="isShow('血流量')" width="92px">血流量(ml/min)</th>
16 16
           <th v-if="isShow('跨膜压')" width="76px">跨膜压({{monitores[0]&&monitores[0]['transmembrane_pressure_type'] == 2 ? 'kpa' : 'mmHg'}})</th>
17
-          <th v-if=" isShow('超滤量') &&(template_id == 6 || template_id == 9 || template_id == 10 || template_id == 11 || template_id == 13 || template_id == 17 || template_id == 18 || template_id == 19 || template_id == 20 || template_id == 21 || template_id == 22 || template_id == 23 || template_id == 24 || template_id == 26 || template_id == 27 || template_id == 28 || template_id == 29 || template_id == 30 || template_id == 31 || template_id == 32 || template_id == 34 || template_id == 35 || template_id == 36 || template_id == 38 || template_id == 39 || template_id == 40  || template_id == 41 || template_id == 43 || template_id == 44 || template_id == 46 || template_id == 47 || template_id == 48 || this.$store.getters.xt_user.template_info.org_id == 9555 || template_id == 53)" width="76px" > 超滤量(ml)</th>
18
-          <th v-if=" isShow('超滤量') && template_id != 6 && template_id != 9 && template_id != 10 && template_id != 11 && template_id != 13 && template_id != 17 && template_id != 18 && template_id != 19 && template_id != 20 && template_id != 21 && template_id != 22 && template_id != 23 && template_id != 24 && template_id != 26 && template_id !=27 && template_id!=28 && template_id!=29 && template_id!=30 && template_id!=31 && template_id!=32 && template_id!=34 && template_id!=35 && template_id!=36 && template_id!=38 && template_id != 39 && template_id != 40  && template_id != 41 && template_id != 43 && template_id != 44 && template_id != 46  && template_id != 47 && template_id != 48 && template_id != 53 && this.$store.getters.xt_user.template_info.org_id != 9555"  width="76px"> 超滤量(L) </th>
17
+          <th v-if=" isShow('超滤量') &&(template_id == 6 || template_id == 9 || template_id == 10 || template_id == 11 || template_id == 13 || template_id == 17 || template_id == 18 || template_id == 19 || template_id == 20 || template_id == 21 || template_id == 22 || template_id == 23 || template_id == 24 || template_id == 26 || template_id == 27 || template_id == 28 || template_id == 29 || template_id == 30 || template_id == 31 || template_id == 32 || template_id == 34 || template_id == 35 || template_id == 36 || template_id == 38 || template_id == 39 || template_id == 40  || template_id == 41 || template_id == 43 || template_id == 44 || template_id == 46 || template_id == 47 || template_id == 48 || this.$store.getters.xt_user.template_info.org_id == 9555 || template_id == 53 || template_id == 54)" width="76px" > 超滤量(ml)</th>
18
+          <th v-if=" isShow('超滤量') && template_id != 6 && template_id != 9 && template_id != 10 && template_id != 11 && template_id != 13 && template_id != 17 && template_id != 18 && template_id != 19 && template_id != 20 && template_id != 21 && template_id != 22 && template_id != 23 && template_id != 24 && template_id != 26 && template_id !=27 && template_id!=28 && template_id!=29 && template_id!=30 && template_id!=31 && template_id!=32 && template_id!=34 && template_id!=35 && template_id!=36 && template_id!=38 && template_id != 39 && template_id != 40  && template_id != 41 && template_id != 43 && template_id != 44 && template_id != 46  && template_id != 47 && template_id != 48 && template_id != 53  && template_id != 54 && this.$store.getters.xt_user.template_info.org_id != 9555"  width="76px"> 超滤量(L) </th>
19 19
           <th v-if="isShow('超滤率') && (template_id ==6 || template_id == 10 || template_id == 11 || template_id == 12 || template_id == 13 || template_id == 17 || template_id == 18 || template_id == 19 || template_id == 20 || template_id == 21 || template_id == 22 || template_id == 23 || template_id == 24 || template_id == 26 || template_id == 29 || template_id == 30 || template_id == 31 || template_id == 34 || template_id == 35 || template_id == 38 || template_id == 41 || template_id == 43 || template_id == 44 || template_id == 46 || template_id == 47  || template_id == 48  || template_id == 53)" width="50px"> 超滤率 <br />(ml/h) </th>
20 20
           <th v-if="isShow('超滤率') && template_id !=6 && template_id !=10 && template_id !=11 && template_id !=12 && template_id !=13 && template_id !=17 && template_id !=18 && template_id !=19 && template_id !=20 && template_id !=21 && template_id !=22 && template_id !=23 && template_id !=24 && template_id !=26 && template_id !=29 && template_id !=30 && template_id !=31 && template_id !=34 && template_id !=35 && template_id !=38  && template_id !=41 && template_id !=43 && template_id !=44 && template_id !=46 && template_id !=47 &&  template_id !=48 &&  template_id !=53" width="50px"> 超滤率 <br />(L/h) </th>
21 21
           <th v-if="isShow('钠浓度')" width="92px">钠浓度(mmol/L)</th>
22 22
           <th v-if="isShow('透析液温度')" width="92px">透析液温度(℃)</th>
23
-          <th v-if=" isShow('置换率') && (template_id == 6 || template_id == 10 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29 || template_id == 46 || template_id == 47 || template_id == 48 || template_id == 53) " width="92px" > 置换率(ml/min) </th>
24
-          <th v-if=" isShow('置换率') && template_id != 6 && template_id != 10 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29 && template_id != 46 && template_id != 47 && template_id != 48 && template_id != 53" width="92px" > 置换率(L/h)  </th>
23
+          <th v-if=" isShow('置换率') && (template_id == 6 || template_id == 10 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29 || template_id == 46 || template_id == 47 || template_id == 48 || template_id == 53  || template_id == 54) " width="92px" > 置换率(ml/min) </th>
24
+          <th v-if=" isShow('置换率') && template_id != 6 && template_id != 10 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29 && template_id != 46 && template_id != 47 && template_id != 48 && template_id != 53 && template_id != 54" width="92px" > 置换率(L/h)  </th>
25 25
           <th v-if=" isShow('置换量') && (template_id == 43)" width="92px"> 置换量(ml/h)  </th>
26
-          <th v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919 && org_id !=10191) || org_id == 9779 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29 || template_id == 46 || template_id == 48 || template_id == 53)" width="92px"  > 置换量(ml)  </th>
27
-          <th v-if=" isShow('置换量') && ((template_id != 6 || org_id == 9919 || org_id == 10191) && org_id != 9779 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29 && template_id != 46 && template_id != 48 && template_id != 53)" width="92px" > 置换量(L) </th>
26
+          <th v-if=" isShow('置换量') && ((template_id == 6 && org_id != 9919 && org_id !=10191) || org_id == 9779 || template_id == 11 || template_id == 20 || template_id == 26 || template_id == 29 || template_id == 46 || template_id == 48 || template_id == 53 || template_id == 54)" width="92px"  > 置换量(ml)  </th>
27
+          <th v-if=" isShow('置换量') && ((template_id != 6 || org_id == 9919 || org_id == 10191) && org_id != 9779 && template_id != 11 && template_id != 20 && template_id != 26 && template_id != 29 && template_id != 46 && template_id != 48 && template_id != 53 && template_id != 54)" width="92px" > 置换量(L) </th>
28 28
           <th v-if=" isShow('SpO₂') && template_id != 6 && template_id != 10 && template_id != 11  " width="92px" > SpO₂(%) </th>
29 29
           <th v-if="isShow('电导度')" width="92px">电导度(mS/m)</th>
30 30
           <th v-if="isShow('置换液流量') && template_id != 27" width="92px">置换液流量(ml/h)</th>
@@ -32,7 +32,10 @@
32 32
           <th v-if="isShow('透析液流量')" width="92px">透析液流量(ml/h)</th>
33 33
           <th v-if="isShow('肝素用量余量')" width="92px">肝素用量余量(ml)</th>
34 34
           <th v-if="isShow('抗凝剂')" width="92px">抗凝剂</th>
35
-          <th v-if="isShow('累计血容量')" width="92px">累计血容量(ml)</th>
35
+          <th v-if="isShow('累计血容量')" width="92px">累计血容量 
36
+            <span v-if="template_id !=41">(ml)</span>
37
+            <span v-if="template_id == 41">(L)</span>
38
+          </th>
36 39
           <th v-if="isShow('血容量')" width="92px">血容量(L)</th>
37 40
           <th v-if="isShow('血温监测')" width="92px">血温监测</th>
38 41
           <th v-if="isShow('尿素监测')" width="92px">尿素监测</th>

+ 9 - 11
src/xt_pages/dialysis/template/DialysisPrintOrderFiftyFour.vue View File

@@ -878,19 +878,17 @@
878 878
                   setAdminUserES(
879 879
                     prescription == null
880 880
                       ? 0
881
-                      : prescription.prescription_doctor
882
-                      ? prescription.prescription_doctor
881
+                      : prescription.creater
882
+                      ? prescription.creater
883 883
                       : ''
884 884
                   ) == ''
885 885
                 "
886 886
               >
887 887
                 {{
888 888
                   getAdminUser(
889
-                    prescription == null
890
-                      ? 0
891
-                      : prescription.prescription_doctor
892
-                      ? prescription.prescription_doctor
893
-                      : ""
889
+                    prescription == null? 0: prescription.creater ? prescription.prescription_doctor: ""
890
+                     
891
+                     
894 892
                   )
895 893
                 }}
896 894
               </span>
@@ -900,11 +898,11 @@
900 898
                   setAdminUserES(
901 899
                     prescription == null
902 900
                       ? 0
903
-                      : prescription.prescription_doctor
904
-                      ? prescription.prescription_doctor
901
+                      : prescription.creater
902
+                      ? prescription.creater
905 903
                       : ''
906
-                  )
907
-                "
904
+                  ) "
905
+               
908 906
                 alt=""
909 907
                 srcset=""
910 908
                 v-else

+ 28 - 13
src/xt_pages/dialysis/template/DialysisPrintOrderFiftyThree.vue View File

@@ -156,7 +156,18 @@
156 156
                 ></label-box>
157 157
 
158 158
                 <div style="display: flex; padding-left: 20px">
159
-                  其他
159
+                  <label-box
160
+                  :isChecked="
161
+                    predialysis.is_hemorrhage == 1 &&
162
+                    predialysis.hemorrhage.indexOf('女性经期') == -1&&
163
+                    predialysis.hemorrhage.indexOf('消化道出血') == -1&&
164
+                    predialysis.hemorrhage.indexOf('牙龈出血') == -1&&
165
+                    predialysis.hemorrhage.indexOf('穿刺点渗血') == -1
166
+                      ? true
167
+                      : false
168
+                      "
169
+                  showValue="其他"
170
+                ></label-box>
160 171
                   <div
161 172
                     style="
162 173
                       min-width: 200px;
@@ -498,7 +509,7 @@
498 509
                           ) == -1
499 510
                         "
500 511
                       >
501
-                        {{ predialysis.blood_access_part_opera_name }}
512
+                        {{ predialysis.blood_access_part_opera_name }} 
502 513
                       </span>
503 514
                     </span>
504 515
                   </span>
@@ -858,7 +869,7 @@
858 869
               {{
859 870
                 monitor.blood_oxygen_saturation
860 871
                   ? monitor.blood_oxygen_saturation
861
-                  : "0"
872
+                  : ""
862 873
               }}
863 874
             </span>
864 875
           </td>
@@ -921,26 +932,29 @@
921 932
               <span v-if="advice.parent_id == 0">{{
922 933
                 advice.execution_frequency
923 934
               }}</span>
935
+              <span>{{
936
+                advice.remark
937
+              }}</span>
924 938
             </td>
925 939
 
926
-            <td>
940
+            <td style="line-height: 30px;">
927 941
               <span v-if="setAdminUserES(advice.execution_staff) == ''">{{
928 942
                 getAdminUser(advice.execution_staff)
929 943
               }}</span>
930 944
               <img
931
-                style="height: 40px"
945
+                style="height: 30px"
932 946
                 :src="setAdminUserES(advice.execution_staff)"
933 947
                 alt=""
934 948
                 srcset=""
935 949
                 v-else
936 950
               />
937 951
             </td>
938
-            <td>
952
+            <td style="line-height: 30px;">
939 953
               <span v-if="setAdminUserES(advice.checker) == ''">{{
940 954
                 getAdminUser(advice.checker)
941 955
               }}</span>
942 956
               <img
943
-                style="height: 40px"
957
+                style="height: 30px"
944 958
                 :src="setAdminUserES(advice.checker)"
945 959
                 alt=""
946 960
                 srcset=""
@@ -1121,9 +1135,9 @@
1121 1135
     <!-- <div style="position: absolute; top: 1380px; left: 50%"></div> -->
1122 1136
     <div
1123 1137
       style="margin-top: 300px; padding-top: 50px"
1124
-      v-if="this.totollength > 20"
1138
+      v-if="this.totollength > 17"
1125 1139
     >
1126
-      <template v-if="this.totollength > 20">
1140
+      <template v-if="this.totollength > 17">
1127 1141
         <div class="dialysis-print-order">
1128 1142
           <div class="order-yy-name">{{ orgname }}</div>
1129 1143
           <div class="order-title">血液透析(滤过)记录表单</div>
@@ -1556,7 +1570,7 @@
1556 1570
         <table
1557 1571
           class="print-table"
1558 1572
           border="1"
1559
-          v-if="doctor_advices_2.length > 0 || this.totollength > 20"
1573
+          v-if="doctor_advices_2.length > 0 || this.totollength > 17"
1560 1574
         >
1561 1575
           <tr style="height: 50px; text-align: left; border: none">
1562 1576
             <td style="padding-left: 5px; border: none">
@@ -2001,7 +2015,7 @@ export default {
2001 2015
           this.prescription = response.data.data.dialysisPrescription;
2002 2016
           this.receiverTreatmentAccess =
2003 2017
             response.data.data.receiverTreatmentAccess;
2004
-          this.assessmentafter = response.data.data.AssessmentAfterDislysis;
2018
+          this.assessmentafter = response.data.data.assessmentAfterDislysis;
2005 2019
 
2006 2020
           this.sick_condition_arr.forEach((o) => {
2007 2021
             if (this.receiverTreatmentAccess.sick_condition == o.id) {
@@ -2058,8 +2072,8 @@ export default {
2058 2072
           this.monitors = response.data.data.monitors;
2059 2073
           this.summary = response.data.data.summary;
2060 2074
           this.org_template_info = response.data.data.org_template_info;
2061
-          if (this.monitors.length < 8) {
2062
-            var nl = 8 - this.monitors.length;
2075
+          if (this.monitors.length < 10) {
2076
+            var nl = 10 - this.monitors.length;
2063 2077
             for (let index = 0; index < nl; index++) {
2064 2078
               this.monitors.push([]);
2065 2079
             }
@@ -2422,6 +2436,7 @@ export default {
2422 2436
 .dialysis-print-order {
2423 2437
   width: 960px;
2424 2438
   margin: 0 auto;
2439
+  
2425 2440
 }
2426 2441
 
2427 2442
 .dialysis-print-order .order-yy-name {

+ 17 - 4
src/xt_pages/dialysis/template/dialysisPrintOrderTwelve.vue View File

@@ -813,13 +813,13 @@
813 813
         </table>-->
814 814
         <table class="print-table" border="1">
815 815
           <tr style="text-align: center">
816
-            <td colspan="14" style="margin-left: 15px; font-size: 20px">
816
+            <td colspan="15" style="margin-left: 15px; font-size: 20px">
817 817
               治 疗 过 程 记 录
818 818
             </td>
819 819
           </tr>
820 820
           <tr>
821 821
             <td style="width: 60px" rowspan="2">时间</td>
822
-            <td colspan="4">透析参数</td>
822
+            <td colspan="5">透析参数</td>
823 823
             <td colspan="5">生命体征</td>
824 824
             <td colspan="2">治疗中病情变化</td>
825 825
             <td style="width: 80px" rowspan="2">护士签名</td>
@@ -841,7 +841,11 @@
841 841
               <p style="height: 20px; line-height: 20px">脱水量</p>
842 842
               <p style="height: 20px; line-height: 20px">ml</p>
843 843
             </th>
844
-            <th style="width: 30px">
844
+            <th style="width: 70px">
845
+              <p style="height: 20px; line-height: 20px">Kt/V</p>
846
+              <p style="height: 20px; line-height: 20px">ml</p>
847
+            </th>
848
+            <th style="width: 40px">
845 849
               <p style="height: 20px; line-height: 20px">T</p>
846 850
               <p style="height: 20px; line-height: 20px">℃</p>
847 851
             </th>
@@ -853,7 +857,7 @@
853 857
               <p style="height: 20px; line-height: 20px">R</p>
854 858
               <p style="height: 20px; line-height: 20px">bpm</p>
855 859
             </th>
856
-            <th style="width: 100px">
860
+            <th style="width: 90px">
857 861
               <p style="height: 20px; line-height: 20px">BP</p>
858 862
               <p style="height: 20px; line-height: 20px">mmHg</p>
859 863
             </th>
@@ -906,6 +910,15 @@
906 910
                 }}
907 911
               </span>
908 912
             </td>
913
+            <td>
914
+              <span v-if="getTime(monitor.operate_time) != ''">
915
+                {{
916
+                  monitor.ktv
917
+                    ? monitor.ktv
918
+                    : ""
919
+                }}
920
+              </span>
921
+            </td>
909 922
             <td>
910 923
               <span v-if="getTime(monitor.operate_time) != ''">
911 924
                 {{ monitor.temperature ? monitor.temperature : "0" }}

+ 235 - 66
src/xt_pages/hospitalStation/components/deskPrescription.vue View File

@@ -169,6 +169,8 @@
169 169
             <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables"
170 170
                                 :prescription="curPrescriptions"
171 171
                                 :preDrugs="preDrugs"
172
+                                v-bind="$attrs"
173
+                                v-on="$listeners"
172 174
                                 :activeType="customTabIndex"></prescription-table>
173 175
 
174 176
 
@@ -291,14 +293,17 @@
291 293
                     </el-table-column>
292 294
                     <el-table-column label="库存" width="60">
293 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 307
                       </template>
303 308
                     </el-table-column>
304 309
                     <el-table-column label="单价" width="40">
@@ -390,11 +395,12 @@
390 395
                     </el-table-column>
391 396
                     <el-table-column label="库存" width="40">
392 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 404
                       </template>
399 405
                     </el-table-column>
400 406
                     <el-table-column label="单价" width="40">
@@ -2196,6 +2202,7 @@ export default {
2196 2202
       }
2197 2203
     },
2198 2204
     open(index, isLoading) {
2205
+     
2199 2206
       if (!isLoading) {
2200 2207
         if (this.dayorMonth == 'day') {
2201 2208
           if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
@@ -2384,7 +2391,7 @@ export default {
2384 2391
                 'prescriptions': this.prescriptions
2385 2392
               }
2386 2393
               isLoading = true
2387
-              console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2394
+             
2388 2395
               let num = 0
2389 2396
               // this.prescriptions.map(item => {
2390 2397
               //   if (item.advices.length > 0) {
@@ -2399,12 +2406,142 @@ export default {
2399 2406
               //   }
2400 2407
               // })
2401 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 2538
                 createHisPrescription(data, params).then(response => {
2404 2539
                   if (response.data.state == 1) {
2405 2540
                     this.$emit('change', this.patientInfo.id)
2406 2541
                     this.$message.success('保存成功')
2407 2542
                     this.$emit('editKeepLoad', false)
2543
+                    this.$parent.getInitData()
2544
+                    this.$parent.getInitDataOne()
2408 2545
                   } else {
2409 2546
                     this.$message.error(response.data.msg)
2410 2547
                     this.$emit('editKeepLoad', false)
@@ -2618,6 +2755,7 @@ export default {
2618 2755
             this.curPrescriptions = []
2619 2756
             this.curStatus = 0
2620 2757
           }
2758
+          this.$parent.getInitDataOne(this.prescriptions)
2621 2759
         } else {
2622 2760
           let params = {
2623 2761
             'id': id
@@ -2656,6 +2794,9 @@ export default {
2656 2794
                 this.curPrescriptions = []
2657 2795
                 this.curStatus = 0
2658 2796
               }
2797
+              this.$parent.getInitData()
2798
+              this.$parent.getInitDataOne(this.prescriptions)
2799
+
2659 2800
             } else {
2660 2801
               this.$message.success(response.data.msg)
2661 2802
             }
@@ -2743,25 +2884,39 @@ export default {
2743 2884
       this.$refs.additionalCharges.show()
2744 2885
     },
2745 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 2917
           if (selection) {
2763 2918
             selection.forEach(row => {
2764
-              if (row.total <= 0) {
2919
+              if (row.sum_count <= 0) {
2765 2920
                 this.$refs.multipleTable.toggleRowSelection(row)
2766 2921
               }
2767 2922
             })
@@ -2770,8 +2925,7 @@ export default {
2770 2925
           }
2771 2926
           this.$message.error(row.drug_name + '库存不足')
2772 2927
           return
2773
-        }
2774
-      }
2928
+       }
2775 2929
       this.curDrugs = selection
2776 2930
     },
2777 2931
 
@@ -3031,40 +3185,55 @@ export default {
3031 3185
     },
3032 3186
     selectChange(selection, row) {
3033 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 3237
       this.teamList.push(row)
3069 3238
     },
3070 3239
     getlist() {
@@ -3231,7 +3400,7 @@ export default {
3231 3400
 
3232 3401
                 teamList.push(obj)
3233 3402
               } else if (project[i].type == 3 && project[i].status == 1) {
3234
-                if (project[i].good_info.total <= 0) {
3403
+                if (project[i].good_info.sum_count <= 0) {
3235 3404
                   num++
3236 3405
                   this.$refs.tabProjectTeam.toggleRowSelection(row)
3237 3406
                   this.$message.error(project[i].good_info.good_name + '库存不足')

+ 6 - 4
src/xt_pages/hospitalStation/components/prescriptionTable.vue View File

@@ -360,6 +360,7 @@
360 360
                   temp2.splice(index, 1)
361 361
                   this.prescription.advices = temp2
362 362
                   this.$message.success(response.data.data.msg)
363
+                  this.$emit("getSunziValue",temp2)
363 364
                 }
364 365
               })
365 366
 
@@ -442,6 +443,7 @@
442 443
 
443 444
       },
444 445
       getAllChange(scope) {
446
+        console.log("2332323232我的",scope.row.drug)
445 447
         if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
446 448
           if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
447 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,11 +462,11 @@
460 462
         }
461 463
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
462 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 466
             this.$message.error(scope.row.drug_name + '库存不足')
465 467
           }
466 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 470
             this.$message.error(scope.row.drug_name + '库存不足')
469 471
           }
470 472
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
@@ -504,11 +506,11 @@
504 506
       },
505 507
       changePrescribingNumber(scope) {
506 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 510
             this.$message.error(scope.row.drug_name + '库存不足')
509 511
           }
510 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 514
             this.$message.error(scope.row.drug_name + '库存不足')
513 515
           }
514 516
         }

+ 20 - 10
src/xt_pages/hospitalStation/doctorDesk.vue View File

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

+ 2 - 1
src/xt_pages/outpatientCharges/components/dayPrescriptionTable.vue View File

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

+ 252 - 70
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -164,7 +164,10 @@
164 164
                         <prescription-table v-if="dayorMonth == 'day'" ref="prescription_tables"
165 165
                                             :prescription="curPrescriptions"
166 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 173
                     </el-tabs>
@@ -285,12 +288,14 @@
285 288
                                         </el-table-column>
286 289
                                         <el-table-column label="库存" width="60">
287 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 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 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 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 299
                                             </template>
295 300
                                         </el-table-column>
296 301
                                         <el-table-column label="单价" width="40">
@@ -382,10 +387,11 @@
382 387
                                         </el-table-column>
383 388
                                         <el-table-column label="库存" width="40">
384 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 391
                                                    {{scope.row.stock_count}}
387 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 395
                                             </template>
390 396
                                         </el-table-column>
391 397
                                         <el-table-column label="单价" width="40">
@@ -1291,6 +1297,7 @@
1291 1297
         })
1292 1298
 
1293 1299
       }, saveTemplate(val) {
1300
+        
1294 1301
         let params = {
1295 1302
           name: val.name,
1296 1303
           mode: val.mode,
@@ -1299,11 +1306,12 @@
1299 1306
         let data = {
1300 1307
           'prescriptions': val.prescriptions
1301 1308
         }
1309
+      
1302 1310
         createdTemplate(params, data).then(response => {
1303 1311
           if (response.data.state == 1) {
1304 1312
             this.$refs.saveTemplate.hide()
1305
-
1306 1313
             this.$message.success('保存成功')
1314
+          
1307 1315
           } else {
1308 1316
             this.$message.error(response.data.msg)
1309 1317
           }
@@ -1807,6 +1815,7 @@
1807 1815
       },
1808 1816
 
1809 1817
       tabclickEvent(val) {
1818
+       
1810 1819
         for (let i = 0; i < this.prescriptions.length; i++) {
1811 1820
           if (this.prescriptions[i].name == val.name) {
1812 1821
             this.prescription_id = this.prescriptions[i].id
@@ -2187,6 +2196,10 @@
2187 2196
         }
2188 2197
       },
2189 2198
       open(index, isLoading) {
2199
+
2200
+        if(this.curStatus == 0){
2201
+          this.prescriptions = []
2202
+        }
2190 2203
         if(!isLoading){
2191 2204
           if (this.dayorMonth == 'day') {
2192 2205
             if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
@@ -2381,6 +2394,7 @@
2381 2394
               }
2382 2395
               isLoading = true
2383 2396
               console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2397
+              console.log('this.prescriptionsthis.prescriptions', params)
2384 2398
               let num = 0
2385 2399
               // this.prescriptions.map(item => {
2386 2400
               //   if (item.advices.length > 0) {
@@ -2395,15 +2409,147 @@
2395 2409
               //   }
2396 2410
               // })
2397 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 2543
                 createHisPrescription(data, params).then(response => {
2400 2544
                   if (response.data.state == 1) {
2401 2545
                     this.$emit('change', this.patientInfo.id)
2402
-                    this.$message.success('保存成功')
2546
+                    this.$message.success('保存成功!')
2403 2547
                     this.$emit('editKeepLoad', false)
2548
+                    this.$parent.getInitData()
2404 2549
                   } else {
2405 2550
                     this.$message.error(response.data.msg)
2406 2551
                     this.$emit('editKeepLoad', false)
2552
+                    
2407 2553
                   }
2408 2554
                 })
2409 2555
               }
@@ -2566,6 +2712,7 @@
2566 2712
 
2567 2713
       },
2568 2714
       removeTab(targetName) {
2715
+        console.log("处方了免费打打啊发发大发阿道夫")
2569 2716
         if (this.curPrescriptions.order_status == 2 || this.curPrescriptions.order_status == 5) {
2570 2717
           this.$message.error('该处方已经结算或者记账,无法删除')
2571 2718
           return
@@ -2598,7 +2745,7 @@
2598 2745
             }
2599 2746
             this.editableTabsValue = activeName
2600 2747
             this.prescriptions = tabs.filter(tab => tab.name !== targetName)
2601
-
2748
+           
2602 2749
             for (let i = 0; i < this.prescriptions.length; i++) {
2603 2750
               if (activeName == this.prescriptions[i].name) {
2604 2751
                 this.curPrescriptions = this.prescriptions[i]
@@ -2610,19 +2757,23 @@
2610 2757
                 }
2611 2758
               }
2612 2759
             }
2760
+            console.log("oo233232233232323",this.prescriptions)
2613 2761
             if (this.prescriptions.length == 0) {
2614 2762
               this.curPrescriptions = []
2615 2763
               this.curStatus = 0
2616 2764
             }
2765
+            this.$parent.getInitDataOne(this.prescriptions)
2617 2766
           } else {
2618 2767
             let params = {
2619 2768
               'id': id
2620 2769
             }
2621 2770
             delHisPrescription(params).then(response => {
2622 2771
               if (response.data.state == 1) {
2623
-                this.$message.success('删除成功')
2772
+                this.$message.success('删除成功!')
2624 2773
                 let tabs = this.prescriptions
2625 2774
                 let activeName = this.editableTabsValue
2775
+                console.log("targetName",targetName)
2776
+                console.log("activeName",activeName)
2626 2777
                 if (activeName === targetName) {
2627 2778
                   tabs.forEach((tab, index) => {
2628 2779
                     if (tab.name === targetName) {
@@ -2636,7 +2787,7 @@
2636 2787
                 }
2637 2788
                 this.editableTabsValue = activeName
2638 2789
                 this.prescriptions = tabs.filter(tab => tab.name !== targetName)
2639
-
2790
+               
2640 2791
                 for (let i = 0; i < this.prescriptions.length; i++) {
2641 2792
                   if (activeName == this.prescriptions[i].name) {
2642 2793
                     this.curPrescriptions = this.prescriptions[i]
@@ -2648,12 +2799,17 @@
2648 2799
                     }
2649 2800
                   }
2650 2801
                 }
2802
+              
2651 2803
                 if (this.prescriptions.length == 0) {
2652 2804
                   this.curPrescriptions = []
2653 2805
                   this.curStatus = 0
2654 2806
                 }
2807
+                
2808
+                this.$parent.getInitData()
2809
+                this.$parent.getInitDataOne(this.prescriptions)
2810
+                console.log("删除后的数据是",this.prescriptions)
2655 2811
               } else {
2656
-                this.$message.success(response.data.msg)
2812
+                this.$message.error(response.data.msg)
2657 2813
               }
2658 2814
             })
2659 2815
           }
@@ -2739,37 +2895,50 @@
2739 2895
         this.$refs.additionalCharges.show()
2740 2896
       },
2741 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 2943
         this.curDrugs = selection
2775 2944
       },
@@ -2844,8 +3013,7 @@
2844 3013
 
2845 3014
           return
2846 3015
         }
2847
-        console.log('this.teamList', this.teamList)
2848
-        console.log('this.curPrescriptions.project', this.curPrescriptions.project)
3016
+
2849 3017
         for (let i = 0; i < this.teamList.length; i++) {
2850 3018
           for (let a = 0; a < this.curPrescriptions.project.length; a++) {
2851 3019
             if (this.teamList[i].id == this.curPrescriptions.project[a].project_id && this.teamList[i].type == this.curPrescriptions.project[a].type) {
@@ -2888,9 +3056,7 @@
2888 3056
             var temp2 = this.deepClone(this.teamList)
2889 3057
 
2890 3058
             var temp3 = this.deepClone(templateDrugs)
2891
-            console.log('hhhhhhhhhhhhhh', temp)
2892
-            console.log('hhhh23', temp2)
2893
-            console.log('hhhh23', temp3)
3059
+           
2894 3060
             if (temp3.length > 0) {
2895 3061
               for (let b = 0; b < temp3.length; b++) {
2896 3062
                 let obj = {
@@ -2950,7 +3116,7 @@
2950 3116
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
2951 3117
                   obj.prescribing_number = 1
2952 3118
                 }
2953
-                console.log('obj', obj)
3119
+               
2954 3120
                 this.prescriptions[i].advices.push(obj)
2955 3121
               }
2956 3122
               this.curStatus = 1
@@ -3021,8 +3187,42 @@
3021 3187
       },
3022 3188
       selectChange(selection, row) {
3023 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 3226
             if (row.type == 3) {
3027 3227
               if (selection) {
3028 3228
                 selection.forEach(row => {
@@ -3035,26 +3235,8 @@
3035 3235
               }
3036 3236
               this.$message.error(row.project_name + '库存不足')
3037 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 3241
         this.teamList.push(row)
3060 3242
       },
@@ -3222,7 +3404,7 @@
3222 3404
 
3223 3405
                   teamList.push(obj)
3224 3406
                 } else if (project[i].type == 3 && project[i].status == 1) {
3225
-                  if (project[i].good_info.total <= 0) {
3407
+                  if (project[i].good_info.sum_count <= 0) {
3226 3408
                     num++
3227 3409
                     this.$refs.tabProjectTeam.toggleRowSelection(row)
3228 3410
                     this.$message.error(project[i].good_info.good_name + '库存不足')

+ 7 - 5
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue View File

@@ -232,6 +232,7 @@
232 232
         }
233 233
       }
234 234
     },
235
+
235 236
     data() {
236 237
       return {
237 238
         advices: [],
@@ -348,6 +349,7 @@
348 349
                   temp2.splice(index, 1)
349 350
                   this.prescription.advices = temp2
350 351
                   this.$message.success(response.data.data.msg)
352
+                  this.$emit("getSunziValue",temp2)
351 353
                 }
352 354
               })
353 355
 
@@ -452,11 +454,11 @@
452 454
         }
453 455
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
454 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 458
             this.$message.error(scope.row.drug_name + '库存不足')
457 459
           }
458 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 462
             this.$message.error(scope.row.drug_name + '库存不足')
461 463
           }
462 464
           // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
@@ -483,7 +485,7 @@
483 485
         //   scope.row.prescribing_number = 1
484 486
         // }
485 487
         if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
486
-          scope.row.retail_price = scope.row.drug.min_price
488
+             scope.row.retail_price = scope.row.drug.min_price
487 489
           // if (scope.row.prescribing_number > scope.row.drug.total) {
488 490
           //   this.$message.error(scope.row.drug_name + '库存不足')
489 491
           // }
@@ -546,11 +548,11 @@
546 548
 
547 549
 
548 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 552
             this.$message.error(scope.row.drug_name + '库存不足')
551 553
           }
552 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 556
             this.$message.error(scope.row.drug_name + '库存不足')
555 557
           }
556 558
         }

+ 23 - 15
src/xt_pages/outpatientDoctorStation/doctorDesk.vue View File

@@ -155,6 +155,7 @@
155 155
                            :month_prescriptions="month_prescriptions"
156 156
                            :org_id="org_id"
157 157
                            ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
158
+                           v-on:getSunziValue = "getSunziValue"
158 159
                            :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)" @editKeepLoad="editKeepLoad"
159 160
                            v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
160 161
 
@@ -425,7 +426,12 @@ export default {
425 426
       org_id: 0
426 427
     }
427 428
   },
429
+
428 430
   methods: {
431
+    getSunziValue(val){
432
+    //  this.drugs=[]
433
+     this.getInitData()
434
+    },
429 435
     editKeepLoad(data) {
430 436
       this.saveLoading = data
431 437
     },
@@ -1222,25 +1228,24 @@ export default {
1222 1228
           return false
1223 1229
         } else {
1224 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",drugs)
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 1243
           this.drugs = drugs
1239
-          console.log('五一劳动节2332323322332', this.drugs)
1244
+        
1240 1245
 
1241 1246
           this.allDrugs = response.data.data.drugs
1242 1247
           this.advices_template = response.data.data.advices_template
1243
-
1248
+         
1244 1249
           this.department = response.data.data.department
1245 1250
           this.sick = response.data.data.sick
1246 1251
           this.diagnoses = response.data.data.diagnose
@@ -4591,7 +4596,7 @@ export default {
4591 4596
       this.$refs.prescriptions.open_three()
4592 4597
     },
4593 4598
     open(index) {
4594
-
4599
+    
4595 4600
       this.index = index
4596 4601
       if (index == 1) {
4597 4602
         this.$refs.prescriptions.open(1, this.saveLoading)
@@ -4951,6 +4956,9 @@ export default {
4951 4956
         }
4952 4957
       })
4953 4958
 
4959
+    },
4960
+    getInitDataOne(val){
4961
+      this.prescriptions = val
4954 4962
     }
4955 4963
   },
4956 4964
   created() {

+ 39 - 1
src/xt_pages/stock/cancelStockOrder.vue View File

@@ -83,6 +83,17 @@
83 83
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
84 84
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
85 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 97
       </div>
87 98
 
88 99
       <el-row :gutter="12" style="margin-top: 10px">
@@ -126,6 +137,13 @@
126 137
             </template>
127 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 147
           <el-table-column label="操作" align="center">
130 148
             <template slot-scope="scope">
131 149
               <el-tooltip
@@ -345,6 +363,12 @@ export default {
345 363
       exportList:[],
346 364
       houseList:[],
347 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 374
   methods: {
@@ -357,6 +381,7 @@ export default {
357 381
         type: this.type,
358 382
         keywords: this.searchKey,
359 383
         storehouse_id:this.storehouse_id,
384
+        check_type:this.check_type,
360 385
       };
361 386
       this.cancelStockDate = [];
362 387
       getCancelStockList(Params).then(response => {
@@ -386,6 +411,7 @@ export default {
386 411
         end_time: this.end_time,
387 412
         type: this.type,
388 413
         storehouse_id:this.storehouse_id,
414
+        check_type:this.check_type,
389 415
       };
390 416
       this.cancelStockDate = [];
391 417
       getCancelStockList(Params).then(response => {
@@ -508,9 +534,13 @@ export default {
508 534
     },
509 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 539
     handleDelete: function(index, row) {
540
+      if(row.is_check == 1){
541
+        this.$message.error("已审核的单据不能删除!")
542
+        return false
543
+      }
514 544
       const ids = [];
515 545
       ids.push(row.id);
516 546
       const idStr = ids.join(",");
@@ -566,12 +596,17 @@ export default {
566 596
       this.getCancelExportList()
567 597
     },
568 598
     batchDelete() {
599
+     
569 600
       if (this.selectedTableData.length <= 0) {
570 601
         this.$message.error("请选择要删除的记录");
571 602
         return;
572 603
       }
573 604
       const ids = [];
574 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 610
         ids.push(this.selectedTableData[i].id);
576 611
       }
577 612
       const idStr = ids.join(",");
@@ -699,6 +734,9 @@ export default {
699 734
     },
700 735
     changeStoreHouse(){
701 736
       this.GetCancelStock()
737
+    },
738
+    changeCheckType(){
739
+     this.GetCancelStock()
702 740
     }
703 741
   }
704 742
 };

+ 113 - 37
src/xt_pages/stock/cancelStockOrderAdd.vue View File

@@ -19,7 +19,15 @@
19 19
           type="primary"
20 20
           @click="submit()"
21 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 32
       </div>
25 33
     </div>
@@ -154,12 +162,13 @@
154 162
           </el-table-column>
155 163
           <el-table-column width="200" align="center">
156 164
             <template slot="header" slot-scope="scope">
157
-              <span>批次<span style="color: red"></span></span>
165
+              <span>批次<span style="color: red">*</span></span>
158 166
             </template>
159 167
             <template slot-scope="scope">
160 168
               <el-form-item
161
-                :prop="'recordData.' + scope.$index + '.return_count'"
169
+                :prop="'recordData.' + scope.$index + '.number'"
162 170
                 style="padding-top: 17px"
171
+                :rules="tableRules.number"
163 172
               >
164 173
                <el-select v-model="scope.row.number" filterable placeholder="请选择">
165 174
                   <el-option
@@ -292,7 +301,7 @@
292 301
 
293 302
 <script>
294 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 305
 import BreadCrumb from "../components/bread-crumb";
297 306
 import StockInDialog from './Dialog/stockInDialog'
298 307
 
@@ -322,12 +331,15 @@ export default {
322 331
       },
323 332
       tableRules: {
324 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 344
       ruleForm: {
333 345
         manufacturer: [
@@ -358,6 +370,8 @@ export default {
358 370
       manufacturerList:[],
359 371
       list:[],
360 372
       storehouse_id:"",
373
+      cancel_stock_id:0,
374
+      showCheck:false,
361 375
     };
362 376
   },
363 377
   methods: {
@@ -453,6 +467,7 @@ export default {
453 467
       tempObj["total"] = ""
454 468
       tempObj["warehouse_info_id"] =  0
455 469
       tempObj["xt_warehouse_info"] = []
470
+      tempObj["id"] = 0
456 471
       this.recordInfo.recordData.push(tempObj);
457 472
     },
458 473
     handleDelete: function(index, row) {
@@ -461,6 +476,27 @@ export default {
461 476
         return;
462 477
       } else {
463 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 502
     calculate: function(val) {
@@ -571,6 +607,7 @@ export default {
571 607
                   this.recordInfo.recordData[i].number = this.recordInfo.recordData[i].xt_warehouse_info[j].number
572 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 613
           const loading = this.$loading({
@@ -582,7 +619,6 @@ export default {
582 619
           const params = {
583 620
             cancelStock: this.recordInfo.recordData
584 621
           };
585
-         
586 622
           postCancelStock(
587 623
             params,
588 624
             this.return_time,
@@ -590,40 +626,41 @@ export default {
590 626
             this.form.dealer,
591 627
             this.type,
592 628
             this.storehouse_id,
629
+            this.cancel_stock_id
593 630
           ).then(response => {
594 631
             if (response.data.state == 0) {
595 632
               this.$message.error(response.data.msg);
596 633
               loading.close()
597 634
               return false;
598 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 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 664
              loading.close()      
628 665
             }
629 666
           });
@@ -678,9 +715,10 @@ export default {
678 715
       this.currentIndex = val
679 716
     },
680 717
     handleSelect(val){
681
-     
718
+      console.log("val23233232",val)
682 719
       for(let i=0;i<this.recordInfo.recordData.length;i++){
683 720
         if(this.currentIndex == i){
721
+          this.recordInfo.recordData[i].register_account = val.number
684 722
           this.recordInfo.recordData[i].good_name = val.good_name
685 723
           this.recordInfo.recordData[i].good_type_id = val.good_type_id
686 724
           this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
@@ -718,6 +756,43 @@ export default {
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 797
   created() {
723 798
     var nowDate = new Date();
@@ -744,6 +819,7 @@ export default {
744 819
     tempObj["total"] = ""
745 820
     tempObj["warehouse_info_id"] = 0
746 821
     tempObj["xt_warehouse_info"] = []
822
+    tempObj["id"] = 0
747 823
     this.recordInfo.recordData.push(tempObj);
748 824
     this.GetConfigInfo();
749 825
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 106 - 33
src/xt_pages/stock/cancelStockOrderEdit.vue View File

@@ -4,8 +4,10 @@
4 4
       <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5 5
       <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6 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 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 11
       </div>
10 12
     </div>
11 13
     <div class="app-container">
@@ -29,7 +31,7 @@
29 31
         <label class="title"><span class="name">退库时间</span> : </label>
30 32
         <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
31 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 35
       </div>
34 36
 
35 37
      
@@ -52,6 +54,7 @@
52 54
                     @select="handleSelect"
53 55
                     @input="changeGoodName(scope.$index)"
54 56
                     style="width:160px;"
57
+                    :disabled="disabled"
55 58
                   >
56 59
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
57 60
                   <template slot-scope="{ item }">
@@ -70,7 +73,7 @@
70 73
             <template slot-scope="scope">
71 74
 
72 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 77
               </el-form-item>
75 78
 
76 79
             </template>
@@ -84,7 +87,7 @@
84 87
             <template slot-scope="scope">
85 88
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
86 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 91
               </el-form-item>
89 92
             </template>
90 93
           </el-table-column>
@@ -102,6 +105,7 @@
102 105
                   placeholder="请输入单价"
103 106
                   type="number"
104 107
                   v-model="scope.row.price"
108
+                  :disabled="disabled"
105 109
                 ></el-input>      
106 110
               </el-form-item>
107 111
               <!-- {{scope.row.packing_unit}} -->
@@ -114,14 +118,15 @@
114 118
           </el-table-column>
115 119
           <el-table-column width="200" align="center">
116 120
             <template slot="header" slot-scope="scope">
117
-              <span>批次<span style="color: red"></span></span>
121
+              <span>批次<span style="color: red">*</span></span>
118 122
             </template>
119 123
             <template slot-scope="scope">
120 124
               <el-form-item
121
-                :prop="'recordData.' + scope.$index + '.return_count'"
125
+                :prop="'recordData.' + scope.$index + '.number'"
122 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 130
                   <el-option
126 131
                     v-for="(item,index) in scope.row.xt_warehouse_info"
127 132
                     :key="index"
@@ -141,13 +146,13 @@
141 146
                 :prop="'recordData.' + scope.$index + '.return_count'"
142 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 150
               </el-form-item>
146 151
             </template>
147 152
           </el-table-column>
148 153
            <el-table-column label="生产厂家" width="160" align="center">
149 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 156
                 <el-option
152 157
                   v-for="(option, index) in manufacturerList"
153 158
                   :key="index"
@@ -162,6 +167,7 @@
162 167
           <el-table-column label="生产日期" width="180" align="center">
163 168
             <template slot-scope="scope">
164 169
               <el-date-picker
170
+               :disabled="disabled"
165 171
                 prefix-icon="el-icon-date"
166 172
                 style="width: 145px"
167 173
                 v-model="scope.row.product_date"
@@ -175,6 +181,7 @@
175 181
           <el-table-column label="有效日期" width="180" align="center">
176 182
             <template slot-scope="scope">
177 183
               <el-date-picker
184
+               :disabled="disabled"
178 185
                 prefix-icon="el-icon-date"
179 186
                 style="width: 145px"
180 187
                 v-model="scope.row.expiry_date"
@@ -188,7 +195,7 @@
188 195
 
189 196
         <el-table-column label="经销商" width="160" align="center">
190 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 199
                 <el-option
193 200
                   v-for="(option, index) in dealerList"
194 201
                   :key="index"
@@ -208,7 +215,7 @@
208 215
                 :rules="tableRules.return_count"
209 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 219
               </el-form-item>
213 220
             </template>
214 221
           </el-table-column>
@@ -249,7 +256,7 @@
249 256
 <script>
250 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 260
   import BreadCrumb from '../components/bread-crumb'
254 261
   import StockInDialog from './Dialog/stockInDialog'
255 262
 
@@ -285,11 +292,14 @@
285 292
         },
286 293
         tableRules: {
287 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 305
         ruleForm: {
@@ -327,6 +337,8 @@
327 337
         numberShow:true,
328 338
         storehouse_id:"",
329 339
         list:[],
340
+        is_check:0,
341
+        disabled:false,
330 342
       }
331 343
     },
332 344
     methods: {
@@ -400,7 +412,12 @@
400 412
           }
401 413
         }
402 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 421
         const tempObj = {}
405 422
         tempObj['id'] = 0
406 423
         tempObj['good_type_id'] = 0
@@ -415,14 +432,19 @@
415 432
         tempObj["warehouse_info_id"] = 0
416 433
         tempObj["xt_warehouse_info"] = []
417 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 441
         if (row.id == 0) {
420 442
           this.recordInfo.recordData.splice(index, 1)
421 443
         } else {
422 444
           const params = {
423 445
             id: row.id
424 446
           }
425
-          this.$confirm('确认删除该退库商品信息记录?', '删除退库商品信息记录', {
447
+          this.$confirm('确认删除该退库商品记录?', '删除退库商品记录', {
426 448
             confirmButtonText: '确定',
427 449
             cancelButtonText: '取消',
428 450
             type: 'warning'
@@ -549,9 +571,8 @@
549 571
             const params = {
550 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 576
               if (response.data.state == 0) {
556 577
                 this.$message.error(response.data.msg)
557 578
                 loading.close()
@@ -572,14 +593,13 @@
572 593
                   this.$message.error("该批次退库数量大于入库数量")
573 594
                 }
574 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 604
                 loading.close()       
585 605
               }
@@ -598,7 +618,7 @@
598 618
             this.$message.error(response.data.msg)
599 619
             return false
600 620
           } else {
601
-            console.log("猎豹323c",response.data.data.list)
621
+           
602 622
             for (let i = 0; i < response.data.data.list.length; i++) {
603 623
               response.data.data.list[i].good_name = response.data.data.list[i].GoodInfo.good_name
604 624
               response.data.data.list[i].name = response.data.data.list[i].GoodInfo.specification_name + "/" + response.data.data.list[i].GoodInfo.packing_unit
@@ -629,7 +649,7 @@
629 649
           this.manufacturerList = response.data.data.manufacturerList
630 650
           this.dealerList = []
631 651
           this.dealerList = response.data.data.dealerList
632
-          console.log("供应商2332322332232323232323",this.dealerList)
652
+         
633 653
 
634 654
         })
635 655
       },changeManufacturer(val) {
@@ -682,6 +702,7 @@
682 702
         //获取当前耗材的批号
683 703
          for(let i=0;i<this.recordInfo.recordData.length;i++){
684 704
            if(this.currentIndex == i){
705
+              this.recordInfo.recordData[i].register_account = val.number
685 706
               this.recordInfo.recordData[i].good_type_id = val.id
686 707
               this.recordInfo.recordData[i].good_name = val.good_name
687 708
               this.recordInfo.recordData[i].good_type_id = val.good_type_id
@@ -715,7 +736,7 @@
715 736
       getStockBatchNumber(params).then(response=>{
716 737
         if(response.data.state == 1){
717 738
           var list = response.data.data.list
718
-          console.log("list2243444",list)
739
+         
719 740
           this.numberList = list
720 741
         }
721 742
       })
@@ -726,12 +747,64 @@
726 747
       }
727 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 796
     created() {
731 797
       this.GetConfigInfo()
732 798
       this.propForm.goodUnit = this.$store.getters.good_unit
733 799
       const order_id = this.$route.query.id
734 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
   }

+ 21 - 0
src/xt_pages/stock/detail/print.vue View File

@@ -445,6 +445,27 @@
445 445
     //       }
446 446
     //   })
447 447
     // },
448
+    getWarehouseOut(good_id){
449
+      var total = 0
450
+      for(let i=0;i<this.wareOutList.length;i++){
451
+         if(this.wareOutList[i].good_id == good_id){
452
+            total += this.wareOutList[i].count
453
+         }
454
+      }
455
+      return total
456
+    },
457
+    
458
+     getPrintStockGood(){
459
+
460
+      getPrintStockGood(this.queryParams).then(response=>{
461
+          if(response.data.state == 1){
462
+            var list =  response.data.data.list
463
+            console.log("list23323232323232",list)
464
+            this.wareOutList = list
465
+
466
+          }
467
+      })
468
+    },
448 469
     getWarehouseOut(good_id){
449 470
       var total = 0
450 471
       for(let i=0;i<this.wareOutList.length;i++){

+ 37 - 1
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue View File

@@ -93,6 +93,16 @@
93 93
         <el-button size="small" type="primary" @click="toExport"
94 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 106
       </div>
97 107
 
98 108
       <el-table
@@ -135,6 +145,13 @@
135 145
           </template>
136 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 155
         <el-table-column label="操作" align="center">
139 156
           <template slot-scope="scope">
140 157
             <el-tooltip
@@ -366,6 +383,12 @@ export default {
366 383
       exportList: [],
367 384
       houseList: [],
368 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 394
   methods: {
@@ -378,6 +401,7 @@ export default {
378 401
         type: this.type,
379 402
         keywords: this.searchKey,
380 403
         storehouse_id: this.storehouse_id,
404
+        check_type:this.check_type,
381 405
       };
382 406
       this.cancelStockDate = [];
383 407
       getDrugCancelStockList(Params).then((response) => {
@@ -406,6 +430,7 @@ export default {
406 430
         end_time: this.end_time,
407 431
         type: this.type,
408 432
         storehouse_id: this.storehouse_id,
433
+        check_type:this.check_type,
409 434
       };
410 435
       this.cancelStockDate = [];
411 436
       getDrugCancelStockList(Params).then((response) => {
@@ -526,10 +551,14 @@ export default {
526 551
     },
527 552
     handleEdit: function (index, row) {
528 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 557
     handleDelete: function (index, row) {
558
+      if(row.is_check == 1){
559
+        this.$message.error("已审核的单据不能删除!")
560
+        return false
561
+      }
533 562
       const ids = [];
534 563
       ids.push(row.id);
535 564
       const idStr = ids.join(",");
@@ -590,6 +619,10 @@ export default {
590 619
       }
591 620
       const ids = [];
592 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 626
         ids.push(this.selectedTableData[i].id);
594 627
       }
595 628
       const idStr = ids.join(",");
@@ -775,6 +808,9 @@ export default {
775 808
     changeStoreHouse() {
776 809
       this.GetCancelStock();
777 810
     },
811
+    changeCheckType(){
812
+      this.GetCancelStock();
813
+    }
778 814
   },
779 815
 };
780 816
 </script>

+ 128 - 16
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue View File

@@ -21,6 +21,14 @@
21 21
           class="filter-item"
22 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 32
       </div>
25 33
     </div>
26 34
 
@@ -173,12 +181,13 @@
173 181
 
174 182
           <el-table-column width="200" align="center">
175 183
             <template slot="header" slot-scope="scope">
176
-              <span>批次<span style="color: red"></span></span>
184
+              <span>批次<span style="color: red">*</span></span>
177 185
             </template>
178 186
             <template slot-scope="scope">
179 187
               <el-form-item
180
-                :prop="'recordData.' + scope.$index + '.return_count'"
188
+                :prop="'recordData.' + scope.$index + '.batch_number'"
181 189
                 style="padding-top: 17px"
190
+                :rules="tableRules.batch_number"
182 191
               >
183 192
                <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
184 193
                   <el-option
@@ -312,7 +321,7 @@
312 321
 
313 322
 <script>
314 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 325
 import BreadCrumb from "../../components/bread-crumb";
317 326
 import DrugsStockDialog from './drugsStockDialog/index'
318 327
 import {postSearchDrugList } from "@/api/data"
@@ -344,7 +353,14 @@ export default {
344 353
       tableRules: {
345 354
         return_count: [
346 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 365
       ruleForm: {
350 366
         manufacturer: [
@@ -376,6 +392,8 @@ export default {
376 392
       unitList:[],
377 393
       list:[],
378 394
       storehouse_id:"",
395
+      showCheck:false,
396
+      cancelstock_id:0,
379 397
     };
380 398
   },
381 399
   methods: {
@@ -481,11 +499,33 @@ export default {
481 499
       this.recordInfo.recordData.push(tempObj);
482 500
     },
483 501
     handleDelete: function(index, row) {
502
+      console.log("index23322332232我的",index)
484 503
       if (this.recordInfo.recordData.length <= 1) {
485 504
         this.$message.error("只有一条记录的时候无法删除");
486 505
         return;
487 506
       } else {
488 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 531
     calculate: function(val) {
@@ -589,11 +629,12 @@ export default {
589 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 634
           const params = {
594 635
             cancelStock: this.recordInfo.recordData
595 636
           };
596
-         console.log("params2222",params,this.return_time)
637
+          console.log("param232222我的",params)
597 638
           
598 639
           postDrugCancelStock(
599 640
             params,
@@ -602,25 +643,50 @@ export default {
602 643
             this.form.dealer,
603 644
             this.type,
604 645
             this.storehouse_id,
646
+            this.cancelstock_id,
605 647
           ).then(response => {
606 648
             if (response.data.state == 0) {
607 649
               this.$message.error(response.data.msg);
608 650
               return false;
609 651
             } else {
610 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 692
         } else {
@@ -678,7 +744,7 @@ export default {
678 744
         this.currentIndex = val
679 745
       },
680 746
       handleSelect(val){
681
-        console.log("val345555555555555555555",val)
747
+         console.log("val32323322323",val)
682 748
          var arr = []
683 749
          for(let i=0;i<this.recordInfo.recordData.length;i++){
684 750
             arr.push(this.recordInfo.recordData[i].drug_id)
@@ -691,6 +757,8 @@ export default {
691 757
         //  this.getDrugBatchNumber(val.id)
692 758
          for(let i=0;i<this.recordInfo.recordData.length;i++){
693 759
            if(i == this.currentIndex){
760
+             this.recordInfo.recordData[i].id = 0
761
+             this.recordInfo.recordData[i].register_account = val.number
694 762
              this.recordInfo.recordData[i].drug_id  = val.id
695 763
              this.recordInfo.recordData[i].drug_name = val.drug_name
696 764
              this.recordInfo.recordData[i].drug_type = val.drug_type
@@ -730,6 +798,49 @@ export default {
730 798
       getDataConfig(module, filed_name){
731 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 845
   created() {
735 846
     var nowDate = new Date();
@@ -744,6 +855,7 @@ export default {
744 855
       (nowDay < 10 ? "0" + nowDay : nowDay);
745 856
 
746 857
     const tempObj = {};
858
+    tempObj["id"] = 0;
747 859
     tempObj["drug_id"] = 0;
748 860
     tempObj["return_count"] = "";
749 861
     tempObj["price"] = "";

+ 115 - 26
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue View File

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

+ 50 - 1
src/xt_pages/stock/drugs/drugStockInOrder.vue View File

@@ -112,6 +112,26 @@
112 112
         <el-button size="small" type="primary" @click="toExport()"
113 113
           >导出</el-button
114 114
         >
115
+        <div>
116
+          <span>&nbsp;&nbsp;</span>
117
+          <label class="title"><span class="name">审核状态</span> :</label>
118
+          <el-select
119
+            size="small"
120
+            v-model="check_type"
121
+            filterable
122
+            placeholder="请选择仓库"
123
+            style="width: 200px"
124
+            @change="changeCheckType"
125
+          >
126
+            <el-option
127
+              v-for="(option, index) in checkList"
128
+              :key="index"
129
+              :label="option.name"
130
+              :value="option.id"
131
+            >
132
+            </el-option>
133
+          </el-select>
134
+        </div>
115 135
       </div>
116 136
 
117 137
       <el-table
@@ -164,6 +184,13 @@
164 184
           </template>
165 185
         </el-table-column>
166 186
 
187
+        <el-table-column label="审核状态" align="center">
188
+          <template slot-scope="scope">
189
+            <span v-if="scope.row.is_check == 1">已审核</span>
190
+            <span v-if="scope.row.is_check == 2">未审核</span>
191
+          </template>
192
+        </el-table-column>
193
+
167 194
         <el-table-column label="操作" align="center" width="240">
168 195
           <template slot-scope="scope">
169 196
             <el-tooltip
@@ -498,6 +525,12 @@ export default {
498 525
       exportList: [],
499 526
       houseList: [],
500 527
       storehouse_id: 0,
528
+      check_type: 0,
529
+      checkList: [
530
+        { id: 0, name: "全部" },
531
+        { id: 1, name: "已审核" },
532
+        { id: 2, name: "未审核" },
533
+      ],
501 534
     };
502 535
   },
503 536
 
@@ -534,6 +567,7 @@ export default {
534 567
         type: this.type,
535 568
         keywords: this.searchKey,
536 569
         storehouse_id: this.storehouse_id,
570
+        check_type: this.check_type,
537 571
       };
538 572
       this.Warehouse.warehouseDate = [];
539 573
       getDrugWarehouseList(Params).then((response) => {
@@ -559,6 +593,7 @@ export default {
559 593
         type: this.type,
560 594
         keywords: this.searchKey,
561 595
         storehouse_id: this.storehouse_id,
596
+        check_type: this.check_type,
562 597
       };
563 598
       this.Warehouse.warehouseDate = [];
564 599
       getDrugWarehouseList(Params).then((response) => {
@@ -720,6 +755,7 @@ export default {
720 755
           type: this.type,
721 756
           supply_warehouse_id: row.supply_warehouse_id,
722 757
           is_sys: row.is_sys,
758
+          is_check: row.is_check,
723 759
         },
724 760
       });
725 761
     },
@@ -759,6 +795,10 @@ export default {
759 795
         this.$message.error("自动入库数据不能删除!");
760 796
         return false;
761 797
       }
798
+      if (row.is_check == 1) {
799
+        this.$message.error("已审核的单据不能删除");
800
+        return false;
801
+      }
762 802
       const ids = [];
763 803
       ids.push(row.id);
764 804
       const idStr = ids.join(",");
@@ -820,12 +860,18 @@ export default {
820 860
       const ids = [];
821 861
       const idOne = [];
822 862
       for (let i = 0; i < this.selectedTableData.length; i++) {
863
+        if (this.selectedTableData[i].is_check == 1) {
864
+          this.$message.error("已审核单据不能删除!");
865
+          return false;
866
+        }
823 867
         if (this.selectedTableData[i].is_sys == 13) {
824 868
           this.$message.error("调拨入库数据不能删除!");
825 869
           return false;
826 870
         }
827 871
         ids.push(this.selectedTableData[i].id);
828
-        idOne.push(this.selectedTableData[i].supply_warehouse_id);
872
+        if (this.selectedTableData[i].supply_warehouse_id > 0) {
873
+          idOne.push(this.selectedTableData[i].supply_warehouse_id);
874
+        }
829 875
       }
830 876
 
831 877
       for (let i = 0; i < idOne.length; i++) {
@@ -1055,6 +1101,9 @@ export default {
1055 1101
     changeStoreHouse() {
1056 1102
       this.GetWarehouse();
1057 1103
     },
1104
+    changeCheckType() {
1105
+      this.GetWarehouse();
1106
+    },
1058 1107
   },
1059 1108
 };
1060 1109
 </script>

+ 123 - 9
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue View File

@@ -15,6 +15,22 @@
15 15
           class="filter-item"
16 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 34
       </div>
19 35
     </div>
20 36
     <div class="app-container" v-loading="loading">
@@ -395,6 +411,8 @@ import {
395 411
   GetAllConfig,
396 412
   GetAllDrugInfoByID,
397 413
   postDrugWarehouse,
414
+  toCheckWarehousingInfo,
415
+  toReturnCheckWarehousing
398 416
 } from "@/api/drug/drug_stock";
399 417
 import BreadCrumb from "../../components/bread-crumb";
400 418
 import DrugsStockDialog from "./drugsStockDialog/index";
@@ -437,7 +455,7 @@ export default {
437 455
       tableRules: {
438 456
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
439 457
         warehousing_count: [
440
-          { required: true, message: "数量不能为空", trigge: "blur" },
458
+          { required: true, message: "数量不能为空", trigger: "blur" },
441 459
         ],
442 460
 
443 461
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
@@ -516,6 +534,9 @@ export default {
516 534
       loading: false,
517 535
       list: [],
518 536
       storehouse_id: "",
537
+      warehousing_id:0,
538
+      showCheck:false,
539
+      showReturnCheck:false,
519 540
     };
520 541
   },
521 542
   methods: {
@@ -620,8 +641,7 @@ export default {
620 641
           this.form.manufacturer = 0;
621 642
           this.form.dealer = 0;
622 643
           this.list = response.data.data.list;
623
-          this.storehouse_id =
624
-            response.data.data.configlist.drug_storehouse_info;
644
+          this.storehouse_id =response.data.data.configlist.drug_storehouse_info;
625 645
         }
626 646
         loading.close();
627 647
       });
@@ -662,6 +682,7 @@ export default {
662 682
     },
663 683
     handleEdit: function (index, row) {
664 684
       const tempObj = {};
685
+      tempObj["id"] = 0;
665 686
       tempObj["drug_name"] = "";
666 687
       tempObj["drug_id"] = 0;
667 688
       tempObj["number"] = "";
@@ -707,6 +728,16 @@ export default {
707 728
         return "";
708 729
       }
709 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
+     },
710 741
     showDialog(index, row) {
711 742
       const loading = this.$loading({
712 743
         lock: true,
@@ -801,6 +832,7 @@ export default {
801 832
             this.$message.success("请添加入库商品");
802 833
             return;
803 834
           }
835
+
804 836
           for (let i = 0; i < this.recordInfo.recordData.length; i++) {
805 837
             if (this.recordInfo.recordData[i].dealer == "") {
806 838
               this.recordInfo.recordData[i].dealer = 0;
@@ -841,7 +873,8 @@ export default {
841 873
             this.form.manufacturer,
842 874
             this.form.dealer,
843 875
             this.type,
844
-            this.storehouse_id
876
+            this.storehouse_id,
877
+            this.warehousing_id,
845 878
           ).then((response) => {
846 879
             if (response.data.state == 0) {
847 880
               this.loading = false;
@@ -849,9 +882,43 @@ export default {
849 882
               return false;
850 883
             } else {
851 884
               this.loading = false;
852
-              this.$message.success("入库成功");
885
+              this.$message.success("保存成功");
853 886
               this.listLoading = false;
854
-              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);
855 922
             }
856 923
           });
857 924
         } else {
@@ -972,12 +1039,59 @@ export default {
972 1039
         }
973 1040
       }
974 1041
     },
1042
+    toCheck(){
1043
+      const loading = this.$loading({
1044
+        lock: true,
1045
+        text: "Loading",
1046
+        spinner: "el-icon-loading",
1047
+        background: "rgba(0, 0, 0, 0.7)",
1048
+      });
1049
+       var params = {
1050
+         warehousing_id:this.warehousing_id,
1051
+       }
1052
+      toCheckWarehousingInfo(params).then(response=>{
1053
+         if(response.data.state == 1){
1054
+           var list = response.data.data.list
1055
+           this.$message.success("审核成功!")
1056
+           this.$router.back(-1);
1057
+           this.showCheck = false
1058
+           this.showReturnCheck = true
1059
+           loading.close()
1060
+         }else{
1061
+          this.$message.error("审核失败!")
1062
+          loading.close()
1063
+         }
1064
+      })
1065
+    },
1066
+    toReturnCheck(){
1067
+       const loading = this.$loading({
1068
+        lock: true,
1069
+        text: "Loading",
1070
+        spinner: "el-icon-loading",
1071
+        background: "rgba(0, 0, 0, 0.7)",
1072
+      });
1073
+        var params = {
1074
+          warehousing_id:this.warehousing_id,
1075
+        }
1076
+      toReturnCheckWarehousing(params).then(response=>{
1077
+         if(response.data.state == 1){
1078
+          var list = response.data.data.list
1079
+           this.$message.success("反审核成功!")
1080
+           this.showCheck = true
1081
+           this.showReturnCheck = false
1082
+           loading.close()
1083
+         }else{
1084
+          this.$message.error("反审核失败!")
1085
+          loading.close()
1086
+         }
1087
+      })
1088
+    },
975 1089
     changeUnit(val,index){
976 1090
     // console.log("val3232323232",val)
977 1091
     //  for(let i=0;i<this.recordInfo.recordData.length;i++){
978 1092
     //    if(i == index){
979 1093
     //      if(this.recordInfo.recordData[i].max_unit == this.recordInfo.recordData[i].count_unit){
980
-           
1094
+
981 1095
     //      }
982 1096
     //      if(this.recordInfo.recordData[i].min_unit == this.recordInfo.recordData[i].count_unit){
983 1097
 
@@ -1007,12 +1121,12 @@ export default {
1007 1121
       "-" +
1008 1122
       (nowDay < 10 ? "0" + nowDay : nowDay);
1009 1123
     const tempObj = {};
1010
-
1124
+    tempObj["id"] = 0;
1011 1125
     tempObj["drug_id"] = 0;
1012 1126
     tempObj["drug_name"] = "";
1013 1127
     tempObj["dosage"] = "";
1014 1128
     tempObj["max_unit"] = "";
1015
-    tempObj["min_unit"] = "", 
1129
+    tempObj["min_unit"] = "",
1016 1130
     tempObj["lot_number"] = "";
1017 1131
     tempObj["product_date"] = "";
1018 1132
     tempObj["expiry_date"] = "";

+ 121 - 55
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue View File

@@ -18,9 +18,26 @@
18 18
           size="small"
19 19
           type="primary"
20 20
           @click="submit()"
21
+          v-if="is_check == 2"
21 22
           class="filter-item"
22 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 41
       </div>
25 42
     </div>
26 43
 
@@ -206,6 +223,7 @@
206 223
                   placeholder="请输入拆零零售价"
207 224
                   type="number"
208 225
                   v-model="scope.row.retail_price"
226
+                  :disabled="disabled"
209 227
                 ></el-input>
210 228
                
211 229
               </el-form-item>
@@ -226,6 +244,7 @@
226 244
                     placeholder="请输入单价"
227 245
                     type="number"
228 246
                     v-model="scope.row.last_price"
247
+                    :disabled="disabled"
229 248
                   ></el-input>
230 249
                 
231 250
                 </el-form-item>
@@ -377,7 +396,9 @@ import {
377 396
   GetAllDrugInfoByID,
378 397
   getDrugWarehouseInfoList,
379 398
   DeleteDrugWarehouseInfoItem,
380
-  EditDrugWarehouse
399
+  EditDrugWarehouse,
400
+  toCheckWarehousingInfo,
401
+  toReturnCheckWarehousing
381 402
 } from "@/api/drug/drug_stock";
382 403
 import BreadCrumb from "../../components/bread-crumb";
383 404
 import DrugsStockDialog from './drugsStockDialog/index'
@@ -469,6 +490,8 @@ export default {
469 490
       disabled:false,
470 491
       storehouse_id:"",
471 492
       list:[],
493
+      is_check:0,
494
+      drug_waresing_id:0,
472 495
     };
473 496
   },
474 497
   methods: {
@@ -565,6 +588,10 @@ export default {
565 588
       return name;
566 589
     },
567 590
     handleEdit: function(index, row) {
591
+      if(parseInt(this.$route.query.is_check) == 1){
592
+        this.$message.error("已审核的单据不能新增!")
593
+        return false
594
+      }
568 595
       if(parseInt(this.$route.query.is_sys)==13){
569 596
         this.$message.error("调拨入库数据不能新增!")
570 597
         return false
@@ -580,6 +607,7 @@ export default {
580 607
       tempObj["product_date"] = "";
581 608
       tempObj["expiry_date"] = "";
582 609
       tempObj["warehousing_count"] = "";
610
+      tempObj["last_price"] = "";
583 611
       tempObj["price"] = "";
584 612
       tempObj["remark"] = "";
585 613
       tempObj["dealer"] = "";
@@ -590,6 +618,10 @@ export default {
590 618
       this.recordInfo.recordData.push(tempObj);
591 619
     },
592 620
     handleDelete: function(index, row) {
621
+      if(parseInt(this.$route.query.is_check) == 1){
622
+        this.$message.error("已审核的单据不能删除!")
623
+        return false
624
+      }
593 625
       if(parseInt(this.$route.query.is_sys)==13){
594 626
         this.$message.error("调拨入库数据不能删除!")
595 627
         return false
@@ -636,55 +668,7 @@ export default {
636 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 672
     back() {
689 673
       this.$router.go(-1);
690 674
     },
@@ -749,9 +733,38 @@ export default {
749 733
               return false;
750 734
             } else {
751 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 767
               this.listLoading = false
754
-              this.$router.back(-1);
755 768
             }
756 769
           });
757 770
         } else {
@@ -916,8 +929,60 @@ export default {
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 987
   created() {
923 988
    
@@ -925,11 +990,12 @@ export default {
925 990
     this.propForm.goodUnit = this.$store.getters.good_unit;
926 991
     const order_id = this.$route.query.id;
927 992
     this.GetOrderDetail(order_id);
993
+    this.is_check = parseInt(this.$route.query.is_check)
928 994
     this.unitList =  getDataConfig('hemodialysis','units')
929 995
     if( parseInt(this.$route.query.supply_warehouse_id)>0){
930 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 999
       this.disabled = true
934 1000
     }
935 1001
 

+ 67 - 15
src/xt_pages/stock/drugs/drugStockOutOrder.vue View File

@@ -76,6 +76,8 @@
76 76
             @change="endTimeChange"
77 77
           ></el-date-picker>
78 78
         </div>
79
+
80
+
79 81
          <!-- <div style="margin-left: 10px">
80 82
           <span>审核状态:</span>
81 83
           <el-select
@@ -110,7 +112,7 @@
110 112
           >导出</el-button
111 113
         >
112 114
 
113
-        <!-- <span>&nbsp;&nbsp;</span>
115
+        <span>&nbsp;&nbsp;</span>
114 116
         <label class="title"><span class="name">出库方式</span> :</label>
115 117
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
116 118
             <el-option
@@ -119,7 +121,18 @@
119 121
               :label="option.name"
120 122
               :value="option.id">
121 123
             </el-option>
122
-        </el-select>  -->
124
+        </el-select>
125
+
126
+      <span>&nbsp;&nbsp;</span>
127
+      <label class="title"><span class="name">审核状态</span> :</label>
128
+      <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
129
+          <el-option
130
+            v-for="(option, index) in checkList"
131
+            :key="index"
132
+            :label="option.name"
133
+            :value="option.id">
134
+          </el-option>
135
+      </el-select>
123 136
       </div>
124 137
 
125 138
       <el-table
@@ -164,7 +177,7 @@
164 177
           </template>
165 178
         </el-table-column>
166 179
 
167
-        <el-table-column min-width="35" align="center">
180
+        <el-table-column min-width="40" align="center">
168 181
           <template slot="header" slot-scope="scope">
169 182
             <span>出库方式</span>
170 183
           </template>
@@ -175,6 +188,17 @@
175 188
           </template>
176 189
         </el-table-column>
177 190
 
191
+        <el-table-column min-width="40" align="center">
192
+          <template slot="header" slot-scope="scope">
193
+            <span>审核状态</span>
194
+          </template>
195
+          <template slot-scope="scope">
196
+            <span v-if="scope.row.is_check == 1">已审核</span>
197
+            <span v-if="scope.row.is_check == 2">未审核</span>
198
+
199
+          </template>
200
+        </el-table-column>
201
+
178 202
         <el-table-column label="操作" align="center" width="240">
179 203
           <template slot-scope="scope">
180 204
             <el-tooltip
@@ -606,6 +630,12 @@ export default {
606 630
         { id: 2, name: "自动出库" },
607 631
         { id: 3, name: "调拨出库" },
608 632
       ],
633
+      check_type:0,
634
+      checkList:[
635
+       {id:0,name:"全部"},
636
+       {id:1,name:"已审核"},
637
+       {id:2,name:"未审核"},
638
+      ]
609 639
     };
610 640
   },
611 641
   methods: {
@@ -643,6 +673,7 @@ export default {
643 673
         keywords: this.searchKey,
644 674
         storehouse_id: this.storehouse_id,
645 675
         way_type: this.way_type,
676
+        check_type:this.check_type,
646 677
       };
647 678
       this.warehouseOutDate = [];
648 679
       getDrugWarehouseOutList(Params).then((response) => {
@@ -654,7 +685,12 @@ export default {
654 685
           for (let i = 0; i < response.data.data.list.length; i++) {
655 686
             this.warehouseOutDate.push(response.data.data.list[i]);
656 687
           }
657
-          this.houseList = response.data.data.houseList;
688
+          var obj = { id: 0, storehouse_name: "全部" };
689
+          this.houseList = [];
690
+          this.houseList.push(obj);
691
+          for (let i = 0; i < response.data.data.houseList.length; i++) {
692
+            this.houseList.push(response.data.data.houseList[i]);
693
+          }
658 694
         }
659 695
       });
660 696
     },
@@ -671,7 +707,7 @@ export default {
671 707
       });
672 708
       }
673 709
 
674
- 
710
+
675 711
     },
676 712
     GetWarehouseOut: function () {
677 713
       const Params = {
@@ -683,6 +719,7 @@ export default {
683 719
         keywords: this.searchKey,
684 720
         storehouse_id: this.storehouse_id,
685 721
         way_type: this.way_type,
722
+        check_type:this.check_type,
686 723
       };
687 724
       this.warehouseOutDate = [];
688 725
       getDrugWarehouseOutList(Params).then((response) => {
@@ -797,7 +834,8 @@ export default {
797 834
           "&is_sys=" +
798 835
           row.is_sys +
799 836
           "&supply_cancel_out_id=" +
800
-          row.supply_cancel_out_id,
837
+          row.supply_cancel_out_id+"&is_check="+row.is_check
838
+
801 839
       });
802 840
     },
803 841
     handleSearch(val) {
@@ -816,6 +854,10 @@ export default {
816 854
         this.$message.error("采购出库数据不能删除!");
817 855
         return;
818 856
       }
857
+      if(row.is_check == 1){
858
+       this.$message.error("已审核的单据不能删除!")
859
+       return false
860
+      }
819 861
       const ids = [];
820 862
       ids.push(row.id);
821 863
       const idStr = ids.join(",");
@@ -879,6 +921,10 @@ export default {
879 921
       const ids = [];
880 922
       const idsOne = [];
881 923
       for (let i = 0; i < this.selectedTableData.length; i++) {
924
+        if(this.selectedTableData[i].is_check == 1){
925
+          this.$message.error("已审核单据不能删除!")
926
+          return false
927
+        }
882 928
         if (this.selectedTableData[i].is_sys == 1) {
883 929
           this.$message.error("自动出库数据不能删除!");
884 930
           return false;
@@ -889,7 +935,10 @@ export default {
889 935
         }
890 936
         if (this.selectedTableData[i].is_sys == 0) {
891 937
           ids.push(this.selectedTableData[i].id);
892
-          idsOne.push(this.selectedTableData[i].supply_cancel_out_id);
938
+          if(this.selectedTableData[i].supply_cancel_out_id >0){
939
+             idsOne.push(this.selectedTableData[i].supply_cancel_out_id);
940
+          }
941
+
893 942
         }
894 943
       }
895 944
       if (idsOne.length > 0) {
@@ -1113,7 +1162,7 @@ export default {
1113 1162
           this.tableShow = true;
1114 1163
           this.tableList = [];
1115 1164
           var list = response.data.data.list;
1116
-          console.log("lisrt233232323232233223", list);
1165
+          // console.log("lisrt233232323232233223", list);
1117 1166
           this.manufacturerList = response.data.data.manufacturerList;
1118 1167
           this.dealerList = response.data.data.dealerList;
1119 1168
           var drugFlowList = response.data.data.drugFlowList;
@@ -1165,7 +1214,7 @@ export default {
1165 1214
             }
1166 1215
           }
1167 1216
           this.tableList = list;
1168
-          console.log("单价23323232323232232332232323233223", this.tableList);
1217
+          // console.log("单价23323232323232232332232323233223", this.tableList);
1169 1218
         }
1170 1219
       });
1171 1220
     },
@@ -1181,7 +1230,7 @@ export default {
1181 1230
       getAutoDrugDetail(params).then((response) => {
1182 1231
         if (response.data.state == 1) {
1183 1232
           this.userList = response.data.data.list;
1184
-          console.log("自动出库数据", this.userList);
1233
+          // console.log("自动出库数据", this.userList);
1185 1234
           if (val.is_sys == 1) {
1186 1235
             this.drugDialogVisible = true;
1187 1236
           }
@@ -1333,9 +1382,9 @@ export default {
1333 1382
       return total_price;
1334 1383
     },
1335 1384
     getDrugBatchNumber(drugid, count) {
1336
-      console.log("drug_id2323", drugid);
1337
-      console.log("count", count);
1338
-      console.log("hhhhhhhhhhh", this.batchNumberList);
1385
+      // console.log("drug_id2323", drugid);
1386
+      // console.log("count", count);
1387
+      // console.log("hhhhhhhhhhh", this.batchNumberList);
1339 1388
       var arr = [];
1340 1389
       for (let i = 0; i < this.batchNumberList.length; i++) {
1341 1390
         if (
@@ -1355,7 +1404,7 @@ export default {
1355 1404
       getExportOutOrderDrugList(params).then((response) => {
1356 1405
         if (response.data.state == 1) {
1357 1406
           var list = response.data.data.list;
1358
-          console.log("list22222", list);
1407
+          // console.log("list22222", list);
1359 1408
           this.exportList = list;
1360 1409
           this.manufacturerList = response.data.data.manufacturerList;
1361 1410
           this.dealerList = response.data.data.dealerList;
@@ -1367,7 +1416,7 @@ export default {
1367 1416
         this.$message.error("请勾选出库单");
1368 1417
         return;
1369 1418
       }
1370
-      console.log("hh2323232322323", this.exportList);
1419
+      // console.log("hh2323232322323", this.exportList);
1371 1420
       for (let i = 0; i < this.exportList.length; i++) {
1372 1421
         if (this.exportList[i].dealer == 0) {
1373 1422
           this.exportList[i].dealer = "";
@@ -1500,6 +1549,9 @@ export default {
1500 1549
     changeWay() {
1501 1550
       this.GetWarehouseOut();
1502 1551
     },
1552
+    changeCheckType(){
1553
+      this.GetWarehouseOut();
1554
+    }
1503 1555
   },
1504 1556
 };
1505 1557
 </script>

+ 134 - 13
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue View File

@@ -21,6 +21,23 @@
21 21
           class="filter-item"
22 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 41
       </div>
25 42
     </div>
26 43
 
@@ -407,6 +424,8 @@ import {
407 424
   GetAllConfig,
408 425
   GetAllDrugInfoByID,
409 426
   getDrugBatchNumber,
427
+  toCheckDrugOut,
428
+  toReturnCheck
410 429
 } from "@/api/drug/drug_stock";
411 430
 
412 431
 import BreadCrumb from "../../components/bread-crumb";
@@ -480,6 +499,9 @@ export default {
480 499
       storehouse_id: "",
481 500
       list: [],
482 501
       doctorList: [],
502
+      showCheck:false,
503
+      showReturnCheck:false,
504
+      warehouse_out_id:0,
483 505
     };
484 506
   },
485 507
   methods: {
@@ -549,6 +571,7 @@ export default {
549 571
     },
550 572
     handleEdit: function (index, row) {
551 573
       const tempObj = {};
574
+      tempObj["id"] = 0;
552 575
       tempObj["drug_id"] = 0;
553 576
       tempObj["count"] = "";
554 577
       tempObj["price"] = "";
@@ -713,7 +736,8 @@ export default {
713 736
             this.form.dealer,
714 737
             this.form.manufacturer,
715 738
             this.type,
716
-            this.storehouse_id
739
+            this.storehouse_id,
740
+            this.warehouse_out_id,
717 741
           ).then((response) => {
718 742
             if (response.data.state == 0) {
719 743
               this.$message.error("库存不足");
@@ -729,24 +753,48 @@ export default {
729 753
               var min_number = response.data.data.min_number;
730 754
               var min_unit = response.data.data.min_unit;
731 755
               var max_unit = response.data.data.max_unit;
732
-              var str =
733
-                drug_name +
734
-                " " +
735
-                dose +
736
-                dose_unit +
737
-                "*" +
738
-                min_number +
739
-                min_unit +
740
-                "/" +
741
-                max_unit;
756
+              var str = drug_name +" " +dose +dose_unit +"*" + min_number + min_unit +"/" + max_unit;
757
+              var warehousingOutInfo = response.data.data.warehousingOutInfo
758
+              var warehouseOut = response.data.data.warehouseOut
759
+              this.warehouse_out_id = warehouseOut.id
760
+              var dealerList = response.data.data.dealerList
761
+              var manufacturerList = response.data.data.manufacturerList
762
+              var drugTypeList = response.data.data.drugTypeList
763
+              for(let i=0;i<warehousingOutInfo.length;i++){
764
+                for(let j=0;j<dealerList.length;j++){
765
+                   if(warehousingOutInfo[i].dealer == dealerList[j].id){
766
+                      warehousingOutInfo[i].dealer = dealerList[j].dealer_name
767
+                   }   
768
+                }
769
+
770
+                for(let z=0;z<manufacturerList.length;z++){
771
+                  if(warehousingOutInfo[i].manufacturer == manufacturerList[z].id){
772
+                     warehousingOutInfo[i].manufacturer = manufacturerList[z].manufacturer_name
773
+                  }
774
+                }
775
+                warehousingOutInfo[i].drug_name = warehousingOutInfo[i].drug.drug_name
776
+                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
777
+                warehousingOutInfo[i].product_date = this.getTimeOne(warehousingOutInfo[i].product_date)
778
+                warehousingOutInfo[i].expiry_date =  this.getTimeOne(warehousingOutInfo[i].expiry_date)
779
+                warehousingOutInfo[i].last_price = warehousingOutInfo[i].price
780
+                warehousingOutInfo[i].max_unit = warehousingOutInfo[i].count_unit
781
+                warehousingOutInfo[i].count = warehousingOutInfo[i].count.toString()
742 782
 
783
+                for(let z=0;z<drugTypeList.length;z++){
784
+                   if(warehousingOutInfo[i].drug.drug_type == drugTypeList[z].value){
785
+                      warehousingOutInfo[i].drug_type = drugTypeList[z].name
786
+                   }
787
+                }
788
+              }
743 789
               if (msg == 1) {
744 790
                 this.$message.error(str + "库存不足");
745 791
               } else {
746 792
                 loading.close();
747
-                this.$message.success("出库成功");
793
+                this.$message.success("保存成功");
748 794
                 this.recordInfo.recordData = [];
749
-                this.$router.back(-1);
795
+                this.recordInfo.recordData = warehousingOutInfo
796
+                this.showCheck = true
797
+               
750 798
               }
751 799
             }
752 800
           });
@@ -1029,6 +1077,78 @@ export default {
1029 1077
       }
1030 1078
       console.log("count_toal23233232", count_total);
1031 1079
     },
1080
+     getTimeOne(val) {
1081
+        if(val < 0){
1082
+          return ""
1083
+        }
1084
+        if(val == ""){
1085
+        return ""
1086
+        }else {
1087
+        return uParseTime(val, '{y}-{m}-{d}')
1088
+        }
1089
+     },
1090
+    toCheck(){
1091
+       const loading = this.$loading({
1092
+        lock: true,
1093
+        text: "Loading",
1094
+        spinner: "el-icon-loading",
1095
+        background: "rgba(0, 0, 0, 0.7)",
1096
+      });
1097
+       var params = {
1098
+        warehouse_out_id:this.warehouse_out_id
1099
+       }
1100
+      toCheckDrugOut(params).then(response=>{
1101
+        if(response.data.state == 1){
1102
+          var warehousingOutInfoList = response.data.data.warehousingOutInfoList
1103
+          var msg =response.data.data.msg
1104
+          if(msg == 1){
1105
+            this.$message.success("审核成功!")
1106
+            this.showCheck = false
1107
+            this.showReturnCheck = true
1108
+            this.$router.back(-1)
1109
+          }
1110
+          if(msg == 2){
1111
+            var drug_name = response.data.data.drug_name
1112
+            var dose = response.data.data.dose
1113
+            var dose_unit = response.data.data.dose_unit
1114
+            var min_number = response.data.data.min_number
1115
+            var min_unit = response.data.data.min_unit
1116
+            var max_unit = response.data.data.max_unit
1117
+            var str = drug_name +" " +dose +dose_unit +"*" + min_number + min_unit +"/" + max_unit;
1118
+            this.$message.error(str+"库存不足,审核失败!")
1119
+          }
1120
+          loading.close()
1121
+        }else{
1122
+          this.$message.error("审核失败!")
1123
+          loading.close()
1124
+        }
1125
+      })
1126
+    },
1127
+    toReturnCheck(){
1128
+       const loading = this.$loading({
1129
+        lock: true,
1130
+        text: "Loading",
1131
+        spinner: "el-icon-loading",
1132
+        background: "rgba(0, 0, 0, 0.7)",
1133
+      });
1134
+       var params = {
1135
+        warehouse_out_id:this.warehouse_out_id
1136
+       }
1137
+      toReturnCheck(params).then(response=>{
1138
+        if(response.data.state == 1){
1139
+          var out = response.data.data.out
1140
+          this.$message.success("反审核成功!")
1141
+          this.showCheck = true
1142
+          this.showReturnCheck = false
1143
+          loading.close()
1144
+          this.$router.back(-1)
1145
+        }else{
1146
+          this.$message.error("反审核失败!")
1147
+          loading.close()
1148
+          this.$router.back(-1)
1149
+        }
1150
+      })
1151
+    }
1032 1152
   },
1033 1153
   created() {
1034 1154
     if (this.$route.path == "/Pharmacy/out/add") {
@@ -1050,6 +1170,7 @@ export default {
1050 1170
       "-" +
1051 1171
       (nowDay < 10 ? "0" + nowDay : nowDay);
1052 1172
     const tempObj = {};
1173
+    tempObj["id"] = 0;
1053 1174
     tempObj["drug_id"] = 0;
1054 1175
     tempObj["max_unit"] = "";
1055 1176
     (tempObj["min_unit"] = ""), (tempObj["return_count"] = 0);

+ 6 - 5
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue View File

@@ -7,7 +7,7 @@
7 7
     </div>
8 8
     <div class="app-container ">
9 9
       <div id="dialysis-print-box">
10
-        <div v-if="orgId!=9671 && orgId!=10210 && orgId!=10188 && orgId!=10127 && orgId!=10164 && orgId!=3877">
10
+        <div v-if="orgId!=9671 && orgId!=9675 && orgId!=10210 && orgId!=10188 && orgId!=10127 && orgId!=10164 && orgId!=3877">
11 11
         <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
12 12
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
13 13
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
@@ -68,7 +68,7 @@
68 68
           </div>
69 69
           <div v-if="orgId == 10024" style="display:flex;margin-top:1px;float:right;">
70 70
             <div style="width:50px;">科室:</div><div style="width:60px;"></div>
71
-            <div style="width:70px;">领人:</div><div style="width:60px;"></div>
71
+            <div style="width:70px;">领人:</div><div style="width:60px;"></div>
72 72
             <div style="width:80px;">审批:</div><div style="width:100px;">肖庆娥</div>
73 73
             <div style="width:50px;">会计:</div><div style="width:100px;">徐立琼</div>
74 74
             <div style="width:50px;">审核:</div><div style="width:100px;">徐立琼</div>
@@ -78,7 +78,7 @@
78 78
       </div> 
79 79
 
80 80
 
81
-      <div v-if="orgId == 9671 || orgId == 10210 || orgId == 10188 || orgId == 10127 || orgId ==10164 || orgId ==3877">
81
+      <div v-if="orgId == 9671 || orgId == 9675 ||  orgId == 10210 || orgId == 10188 || orgId == 10127 || orgId ==10164 || orgId ==3877">
82 82
        <div class="dialysis-print-order" v-for="(it,index) in tableData" :key="index" >
83 83
          <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
84 84
           <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
@@ -123,7 +123,7 @@
123 123
                 <span v-else> {{(item.count * item.price).toFixed(2)}}</span>
124 124
                
125 125
              </td>
126
-             <td>{{item.batch_number}}</td>
126
+             <td>{{item.drug_warehouse_info.batch_number}}</td>
127 127
              <td>{{(getTime(item.product_date))}}</td>
128 128
              <td>{{(getTime(item.expiry_date))}}</td>
129 129
             </tr>
@@ -144,7 +144,7 @@
144 144
           </div>
145 145
           <div v-if="orgId == 10024" style="display:flex;margin-top:1px;float:right;">
146 146
             <div style="width:50px;">科室:</div><div style="width:60px;"></div>
147
-            <div style="width:70px;">领人:</div><div style="width:60px;"></div>
147
+            <div style="width:70px;">领人:</div><div style="width:60px;"></div>
148 148
             <div style="width:80px;">审批:</div><div style="width:100px;">肖庆娥</div>
149 149
             <div style="width:50px;">会计:</div><div style="width:100px;">徐立琼</div>
150 150
             <div style="width:50px;">审核:</div><div style="width:100px;">徐立琼</div>
@@ -157,6 +157,7 @@
157 157
 
158 158
     </div>
159 159
   </div>
160
+  </div>
160 161
 
161 162
 </template>
162 163
 

+ 105 - 14
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue View File

@@ -11,16 +11,31 @@
11 11
       ></bread-crumb>
12 12
 
13 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 15
         <el-button
18 16
           size="small"
19 17
           type="primary"
20 18
           @click="submit()"
19
+          v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0"
21 20
           class="filter-item"
22 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 39
       </div>
25 40
     </div>
26 41
 
@@ -441,6 +456,8 @@ import {
441 456
   GetAllConfigOne,
442 457
   GetAllDrugInfoByID,
443 458
   getDrugBatchNumber,
459
+  toCheckDrugOut,
460
+  toReturnCheck,
444 461
 } from "@/api/drug/drug_stock";
445 462
 import BreadCrumb from "../../components/bread-crumb";
446 463
 import DrugsStockDialog from "./drugsStockDialog/index";
@@ -511,6 +528,8 @@ export default {
511 528
       numberList: [],
512 529
       houstList: [],
513 530
       storehouse_id: "",
531
+      is_check:0,
532
+      order_id:0,
514 533
     };
515 534
   },
516 535
   methods: {
@@ -611,6 +630,10 @@ export default {
611 630
         this.$message.error("采购出库数据不能新增!");
612 631
         return;
613 632
       }
633
+      if(this.is_check == 1){
634
+        this.$message.error("已审核的单据不能新增!");
635
+        return;
636
+      }
614 637
       this.unitShow = false;
615 638
       if (this.drug_show == true) {
616 639
         this.$message.error("自动出库数据不能编辑");
@@ -623,7 +646,7 @@ export default {
623 646
       tempObj["count"] = "";
624 647
       tempObj["max_unit"] = "";
625 648
       tempObj["min_unit"] = "";
626
-      tempObj["price"] = "";
649
+      tempObj["price"] = 0;
627 650
       tempObj["remark"] = "";
628 651
       tempObj["batch_number"] = "";
629 652
       tempObj["number"] = "";
@@ -632,7 +655,7 @@ export default {
632 655
       tempObj["manufacturer"] = "";
633 656
       tempObj["warehouse_info_id"] = 0;
634 657
       tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name;
635
-      tempObj["last_price"] = "";
658
+      tempObj["last_price"] = 0;
636 659
       tempObj["stock_count"] = "";
637 660
       tempObj["total_count"] = 0;
638 661
       tempObj["max_unit_fisrt"] = 0;
@@ -644,6 +667,10 @@ export default {
644 667
         this.$message.error("调拨出库数据不能删除!");
645 668
         return;
646 669
       }
670
+     if(parseInt(this.$route.query.is_check) == 1){
671
+        this.$message.error("已审核的单据不能删除!")
672
+        return false
673
+      }
647 674
       if (row.supply_cancel_out_id > 0) {
648 675
         this.$message.error("采购出库数据不能删除!");
649 676
         return;
@@ -653,6 +680,10 @@ export default {
653 680
         this.$message.error("采购出库数据不能编辑");
654 681
         return;
655 682
       }
683
+      if (this.is_checks == 2) {
684
+        this.$message.error("已审核的单据不能删除!");
685
+        return;
686
+      }
656 687
       if (row.id == 0) {
657 688
         this.recordInfo.recordData.splice(index, 1);
658 689
       } else {
@@ -818,7 +849,6 @@ export default {
818 849
           const params = {
819 850
             stockOut: this.recordInfo.recordData,
820 851
           };
821
-
822 852
           editDrugWarehouseoutInfo(
823 853
             params,
824 854
             this.warehouse_out_time,
@@ -851,14 +881,15 @@ export default {
851 881
                 "/" +
852 882
                 max_unit;
853 883
               loading.close();
884
+
854 885
               if (msg == 1) {
855 886
                 this.$message.error(str + "库存不足,请入库");
856 887
                 loading.close();
857 888
               } else {
858
-                this.$message.success("出库成功");
889
+                this.$message.success("保存成功");
859 890
                 this.recordInfo.recordData = [];
860
-                this.$router.back(-1);
861 891
                 loading.close();
892
+                this.GetOrderDetail(this.order_id)
862 893
               }
863 894
             }
864 895
           });
@@ -949,10 +980,7 @@ export default {
949 980
               response.data.data.list[i].last_price;
950 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 984
           for (let j = 0; j < this.recordInfo.recordData.length; j++) {
957 985
             for (let i = 0; i < manulist.length; i++) {
958 986
               if (
@@ -1190,12 +1218,74 @@ export default {
1190 1218
       }
1191 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 1283
   created() {
1195 1284
     this.drugTypeList = getDictionaryDataConfig("system", "drug_type");
1196
-    // this.GetConfigInfo()
1285
+
1197 1286
     this.propForm.goodUnit = this.$store.getters.good_unit;
1198 1287
     const order_id = this.$route.query.id;
1288
+    this.order_id = order_id
1199 1289
     this.GetOrderDetail(order_id);
1200 1290
     var sys = this.$route.query.is_sys;
1201 1291
     if (sys == 0) {
@@ -1207,9 +1297,10 @@ export default {
1207 1297
     if (sys == 12) {
1208 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 1301
       this.drug_show = true;
1212 1302
     }
1303
+    this.is_check =  parseInt(this.$route.query.is_check)
1213 1304
     this.unitList = getDataConfig("hemodialysis", "units");
1214 1305
   },
1215 1306
 };

+ 2 - 1
src/xt_pages/stock/drugs/inventoryDetails.vue View File

@@ -133,6 +133,7 @@ export default {
133 133
             limit:10,
134 134
             page:1,
135 135
             storehouse_id:0,
136
+            houseList:[],
136 137
         }
137 138
     },
138 139
     methods:{
@@ -143,7 +144,7 @@ export default {
143 144
             this.$router.push({path:'/stock/drugs/inventoryPrint'}) 
144 145
         },
145 146
         print_1(){
146
-           this.$router.push({path:'/stock/drugs/print'}) 
147
+           this.$router.push({path:'/stock/drugs/print?storehouse_id='+this.storehouse_id+"&drug_name="+this.searchKey+"&limit="+this.limit+"&page="+this.page}) 
147 148
         },
148 149
         handleSizeChange(val){
149 150
          this.limit = val

+ 80 - 22
src/xt_pages/stock/drugs/print.vue View File

@@ -32,17 +32,27 @@
32 32
                         
33 33
                     </tr>
34 34
                     <tr v-for="(item,index) in tableData" :key="index">
35
-                        <td>{{item.good_name}}</td>
35
+                        <td>{{item.drug_name}}</td>
36 36
                         <td>{{item.specification_name}}</td>
37
-                        <td>{{item.packing_unit}}</td>
38
-                        <td>{{item.number}}</td>
39
-                        <td></td>
40
-                        <td></td>
41
-                        <td></td>
42
-                        <td></td>
43
-                        <td></td>
44
-                        <td></td>
45
-                        <td></td>
37
+                        <td>{{item.warehousing_unit}}</td>
38
+                        <td>{{getNumber(item.id)}}</td>
39
+                        <td>{{item.manufacturer}}</td>
40
+                        <td>{{item.storehouse_id}}</td>
41
+                        <td> 
42
+                            <span v-if="item.stock_max_number>0">{{item.stock_max_number}}{{item.warehousing_unit}} </span>  
43
+                            <span v-if="item.stock_min_number>0">{{item.stock_min_number}}{{item.min_unit}}</span>
44
+                            <span v-if="item.stock_max_number == 0 && item.stock_min_number == 0">0</span></td>
45
+                        <td>
46
+                            <span v-if="item.last_stock_max_number > 0">{{item.last_stock_max_number}}{{item.warehousing_unit}}</span>  
47
+                            <span v-if="item.last_stock_min_number>0">{{item.last_stock_min_number}}{{item.min_unit}}</span>
48
+                            <span v-if="item.last_stock_max_number == 0 && item.last_stock_min_number == 0">0</span>
49
+                        </td>
50
+                        <td>
51
+                          <span v-if="item.inventory_type == 10">盘盈</span>
52
+                          <span v-if="item.inventory_type == 11">盘亏</span>  
53
+                        </td>
54
+                        <td>{{getPrice(item.id)}}</td>
55
+                        <td>{{getTotalPrice(item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id,item.stock_max_number,item.stock_min_number)}}</td>
46 56
                     </tr>
47 57
                     </tbody>
48 58
                 </table>
@@ -55,7 +65,7 @@
55 65
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
56 66
 const moment = require('moment');
57 67
 import { uParseTime } from '@/utils/tools'
58
-import { getInventoryExportList } from "@/api/stock"
68
+import { getInventoryDetailList } from "@/api/drug/drug"
59 69
 import print from "print-js";
60 70
 export default {
61 71
     components:{
@@ -68,10 +78,12 @@ export default {
68 78
             { path: false, name: '耗材管理' },
69 79
             { path: false, name: '耗材盘点打印' },
70 80
           ],
71
-          org_name:"",
81
+          org_name: this.$store.getters.xt_user.org.org_name,
72 82
           ids:"",
73 83
           tableData:[],
74 84
           manufacturerList:[],
85
+          houseList:[],
86
+          inventoryList:[],
75 87
         }
76 88
     },
77 89
     methods:{
@@ -95,15 +107,23 @@ export default {
95 107
             return uParseTime(val, '{y}-{m}-{d}')
96 108
          }
97 109
         },
98
-        getlist(){
99
-         getInventoryExportList().then(response=>{
100
-           if(response.data.state == 1){
101
-             var list =  response.data.data.list
102
-             console.log("list233233232323",list)
103
-             this.tableData = list
104
-             this.manufacturerList = response.data.data.manufacturerList
105
-           }
106
-         })
110
+       getlist(){
111
+            var params = {
112
+              limit:this.$route.query.limit,
113
+              page:this.$route.query.page,
114
+              keyword:this.$route.query.drug_name,
115
+              storehouse_id:this.$route.query.storehouse_id,
116
+            }
117
+          getInventoryDetailList(params).then(response=>{
118
+             if(response.data.state == 1){
119
+              this.total =  response.data.data.total
120
+              this.tableData = response.data.data.list
121
+              this.houseList = response.data.data.houseList
122
+              this.inventoryList = response.data.data.inventoryList
123
+              console.log("hhahhh2o2o233oo2332",this.inventoryList)
124
+              
125
+             }
126
+          })   
107 127
         },
108 128
         getManufacturerName(id){
109 129
 
@@ -114,9 +134,47 @@ export default {
114 134
               }
115 135
            }
116 136
            return name
117
-        }
137
+        },
138
+        getNumber(id){
139
+          var number = ""
140
+          for(let i=0;i<this.inventoryList.length;i++){
141
+            if(id == this.inventoryList[i].id){
142
+                number = this.inventoryList[i].drug_warehouse_info.batch_number
143
+            }
144
+          }
145
+          return number
146
+         },
147
+         getTotalPrice(last_stock_max_number,last_stock_min_number,min_number,id,stock_max_number,stock_min_number){
148
+           var retail_price = 0
149
+           var totail_price =0
150
+           for(let i=0;i<this.inventoryList.length;i++){
151
+            if(id == this.inventoryList[i].id){
152
+              retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
153
+            }
154
+          }
155
+          var totail_price = (stock_max_number*min_number +stock_min_number - last_stock_max_number * min_number + last_stock_min_number) * retail_price
156
+        //  var totail_price = last_stock_max_number * min_number * retail_price + last_stock_min_number * retail_price 
157
+          if(totail_price > 0){
158
+             return totail_price.toFixed(4)
159
+          }else{
160
+            return ""
161
+          }
162
+         },
163
+         getPrice(id){
164
+           var retail_price = 0
165
+           for(let i=0;i<this.inventoryList.length;i++){
166
+            if(id == this.inventoryList[i].id){
167
+               retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
168
+            }
169
+          }
170
+          if(retail_price > 0){
171
+          return retail_price
172
+          }
173
+          
174
+         }
118 175
     },
119 176
     created(){
177
+
120 178
       this.getlist()
121 179
     }
122 180
 }

+ 2 - 2
src/xt_pages/stock/inventoryDetails.vue View File

@@ -26,7 +26,7 @@
26 26
                 @click="search">搜索</el-button>
27 27
             </div>
28 28
             <div>
29
-              <el-button type="primary" @click="toprint">打印</el-button>
29
+              <!-- <el-button type="primary" @click="toprint">打印</el-button> -->
30 30
               <el-button type="primary" @click="inventoryExportList">盘点模版打印</el-button>
31 31
             </div>
32 32
             <!-- <div>
@@ -130,7 +130,7 @@ export default {
130 130
     },
131 131
     methods:{
132 132
         toprint(){
133
-          this.$router.push({path:'/stock/print_all'})
133
+          this.$router.push({path:'/stock/print_all?storehouse_id='+this.storehouse_id+"&good_name="+this.searchKey+"&limit="+this.limit+"&page="+this.page})
134 134
         },
135 135
 
136 136
         search(){

+ 44 - 18
src/xt_pages/stock/print_all.vue View File

@@ -36,13 +36,18 @@
36 36
                         <td>{{item.specification_name}}</td>
37 37
                         <td>{{item.packing_unit}}</td>
38 38
                         <td>{{item.number}}</td>
39
-                        <td></td>
40
-                        <td></td>
41
-                        <td></td>
42
-                        <td></td>
43
-                        <td></td>
44
-                        <td></td>
45
-                        <td></td>
39
+                        <td>{{item.manufacturer}}</td>
40
+                        <td>{{getHouseName(item.storehouse_id)}}</td>
41
+                        <td>{{item.stock_count}}</td>
42
+                        <td>{{item.last_stock_count}}</td>
43
+                        <td>  
44
+                          <span v-if="item.stock_count > item.last_stock_count">盘亏</span>
45
+                          <span v-if="item.stock_count < item.last_stock_count">盘盈</span>
46
+                        </td>
47
+                        <td>{{item.buy_price}}</td>
48
+                        <td>
49
+                          <span v-if="item.stock_count > item.last_stock_count">{{((item.stock_count - item.last_stock_count)  * item.buy_price).toFixed(2)}}</span> 
50
+                        </td>
46 51
                     </tr>
47 52
                     </tbody>
48 53
                 </table>
@@ -55,7 +60,7 @@
55 60
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
56 61
 const moment = require('moment');
57 62
 import { uParseTime } from '@/utils/tools'
58
-import { getInventoryExportList } from "@/api/stock"
63
+import { getPrintList } from "@/api/stock"
59 64
 import print from "print-js";
60 65
 export default {
61 66
     components:{
@@ -68,10 +73,11 @@ export default {
68 73
             { path: false, name: '耗材管理' },
69 74
             { path: false, name: '耗材盘点打印' },
70 75
           ],
71
-          org_name:"",
76
+          org_name: this.$store.getters.xt_user.org.org_name,
72 77
           ids:"",
73 78
           tableData:[],
74 79
           manufacturerList:[],
80
+          houseList:[],
75 81
         }
76 82
     },
77 83
     methods:{
@@ -96,14 +102,20 @@ export default {
96 102
          }
97 103
         },
98 104
         getlist(){
99
-        //  getInventoryExportList().then(response=>{
100
-        //    if(response.data.state == 1){
101
-        //      var list =  response.data.data.list
102
-        //      console.log("list233233232323",list)
103
-        //      this.tableData = list
104
-        //      this.manufacturerList = response.data.data.manufacturerList
105
-        //    }
106
-        //  })
105
+          var params = {
106
+            storehouse_id:this.$route.query.storehouse_id,
107
+            good_name:this.$route.query.good_name,
108
+            limit:this.$route.query.limit,
109
+            page:this.$route.query.page,
110
+          }
111
+         getPrintList(params).then(response=>{
112
+           if(response.data.state == 1){
113
+             var list =  response.data.data.list
114
+             console.log("list233233232323",list)
115
+             this.tableData = list
116
+             this.houseList = response.data.data.houseList
117
+           }
118
+         })
107 119
         },
108 120
         getManufacturerName(id){
109 121
            var name = ""
@@ -113,9 +125,23 @@ export default {
113 125
               }
114 126
            }
115 127
            return name
116
-        }
128
+        },
129
+        getHouseName(id){
130
+         var storehouse_name = ""
131
+         for(let i=0;i<this.houseList.length;i++){
132
+           if(id == this.houseList[i].id){
133
+              storehouse_name = this.houseList[i].storehouse_name
134
+           }
135
+         }
136
+         if(storehouse_name == "全部"){
137
+           return ""
138
+         }else{
139
+           return storehouse_name
140
+         }
141
+       }
117 142
     },
118 143
     created(){
144
+
119 145
       this.getlist()
120 146
     }
121 147
 }

+ 46 - 6
src/xt_pages/stock/stockInOrder.vue View File

@@ -88,7 +88,7 @@
88 88
             </el-option>
89 89
           </el-select>
90 90
         </div> -->
91
- 
91
+
92 92
       </div>
93 93
 
94 94
 
@@ -105,6 +105,17 @@
105 105
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
106 106
 
107 107
         <el-button size="small" type="primary" @click="toExport">导出</el-button>
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>
108 119
       </div>
109 120
 
110 121
       <el-table
@@ -157,6 +168,13 @@
157 168
           </template>
158 169
         </el-table-column>
159 170
 
171
+        <el-table-column label="审核状态" align="center">
172
+          <template slot-scope="scope">
173
+            <span v-if="scope.row.is_check == 1">已审核</span>
174
+            <span v-if="scope.row.is_check == 2">未审核</span>
175
+          </template>
176
+        </el-table-column>
177
+
160 178
         <el-table-column label="操作" align="center" width="260px">
161 179
           <template slot-scope="scope">
162 180
             <el-tooltip
@@ -829,6 +847,12 @@ export default {
829 847
       checkAllStatus:false,
830 848
       list:[],
831 849
       storehouse_id:0,
850
+      check_type:0,
851
+      checkList:[
852
+       {id:0,name:"全部"},
853
+       {id:1,name:"已审核"},
854
+       {id:2,name:"未审核"},
855
+      ],
832 856
       check_id: 0,
833 857
     };
834 858
 
@@ -857,6 +881,9 @@ export default {
857 881
           this.doctorList = response.data.data.doctorList;
858 882
         }
859 883
       });
884
+    },
885
+    changeCheckType(){
886
+      this.GetWarehouse()
860 887
     },
861 888
      changeCheck() {
862 889
       this.$refs.multipleTable.clearSelection();
@@ -873,6 +900,7 @@ export default {
873 900
         type: this.type,
874 901
         keywords: this.searchKey,
875 902
         storehouse_id:this.storehouse_id,
903
+        check_type:this.check_type,
876 904
       };
877 905
       this.Warehouse.warehouseDate = [];
878 906
       getWarehouseList(Params).then(response => {
@@ -898,6 +926,7 @@ export default {
898 926
         end_time: this.end_time,
899 927
         type: this.type,
900 928
         storehouse_id:this.storehouse_id,
929
+        check_type:this.check_type,
901 930
       };
902 931
 
903 932
       this.Warehouse.warehouseDate = [];
@@ -1143,7 +1172,8 @@ export default {
1143 1172
       }
1144 1173
     },
1145 1174
     handleEdit: function(index, row) {
1146
-      this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id+"&is_sys="+row.is_sys})
1175
+
1176
+      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})
1147 1177
     },
1148 1178
     handleDelete: function(index, row) {
1149 1179
       if(row.is_sys== 12){
@@ -1154,6 +1184,10 @@ export default {
1154 1184
         this.$message.error("采购入库单不能删除!")
1155 1185
         return false
1156 1186
       }
1187
+      if(row.is_check == 1){
1188
+        this.$message.error("已审核的单据不能删除!")
1189
+        return false
1190
+      }
1157 1191
       const ids = [];
1158 1192
       ids.push(row.id);
1159 1193
       const idStr = ids.join(",");
@@ -1211,12 +1245,19 @@ export default {
1211 1245
       const ids = [];
1212 1246
       const idOne = []
1213 1247
       for (let i = 0; i < this.selectedTableData.length; i++) {
1248
+        if(this.selectedTableData[i].is_check == 1){
1249
+          this.$message.error("已审核单据不能删除!")
1250
+          return false
1251
+        }
1214 1252
         if(this.selectedTableData[i].is_sys ==12){
1215 1253
           this.$message.error("调拨入库数据不能删除!")
1216 1254
           return false
1217 1255
         }
1218 1256
         ids.push(this.selectedTableData[i].id);
1219
-        idOne.push(this.selectedTableData[i].supply_warehouse_id)
1257
+        if(this.selectedTableData[i].supply_warehouse_id >0){
1258
+          idOne.push(this.selectedTableData[i].supply_warehouse_id)
1259
+        }
1260
+
1220 1261
       }
1221 1262
       for(let i=0;i<idOne.length;i++){
1222 1263
         if(idOne[i] >0){
@@ -1233,8 +1274,7 @@ export default {
1233 1274
         confirmButtonText: "确定",
1234 1275
         cancelButtonText: "取消",
1235 1276
         type: "warning"
1236
-      })
1237
-        .then(() => {
1277
+      }).then(() => {
1238 1278
           deleteWarehouseInfo(params).then(response => {
1239 1279
             if (response.data.state == 0) {
1240 1280
               this.$message.error(response.data.msg);
@@ -1450,7 +1490,7 @@ export default {
1450 1490
               this.$message.error(response.data.msg);
1451 1491
               return false;
1452 1492
             } else {
1453
-              this.$message.success("入库成功");
1493
+              this.$message.success("保存成功");
1454 1494
               this.dialogVisible = false
1455 1495
               this.editDialogVisible = false
1456 1496
 

+ 132 - 37
src/xt_pages/stock/stockInOrderAdd.vue View File

@@ -8,6 +8,8 @@
8 8
       <div style="float:right;">
9 9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10 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 13
       </div>
12 14
     </div>
13 15
     <div class="app-container" v-loading="loading">
@@ -35,7 +37,7 @@
35 37
                         value-format="yyyy-MM-dd"></el-date-picker>
36 38
       </div>
37 39
 
38
-    
40
+
39 41
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
40 42
         <el-table id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" border
41 43
                   style="width: 100%"
@@ -65,11 +67,11 @@
65 67
             </template>
66 68
           </el-table-column>
67 69
           <el-table-column align="center" width="140">
68
-            
70
+
69 71
             <template slot="header" slot-scope="scope">
70 72
               <span>耗材类型<span style="color: red">*</span></span>
71 73
             </template>
72
-     
74
+
73 75
             <template slot-scope="scope">
74 76
               <el-form-item style="padding-top: 20px;">
75 77
                 <el-input placeholder="请输入耗材类型" v-model="scope.row.good_type_id" :value="typeName(scope.row.good_type_id)"></el-input>
@@ -77,7 +79,7 @@
77 79
             </template>
78 80
           </el-table-column>
79 81
           <el-table-column align="center" width="140">
80
-            
82
+
81 83
             <template slot="header" slot-scope="scope">
82 84
               <span>规格&单位<span style="color: red">*</span></span>
83 85
             </template>
@@ -89,7 +91,7 @@
89 91
 
90 92
             </template>
91 93
           </el-table-column>
92
-        
94
+
93 95
           <el-table-column align="center" width="150">
94 96
             <template slot="header" slot-scope="scope">
95 97
               <span>批号<span style="color: red">*</span></span>
@@ -114,16 +116,16 @@
114 116
                 <!-- <el-input placeholder="请输入入库数量" v-model="scope.row.warehousing_count"></el-input> -->
115 117
                   {{scope.row.min_unit}}
116 118
               </el-form-item>
117
-            
119
+
118 120
             </template>
119 121
           </el-table-column>
120
-        
122
+
121 123
           <el-table-column align="center" width="120">
122 124
             <template slot="header" slot-scope="scope">
123 125
               <span>零售价<span style="color: red">*</span></span>
124 126
             </template>
125 127
             <template slot-scope="scope">
126
-            
128
+
127 129
               <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
128 130
                             style="padding-top: 20px">
129 131
                 <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price"></el-input>
@@ -137,7 +139,7 @@
137 139
               <span>进货单价<span style="color: red">*</span></span>
138 140
             </template>
139 141
             <template slot-scope="scope">
140
-            
142
+
141 143
               <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
142 144
                             style="padding-top: 20px">
143 145
                 <el-input placeholder="请输入单价" type="number" v-model="scope.row.price"></el-input>
@@ -166,8 +168,8 @@
166 168
              </el-form-item>
167 169
             </template>
168 170
           </el-table-column>
169
-        
170
-        
171
+
172
+
171 173
           <el-table-column label="生产日期" align="center" width="180">
172 174
             <template slot-scope="scope">
173 175
               <el-date-picker prefix-icon="el-icon-date" v-model="scope.row.product_date" style="width: 145px"
@@ -177,7 +179,7 @@
177 179
 
178 180
             </template>
179 181
           </el-table-column>
180
-       
182
+
181 183
          <el-table-column label="生产厂家" align="center" width="150">
182 184
              <template slot-scope="scope">
183 185
                <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
@@ -276,7 +278,9 @@
276 278
     getWarehouseInfoByOrdeNumber,
277 279
     modifyWarehouseInfo,
278 280
     postWarehouse,
279
-    postSearchGoodList
281
+    postSearchGoodList,
282
+    toCheckWarehouseInfo,
283
+    toReturnCheckWarehouseInfo
280 284
   } from '@/api/stock'
281 285
   import BreadCrumb from '../components/bread-crumb'
282 286
 
@@ -323,17 +327,17 @@
323 327
             { required: true, message: '零售价不能为空', trigger: 'blur' }
324 328
           ],
325 329
           warehousing_count: [
326
-            { required: true, message: '数量不能为空', trigge: 'blur' }
330
+            { required: true, message: '数量不能为空', trigger: 'blur' }
327 331
           ],
328 332
 
329 333
           good_id: [
330 334
             { validator: checkGoodId, trigger: 'blur' }
331 335
           ],
332 336
           number:[
333
-            { required: true, message: '批号不能为空', trigge: 'blur' }
337
+            { required: true, message: '批号不能为空', trigger: 'blur' }
334 338
           ],
335 339
           expiry_date:[
336
-            { required: true, message: '有效日期不能为空', trigge: 'blur' }
340
+            { required: true, message: '有效日期不能为空', trigger: 'blur' }
337 341
           ],
338 342
 
339 343
         },
@@ -400,6 +404,9 @@
400 404
         loading:false,
401 405
         list:[],
402 406
         storehouse_id:"",
407
+        showCheck:false,
408
+        showReturnCheck:false,
409
+        warehousing_info_id:0,
403 410
       }
404 411
     },
405 412
     methods: {
@@ -465,7 +472,7 @@
465 472
         this.propForm.goodType = []
466 473
         this.propForm.goods = []
467 474
         this.$refs.dialog.hide()
468
-      }, 
475
+      },
469 476
       GetAllGoodType: function() {
470 477
         GetAllGoodType().then(response => {
471 478
           if (response.data.state == 0) {
@@ -477,7 +484,7 @@
477 484
             }
478 485
           }
479 486
         })
480
-      }, 
487
+      },
481 488
       GetAllGoodInfo: function() {
482 489
         GetAllGoodInfo().then(response => {
483 490
           if (response.data.state == 0) {
@@ -528,7 +535,7 @@
528 535
         }
529 536
         return name
530 537
       }, specificationName: function(good_info_id) {
531
-      
538
+
532 539
         let name = ''
533 540
         for (let i = 0; i < this.goodInfo.length; i++) {
534 541
           if (this.goodInfo[i].id == good_info_id) {
@@ -536,7 +543,7 @@
536 543
           }
537 544
         }
538 545
         return name
539
-      }, 
546
+      },
540 547
       handleEdit: function(index, row) {
541 548
         const tempObj = {}
542 549
         tempObj['good_type_id'] = 0
@@ -554,6 +561,7 @@
554 561
         tempObj['name'] = ''
555 562
         tempObj['license_number'] = ""
556 563
         tempObj["packing_price"] = ""
564
+        tempObj["id"] = 0
557 565
         tempObj['register_number'] = ''
558 566
         this.recordInfo.recordData.push(tempObj)
559 567
       }, handleDelete: function(index, row) {
@@ -568,7 +576,7 @@
568 576
           return ''
569 577
         }
570 578
         return Math.round(parseFloat(val) * 100) / 100
571
-      }, 
579
+      },
572 580
       GetWarehouseInfoByOrdeNumber: function() {
573 581
         const params = {
574 582
           'warehousing_order': sessionStorage.getItem('warehousing_orders')
@@ -576,7 +584,7 @@
576 584
         this.recordInfo.recordData = []
577 585
         getWarehouseInfoByOrdeNumber(params).then(response => {
578 586
           if (response.data.state != 0) {
579
-            
587
+
580 588
             for (let i = 0; i < response.data.data.info.length; i++) {
581 589
               this.recordInfo.recordData.push(response.data.data.info[i])
582 590
             }
@@ -714,7 +722,7 @@
714 722
              }
715 723
               for(let j=0;j<this.manufacturerList.length;j++){
716 724
                  if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
717
-               
725
+
718 726
                   this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
719 727
                  }
720 728
               }
@@ -726,6 +734,7 @@
726 734
                     this.recordInfo.recordData[i].dealer = this.dealerList[j].id
727 735
                  }
728 736
               }
737
+              this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString()
729 738
             }
730 739
             const loading = this.$loading({
731 740
               lock: true,
@@ -736,8 +745,9 @@
736 745
             const params = {
737 746
               'stockIn': this.recordInfo.recordData
738 747
             }
739
-           
740
-            postWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type,this.storehouse_id).then(response => {
748
+            console.log("param232232323232323w",params)
749
+   
750
+            postWarehouse(params, this.warehousing_time, this.type,this.storehouse_id,this.warehousing_info_id).then(response => {
741 751
               if (response.data.state == 0) {
742 752
                 this.loading = false
743 753
                 this.$message.error(response.data.msg)
@@ -746,8 +756,33 @@
746 756
               } else {
747 757
                 loading.close()
748 758
                 this.loading = false
749
-                this.$message.success('入库成功')
750
-                this.$router.back(-1)
759
+                this.$message.success('保存成功')
760
+                var list = response.data.data.list
761
+                console.log("list2332323323",list)
762
+                var dealerList = response.data.data.dealerList
763
+                var manufacturerList = response.data.data.manufacturerList
764
+                var info =  response.data.data.info
765
+                this.warehousing_info_id  = info.id
766
+                for(let i=0;i<list.length;i++){
767
+                  for(let j=0;j<dealerList.length;j++){
768
+                     if(list[i].dealer == dealerList[i].id){
769
+                        list[i].dealer = dealerList[i].dealer_name
770
+                     }
771
+                  }
772
+                  for(let s=0;s<manufacturerList.length;s++){
773
+                    if(list[i].manufacturer == manufacturerList[s].id){
774
+                       list[i].manufacturer = manufacturerList[s].manufacturer_name
775
+                    }
776
+                  }
777
+                  list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
778
+                  list[i].product_date = this.getTimeOne(list[i].product_date)
779
+                  list[i].good_name = list[i].GoodInfo.good_name
780
+                  list[i].name = list[i].GoodInfo.specification_name +"/"+ list[i].GoodInfo.packing_unit
781
+                }
782
+                this.recordInfo.recordData = []
783
+                this.recordInfo.recordData = list
784
+                this.showCheck = true
785
+                // this.$router.back(-1)
751 786
               }
752 787
             })
753 788
           } else {
@@ -758,7 +793,7 @@
758 793
       ,
759 794
       changeManufacturer(val) {
760 795
 
761
-      }, 
796
+      },
762 797
       changeDealer(val) {
763 798
 
764 799
       },
@@ -772,9 +807,9 @@
772 807
         }
773 808
         postSearchGoodList(key,this.storehouse_id).then(response => {
774 809
           if (response.data.state == 1) {
775
-           
810
+
776 811
              var list = response.data.data.list
777
-             
812
+
778 813
              this.goodList = list
779 814
              var manufacturerList = response.data.data.manufacturerList
780 815
              this.manufacturerList = manufacturerList
@@ -795,7 +830,7 @@
795 830
                   }
796 831
                }
797 832
              }
798
-           
833
+
799 834
              cb(this.goodList)
800 835
           } else {
801 836
             cb([])
@@ -809,11 +844,12 @@
809 844
         console.log("al32323232323223",val)
810 845
          for(let i=0;i<this.recordInfo.recordData.length;i++){
811 846
            if(this.currentIndex == i){
847
+              this.recordInfo.recordData[i].id = 0
812 848
               this.recordInfo.recordData[i].good_type_id = val.id
813 849
               this.recordInfo.recordData[i].good_name = val.good_name
814 850
               this.recordInfo.recordData[i].good_type_id = val.good_type_id
815 851
               this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
816
-             // this.recordInfo.recordData[i].number =  val.number
852
+
817 853
               this.recordInfo.recordData[i].manufacturer = val.manufacturer
818 854
               this.recordInfo.recordData[i].remark = val.remark
819 855
               this.recordInfo.recordData[i].license_number = val.number
@@ -829,7 +865,7 @@
829 865
               }else{
830 866
                 this.recordInfo.recordData[i].packing_price = val.packing_price
831 867
               }
832
-              
868
+
833 869
               this.recordInfo.recordData[i].specification_name = val.specification_name
834 870
               this.recordInfo.recordData[i].good_id = val.id
835 871
               this.recordInfo.recordData[i].packing_unit = val.packing_unit
@@ -838,11 +874,69 @@
838 874
               }else{
839 875
                 this.recordInfo.recordData[i].dealer = val.dealer
840 876
               }
841
-             
877
+
842 878
            }
843 879
          }
844 880
       },
845
-   
881
+     getTimeOne(val) {
882
+        if(val < 0){
883
+          return ""
884
+        }
885
+        if(val == ""){
886
+        return ""
887
+        }else {
888
+        return uParseTime(val, '{y}-{m}-{d}')
889
+        }
890
+     },
891
+     toCheck(){
892
+        const loading = this.$loading({
893
+          lock: true,
894
+          text: 'Loading',
895
+          spinner: 'el-icon-loading',
896
+          background: 'rgba(0, 0, 0, 0.7)'
897
+        })
898
+
899
+        var params = {
900
+          warehousing_info_id:this.warehousing_info_id,
901
+        }
902
+       toCheckWarehouseInfo(params).then(response=>{
903
+          if(response.data.state == 1){
904
+            var list = response.data.data.list
905
+            this.$message.success("审核成功!")
906
+            this.showCheck = false
907
+            this.showReturnCheck = true
908
+            this.$router.back(-1)
909
+            loading.close()
910
+          }else{
911
+            this.$message.error("审核失败")
912
+            loading.close()
913
+          }
914
+       })
915
+     },
916
+     toReturnCheck(){
917
+       const loading = this.$loading({
918
+          lock: true,
919
+          text: 'Loading',
920
+          spinner: 'el-icon-loading',
921
+          background: 'rgba(0, 0, 0, 0.7)'
922
+        })
923
+       var params = {
924
+          warehousing_info_id:this.warehousing_info_id,
925
+        }
926
+       toReturnCheckWarehouseInfo(params).then(response=>{
927
+          if(response.data.state == 1){
928
+             var list = response.data.data.list
929
+             this.$message.success("反审核成功!")
930
+             this.showCheck = true
931
+             this.showReturnCheck = false
932
+             loading.close()
933
+             this.$router.back(-1)
934
+          }else{
935
+            this.$message.error("反审核失败!")
936
+            loading.close()
937
+          }
938
+       })
939
+     }
846 940
     }
847 941
     ,
848 942
     created() {
@@ -873,6 +967,7 @@
873 967
       tempObj['name'] = ''
874 968
       tempObj['license_number'] = ''
875 969
       tempObj['packing_price']= ''
970
+      tempObj['id']= 0
876 971
       tempObj['register_number'] = ''
877 972
       this.recordInfo.recordData.push(tempObj)
878 973
       this.GetConfigInfo()
@@ -905,7 +1000,7 @@
905 1000
     margin-top: 15px;
906 1001
     margin-bottom: 15px;
907 1002
   }
908
-  
1003
+
909 1004
 
910 1005
 </style>
911 1006
 
@@ -920,6 +1015,6 @@
920 1015
   .el-autocomplete-suggestion{
921 1016
     width: 400px !important;
922 1017
   }
923
-  
1018
+
924 1019
 
925 1020
 </style>

+ 117 - 8
src/xt_pages/stock/stockInOrderEdit.vue View File

@@ -18,9 +18,26 @@
18 18
           size="small"
19 19
           type="primary"
20 20
           @click="submit()"
21
+          v-if="is_check == 2"
21 22
           class="filter-item"
22 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 41
       </div>
25 42
     </div>
26 43
 
@@ -142,7 +159,7 @@
142 159
             
143 160
               <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
144 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 163
               </el-form-item>
147 164
 
148 165
 
@@ -160,6 +177,7 @@
160 177
                 style="padding-top: 20px"
161 178
               >
162 179
                 <el-input
180
+                 :disabled ="disabled"
163 181
                   placeholder="请输入单价"
164 182
                   type="number"
165 183
                   v-model="scope.row.price"
@@ -341,7 +359,9 @@ import {
341 359
   GetAllGoodInfoByID,
342 360
   DeleteWarehouseInfoItem,
343 361
   EditWarehouse,
344
-  postSearchGoodList
362
+  postSearchGoodList,
363
+  toCheckWarehouseInfo,
364
+  toReturnCheckWarehouseInfo
345 365
 } from "@/api/stock";
346 366
 import BreadCrumb from "../components/bread-crumb";
347 367
 
@@ -385,7 +405,7 @@ export default {
385 405
           { required: true, message: '零售价不能为空', trigger: 'blur' }
386 406
         ],
387 407
         warehousing_count: [
388
-          { required: true, message: "数量不能为空", trigge: "blur" }
408
+          { required: true, message: "数量不能为空", trigger: "blur" }
389 409
         ],
390 410
 
391 411
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
@@ -426,6 +446,8 @@ export default {
426 446
       disabled:false,
427 447
       storehouse_id:0,
428 448
       list:[],
449
+      is_check:0,
450
+      order_id:0,
429 451
     };
430 452
   },
431 453
   methods: {
@@ -527,6 +549,10 @@ export default {
527 549
         this.$message.error("调拨入库数据不能新增!")
528 550
         return false
529 551
       }
552
+      if(parseInt(this.$route.query.is_check) == 1){
553
+        this.$message.error("已审核的单据不能新增!")
554
+        return false
555
+      }
530 556
       const tempObj = {};
531 557
       tempObj["id"] = 0;
532 558
       tempObj["good_type_id"] = 0;
@@ -552,6 +578,10 @@ export default {
552 578
         this.$message.error("采购入库数据不能删除!")
553 579
         return false
554 580
       }
581
+     if(parseInt(this.$route.query.is_check) == 1){
582
+        this.$message.error("已审核的单据不能删除!")
583
+        return false
584
+      }
555 585
       if (row.id == 0) {
556 586
         this.recordInfo.recordData.splice(index, 1);
557 587
       } else {
@@ -694,12 +724,13 @@ export default {
694 724
                   this.recordInfo.recordData[i].dealer = this.dealerList[z].id
695 725
                }
696 726
              }
727
+             this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString() 
697 728
           }
698 729
          
699 730
           const params = {
700 731
             stockIn: this.recordInfo.recordData
701 732
           };
702
-          
733
+          console.log("param22332322332",params)
703 734
           const loading = this.$loading({
704 735
             lock: true,
705 736
             text: 'Loading',
@@ -723,8 +754,28 @@ export default {
723 754
             } else {
724 755
               loading.close()
725 756
               this.loading = false
726
-              this.$message.success("入库成功");
727
-              this.$router.back(-1);
757
+              var list = response.data.data.list
758
+              var manufacturerList = response.data.data.manufacturerList
759
+              var dealerList = response.data.data.dealerList
760
+              for(let i=0;i<list.length;i++){
761
+                for(let j=0;j<dealerList.length;j++){
762
+                 if(list[i].dealer == dealerList[i].id){
763
+                    list[i].dealer = dealerList[i].dealer_name
764
+                  }
765
+                }
766
+                for(let s=0;s<manufacturerList.length;s++){
767
+                  if(list[i].manufacturer == manufacturerList[s].id){
768
+                    list[i].manufacturer = manufacturerList[s].manufacturer_name
769
+                  }
770
+                } 
771
+                list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
772
+                list[i].product_date = this.getTimeOne(list[i].product_date)
773
+                list[i].good_name = list[i].GoodInfo.good_name
774
+                list[i].name = list[i].GoodInfo.specification_name
775
+               }
776
+              this.recordInfo.recordData = []
777
+              this.recordInfo.recordData = list
778
+              this.$message.success("保存成功");
728 779
             }
729 780
           });
730 781
         } else {
@@ -870,18 +921,76 @@ export default {
870 921
           }
871 922
         }
872 923
      
873
-    }
924
+    },
925
+    toCheck(){
926
+        const loading = this.$loading({
927
+          lock: true,
928
+          text: 'Loading',
929
+          spinner: 'el-icon-loading',
930
+          background: 'rgba(0, 0, 0, 0.7)'
931
+        })
932
+        var params = {
933
+          warehousing_info_id:this.order_id,
934
+        }
935
+       toCheckWarehouseInfo(params).then(response=>{
936
+          if(response.data.state == 1){
937
+            var list = response.data.data.list
938
+            this.$message.success("审核成功!")
939
+            loading.close()
940
+            this.$router.back(-1)
941
+          }else{
942
+            this.$message.error("审核失败!")
943
+            loading.close()
944
+          }
945
+       })
946
+     },
947
+     toReturnCheck(){
948
+       const loading = this.$loading({
949
+          lock: true,
950
+          text: 'Loading',
951
+          spinner: 'el-icon-loading',
952
+          background: 'rgba(0, 0, 0, 0.7)'
953
+        })
954
+       var params = {
955
+          warehousing_info_id:this.order_id,
956
+        }
957
+
958
+       toReturnCheckWarehouseInfo(params).then(response=>{
959
+          if(response.data.state == 1){
960
+             this.$message.success(response.data.data.msg)
961
+             loading.close()
962
+             this.$router.back(-1)
963
+          }else{
964
+            this.$message.error(response.data.msg)
965
+            loading.close()
966
+            this.$router.back(-1)
967
+          }
968
+       })
969
+     },
970
+     getTimeOne(val) {
971
+        if(val < 0){
972
+          return ""
973
+        }
974
+        if(val == ""){
975
+        return ""
976
+        }else {
977
+        return uParseTime(val, '{y}-{m}-{d}')
978
+        }
979
+     },
874 980
   },
875 981
   created() {
876 982
     this.GetConfigInfo();
877 983
     this.propForm.goodUnit = this.$store.getters.good_unit;
878 984
     const order_id = this.$route.query.id;
985
+    this.order_id = order_id
879 986
     var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
880 987
     var is_sys = parseInt(this.$route.query.is_sys)
988
+    this.is_check = parseInt(this.$route.query.is_check)
989
+   
881 990
     if(supply_warehouse_id > 0){
882 991
       this.disabled = true
883 992
     }
884
-    if(is_sys == 12){
993
+    if(is_sys == 12 || this.is_check == 1){
885 994
       this.disabled = true
886 995
     }
887 996
     this.GetOrderDetail(order_id);

+ 46 - 4
src/xt_pages/stock/stockOutOrder.vue View File

@@ -109,7 +109,7 @@
109 109
         <el-button size="small" type="primary" @click="toExport"
110 110
           >导出</el-button
111 111
         >
112
-        <!-- <span>&nbsp;&nbsp;</span>
112
+        <span>&nbsp;&nbsp;</span>
113 113
         <label class="title"><span class="name">出库方式</span> :</label>
114 114
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
115 115
             <el-option
@@ -118,7 +118,18 @@
118 118
               :label="option.name"
119 119
               :value="option.id">
120 120
             </el-option>
121
-        </el-select>  -->
121
+        </el-select> 
122
+
123
+       <span>&nbsp;&nbsp;</span>
124
+          <label class="title"><span class="name">审核状态</span> :</label>
125
+          <el-select size="small" v-model="check_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeCheckType">
126
+              <el-option
127
+                v-for="(option, index) in checkList"
128
+                :key="index"
129
+                :label="option.name"
130
+                :value="option.id">
131
+              </el-option>
132
+          </el-select>
122 133
       </div>
123 134
 
124 135
       <el-table
@@ -171,6 +182,13 @@
171 182
           </template>
172 183
         </el-table-column>
173 184
 
185
+        <el-table-column label="审核状态" align="center">
186
+          <template slot-scope="scope">
187
+            <span v-if="scope.row.is_check == 1">已审核</span>
188
+            <span v-if="scope.row.is_check == 2">未审核</span>
189
+          </template>
190
+        </el-table-column>
191
+
174 192
         <el-table-column label="操作" align="center" width="300px">
175 193
           <template slot-scope="scope">
176 194
             <el-tooltip
@@ -997,6 +1015,13 @@ export default {
997 1015
         { id: 2, name: "自动出库" },
998 1016
         { id: 3, name: "调拨出库" },
999 1017
       ],
1018
+      check_type:0,
1019
+      checkList:[
1020
+       {id:0,name:"全部"},
1021
+       {id:1,name:"已审核"},
1022
+       {id:2,name:"未审核"},
1023
+      ],
1024
+      check_id: 0,
1000 1025
     };
1001 1026
   },
1002 1027
   methods: {
@@ -1033,6 +1058,7 @@ export default {
1033 1058
         keywords: this.searchKey,
1034 1059
         storehouse_id: this.storehouse_id,
1035 1060
         way_type: this.way_type,
1061
+        check_type:this.check_type,
1036 1062
       };
1037 1063
       this.warehouseOutDate = [];
1038 1064
       getWarehouseOutList(Params).then((response) => {
@@ -1062,6 +1088,7 @@ export default {
1062 1088
         type: this.type,
1063 1089
         storehouse_id: this.storehouse_id,
1064 1090
         way_type: this.way_type,
1091
+        check_type:this.check_type,
1065 1092
       };
1066 1093
       this.warehouseOutDate = [];
1067 1094
       getWarehouseOutList(Params).then((response) => {
@@ -1195,7 +1222,8 @@ export default {
1195 1222
           "&is_sys=" +
1196 1223
           row.is_sys +
1197 1224
           "&supply_cancel_out_id=" +
1198
-          row.supply_cancel_out_id,
1225
+          row.supply_cancel_out_id+
1226
+          "&type="+row.type+"&is_check="+row.is_check,
1199 1227
       });
1200 1228
     },
1201 1229
     handleDelete: function (index, row) {
@@ -1207,6 +1235,10 @@ export default {
1207 1235
         this.$message.error("采购出库数据不能删除!");
1208 1236
         return false;
1209 1237
       }
1238
+      if(row.is_check == 1){
1239
+        this.$message.error("已审核的单据不能删除!")
1240
+        return false
1241
+      }
1210 1242
       const ids = [];
1211 1243
       ids.push(row.id);
1212 1244
       const idStr = ids.join(",");
@@ -1271,6 +1303,10 @@ export default {
1271 1303
       const ids = [];
1272 1304
       const idOne = [];
1273 1305
       for (let i = 0; i < this.selectedTableData.length; i++) {
1306
+        if(this.selectedTableData[i].is_check == 1){
1307
+          this.$message.error("已审核单据不能删除!")
1308
+          return false
1309
+        }
1274 1310
         if (this.selectedTableData[i].is_sys == 1) {
1275 1311
           this.$message.error("自动出库数据不能删除!");
1276 1312
           return false;
@@ -1281,7 +1317,10 @@ export default {
1281 1317
         }
1282 1318
         if (this.selectedTableData[i].is_sys == 0) {
1283 1319
           ids.push(this.selectedTableData[i].id);
1284
-          idOne.push(this.selectedTableData[i].supply_cancel_out_id);
1320
+          if(this.selectedTableData[i].supply_cancel_out_id >0){
1321
+            idOne.push(this.selectedTableData[i].supply_cancel_out_id);
1322
+          }
1323
+          
1285 1324
         }
1286 1325
       }
1287 1326
       if (idOne.length > 0) {
@@ -1989,6 +2028,9 @@ export default {
1989 2028
     changeWay() {
1990 2029
       this.GetWarehouseOut();
1991 2030
     },
2031
+    changeCheckType(){
2032
+      this.GetWarehouseOut()
2033
+    }
1992 2034
   },
1993 2035
 };
1994 2036
 </script>

+ 176 - 55
src/xt_pages/stock/stockOutOrderAdd.vue View File

@@ -21,11 +21,27 @@
21 21
           class="filter-item"
22 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 40
       </div>
25 41
     </div>
26 42
 
27 43
     <div class="app-container">
28
-    
44
+
29 45
 
30 46
       <stock-in-dialog
31 47
         ref="dialog" :propForm="propForm"
@@ -61,7 +77,7 @@
61 77
         ></el-date-picker>
62 78
       </div>
63 79
 
64
-    
80
+
65 81
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
66 82
         <el-table
67 83
           :data="recordInfo.recordData"
@@ -103,7 +119,7 @@
103 119
             </template>
104 120
 
105 121
             <template slot-scope="scope">
106
-             
122
+
107 123
 
108 124
               <el-form-item style="padding-top: 20px">
109 125
                 <el-input
@@ -114,8 +130,8 @@
114 130
               </el-form-item>
115 131
             </template>
116 132
           </el-table-column>
117
-      
118
-          
133
+
134
+
119 135
           <el-table-column width="140" align="center">
120 136
             <template slot="header" slot-scope="scope">
121 137
               <span>规格&单位<span style="color: red">*</span></span>
@@ -126,7 +142,7 @@
126 142
               </el-form-item>
127 143
             </template>
128 144
           </el-table-column>
129
-          
145
+
130 146
           <el-table-column  width="150" align="center">
131 147
             <template slot="header" slot-scope="scope">
132 148
               <span>剩余库存</span>
@@ -145,7 +161,7 @@
145 161
               </el-form-item>
146 162
             </template>
147 163
           </el-table-column>
148
-      
164
+
149 165
 
150 166
          <el-table-column  width="150" align="center">
151 167
             <template slot="header" slot-scope="scope">
@@ -159,7 +175,7 @@
159 175
               >
160 176
                 <el-input
161 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 179
                   placeholder="请输入出库数量"
164 180
                   type="number"
165 181
                   v-model="scope.row.count"
@@ -178,9 +194,9 @@
178 194
                   :value="option.admin_user_id">
179 195
                 </el-option>
180 196
                </el-select>
181
-            </template>   
197
+            </template>
182 198
           </el-table-column>
183
-<!-- 
199
+<!--
184 200
           <el-table-column  width="150" align="center">
185 201
             <template slot="header" slot-scope="scope">
186 202
               <span>进货价</span>
@@ -238,7 +254,7 @@
238 254
                   :value="option.id">
239 255
                 </el-option>
240 256
                </el-select>
241
-            </template>   
257
+            </template>
242 258
           </el-table-column>
243 259
 
244 260
          <el-table-column label="生产日期"  width="150" align="center">
@@ -268,7 +284,7 @@
268 284
               ></el-date-picker>
269 285
             </template>
270 286
           </el-table-column>
271
-         
287
+
272 288
           <el-table-column  width="150" align="center">
273 289
             <template slot="header" slot-scope="scope">
274 290
             <span>批准文号<span style="color: red" ></span></span>
@@ -277,7 +293,7 @@
277 293
               <el-input placeholder="请输入批准文号" v-model="scope.row.license_number" ></el-input>
278 294
           </template>
279 295
         </el-table-column>
280
-       
296
+
281 297
         <el-table-column align="center" width="150">
282 298
             <template slot="header" slot-scope="scope">
283 299
               <span>注册编码</span>
@@ -299,7 +315,7 @@
299 315
                   :value="option.id">
300 316
                 </el-option>
301 317
                </el-select>
302
-            </template>   
318
+            </template>
303 319
           </el-table-column>
304 320
 
305 321
 
@@ -350,7 +366,7 @@
350 366
 
351 367
 <script>
352 368
 import { uParseTime } from "@/utils/tools";
353
-import {  postWarehouseOut,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber } from "@/api/stock";
369
+import {  postWarehouseOut,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber,checkWarehouseOut } from "@/api/stock";
354 370
 
355 371
 import BreadCrumb from "../components/bread-crumb";
356 372
 import StockInDialog from './Dialog/stockInDialog'
@@ -380,8 +396,7 @@ export default {
380 396
       },
381 397
       tableRules: {
382 398
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
383
-        count: [{ required: true, message: "数量不能为空", trigge: "blur" }],
384
-        // number:[{ required: true, message: "批号不能为空",trigge:"blur"}],
399
+        count: [{ required: true, message: "数量不能为空", trigger: "blur" }],
385 400
       },
386 401
       ruleForm: {
387 402
         manufacturer: [
@@ -413,6 +428,11 @@ export default {
413 428
       storehouse_id:"",
414 429
       list:[],
415 430
       doctorList:[],
431
+      showCheck:false,
432
+      showReturnCheck:false,
433
+      warehouseOut:{},
434
+      warehouseOut_id:0,
435
+      is_check:0,
416 436
     };
417 437
   },
418 438
   methods: {
@@ -421,7 +441,7 @@ export default {
421 441
       this.propForm.goods = []
422 442
 
423 443
       this.$refs.dialog.hide()
424
-    
444
+
425 445
       if (val.selectedGoodInfo.length > 0) {
426 446
         for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
427 447
           if (i == 0) {
@@ -444,7 +464,7 @@ export default {
444 464
 
445 465
       this.currentIndex = -1
446 466
 
447
-    
467
+
448 468
     },
449 469
     cancle: function() {
450 470
       this.$refs.dialog.hide();
@@ -525,6 +545,7 @@ export default {
525 545
       tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
526 546
       tempObj["buy_price"]= ""
527 547
       tempObj["stock_count"] = ""
548
+      tempObj["id"] = 0
528 549
       tempObj['register_number'] = ''
529 550
       this.recordInfo.recordData.push(tempObj);
530 551
     },
@@ -552,6 +573,16 @@ export default {
552 573
         return "";
553 574
       }
554 575
     },
576
+   getTimeOne(val) {
577
+      if(val < 0){
578
+        return ""
579
+      }
580
+      if(val == ""){
581
+      return ""
582
+      }else {
583
+      return uParseTime(val, '{y}-{m}-{d}')
584
+      }
585
+    },
555 586
     showDialog(index, row) {
556 587
       const loading = this.$loading({
557 588
         lock: true,
@@ -610,7 +641,7 @@ export default {
610 641
             this.propForm.goods.push(goodObj)
611 642
 
612 643
           }
613
-       
644
+
614 645
         }
615 646
       )
616 647
 
@@ -639,25 +670,28 @@ export default {
639 670
             this.$message.success("请添加出库商品");
640 671
             return;
641 672
           }
642
-       
673
+
643 674
           for(let i=0;i<this.recordInfo.recordData.length;i++){
644 675
              if(this.recordInfo.recordData[i].dealer == ""){
645 676
                 this.recordInfo.recordData[i].dealer = 0
646 677
              }
647 678
             if(this.recordInfo.recordData[i].expiry_date == "" || this.recordInfo.recordData[i].expiry_date == undefined){
648 679
               this.recordInfo.recordData[i].expiry_date = ""
649
-            } 
680
+            }
650 681
             if(this.recordInfo.recordData[i].product_date == "" || this.recordInfo.recordData[i].product_date == undefined){
651 682
               this.recordInfo.recordData[i].product_date = ""
652 683
             }
653
-           
684
+
654 685
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
655 686
 
656 687
              this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString()
657 688
 
658 689
              this.recordInfo.recordData[i].buy_price = this.recordInfo.recordData[i].buy_price.toString()
690
+
691
+              this.recordInfo.recordData[i].count = this.recordInfo.recordData[i].count.toString()
692
+
659 693
           }
660
-       
694
+
661 695
           for(let i=0;i<this.recordInfo.recordData.length;i++){
662 696
             for(let j=0;j<this.manufacturerList.length;j++){
663 697
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
@@ -669,13 +703,13 @@ export default {
669 703
                   this.recordInfo.recordData[i].dealer = this.dealerList[z].id
670 704
               }
671 705
             }
672
-          
706
+
673 707
             for(let y=0;y<this.numberList.length;y++){
674 708
                if(this.recordInfo.recordData[i].number == this.numberList[y].id){
675 709
                    this.recordInfo.recordData[i].number = this.numberList[y].number
676 710
                }
677 711
             }
678
-            
712
+
679 713
             for(let s=0;s<this.doctorList.length;s++){
680 714
 
681 715
               if(this.recordInfo.recordData[i].admin_user_id == this.doctorList[s].user_name){
@@ -687,8 +721,7 @@ export default {
687 721
           const params = {
688 722
             stockOut: this.recordInfo.recordData
689 723
           };
690
-         
691
-         
724
+
692 725
           const loading = this.$loading({
693 726
             lock: true,
694 727
             text: 'Loading',
@@ -701,7 +734,8 @@ export default {
701 734
             this.form.dealer,
702 735
             this.form.manufacturer,
703 736
             this.type,
704
-            this.storehouse_id
737
+            this.storehouse_id,
738
+            this.warehouseOut_id
705 739
           ).then(response => {
706 740
             if (response.data.state == 0) {
707 741
               this.$message.error("库存不足")
@@ -713,18 +747,51 @@ export default {
713 747
                var specification_name = response.data.data.specification_name
714 748
                var storehose_name = response.data.data.storehose_name
715 749
                var str = storehose_name + " " + good_name +"*" + specification_name +"无库存,请入库"
716
-             
750
+               var warehouseOut =  response.data.data.warehouseOut
751
+               this.warehouseOut = warehouseOut
752
+              this.warehouseOut_id = warehouseOut.id
753
+
717 754
                if(msg == 1){
718 755
                   this.$message.error(str)
719 756
                }
720
-              
757
+
721 758
                if(msg == 2){
722
-                 this.$message.success("出库成功");
759
+                 this.$message.success("保存成功");
723 760
                  this.recordInfo.recordData = [];
724
-                 this.$router.back(-1);
761
+                 var warehouseOutInfoList =  response.data.data.warehouseOutInfoList
762
+                 var manufacturerList = response.data.data.manufacturerList
763
+                 var dealerList = response.data.data.dealerList
764
+
765
+                 var doctorList = response.data.data.doctorList
766
+                 for(let i=0;i<warehouseOutInfoList.length;i++){
767
+                    for(let j=0;j<manufacturerList.length;j++){
768
+                       if(warehouseOutInfoList[i].manufacturer_id == manufacturerList[i].id){
769
+                          warehouseOutInfoList[i].manufacturer_id = manufacturerList[i].manufacturer_name
770
+                       }
771
+                    }
772
+                    for(let z=0;z<dealerList.length;z++){
773
+                      if(warehouseOutInfoList[i].dealer_id == dealerList[z].id){
774
+                         warehouseOutInfoList[i].dealer_id = dealerList[z].dealer_name
775
+                      }
776
+                    }
777
+                    for(let s=0;s<doctorList.length;s++){
778
+                       if(warehouseOutInfoList[i].admin_user_id == doctorList[s].admin_user_id){
779
+                          warehouseOutInfoList[i].admin_user_id = doctorList[s].user_name
780
+                       }
781
+                    }
782
+                    warehouseOutInfoList[i].good_name = warehouseOutInfoList[i].GoodInfo.good_name
783
+
784
+                    warehouseOutInfoList[i].name =  warehouseOutInfoList[i].GoodInfo.specification_name +"/"+ warehouseOutInfoList[i].GoodInfo.packing_unit
785
+                    warehouseOutInfoList[i].expiry_date = this.getTimeOne(warehouseOutInfoList[i].expiry_date)
786
+                    warehouseOutInfoList[i].product_date = this.getTimeOne(warehouseOutInfoList[i].product_date)
787
+
788
+                 }
789
+                 this.recordInfo.recordData = warehouseOutInfoList
790
+
791
+                 this.showCheck = true
725 792
                }
726 793
                loading.close()
727
-             
794
+
728 795
             }
729 796
           });
730 797
         } else {
@@ -747,7 +814,7 @@ export default {
747 814
       postSearchGoodList(key,this.storehouse_id).then(response => {
748 815
         if (response.data.state == 1) {
749 816
             var list = response.data.data.list
750
-          
817
+
751 818
             this.goodList = list
752 819
             var manufacturerList = response.data.data.manufacturerList
753 820
             this.manufacturerList = manufacturerList
@@ -766,8 +833,8 @@ export default {
766 833
                 }
767 834
               }
768 835
             }
769
-         
770
-          
836
+
837
+
771 838
             cb(this.goodList)
772 839
         } else {
773 840
           cb([])
@@ -778,15 +845,12 @@ export default {
778 845
       this.currentIndex = val
779 846
     },
780 847
     handleSelect(val){
781
-      //  console.log("val232332322323323232323",val)
782 848
         var arr = []
783
-       
784 849
         for(let i=0;i<this.recordInfo.recordData.length;i++){
785 850
            arr.push(this.recordInfo.recordData[i].good_id)
786 851
         }
787
-       
788 852
         var str = arr.join(",")
789
-       
853
+
790 854
         if(str.indexOf(val.id)!=-1){
791 855
           this.$message.error("该耗材已存在列表中")
792 856
           return
@@ -800,8 +864,7 @@ export default {
800 864
 
801 865
         for(let i=0;i<this.recordInfo.recordData.length;i++){
802 866
           if(this.currentIndex == i){
803
-           
804
-            this.recordInfo.recordData[i].good_type_id = val.id
867
+            this.recordInfo.recordData[i].id = 0
805 868
             this.recordInfo.recordData[i].good_name = val.good_name
806 869
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
807 870
             this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
@@ -816,7 +879,7 @@ export default {
816 879
             }else{
817 880
               this.recordInfo.recordData[i].price = val.packing_price
818 881
             }
819
-           
882
+
820 883
             this.recordInfo.recordData[i].specification_name = val.specification_name
821 884
             this.recordInfo.recordData[i].good_id = val.id
822 885
             if(val.dealer == 0){
@@ -826,8 +889,8 @@ export default {
826 889
             }
827 890
          }
828 891
 
829
-       
830
-      }    
892
+
893
+      }
831 894
     },
832 895
 
833 896
     getStockBatchNumber(id){
@@ -837,7 +900,7 @@ export default {
837 900
       getStockBatchNumber(params).then(response=>{
838 901
         if(response.data.state == 1){
839 902
           var list = response.data.data.list
840
- 
903
+
841 904
           this.numberList = list
842 905
         }
843 906
      })
@@ -850,11 +913,11 @@ export default {
850 913
          if(index == i){
851 914
           this.recordInfo.recordData[i].warehouse_info_id = val.number
852 915
          }
853
-       }  
854
-    
916
+       }
917
+
855 918
     },
856 919
     getSupplyCount(count,sum_count,index){
857
-    
920
+
858 921
       if(sum_count < count){
859 922
         this.$message.error("出库数量不能大于剩余库存")
860 923
         for(let i=0;i<this.recordInfo.recordData.length;i++){
@@ -871,12 +934,70 @@ export default {
871 934
           return
872 935
         }
873 936
       }
874
- 
937
+
938
+    },
939
+    toCheck(){
940
+       const loading = this.$loading({
941
+          lock: true,
942
+          text: 'Loading',
943
+          spinner: 'el-icon-loading',
944
+          background: 'rgba(0, 0, 0, 0.7)'
945
+        })
946
+       var params = {
947
+         id:this.warehouseOut.id
948
+       }
949
+      checkWarehouseOut(params).then(response=>{
950
+        if(response.data.state == 1){
951
+          var msg = response.data.data.msg
952
+          var good_name = response.data.data.good_name
953
+          var specification_name = response.data.data.specification_name
954
+          var storehose_name = response.data.data.storehose_name
955
+          var str = storehose_name + " " + good_name +"*" + specification_name +"库存不足,请入库"
956
+          if(msg == 1){
957
+            this.$message.error(str)
958
+            loading.close()
959
+           }
960
+           if(msg == 2){
961
+            this.$message.success("审核成功!")
962
+            this.recordInfo.recordData = [];
963
+            this.$router.back(-1);
964
+            this.showCheck = false
965
+            this.showReturnCheck = true
966
+            loading.close()
967
+           }
968
+        }else{
969
+          this.$message.error("审核失败!")
970
+          loading.close()
971
+        }
972
+      })
973
+    },
974
+    toReturnCheck(){
975
+       const loading = this.$loading({
976
+          lock: true,
977
+          text: 'Loading',
978
+          spinner: 'el-icon-loading',
979
+          background: 'rgba(0, 0, 0, 0.7)'
980
+        })
981
+       var params = {
982
+         id:this.warehouseOut_id,
983
+       }
984
+      returnCheckWarehouseOut(params).then(response=>{
985
+         if(response.data.state == 1){
986
+            var list = response.dat.data.list
987
+            this.$message.success("反审核成功")
988
+             this.showCheck = true
989
+            this.showReturnCheck = false
990
+            loading.close()
991
+         }else{
992
+          this.$message.error("反审核失败!")
993
+          loading.close()
994
+         }
995
+      })
875 996
     }
876
-    
997
+
877 998
   },
878 999
   created() {
879
-   
1000
+
880 1001
     var nowDate = new Date();
881 1002
     var nowYear = nowDate.getFullYear();
882 1003
     var nowMonth = nowDate.getMonth() + 1;
@@ -902,13 +1023,13 @@ export default {
902 1023
     tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
903 1024
     tempObj["buy_price"]= ""
904 1025
     tempObj["stock_count"] = ""
1026
+    tempObj["id"] = 0
905 1027
     tempObj['register_number'] = ''
906 1028
     this.recordInfo.recordData.push(tempObj);
907 1029
     this.GetConfigInfo();
908
-  
909 1030
     this.propForm.goodUnit = this.$store.getters.good_unit;
910 1031
     this.unitList =  getDataConfig('hemodialysis','units')
911
- 
1032
+
912 1033
   }
913 1034
 };
914 1035
 </script>

+ 1 - 0
src/xt_pages/stock/stockOutOrderDetailPrint.vue View File

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

+ 79 - 6
src/xt_pages/stock/stockOutOrderEdit.vue View File

@@ -7,7 +7,9 @@
7 7
 
8 8
       <div style="float:right;">
9 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 13
       </div>
12 14
     </div>
13 15
 
@@ -257,7 +259,7 @@
257 259
             <span>批准文号<span style="color: red"></span></span>
258 260
           </template>
259 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 263
           </template>
262 264
         </el-table-column>
263 265
 
@@ -324,7 +326,7 @@
324 326
 <script>
325 327
   import { uParseTime } from '@/utils/tools'
326 328
 
327
-  import { deleteWarehouseOutInfo, editWarehouseoutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getSingleOutOrderDetail,getStockBatchNumber } from '@/api/stock'
329
+  import { deleteWarehouseOutInfo, editWarehouseoutInfo,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getSingleOutOrderDetail,getStockBatchNumber,checkWarehouseOut,returnCheckWarehouseOut } from '@/api/stock'
328 330
   import BreadCrumb from '../components/bread-crumb'
329 331
   import StockInDialog from './Dialog/stockInDialog'
330 332
 
@@ -397,6 +399,8 @@
397 399
         storelist:[],
398 400
         storehouse_id:"",
399 401
         doctorList:[],
402
+        showCheck:false,
403
+        showReturnCheck:false,
400 404
       }
401 405
     },
402 406
     methods: {
@@ -484,6 +488,10 @@
484 488
           this.$message.error("采购出库数据不能新增!")
485 489
           return
486 490
         }
491
+        if(this.is_check == 1){
492
+          this.$message.error("已审核的数据不能新增")
493
+          return
494
+        }
487 495
         this.stockTrue = false
488 496
         if(this.stockShow == true){
489 497
          this.$message.error("自动出库数据无法编辑")
@@ -516,6 +524,11 @@
516 524
           return
517 525
         }
518 526
 
527
+        if(this.is_check == 1){
528
+          this.$message.error("已审核的数据不能删除!")
529
+          return
530
+        }
531
+
519 532
         if(this.stockShow == true){
520 533
          this.$message.error("自动出库数据无法删除")
521 534
          return
@@ -697,7 +710,7 @@
697 710
               } else {
698 711
                 if(response.data.data.msg == 1){
699 712
                   this.$message.success('保存成功')
700
-                  this.$router.back(-1)
713
+                  // this.$router.back(-1)
701 714
                   loading.close()
702 715
                 }
703 716
 
@@ -904,7 +917,65 @@
904 917
           return
905 918
         }
906 919
       }
907
-     }
920
+     },
921
+     toCheck(){
922
+       const loading = this.$loading({
923
+          lock: true,
924
+          text: "Loading",
925
+          spinner: "el-icon-loading",
926
+          background: "rgba(0, 0, 0, 0.7)"
927
+        });
928
+       var params = {
929
+         id:parseInt(this.$route.query.id)
930
+       }
931
+      checkWarehouseOut(params).then(response=>{
932
+        if(response.data.state == 1){
933
+          var msg = response.data.data.msg
934
+          var good_name = response.data.data.good_name
935
+          var specification_name = response.data.data.specification_name
936
+          var storehose_name = response.data.data.storehose_name
937
+          var str = storehose_name + " " + good_name +"*" + specification_name +"库存不足,请入库"
938
+          if(msg == 1){
939
+            this.$message.error(str)
940
+            loading.close()
941
+           } 
942
+           if(msg == 2){
943
+            this.$message.success("审核成功!")
944
+            this.recordInfo.recordData = [];
945
+            this.is_check = 1
946
+            this.$router.back(-1);
947
+            loading.close()
948
+           }
949
+        }else{
950
+          this.$message.error("审核失败!")
951
+          loading.close()
952
+        }
953
+      }) 
954
+    },
955
+    toReturnCheck(){
956
+       const loading = this.$loading({
957
+          lock: true,
958
+          text: "Loading",
959
+          spinner: "el-icon-loading",
960
+          background: "rgba(0, 0, 0, 0.7)"
961
+        });
962
+       var params = {
963
+         id:parseInt(this.$route.query.id),
964
+       }
965
+      returnCheckWarehouseOut(params).then(response=>{
966
+         if(response.data.state == 1){
967
+            var list = response.data.data.list
968
+            this.$message.success("反审核成功")
969
+            this.is_check = 2
970
+            this.$router.back(-1);
971
+            loading.close()
972
+         }else{
973
+           this.$message.error("反审核失败!")
974
+           loading.close()
975
+         }
976
+      })
977
+    }
978
+
908 979
     },
909 980
     created() {
910 981
       // var nowDate = new Date();
@@ -917,14 +988,16 @@
917 988
       //   (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
918 989
       //   "-" +
919 990
       //   (nowDay < 10 ? "0" + nowDay : nowDay);
991
+      this.is_check = parseInt(this.$route.query.is_check) 
920 992
       this.propForm.goodUnit = this.$store.getters.good_unit
921 993
       const order_id = this.$route.query.id
994
+      
922 995
       this.getSingleOutOrderDetail(order_id)
923 996
       var is_sys = this.$route.query.is_sys
924 997
       if(is_sys == 0){
925 998
         this.stockShow = false
926 999
       }
927
-      if(is_sys == 1){
1000
+      if(is_sys == 1 ||  this.is_check == 1){
928 1001
         this.stockShow = true
929 1002
       }
930 1003
       if(is_sys == 12){

+ 2 - 2
src/xt_pages/stock/stockQuery.vue View File

@@ -184,7 +184,7 @@
184 184
 
185 185
        <el-table-column label="总库存量" align="center">
186 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 189
               getWareInfo(scope.row.xt_warehouse_info) -
190 190
               getAutoCount(scope.row.id) -
@@ -192,7 +192,7 @@
192 192
               getCancelCount(scope.row.id)
193 193
               }}
194 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 196
                {{getOverFlushInfo(scope.row.xt_warehouse_info)}}
197 197
            </span>
198 198
          </template>

+ 3 - 6
src/xt_pages/supply/components/addGoodOrder.vue View File

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

+ 25 - 30
src/xt_pages/user/dialysisSolution.vue View File

@@ -397,14 +397,7 @@
397 397
               ></el-input>
398 398
             </el-form-item>
399 399
           </el-col>
400
-          <el-col :span="8" v-if="isShows('置换量')" v-show="zhiShow">
401
-            <el-form-item label="置换量(L) : " prop="replacement_total">
402
-              <el-input
403
-                v-model="addPlan.replacement_total"
404
-                type="number"
405
-              ></el-input>
406
-            </el-form-item>
407
-          </el-col>
400
+         
408 401
 
409 402
           <el-col :span="8" v-if="isShows('钾')">
410 403
             <el-form-item label="钾(mmol/L): " prop="kalium">
@@ -517,15 +510,18 @@
517 510
               <el-input v-model="addPlan.special_medicine_other"></el-input>
518 511
             </el-form-item>
519 512
           </el-col>
520
-
513
+           <el-col :span="8" v-if="isShows('置换量') && (addPlan.mode == 2 || addPlan.mode == 5 || addPlan.mode == 12)">
514
+            <el-form-item label="置换量(L) : " prop="replacement_total">
515
+              <el-input
516
+                v-model="addPlan.replacement_total"
517
+                type="number"
518
+              ></el-input>
519
+            </el-form-item>
520
+          </el-col>
521 521
           <el-col :span="8">
522 522
             <el-form-item
523
-              label="置换液:"
524
-              v-if="
525
-                isShows('置换液') &&
526
-                  this.$store.getters.xt_user.template_info.template_id != 6
523
+              label="置换液:" v-if="isShows('置换液') &&   (addPlan.mode == 2 || addPlan.mode == 5 || addPlan.mode == 12)
527 524
               "
528
-              v-show="huShow"
529 525
             >
530 526
               <el-select
531 527
                 v-model="addPlan.displace_liqui_part"
@@ -541,11 +537,10 @@
541 537
               </el-select>
542 538
             </el-form-item>
543 539
 
544
-            <el-form-item
540
+            <!-- <el-form-item
545 541
               label="置换方式:"
546 542
               v-if="
547
-                isShows('置换液') &&
548
-                  this.$store.getters.xt_user.template_info.template_id == 6
543
+                isShows('置换液')   && (addPlan.mode == 2 || addPlan.mode == 5 || addPlan.mode == 12)
549 544
               "
550 545
             >
551 546
               <el-select
@@ -560,10 +555,10 @@
560 555
                   :value="option.id"
561 556
                 ></el-option>
562 557
               </el-select>
563
-            </el-form-item>
558
+            </el-form-item> -->
564 559
           </el-col>
565 560
 
566
-          <el-col :span="8" v-if="isShows('置换液总量')" v-show="totalShow">
561
+          <el-col :span="8" v-if="isShows('置换液总量')  && (addPlan.mode == 2 || addPlan.mode == 5 || addPlan.mode == 12)">
567 562
             <el-form-item label="置换液总量(L)">
568 563
               <el-input v-model="addPlan.displace_liqui_value"></el-input>
569 564
             </el-form-item>
@@ -900,7 +895,7 @@ export default {
900 895
         epo:"",
901 896
         epo_count:"",
902 897
         max_ultrafiltration_rate:"",
903
-   
898
+        
904 899
       },
905 900
       childPlan: {
906 901
         mode: '',
@@ -1406,7 +1401,7 @@ export default {
1406 1401
                 type: 'success',
1407 1402
                 duration: 2000
1408 1403
               })
1409
-              this.$refs[formName].resetFields()
1404
+              
1410 1405
               this.dialogFormVisible = false
1411 1406
               this.tableData[this.current_index].doctor =
1412 1407
                 response.data.data.solution.doctor
@@ -1415,6 +1410,7 @@ export default {
1415 1410
               this.tableData[this.current_index].initiate_mode =
1416 1411
                 response.data.data.solution.initiate_mode
1417 1412
               this.current_index = -1
1413
+              this.$refs[formName].resetFields()
1418 1414
               return false
1419 1415
             }
1420 1416
           })
@@ -1489,7 +1485,7 @@ export default {
1489 1485
           }
1490 1486
           this.addPlan.dialysis_dialyszers = this.dialysis_dialyszers
1491 1487
           this.addPlan.dialysis_irrigation = this.dialysis_irrigation
1492
-
1488
+          this.addPlan.mode_id = parseInt(this.addPlan.mode_id)
1493 1489
           editPatientDialysisSolution(this.patientID,this.addPlan.id,this.addPlan, mode).then(response => {
1494 1490
             if (response.data.state == 0) {
1495 1491
               this.$message.error(response.data.msg)
@@ -1501,10 +1497,8 @@ export default {
1501 1497
                 type: 'success',
1502 1498
                 duration: 2000
1503 1499
               })
1504
-              this.$refs[formName].resetFields()
1505
-
1506 1500
               this.dialogVisible = false
1507
-
1501
+              // this.$refs[formName].resetFields()
1508 1502
               for (var dindex in response.data.data.solution) {
1509 1503
                 if (dindex == 'id') {
1510 1504
                   continue
@@ -1517,6 +1511,7 @@ export default {
1517 1511
               // this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time;
1518 1512
 
1519 1513
               this.current_index = -1
1514
+              this.fetchPatientDialysisSolutions()
1520 1515
               return false
1521 1516
             }
1522 1517
           })
@@ -1531,6 +1526,7 @@ export default {
1531 1526
           const mode = '1'
1532 1527
           this.addPlan.dialysis_dialyszers = this.dialysis_dialyszers
1533 1528
           this.addPlan.dialysis_irrigation = this.dialysis_irrigation
1529
+          this.addPlan.mode_id = parseInt(this.addPlan.mode_id)
1534 1530
           console.log("add",this.addPlan)
1535 1531
           createPatientDialysisSolution(
1536 1532
             this.patientID,
@@ -1547,13 +1543,14 @@ export default {
1547 1543
                 type: 'success',
1548 1544
                 duration: 2000
1549 1545
               })
1550
-              this.$refs[formName].resetFields()
1551 1546
               this.dialogVisible = false
1552
-              this.tableData.unshift(response.data.data.solution)
1547
+              // this.tableData.unshift(response.data.data.solution)
1553 1548
               if (this.tableData.length > 10) {
1554 1549
                 this.tableData.pop()
1555 1550
               }
1556 1551
               this.total += 1
1552
+              // this.$refs[formName].resetFields()
1553
+              this.fetchPatientDialysisSolutions()
1557 1554
               return false
1558 1555
             }
1559 1556
           })
@@ -1574,7 +1571,6 @@ export default {
1574 1571
     openEdit(index, row) {
1575 1572
       console.log("ro2333333",row)
1576 1573
       this.current_index = index
1577
-
1578 1574
       this.addPlan.id = row.id
1579 1575
       this.addPlan.mode = row.mode_id
1580 1576
       this.addPlan.mode_name = row.mode_name
@@ -1950,7 +1946,6 @@ export default {
1950 1946
 
1951 1947
     addPlanModeChange() {
1952 1948
       var thismode = parseInt(this.addPlan.mode)
1953
-      console.log("addplan22323",this.addPlan.mode)
1954 1949
       if(thismode == 2 || thismode == 5 || thismode ==12){
1955 1950
           this.zhiShow = true
1956 1951
           this.huShow= true
@@ -2201,7 +2196,7 @@ export default {
2201 2196
     this.plasmaSeparatorList = getDataConfig('hemodialysis','plasma_separator')
2202 2197
     this.bilirubinAdsorptionColumn = getDataConfig('hemodialysis','bilirubin_adsorption_column')
2203 2198
     this.queryParams.id = this.patientID
2204
-    // this.fetchAllDoctorAndNurse();
2199
+  
2205 2200
 
2206 2201
   }
2207 2202
 }