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

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

201
   })
201
   })
202
 }
202
 }
203
 
203
 
204
-export function postWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type, storehouse_id) {
204
+export function postWarehouse(data, warehousing_time, type, storehouse_id, warehousing_info_id) {
205
   return request({
205
   return request({
206
-    url: '/api/warehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
206
+    url: '/api/warehouse/create?warehousing_time=' + warehousing_time + '&type=' + type + '&storehouse_id=' + storehouse_id + '&warehousing_info_id=' + warehousing_info_id,
207
     method: 'post',
207
     method: 'post',
208
-    data: params
208
+    data: data
209
   })
209
   })
210
 }
210
 }
211
 
211
 
490
   })
490
   })
491
 }
491
 }
492
 
492
 
493
-export function editCancelStockInfo(params, cancel_stock_time, id, type, manufacturer_id, dealer_id) {
493
+export function editCancelStockInfo(params, cancel_stock_time, id, type, manufacturer_id, dealer_id, storehouse_id) {
494
   return request({
494
   return request({
495
-    url: '/api/cancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
495
+    url: '/api/cancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&storehouse_id=' + storehouse_id,
496
     method: 'post',
496
     method: 'post',
497
     data: params
497
     data: params
498
   })
498
   })
522
   })
522
   })
523
 }
523
 }
524
 
524
 
525
-export function postCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id) {
525
+export function postCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id, cancel_stock_id) {
526
   return request({
526
   return request({
527
-    url: '/api/cancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
527
+    url: '/api/cancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id + '&cancel_stock_id=' + cancel_stock_id,
528
     method: 'post',
528
     method: 'post',
529
     data: params
529
     data: params
530
   })
530
   })
578
 }
578
 }
579
 
579
 
580
 export function postGoodInformation(params) {
580
 export function postGoodInformation(params) {
581
-  console.log('PARMAS22', params)
582
   return request({
581
   return request({
583
     url: '/api/good/postgoodinformation',
582
     url: '/api/good/postgoodinformation',
584
     method: 'Post',
583
     method: 'Post',
1009
     params: params
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
       noCache: true
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
     path: '/patient/patient/hospitalSummary/print',
241
     path: '/patient/patient/hospitalSummary/print',
242
     component: () => import('@/xt_pages/user/hospitalSummaryPrint'),
242
     component: () => import('@/xt_pages/user/hospitalSummaryPrint'),
247
       title: 'templateSummary',
247
       title: 'templateSummary',
248
       noCache: true
248
       noCache: true
249
     }
249
     }
250
-  },
250
+  }
251
 
251
 
252
   ]
252
   ]
253
 }
253
 }

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

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

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

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

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

118
           <div>{{scope.row.medical_insurance_number}}</div>
118
           <div>{{scope.row.medical_insurance_number}}</div>
119
         </template>
119
         </template>
120
       </el-table-column>
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
       <el-table-column prop="date" label="药品本位码" width="100" align="center">
126
       <el-table-column prop="date" label="药品本位码" width="100" align="center">
122
         <template slot-scope="scope">
127
         <template slot-scope="scope">
123
           <div>{{scope.row.code}}</div>
128
           <div>{{scope.row.code}}</div>
1109
 
1114
 
1110
 
1115
 
1111
           if (results[i]['*拆零零售价'] === undefined) {
1116
           if (results[i]['*拆零零售价'] === undefined) {
1112
-                obj['retail_price'] = ''
1117
+                obj['min_price'] = ''
1113
               } else {
1118
               } else {
1114
            if (key == '*拆零零售价') {
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
                obj['retail_price'] = results[i][key].replace(/\s/g,"")
1128
                obj['retail_price'] = results[i][key].replace(/\s/g,"")
1116
               }
1129
               }
1117
            }
1130
            }
1430
         }
1443
         }
1431
        }
1444
        }
1432
        for(let i=0;i<tableData.length;i++){
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
        let params = {
1448
        let params = {
1436
           'drugs':tableData
1449
           'drugs':tableData

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

90
           >
90
           >
91
         </div>
91
         </div>
92
       </template>
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
         <el-button
94
         <el-button
95
           size="small"
95
           size="small"
96
           icon="el-icon-printer"
96
           icon="el-icon-printer"

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

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

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

377
                 :value="item.id"
377
                 :value="item.id"
378
                 :key="item.id"
378
                 :key="item.id"
379
               ></el-option>
379
               ></el-option>
380
-            </el-select>
380
+            </el-select> 
381
           </el-form-item>
381
           </el-form-item>
382
         </el-col>
382
         </el-col>
383
 
383
 
690
       symptomsOptions: [],
690
       symptomsOptions: [],
691
       internalFistulaOptions: [],
691
       internalFistulaOptions: [],
692
       vascularAccessOptions: [],
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
       actualTreatmentHourShow: '',
694
       actualTreatmentHourShow: '',
695
       vascularAccessDescOptions: [],
695
       vascularAccessDescOptions: [],
696
       catheterOptions: [],
696
       catheterOptions: [],

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

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

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

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

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

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

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

14
           <th width="76px">静脉压/动脉压({{monitores[0]&&monitores[0]['venous_pressure_type'] == 2 ? 'kpa' : 'mmHg'}})</th>
14
           <th width="76px">静脉压/动脉压({{monitores[0]&&monitores[0]['venous_pressure_type'] == 2 ? 'kpa' : 'mmHg'}})</th>
15
           <th v-if="isShow('血流量')" width="92px">血流量(ml/min)</th>
15
           <th v-if="isShow('血流量')" width="92px">血流量(ml/min)</th>
16
           <th v-if="isShow('跨膜压')" width="76px">跨膜压({{monitores[0]&&monitores[0]['transmembrane_pressure_type'] == 2 ? 'kpa' : 'mmHg'}})</th>
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
           <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>
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
           <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>
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
           <th v-if="isShow('钠浓度')" width="92px">钠浓度(mmol/L)</th>
21
           <th v-if="isShow('钠浓度')" width="92px">钠浓度(mmol/L)</th>
22
           <th v-if="isShow('透析液温度')" width="92px">透析液温度(℃)</th>
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
           <th v-if=" isShow('置换量') && (template_id == 43)" width="92px"> 置换量(ml/h)  </th>
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
           <th v-if=" isShow('SpO₂') && template_id != 6 && template_id != 10 && template_id != 11  " width="92px" > SpO₂(%) </th>
28
           <th v-if=" isShow('SpO₂') && template_id != 6 && template_id != 10 && template_id != 11  " width="92px" > SpO₂(%) </th>
29
           <th v-if="isShow('电导度')" width="92px">电导度(mS/m)</th>
29
           <th v-if="isShow('电导度')" width="92px">电导度(mS/m)</th>
30
           <th v-if="isShow('置换液流量') && template_id != 27" width="92px">置换液流量(ml/h)</th>
30
           <th v-if="isShow('置换液流量') && template_id != 27" width="92px">置换液流量(ml/h)</th>
32
           <th v-if="isShow('透析液流量')" width="92px">透析液流量(ml/h)</th>
32
           <th v-if="isShow('透析液流量')" width="92px">透析液流量(ml/h)</th>
33
           <th v-if="isShow('肝素用量余量')" width="92px">肝素用量余量(ml)</th>
33
           <th v-if="isShow('肝素用量余量')" width="92px">肝素用量余量(ml)</th>
34
           <th v-if="isShow('抗凝剂')" width="92px">抗凝剂</th>
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
           <th v-if="isShow('血容量')" width="92px">血容量(L)</th>
39
           <th v-if="isShow('血容量')" width="92px">血容量(L)</th>
37
           <th v-if="isShow('血温监测')" width="92px">血温监测</th>
40
           <th v-if="isShow('血温监测')" width="92px">血温监测</th>
38
           <th v-if="isShow('尿素监测')" width="92px">尿素监测</th>
41
           <th v-if="isShow('尿素监测')" width="92px">尿素监测</th>

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

878
                   setAdminUserES(
878
                   setAdminUserES(
879
                     prescription == null
879
                     prescription == null
880
                       ? 0
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
                   getAdminUser(
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
               </span>
894
               </span>
900
                   setAdminUserES(
898
                   setAdminUserES(
901
                     prescription == null
899
                     prescription == null
902
                       ? 0
900
                       ? 0
903
-                      : prescription.prescription_doctor
904
-                      ? prescription.prescription_doctor
901
+                      : prescription.creater
902
+                      ? prescription.creater
905
                       : ''
903
                       : ''
906
-                  )
907
-                "
904
+                  ) "
905
+               
908
                 alt=""
906
                 alt=""
909
                 srcset=""
907
                 srcset=""
910
                 v-else
908
                 v-else

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

156
                 ></label-box>
156
                 ></label-box>
157
 
157
 
158
                 <div style="display: flex; padding-left: 20px">
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
                   <div
171
                   <div
161
                     style="
172
                     style="
162
                       min-width: 200px;
173
                       min-width: 200px;
498
                           ) == -1
509
                           ) == -1
499
                         "
510
                         "
500
                       >
511
                       >
501
-                        {{ predialysis.blood_access_part_opera_name }}
512
+                        {{ predialysis.blood_access_part_opera_name }} 
502
                       </span>
513
                       </span>
503
                     </span>
514
                     </span>
504
                   </span>
515
                   </span>
858
               {{
869
               {{
859
                 monitor.blood_oxygen_saturation
870
                 monitor.blood_oxygen_saturation
860
                   ? monitor.blood_oxygen_saturation
871
                   ? monitor.blood_oxygen_saturation
861
-                  : "0"
872
+                  : ""
862
               }}
873
               }}
863
             </span>
874
             </span>
864
           </td>
875
           </td>
921
               <span v-if="advice.parent_id == 0">{{
932
               <span v-if="advice.parent_id == 0">{{
922
                 advice.execution_frequency
933
                 advice.execution_frequency
923
               }}</span>
934
               }}</span>
935
+              <span>{{
936
+                advice.remark
937
+              }}</span>
924
             </td>
938
             </td>
925
 
939
 
926
-            <td>
940
+            <td style="line-height: 30px;">
927
               <span v-if="setAdminUserES(advice.execution_staff) == ''">{{
941
               <span v-if="setAdminUserES(advice.execution_staff) == ''">{{
928
                 getAdminUser(advice.execution_staff)
942
                 getAdminUser(advice.execution_staff)
929
               }}</span>
943
               }}</span>
930
               <img
944
               <img
931
-                style="height: 40px"
945
+                style="height: 30px"
932
                 :src="setAdminUserES(advice.execution_staff)"
946
                 :src="setAdminUserES(advice.execution_staff)"
933
                 alt=""
947
                 alt=""
934
                 srcset=""
948
                 srcset=""
935
                 v-else
949
                 v-else
936
               />
950
               />
937
             </td>
951
             </td>
938
-            <td>
952
+            <td style="line-height: 30px;">
939
               <span v-if="setAdminUserES(advice.checker) == ''">{{
953
               <span v-if="setAdminUserES(advice.checker) == ''">{{
940
                 getAdminUser(advice.checker)
954
                 getAdminUser(advice.checker)
941
               }}</span>
955
               }}</span>
942
               <img
956
               <img
943
-                style="height: 40px"
957
+                style="height: 30px"
944
                 :src="setAdminUserES(advice.checker)"
958
                 :src="setAdminUserES(advice.checker)"
945
                 alt=""
959
                 alt=""
946
                 srcset=""
960
                 srcset=""
1121
     <!-- <div style="position: absolute; top: 1380px; left: 50%"></div> -->
1135
     <!-- <div style="position: absolute; top: 1380px; left: 50%"></div> -->
1122
     <div
1136
     <div
1123
       style="margin-top: 300px; padding-top: 50px"
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
         <div class="dialysis-print-order">
1141
         <div class="dialysis-print-order">
1128
           <div class="order-yy-name">{{ orgname }}</div>
1142
           <div class="order-yy-name">{{ orgname }}</div>
1129
           <div class="order-title">血液透析(滤过)记录表单</div>
1143
           <div class="order-title">血液透析(滤过)记录表单</div>
1556
         <table
1570
         <table
1557
           class="print-table"
1571
           class="print-table"
1558
           border="1"
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
           <tr style="height: 50px; text-align: left; border: none">
1575
           <tr style="height: 50px; text-align: left; border: none">
1562
             <td style="padding-left: 5px; border: none">
1576
             <td style="padding-left: 5px; border: none">
2001
           this.prescription = response.data.data.dialysisPrescription;
2015
           this.prescription = response.data.data.dialysisPrescription;
2002
           this.receiverTreatmentAccess =
2016
           this.receiverTreatmentAccess =
2003
             response.data.data.receiverTreatmentAccess;
2017
             response.data.data.receiverTreatmentAccess;
2004
-          this.assessmentafter = response.data.data.AssessmentAfterDislysis;
2018
+          this.assessmentafter = response.data.data.assessmentAfterDislysis;
2005
 
2019
 
2006
           this.sick_condition_arr.forEach((o) => {
2020
           this.sick_condition_arr.forEach((o) => {
2007
             if (this.receiverTreatmentAccess.sick_condition == o.id) {
2021
             if (this.receiverTreatmentAccess.sick_condition == o.id) {
2058
           this.monitors = response.data.data.monitors;
2072
           this.monitors = response.data.data.monitors;
2059
           this.summary = response.data.data.summary;
2073
           this.summary = response.data.data.summary;
2060
           this.org_template_info = response.data.data.org_template_info;
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
             for (let index = 0; index < nl; index++) {
2077
             for (let index = 0; index < nl; index++) {
2064
               this.monitors.push([]);
2078
               this.monitors.push([]);
2065
             }
2079
             }
2422
 .dialysis-print-order {
2436
 .dialysis-print-order {
2423
   width: 960px;
2437
   width: 960px;
2424
   margin: 0 auto;
2438
   margin: 0 auto;
2439
+  
2425
 }
2440
 }
2426
 
2441
 
2427
 .dialysis-print-order .order-yy-name {
2442
 .dialysis-print-order .order-yy-name {

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

813
         </table>-->
813
         </table>-->
814
         <table class="print-table" border="1">
814
         <table class="print-table" border="1">
815
           <tr style="text-align: center">
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
             </td>
818
             </td>
819
           </tr>
819
           </tr>
820
           <tr>
820
           <tr>
821
             <td style="width: 60px" rowspan="2">时间</td>
821
             <td style="width: 60px" rowspan="2">时间</td>
822
-            <td colspan="4">透析参数</td>
822
+            <td colspan="5">透析参数</td>
823
             <td colspan="5">生命体征</td>
823
             <td colspan="5">生命体征</td>
824
             <td colspan="2">治疗中病情变化</td>
824
             <td colspan="2">治疗中病情变化</td>
825
             <td style="width: 80px" rowspan="2">护士签名</td>
825
             <td style="width: 80px" rowspan="2">护士签名</td>
841
               <p style="height: 20px; line-height: 20px">脱水量</p>
841
               <p style="height: 20px; line-height: 20px">脱水量</p>
842
               <p style="height: 20px; line-height: 20px">ml</p>
842
               <p style="height: 20px; line-height: 20px">ml</p>
843
             </th>
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
               <p style="height: 20px; line-height: 20px">T</p>
849
               <p style="height: 20px; line-height: 20px">T</p>
846
               <p style="height: 20px; line-height: 20px">℃</p>
850
               <p style="height: 20px; line-height: 20px">℃</p>
847
             </th>
851
             </th>
853
               <p style="height: 20px; line-height: 20px">R</p>
857
               <p style="height: 20px; line-height: 20px">R</p>
854
               <p style="height: 20px; line-height: 20px">bpm</p>
858
               <p style="height: 20px; line-height: 20px">bpm</p>
855
             </th>
859
             </th>
856
-            <th style="width: 100px">
860
+            <th style="width: 90px">
857
               <p style="height: 20px; line-height: 20px">BP</p>
861
               <p style="height: 20px; line-height: 20px">BP</p>
858
               <p style="height: 20px; line-height: 20px">mmHg</p>
862
               <p style="height: 20px; line-height: 20px">mmHg</p>
859
             </th>
863
             </th>
906
                 }}
910
                 }}
907
               </span>
911
               </span>
908
             </td>
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
             <td>
922
             <td>
910
               <span v-if="getTime(monitor.operate_time) != ''">
923
               <span v-if="getTime(monitor.operate_time) != ''">
911
                 {{ monitor.temperature ? monitor.temperature : "0" }}
924
                 {{ monitor.temperature ? monitor.temperature : "0" }}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
     getWarehouseOut(good_id){
469
     getWarehouseOut(good_id){
449
       var total = 0
470
       var total = 0
450
       for(let i=0;i<this.wareOutList.length;i++){
471
       for(let i=0;i<this.wareOutList.length;i++){

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

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

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

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

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

6
       <div style="float:right;">
6
       <div style="float:right;">
7
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
9
+        <el-button size="small"  type="primary" @click="toCheck" v-if="is_check == 2" class="filter-item" >审 核</el-button>
10
+        <el-button size="small"  type="primary" @click="toReturnCheck" v-if="is_check == 1" class="filter-item" >反审核</el-button>
9
       </div>
11
       </div>
10
     </div>
12
     </div>
11
     <div class="app-container">
13
     <div class="app-container">
53
                     @select="handleSelect"
55
                     @select="handleSelect"
54
                     @input="changeDrugName(scope.$index)"
56
                     @input="changeDrugName(scope.$index)"
55
                     style="width:160px;"
57
                     style="width:160px;"
58
+                    :disabled="disabled"
56
                   >
59
                   >
57
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
60
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
58
                   <template slot-scope="{ item }">
61
                   <template slot-scope="{ item }">
69
             <template slot-scope="scope">
72
             <template slot-scope="scope">
70
               <el-form-item style="padding-top: 20px">
73
               <el-form-item style="padding-top: 20px">
71
                 <el-input
74
                 <el-input
75
+                
72
                   :disabled="true"
76
                   :disabled="true"
73
                   placeholder="请输入规格&单位"
77
                   placeholder="请输入规格&单位"
74
                   v-model="scope.row.name"
78
                   v-model="scope.row.name"
89
               >
93
               >
90
               <div style="display:flex;">
94
               <div style="display:flex;">
91
                 <el-input
95
                 <el-input
96
+                :disabled="disabled"
92
                  oninput="value=value.replace(/\D|^0/g,'')"
97
                  oninput="value=value.replace(/\D|^0/g,'')"
93
                   style="width:100px"
98
                   style="width:100px"
94
                   placeholder="请输入退库数量"
99
                   placeholder="请输入退库数量"
95
                   type="number"
100
                   type="number"
96
                   v-model="scope.row.count"
101
                   v-model="scope.row.count"
97
                 ></el-input>
102
                 ></el-input>
98
-                 <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
103
+                 <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px" :disabled="disabled">
99
                     <el-option
104
                     <el-option
100
                       v-for="(option, index) in unitList"
105
                       v-for="(option, index) in unitList"
101
                       :key="index"
106
                       :key="index"
119
                 style="padding-top: 17px"
124
                 style="padding-top: 17px"
120
               >
125
               >
121
                 <el-input
126
                 <el-input
127
+                 :disabled="disabled"
122
                   placeholder="请输入单价"
128
                   placeholder="请输入单价"
123
                   type="number"
129
                   type="number"
124
                   v-model="scope.row.price"
130
                   v-model="scope.row.price"
135
 
141
 
136
           <el-table-column width="200" align="center">
142
           <el-table-column width="200" align="center">
137
             <template slot="header" slot-scope="scope">
143
             <template slot="header" slot-scope="scope">
138
-              <span>批次<span style="color: red"></span></span>
144
+              <span>批次<span style="color: red">*</span></span>
139
             </template>
145
             </template>
140
             <template slot-scope="scope">
146
             <template slot-scope="scope">
141
               <el-form-item
147
               <el-form-item
142
-                :prop="'recordData.' + scope.$index + '.return_count'"
148
+                :prop="'recordData.' + scope.$index + '.batch_number'"
143
                 style="padding-top: 17px"
149
                 style="padding-top: 17px"
150
+                :rules="tableRules.batch_number"
144
               >
151
               >
145
-               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" :disabled="canCelShow">
152
+               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" :disabled="disabled" >
146
                   <el-option
153
                   <el-option
147
-                    v-for="(item,index) in numberList"
154
+                    v-for="(item,index) in scope.row.drug_warehouse_info"
148
                     :key="index"
155
                     :key="index"
149
                     :label="item.batch_number"
156
                     :label="item.batch_number"
150
                     :value="item.id">
157
                     :value="item.id">
163
                 :prop="'recordData.' + scope.$index + '.register_account'"
170
                 :prop="'recordData.' + scope.$index + '.register_account'"
164
                 style="padding-top: 17px"
171
                 style="padding-top: 17px"
165
               >
172
               >
166
-              <el-input v-model="scope.row.register_account"></el-input>
173
+              <el-input v-model="scope.row.register_account" :disabled="disabled"></el-input>
167
               </el-form-item>
174
               </el-form-item>
168
             </template>
175
             </template>
169
           </el-table-column>
176
           </el-table-column>
170
            <el-table-column label="生产厂家" width="160" align="center">
177
            <el-table-column label="生产厂家" width="160" align="center">
171
             <template slot-scope="scope">
178
             <template slot-scope="scope">
172
-               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
179
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商" :disabled="disabled">
173
                 <el-option
180
                 <el-option
174
                   v-for="(option, index) in manufacturerList"
181
                   v-for="(option, index) in manufacturerList"
175
                   :key="index"
182
                   :key="index"
191
                 placeholder="选择日期时间"
198
                 placeholder="选择日期时间"
192
                 format="yyyy-MM-dd"
199
                 format="yyyy-MM-dd"
193
                 value-format="yyyy-MM-dd"
200
                 value-format="yyyy-MM-dd"
201
+                :disabled="disabled"
194
               ></el-date-picker>
202
               ></el-date-picker>
195
             </template>
203
             </template>
196
           </el-table-column>
204
           </el-table-column>
204
                 placeholder="选择日期时间"
212
                 placeholder="选择日期时间"
205
                 format="yyyy-MM-dd"
213
                 format="yyyy-MM-dd"
206
                 value-format="yyyy-MM-dd"
214
                 value-format="yyyy-MM-dd"
215
+                :disabled="disabled"
207
               ></el-date-picker>
216
               ></el-date-picker>
208
             </template>
217
             </template>
209
           </el-table-column>
218
           </el-table-column>
211
 
220
 
212
         <el-table-column label="经销商" width="160" align="center">
221
         <el-table-column label="经销商" width="160" align="center">
213
             <template slot-scope="scope">
222
             <template slot-scope="scope">
214
-                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
223
+                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商" :disabled="disabled">
215
                 <el-option
224
                 <el-option
216
                   v-for="(option, index) in dealerList"
225
                   v-for="(option, index) in dealerList"
217
                   :key="index"
226
                   :key="index"
230
                 :prop="'recordData.' + scope.$index + '.remark'"
239
                 :prop="'recordData.' + scope.$index + '.remark'"
231
                 style="padding-top: 17px"
240
                 style="padding-top: 17px"
232
               >
241
               >
233
-              <el-input v-model="scope.row.remark"></el-input>
242
+              <el-input v-model="scope.row.remark" :disabled="disabled"></el-input>
234
               </el-form-item>
243
               </el-form-item>
235
             </template>
244
             </template>
236
           </el-table-column>
245
           </el-table-column>
278
 <script>
287
 <script>
279
   import { uParseTime } from '@/utils/tools'
288
   import { uParseTime } from '@/utils/tools'
280
 
289
 
281
-  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber  } from '@/api/drug/drug_stock'
290
+  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber,checkCancelDrugStock,returnDrugCancelStock  } from '@/api/drug/drug_stock'
282
   import BreadCrumb from '../../components/bread-crumb'
291
   import BreadCrumb from '../../components/bread-crumb'
283
   import DrugsStockDialog from './drugsStockDialog/index'
292
   import DrugsStockDialog from './drugsStockDialog/index'
284
   import {postSearchDrugList} from "@/api/data"
293
   import {postSearchDrugList} from "@/api/data"
294
+  import { getDataConfig } from "@/utils/data";
285
   export default {
295
   export default {
286
     components: { DrugsStockDialog, BreadCrumb },
296
     components: { DrugsStockDialog, BreadCrumb },
287
     name: 'cancelStockOrderEdit',
297
     name: 'cancelStockOrderEdit',
315
         tableRules: {
325
         tableRules: {
316
           count: [
326
           count: [
317
             { required: true, message: '数量不能为空', trigger: 'blur' }
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
         ruleForm: {
336
         ruleForm: {
322
           manufacturer: [
337
           manufacturer: [
353
         canCelShow:true,
368
         canCelShow:true,
354
         storehouse_id:"",
369
         storehouse_id:"",
355
         houseList:[],
370
         houseList:[],
371
+        is_check:0,
372
+        disabled:false,
356
       }
373
       }
357
     },
374
     },
358
     methods: {
375
     methods: {
440
         return name;
457
         return name;
441
       }, 
458
       }, 
442
       handleEdit: function(index, row) {
459
       handleEdit: function(index, row) {
460
+        if(this.is_check == 1){
461
+          this.$message.error("已审核的数据不能新增!")
462
+          return false
463
+        }
443
         this.canCelShow = false
464
         this.canCelShow = false
444
         const tempObj = {}
465
         const tempObj = {}
445
         tempObj['id'] = 0
466
         tempObj['id'] = 0
454
         tempObj["expiry_date"] = ""
475
         tempObj["expiry_date"] = ""
455
         tempObj["batch_number"] = ""
476
         tempObj["batch_number"] = ""
456
         tempObj["batch_number_id"] = 0
477
         tempObj["batch_number_id"] = 0
457
-         tempObj["count"] = 0
478
+        tempObj["count"] = 0
479
+        tempObj["drug_warehouse_info"] = []
458
         this.recordInfo.recordData.push(tempObj)
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
         if (row.id == 0) {
487
         if (row.id == 0) {
461
           this.recordInfo.recordData.splice(index, 1)
488
           this.recordInfo.recordData.splice(index, 1)
462
         } else {
489
         } else {
553
             }
580
             }
554
 
581
 
555
             for(let i=0;i<this.recordInfo.recordData.length;i++){
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
               this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
589
               this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
573
                 return false
600
                 return false
574
               } else {
601
               } else {
575
                 if (response.data.data.msg == 1){
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
             this.$message.error("该药品已存在列表中")
716
             this.$message.error("该药品已存在列表中")
690
             return
717
             return
691
          }
718
          }
692
-         this.getDrugBatchNumber(val.id)
719
+        // this.getDrugBatchNumber(val.id)
693
 
720
 
694
          for(let i=0;i<this.recordInfo.recordData.length;i++){
721
          for(let i=0;i<this.recordInfo.recordData.length;i++){
695
            if(i == this.currentIndex){
722
            if(i == this.currentIndex){
723
+             this.recordInfo.recordData[i].register_account = val.number
696
              this.recordInfo.recordData[i].drug_id  = val.id
724
              this.recordInfo.recordData[i].drug_id  = val.id
697
              this.recordInfo.recordData[i].drug_name = val.drug_name
725
              this.recordInfo.recordData[i].drug_name = val.drug_name
698
              this.recordInfo.recordData[i].drug_type = val.drug_type
726
              this.recordInfo.recordData[i].drug_type = val.drug_type
703
              this.recordInfo.recordData[i].number =  val.number
731
              this.recordInfo.recordData[i].number =  val.number
704
              this.recordInfo.recordData[i].max_unit = val.max_unit
732
              this.recordInfo.recordData[i].max_unit = val.max_unit
705
              this.recordInfo.recordData[i].min_unit = val.min_unit
733
              this.recordInfo.recordData[i].min_unit = val.min_unit
734
+             this.recordInfo.recordData[i].drug_warehouse_info = val.drug_warehouse_info
706
              if(val.dealer == 0){
735
              if(val.dealer == 0){
707
                this.recordInfo.recordData[i].dealer = ""
736
                this.recordInfo.recordData[i].dealer = ""
708
              }else{
737
              }else{
730
       getDataConfig(module, filed_name){
759
       getDataConfig(module, filed_name){
731
        return getDataConfig(module, filed_name)
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
     created() {
814
     created() {
815
+      this.unitList = getDataConfig('hemodialysis','units')
735
       this.GetConfigInfo()
816
       this.GetConfigInfo()
736
       this.propForm.goodUnit = this.$store.getters.good_unit
817
       this.propForm.goodUnit = this.$store.getters.good_unit
737
       const order_id = this.$route.query.id
818
       const order_id = this.$route.query.id
738
       this.GetOrderDetail(order_id)
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
         <el-button size="small" type="primary" @click="toExport()"
112
         <el-button size="small" type="primary" @click="toExport()"
113
           >导出</el-button
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
       </div>
135
       </div>
116
 
136
 
117
       <el-table
137
       <el-table
164
           </template>
184
           </template>
165
         </el-table-column>
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
         <el-table-column label="操作" align="center" width="240">
194
         <el-table-column label="操作" align="center" width="240">
168
           <template slot-scope="scope">
195
           <template slot-scope="scope">
169
             <el-tooltip
196
             <el-tooltip
498
       exportList: [],
525
       exportList: [],
499
       houseList: [],
526
       houseList: [],
500
       storehouse_id: 0,
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
         type: this.type,
567
         type: this.type,
535
         keywords: this.searchKey,
568
         keywords: this.searchKey,
536
         storehouse_id: this.storehouse_id,
569
         storehouse_id: this.storehouse_id,
570
+        check_type: this.check_type,
537
       };
571
       };
538
       this.Warehouse.warehouseDate = [];
572
       this.Warehouse.warehouseDate = [];
539
       getDrugWarehouseList(Params).then((response) => {
573
       getDrugWarehouseList(Params).then((response) => {
559
         type: this.type,
593
         type: this.type,
560
         keywords: this.searchKey,
594
         keywords: this.searchKey,
561
         storehouse_id: this.storehouse_id,
595
         storehouse_id: this.storehouse_id,
596
+        check_type: this.check_type,
562
       };
597
       };
563
       this.Warehouse.warehouseDate = [];
598
       this.Warehouse.warehouseDate = [];
564
       getDrugWarehouseList(Params).then((response) => {
599
       getDrugWarehouseList(Params).then((response) => {
720
           type: this.type,
755
           type: this.type,
721
           supply_warehouse_id: row.supply_warehouse_id,
756
           supply_warehouse_id: row.supply_warehouse_id,
722
           is_sys: row.is_sys,
757
           is_sys: row.is_sys,
758
+          is_check: row.is_check,
723
         },
759
         },
724
       });
760
       });
725
     },
761
     },
759
         this.$message.error("自动入库数据不能删除!");
795
         this.$message.error("自动入库数据不能删除!");
760
         return false;
796
         return false;
761
       }
797
       }
798
+      if (row.is_check == 1) {
799
+        this.$message.error("已审核的单据不能删除");
800
+        return false;
801
+      }
762
       const ids = [];
802
       const ids = [];
763
       ids.push(row.id);
803
       ids.push(row.id);
764
       const idStr = ids.join(",");
804
       const idStr = ids.join(",");
820
       const ids = [];
860
       const ids = [];
821
       const idOne = [];
861
       const idOne = [];
822
       for (let i = 0; i < this.selectedTableData.length; i++) {
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
         if (this.selectedTableData[i].is_sys == 13) {
867
         if (this.selectedTableData[i].is_sys == 13) {
824
           this.$message.error("调拨入库数据不能删除!");
868
           this.$message.error("调拨入库数据不能删除!");
825
           return false;
869
           return false;
826
         }
870
         }
827
         ids.push(this.selectedTableData[i].id);
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
       for (let i = 0; i < idOne.length; i++) {
877
       for (let i = 0; i < idOne.length; i++) {
1055
     changeStoreHouse() {
1101
     changeStoreHouse() {
1056
       this.GetWarehouse();
1102
       this.GetWarehouse();
1057
     },
1103
     },
1104
+    changeCheckType() {
1105
+      this.GetWarehouse();
1106
+    },
1058
   },
1107
   },
1059
 };
1108
 };
1060
 </script>
1109
 </script>

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

15
           class="filter-item"
15
           class="filter-item"
16
           >保 存</el-button
16
           >保 存</el-button
17
         >
17
         >
18
+        <el-button
19
+          size="small"
20
+          type="primary"
21
+          @click="toCheck()"
22
+          v-show ="showCheck"
23
+          class="filter-item"
24
+          >审核</el-button
25
+        >
26
+       <!-- <el-button
27
+          size="small"
28
+          type="primary"
29
+          @click="toReturnCheck()"
30
+          v-show ="showReturnCheck"
31
+          class="filter-item"
32
+          >反审核</el-button
33
+        > -->
18
       </div>
34
       </div>
19
     </div>
35
     </div>
20
     <div class="app-container" v-loading="loading">
36
     <div class="app-container" v-loading="loading">
395
   GetAllConfig,
411
   GetAllConfig,
396
   GetAllDrugInfoByID,
412
   GetAllDrugInfoByID,
397
   postDrugWarehouse,
413
   postDrugWarehouse,
414
+  toCheckWarehousingInfo,
415
+  toReturnCheckWarehousing
398
 } from "@/api/drug/drug_stock";
416
 } from "@/api/drug/drug_stock";
399
 import BreadCrumb from "../../components/bread-crumb";
417
 import BreadCrumb from "../../components/bread-crumb";
400
 import DrugsStockDialog from "./drugsStockDialog/index";
418
 import DrugsStockDialog from "./drugsStockDialog/index";
437
       tableRules: {
455
       tableRules: {
438
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
456
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
439
         warehousing_count: [
457
         warehousing_count: [
440
-          { required: true, message: "数量不能为空", trigge: "blur" },
458
+          { required: true, message: "数量不能为空", trigger: "blur" },
441
         ],
459
         ],
442
 
460
 
443
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
461
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
516
       loading: false,
534
       loading: false,
517
       list: [],
535
       list: [],
518
       storehouse_id: "",
536
       storehouse_id: "",
537
+      warehousing_id:0,
538
+      showCheck:false,
539
+      showReturnCheck:false,
519
     };
540
     };
520
   },
541
   },
521
   methods: {
542
   methods: {
620
           this.form.manufacturer = 0;
641
           this.form.manufacturer = 0;
621
           this.form.dealer = 0;
642
           this.form.dealer = 0;
622
           this.list = response.data.data.list;
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
         loading.close();
646
         loading.close();
627
       });
647
       });
662
     },
682
     },
663
     handleEdit: function (index, row) {
683
     handleEdit: function (index, row) {
664
       const tempObj = {};
684
       const tempObj = {};
685
+      tempObj["id"] = 0;
665
       tempObj["drug_name"] = "";
686
       tempObj["drug_name"] = "";
666
       tempObj["drug_id"] = 0;
687
       tempObj["drug_id"] = 0;
667
       tempObj["number"] = "";
688
       tempObj["number"] = "";
707
         return "";
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
     showDialog(index, row) {
741
     showDialog(index, row) {
711
       const loading = this.$loading({
742
       const loading = this.$loading({
712
         lock: true,
743
         lock: true,
801
             this.$message.success("请添加入库商品");
832
             this.$message.success("请添加入库商品");
802
             return;
833
             return;
803
           }
834
           }
835
+
804
           for (let i = 0; i < this.recordInfo.recordData.length; i++) {
836
           for (let i = 0; i < this.recordInfo.recordData.length; i++) {
805
             if (this.recordInfo.recordData[i].dealer == "") {
837
             if (this.recordInfo.recordData[i].dealer == "") {
806
               this.recordInfo.recordData[i].dealer = 0;
838
               this.recordInfo.recordData[i].dealer = 0;
841
             this.form.manufacturer,
873
             this.form.manufacturer,
842
             this.form.dealer,
874
             this.form.dealer,
843
             this.type,
875
             this.type,
844
-            this.storehouse_id
876
+            this.storehouse_id,
877
+            this.warehousing_id,
845
           ).then((response) => {
878
           ).then((response) => {
846
             if (response.data.state == 0) {
879
             if (response.data.state == 0) {
847
               this.loading = false;
880
               this.loading = false;
849
               return false;
882
               return false;
850
             } else {
883
             } else {
851
               this.loading = false;
884
               this.loading = false;
852
-              this.$message.success("入库成功");
885
+              this.$message.success("保存成功");
853
               this.listLoading = false;
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
         } else {
924
         } else {
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
     changeUnit(val,index){
1089
     changeUnit(val,index){
976
     // console.log("val3232323232",val)
1090
     // console.log("val3232323232",val)
977
     //  for(let i=0;i<this.recordInfo.recordData.length;i++){
1091
     //  for(let i=0;i<this.recordInfo.recordData.length;i++){
978
     //    if(i == index){
1092
     //    if(i == index){
979
     //      if(this.recordInfo.recordData[i].max_unit == this.recordInfo.recordData[i].count_unit){
1093
     //      if(this.recordInfo.recordData[i].max_unit == this.recordInfo.recordData[i].count_unit){
980
-           
1094
+
981
     //      }
1095
     //      }
982
     //      if(this.recordInfo.recordData[i].min_unit == this.recordInfo.recordData[i].count_unit){
1096
     //      if(this.recordInfo.recordData[i].min_unit == this.recordInfo.recordData[i].count_unit){
983
 
1097
 
1007
       "-" +
1121
       "-" +
1008
       (nowDay < 10 ? "0" + nowDay : nowDay);
1122
       (nowDay < 10 ? "0" + nowDay : nowDay);
1009
     const tempObj = {};
1123
     const tempObj = {};
1010
-
1124
+    tempObj["id"] = 0;
1011
     tempObj["drug_id"] = 0;
1125
     tempObj["drug_id"] = 0;
1012
     tempObj["drug_name"] = "";
1126
     tempObj["drug_name"] = "";
1013
     tempObj["dosage"] = "";
1127
     tempObj["dosage"] = "";
1014
     tempObj["max_unit"] = "";
1128
     tempObj["max_unit"] = "";
1015
-    tempObj["min_unit"] = "", 
1129
+    tempObj["min_unit"] = "",
1016
     tempObj["lot_number"] = "";
1130
     tempObj["lot_number"] = "";
1017
     tempObj["product_date"] = "";
1131
     tempObj["product_date"] = "";
1018
     tempObj["expiry_date"] = "";
1132
     tempObj["expiry_date"] = "";

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

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

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

76
             @change="endTimeChange"
76
             @change="endTimeChange"
77
           ></el-date-picker>
77
           ></el-date-picker>
78
         </div>
78
         </div>
79
+
80
+
79
          <!-- <div style="margin-left: 10px">
81
          <!-- <div style="margin-left: 10px">
80
           <span>审核状态:</span>
82
           <span>审核状态:</span>
81
           <el-select
83
           <el-select
110
           >导出</el-button
112
           >导出</el-button
111
         >
113
         >
112
 
114
 
113
-        <!-- <span>&nbsp;&nbsp;</span>
115
+        <span>&nbsp;&nbsp;</span>
114
         <label class="title"><span class="name">出库方式</span> :</label>
116
         <label class="title"><span class="name">出库方式</span> :</label>
115
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
117
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
116
             <el-option
118
             <el-option
119
               :label="option.name"
121
               :label="option.name"
120
               :value="option.id">
122
               :value="option.id">
121
             </el-option>
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
       </div>
136
       </div>
124
 
137
 
125
       <el-table
138
       <el-table
164
           </template>
177
           </template>
165
         </el-table-column>
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
           <template slot="header" slot-scope="scope">
181
           <template slot="header" slot-scope="scope">
169
             <span>出库方式</span>
182
             <span>出库方式</span>
170
           </template>
183
           </template>
175
           </template>
188
           </template>
176
         </el-table-column>
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
         <el-table-column label="操作" align="center" width="240">
202
         <el-table-column label="操作" align="center" width="240">
179
           <template slot-scope="scope">
203
           <template slot-scope="scope">
180
             <el-tooltip
204
             <el-tooltip
606
         { id: 2, name: "自动出库" },
630
         { id: 2, name: "自动出库" },
607
         { id: 3, name: "调拨出库" },
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
   methods: {
641
   methods: {
643
         keywords: this.searchKey,
673
         keywords: this.searchKey,
644
         storehouse_id: this.storehouse_id,
674
         storehouse_id: this.storehouse_id,
645
         way_type: this.way_type,
675
         way_type: this.way_type,
676
+        check_type:this.check_type,
646
       };
677
       };
647
       this.warehouseOutDate = [];
678
       this.warehouseOutDate = [];
648
       getDrugWarehouseOutList(Params).then((response) => {
679
       getDrugWarehouseOutList(Params).then((response) => {
654
           for (let i = 0; i < response.data.data.list.length; i++) {
685
           for (let i = 0; i < response.data.data.list.length; i++) {
655
             this.warehouseOutDate.push(response.data.data.list[i]);
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
       });
707
       });
672
       }
708
       }
673
 
709
 
674
- 
710
+
675
     },
711
     },
676
     GetWarehouseOut: function () {
712
     GetWarehouseOut: function () {
677
       const Params = {
713
       const Params = {
683
         keywords: this.searchKey,
719
         keywords: this.searchKey,
684
         storehouse_id: this.storehouse_id,
720
         storehouse_id: this.storehouse_id,
685
         way_type: this.way_type,
721
         way_type: this.way_type,
722
+        check_type:this.check_type,
686
       };
723
       };
687
       this.warehouseOutDate = [];
724
       this.warehouseOutDate = [];
688
       getDrugWarehouseOutList(Params).then((response) => {
725
       getDrugWarehouseOutList(Params).then((response) => {
797
           "&is_sys=" +
834
           "&is_sys=" +
798
           row.is_sys +
835
           row.is_sys +
799
           "&supply_cancel_out_id=" +
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
     handleSearch(val) {
841
     handleSearch(val) {
816
         this.$message.error("采购出库数据不能删除!");
854
         this.$message.error("采购出库数据不能删除!");
817
         return;
855
         return;
818
       }
856
       }
857
+      if(row.is_check == 1){
858
+       this.$message.error("已审核的单据不能删除!")
859
+       return false
860
+      }
819
       const ids = [];
861
       const ids = [];
820
       ids.push(row.id);
862
       ids.push(row.id);
821
       const idStr = ids.join(",");
863
       const idStr = ids.join(",");
879
       const ids = [];
921
       const ids = [];
880
       const idsOne = [];
922
       const idsOne = [];
881
       for (let i = 0; i < this.selectedTableData.length; i++) {
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
         if (this.selectedTableData[i].is_sys == 1) {
928
         if (this.selectedTableData[i].is_sys == 1) {
883
           this.$message.error("自动出库数据不能删除!");
929
           this.$message.error("自动出库数据不能删除!");
884
           return false;
930
           return false;
889
         }
935
         }
890
         if (this.selectedTableData[i].is_sys == 0) {
936
         if (this.selectedTableData[i].is_sys == 0) {
891
           ids.push(this.selectedTableData[i].id);
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
       if (idsOne.length > 0) {
944
       if (idsOne.length > 0) {
1113
           this.tableShow = true;
1162
           this.tableShow = true;
1114
           this.tableList = [];
1163
           this.tableList = [];
1115
           var list = response.data.data.list;
1164
           var list = response.data.data.list;
1116
-          console.log("lisrt233232323232233223", list);
1165
+          // console.log("lisrt233232323232233223", list);
1117
           this.manufacturerList = response.data.data.manufacturerList;
1166
           this.manufacturerList = response.data.data.manufacturerList;
1118
           this.dealerList = response.data.data.dealerList;
1167
           this.dealerList = response.data.data.dealerList;
1119
           var drugFlowList = response.data.data.drugFlowList;
1168
           var drugFlowList = response.data.data.drugFlowList;
1165
             }
1214
             }
1166
           }
1215
           }
1167
           this.tableList = list;
1216
           this.tableList = list;
1168
-          console.log("单价23323232323232232332232323233223", this.tableList);
1217
+          // console.log("单价23323232323232232332232323233223", this.tableList);
1169
         }
1218
         }
1170
       });
1219
       });
1171
     },
1220
     },
1181
       getAutoDrugDetail(params).then((response) => {
1230
       getAutoDrugDetail(params).then((response) => {
1182
         if (response.data.state == 1) {
1231
         if (response.data.state == 1) {
1183
           this.userList = response.data.data.list;
1232
           this.userList = response.data.data.list;
1184
-          console.log("自动出库数据", this.userList);
1233
+          // console.log("自动出库数据", this.userList);
1185
           if (val.is_sys == 1) {
1234
           if (val.is_sys == 1) {
1186
             this.drugDialogVisible = true;
1235
             this.drugDialogVisible = true;
1187
           }
1236
           }
1333
       return total_price;
1382
       return total_price;
1334
     },
1383
     },
1335
     getDrugBatchNumber(drugid, count) {
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
       var arr = [];
1388
       var arr = [];
1340
       for (let i = 0; i < this.batchNumberList.length; i++) {
1389
       for (let i = 0; i < this.batchNumberList.length; i++) {
1341
         if (
1390
         if (
1355
       getExportOutOrderDrugList(params).then((response) => {
1404
       getExportOutOrderDrugList(params).then((response) => {
1356
         if (response.data.state == 1) {
1405
         if (response.data.state == 1) {
1357
           var list = response.data.data.list;
1406
           var list = response.data.data.list;
1358
-          console.log("list22222", list);
1407
+          // console.log("list22222", list);
1359
           this.exportList = list;
1408
           this.exportList = list;
1360
           this.manufacturerList = response.data.data.manufacturerList;
1409
           this.manufacturerList = response.data.data.manufacturerList;
1361
           this.dealerList = response.data.data.dealerList;
1410
           this.dealerList = response.data.data.dealerList;
1367
         this.$message.error("请勾选出库单");
1416
         this.$message.error("请勾选出库单");
1368
         return;
1417
         return;
1369
       }
1418
       }
1370
-      console.log("hh2323232322323", this.exportList);
1419
+      // console.log("hh2323232322323", this.exportList);
1371
       for (let i = 0; i < this.exportList.length; i++) {
1420
       for (let i = 0; i < this.exportList.length; i++) {
1372
         if (this.exportList[i].dealer == 0) {
1421
         if (this.exportList[i].dealer == 0) {
1373
           this.exportList[i].dealer = "";
1422
           this.exportList[i].dealer = "";
1500
     changeWay() {
1549
     changeWay() {
1501
       this.GetWarehouseOut();
1550
       this.GetWarehouseOut();
1502
     },
1551
     },
1552
+    changeCheckType(){
1553
+      this.GetWarehouseOut();
1554
+    }
1503
   },
1555
   },
1504
 };
1556
 };
1505
 </script>
1557
 </script>

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

21
           class="filter-item"
21
           class="filter-item"
22
           >保 存</el-button
22
           >保 存</el-button
23
         >
23
         >
24
+         <el-button
25
+          size="small"
26
+          type="primary"
27
+          v-show="showCheck"
28
+          class="filter-item"
29
+          @click="toCheck"
30
+          >审 核</el-button
31
+        >
32
+
33
+        <!-- <el-button
34
+          size="small"
35
+          type="primary"
36
+          v-show="showReturnCheck"
37
+          @click="toReturnCheck"
38
+          class="filter-item"
39
+          >反 审 核</el-button
40
+        > -->
24
       </div>
41
       </div>
25
     </div>
42
     </div>
26
 
43
 
407
   GetAllConfig,
424
   GetAllConfig,
408
   GetAllDrugInfoByID,
425
   GetAllDrugInfoByID,
409
   getDrugBatchNumber,
426
   getDrugBatchNumber,
427
+  toCheckDrugOut,
428
+  toReturnCheck
410
 } from "@/api/drug/drug_stock";
429
 } from "@/api/drug/drug_stock";
411
 
430
 
412
 import BreadCrumb from "../../components/bread-crumb";
431
 import BreadCrumb from "../../components/bread-crumb";
480
       storehouse_id: "",
499
       storehouse_id: "",
481
       list: [],
500
       list: [],
482
       doctorList: [],
501
       doctorList: [],
502
+      showCheck:false,
503
+      showReturnCheck:false,
504
+      warehouse_out_id:0,
483
     };
505
     };
484
   },
506
   },
485
   methods: {
507
   methods: {
549
     },
571
     },
550
     handleEdit: function (index, row) {
572
     handleEdit: function (index, row) {
551
       const tempObj = {};
573
       const tempObj = {};
574
+      tempObj["id"] = 0;
552
       tempObj["drug_id"] = 0;
575
       tempObj["drug_id"] = 0;
553
       tempObj["count"] = "";
576
       tempObj["count"] = "";
554
       tempObj["price"] = "";
577
       tempObj["price"] = "";
713
             this.form.dealer,
736
             this.form.dealer,
714
             this.form.manufacturer,
737
             this.form.manufacturer,
715
             this.type,
738
             this.type,
716
-            this.storehouse_id
739
+            this.storehouse_id,
740
+            this.warehouse_out_id,
717
           ).then((response) => {
741
           ).then((response) => {
718
             if (response.data.state == 0) {
742
             if (response.data.state == 0) {
719
               this.$message.error("库存不足");
743
               this.$message.error("库存不足");
729
               var min_number = response.data.data.min_number;
753
               var min_number = response.data.data.min_number;
730
               var min_unit = response.data.data.min_unit;
754
               var min_unit = response.data.data.min_unit;
731
               var max_unit = response.data.data.max_unit;
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
               if (msg == 1) {
789
               if (msg == 1) {
744
                 this.$message.error(str + "库存不足");
790
                 this.$message.error(str + "库存不足");
745
               } else {
791
               } else {
746
                 loading.close();
792
                 loading.close();
747
-                this.$message.success("出库成功");
793
+                this.$message.success("保存成功");
748
                 this.recordInfo.recordData = [];
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
       }
1077
       }
1030
       console.log("count_toal23233232", count_total);
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
   created() {
1153
   created() {
1034
     if (this.$route.path == "/Pharmacy/out/add") {
1154
     if (this.$route.path == "/Pharmacy/out/add") {
1050
       "-" +
1170
       "-" +
1051
       (nowDay < 10 ? "0" + nowDay : nowDay);
1171
       (nowDay < 10 ? "0" + nowDay : nowDay);
1052
     const tempObj = {};
1172
     const tempObj = {};
1173
+    tempObj["id"] = 0;
1053
     tempObj["drug_id"] = 0;
1174
     tempObj["drug_id"] = 0;
1054
     tempObj["max_unit"] = "";
1175
     tempObj["max_unit"] = "";
1055
     (tempObj["min_unit"] = ""), (tempObj["return_count"] = 0);
1176
     (tempObj["min_unit"] = ""), (tempObj["return_count"] = 0);

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

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

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

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

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

133
             limit:10,
133
             limit:10,
134
             page:1,
134
             page:1,
135
             storehouse_id:0,
135
             storehouse_id:0,
136
+            houseList:[],
136
         }
137
         }
137
     },
138
     },
138
     methods:{
139
     methods:{
143
             this.$router.push({path:'/stock/drugs/inventoryPrint'}) 
144
             this.$router.push({path:'/stock/drugs/inventoryPrint'}) 
144
         },
145
         },
145
         print_1(){
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
         handleSizeChange(val){
149
         handleSizeChange(val){
149
          this.limit = val
150
          this.limit = val

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

32
                         
32
                         
33
                     </tr>
33
                     </tr>
34
                     <tr v-for="(item,index) in tableData" :key="index">
34
                     <tr v-for="(item,index) in tableData" :key="index">
35
-                        <td>{{item.good_name}}</td>
35
+                        <td>{{item.drug_name}}</td>
36
                         <td>{{item.specification_name}}</td>
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
                     </tr>
56
                     </tr>
47
                     </tbody>
57
                     </tbody>
48
                 </table>
58
                 </table>
55
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
65
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
56
 const moment = require('moment');
66
 const moment = require('moment');
57
 import { uParseTime } from '@/utils/tools'
67
 import { uParseTime } from '@/utils/tools'
58
-import { getInventoryExportList } from "@/api/stock"
68
+import { getInventoryDetailList } from "@/api/drug/drug"
59
 import print from "print-js";
69
 import print from "print-js";
60
 export default {
70
 export default {
61
     components:{
71
     components:{
68
             { path: false, name: '耗材管理' },
78
             { path: false, name: '耗材管理' },
69
             { path: false, name: '耗材盘点打印' },
79
             { path: false, name: '耗材盘点打印' },
70
           ],
80
           ],
71
-          org_name:"",
81
+          org_name: this.$store.getters.xt_user.org.org_name,
72
           ids:"",
82
           ids:"",
73
           tableData:[],
83
           tableData:[],
74
           manufacturerList:[],
84
           manufacturerList:[],
85
+          houseList:[],
86
+          inventoryList:[],
75
         }
87
         }
76
     },
88
     },
77
     methods:{
89
     methods:{
95
             return uParseTime(val, '{y}-{m}-{d}')
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
         getManufacturerName(id){
128
         getManufacturerName(id){
109
 
129
 
114
               }
134
               }
115
            }
135
            }
116
            return name
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
     created(){
176
     created(){
177
+
120
       this.getlist()
178
       this.getlist()
121
     }
179
     }
122
 }
180
 }

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

26
                 @click="search">搜索</el-button>
26
                 @click="search">搜索</el-button>
27
             </div>
27
             </div>
28
             <div>
28
             <div>
29
-              <el-button type="primary" @click="toprint">打印</el-button>
29
+              <!-- <el-button type="primary" @click="toprint">打印</el-button> -->
30
               <el-button type="primary" @click="inventoryExportList">盘点模版打印</el-button>
30
               <el-button type="primary" @click="inventoryExportList">盘点模版打印</el-button>
31
             </div>
31
             </div>
32
             <!-- <div>
32
             <!-- <div>
130
     },
130
     },
131
     methods:{
131
     methods:{
132
         toprint(){
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
         search(){
136
         search(){

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

36
                         <td>{{item.specification_name}}</td>
36
                         <td>{{item.specification_name}}</td>
37
                         <td>{{item.packing_unit}}</td>
37
                         <td>{{item.packing_unit}}</td>
38
                         <td>{{item.number}}</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>
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
                     </tr>
51
                     </tr>
47
                     </tbody>
52
                     </tbody>
48
                 </table>
53
                 </table>
55
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
60
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
56
 const moment = require('moment');
61
 const moment = require('moment');
57
 import { uParseTime } from '@/utils/tools'
62
 import { uParseTime } from '@/utils/tools'
58
-import { getInventoryExportList } from "@/api/stock"
63
+import { getPrintList } from "@/api/stock"
59
 import print from "print-js";
64
 import print from "print-js";
60
 export default {
65
 export default {
61
     components:{
66
     components:{
68
             { path: false, name: '耗材管理' },
73
             { path: false, name: '耗材管理' },
69
             { path: false, name: '耗材盘点打印' },
74
             { path: false, name: '耗材盘点打印' },
70
           ],
75
           ],
71
-          org_name:"",
76
+          org_name: this.$store.getters.xt_user.org.org_name,
72
           ids:"",
77
           ids:"",
73
           tableData:[],
78
           tableData:[],
74
           manufacturerList:[],
79
           manufacturerList:[],
80
+          houseList:[],
75
         }
81
         }
76
     },
82
     },
77
     methods:{
83
     methods:{
96
          }
102
          }
97
         },
103
         },
98
         getlist(){
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
         getManufacturerName(id){
120
         getManufacturerName(id){
109
            var name = ""
121
            var name = ""
113
               }
125
               }
114
            }
126
            }
115
            return name
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
     created(){
143
     created(){
144
+
119
       this.getlist()
145
       this.getlist()
120
     }
146
     }
121
 }
147
 }

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

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

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

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

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

18
           size="small"
18
           size="small"
19
           type="primary"
19
           type="primary"
20
           @click="submit()"
20
           @click="submit()"
21
+          v-if="is_check == 2"
21
           class="filter-item"
22
           class="filter-item"
22
           >保 存</el-button
23
           >保 存</el-button
23
         >
24
         >
25
+        <el-button
26
+          size="small"
27
+          type="primary"
28
+          @click="toCheck()"
29
+          v-if="is_check == 2"
30
+          class="filter-item"
31
+          >审核</el-button
32
+        >
33
+        <el-button
34
+          size="small"
35
+          type="primary"
36
+          v-if="is_check == 1"
37
+          @click="toReturnCheck()"
38
+          class="filter-item"
39
+          >反审核</el-button
40
+        >
24
       </div>
41
       </div>
25
     </div>
42
     </div>
26
 
43
 
142
             
159
             
143
               <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
160
               <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
144
                             style="padding-top: 20px">
161
                             style="padding-top: 20px">
145
-                <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price"></el-input>
162
+                <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price" :disabled ="disabled"></el-input>
146
               </el-form-item>
163
               </el-form-item>
147
 
164
 
148
 
165
 
160
                 style="padding-top: 20px"
177
                 style="padding-top: 20px"
161
               >
178
               >
162
                 <el-input
179
                 <el-input
180
+                 :disabled ="disabled"
163
                   placeholder="请输入单价"
181
                   placeholder="请输入单价"
164
                   type="number"
182
                   type="number"
165
                   v-model="scope.row.price"
183
                   v-model="scope.row.price"
341
   GetAllGoodInfoByID,
359
   GetAllGoodInfoByID,
342
   DeleteWarehouseInfoItem,
360
   DeleteWarehouseInfoItem,
343
   EditWarehouse,
361
   EditWarehouse,
344
-  postSearchGoodList
362
+  postSearchGoodList,
363
+  toCheckWarehouseInfo,
364
+  toReturnCheckWarehouseInfo
345
 } from "@/api/stock";
365
 } from "@/api/stock";
346
 import BreadCrumb from "../components/bread-crumb";
366
 import BreadCrumb from "../components/bread-crumb";
347
 
367
 
385
           { required: true, message: '零售价不能为空', trigger: 'blur' }
405
           { required: true, message: '零售价不能为空', trigger: 'blur' }
386
         ],
406
         ],
387
         warehousing_count: [
407
         warehousing_count: [
388
-          { required: true, message: "数量不能为空", trigge: "blur" }
408
+          { required: true, message: "数量不能为空", trigger: "blur" }
389
         ],
409
         ],
390
 
410
 
391
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
411
         good_id: [{ validator: checkGoodId, trigger: "blur" }],
426
       disabled:false,
446
       disabled:false,
427
       storehouse_id:0,
447
       storehouse_id:0,
428
       list:[],
448
       list:[],
449
+      is_check:0,
450
+      order_id:0,
429
     };
451
     };
430
   },
452
   },
431
   methods: {
453
   methods: {
527
         this.$message.error("调拨入库数据不能新增!")
549
         this.$message.error("调拨入库数据不能新增!")
528
         return false
550
         return false
529
       }
551
       }
552
+      if(parseInt(this.$route.query.is_check) == 1){
553
+        this.$message.error("已审核的单据不能新增!")
554
+        return false
555
+      }
530
       const tempObj = {};
556
       const tempObj = {};
531
       tempObj["id"] = 0;
557
       tempObj["id"] = 0;
532
       tempObj["good_type_id"] = 0;
558
       tempObj["good_type_id"] = 0;
552
         this.$message.error("采购入库数据不能删除!")
578
         this.$message.error("采购入库数据不能删除!")
553
         return false
579
         return false
554
       }
580
       }
581
+     if(parseInt(this.$route.query.is_check) == 1){
582
+        this.$message.error("已审核的单据不能删除!")
583
+        return false
584
+      }
555
       if (row.id == 0) {
585
       if (row.id == 0) {
556
         this.recordInfo.recordData.splice(index, 1);
586
         this.recordInfo.recordData.splice(index, 1);
557
       } else {
587
       } else {
694
                   this.recordInfo.recordData[i].dealer = this.dealerList[z].id
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
           const params = {
730
           const params = {
700
             stockIn: this.recordInfo.recordData
731
             stockIn: this.recordInfo.recordData
701
           };
732
           };
702
-          
733
+          console.log("param22332322332",params)
703
           const loading = this.$loading({
734
           const loading = this.$loading({
704
             lock: true,
735
             lock: true,
705
             text: 'Loading',
736
             text: 'Loading',
723
             } else {
754
             } else {
724
               loading.close()
755
               loading.close()
725
               this.loading = false
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
         } else {
781
         } else {
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
   created() {
981
   created() {
876
     this.GetConfigInfo();
982
     this.GetConfigInfo();
877
     this.propForm.goodUnit = this.$store.getters.good_unit;
983
     this.propForm.goodUnit = this.$store.getters.good_unit;
878
     const order_id = this.$route.query.id;
984
     const order_id = this.$route.query.id;
985
+    this.order_id = order_id
879
     var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
986
     var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
880
     var is_sys = parseInt(this.$route.query.is_sys)
987
     var is_sys = parseInt(this.$route.query.is_sys)
988
+    this.is_check = parseInt(this.$route.query.is_check)
989
+   
881
     if(supply_warehouse_id > 0){
990
     if(supply_warehouse_id > 0){
882
       this.disabled = true
991
       this.disabled = true
883
     }
992
     }
884
-    if(is_sys == 12){
993
+    if(is_sys == 12 || this.is_check == 1){
885
       this.disabled = true
994
       this.disabled = true
886
     }
995
     }
887
     this.GetOrderDetail(order_id);
996
     this.GetOrderDetail(order_id);

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

109
         <el-button size="small" type="primary" @click="toExport"
109
         <el-button size="small" type="primary" @click="toExport"
110
           >导出</el-button
110
           >导出</el-button
111
         >
111
         >
112
-        <!-- <span>&nbsp;&nbsp;</span>
112
+        <span>&nbsp;&nbsp;</span>
113
         <label class="title"><span class="name">出库方式</span> :</label>
113
         <label class="title"><span class="name">出库方式</span> :</label>
114
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
114
         <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
115
             <el-option
115
             <el-option
118
               :label="option.name"
118
               :label="option.name"
119
               :value="option.id">
119
               :value="option.id">
120
             </el-option>
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
       </div>
133
       </div>
123
 
134
 
124
       <el-table
135
       <el-table
171
           </template>
182
           </template>
172
         </el-table-column>
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
         <el-table-column label="操作" align="center" width="300px">
192
         <el-table-column label="操作" align="center" width="300px">
175
           <template slot-scope="scope">
193
           <template slot-scope="scope">
176
             <el-tooltip
194
             <el-tooltip
997
         { id: 2, name: "自动出库" },
1015
         { id: 2, name: "自动出库" },
998
         { id: 3, name: "调拨出库" },
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
   methods: {
1027
   methods: {
1033
         keywords: this.searchKey,
1058
         keywords: this.searchKey,
1034
         storehouse_id: this.storehouse_id,
1059
         storehouse_id: this.storehouse_id,
1035
         way_type: this.way_type,
1060
         way_type: this.way_type,
1061
+        check_type:this.check_type,
1036
       };
1062
       };
1037
       this.warehouseOutDate = [];
1063
       this.warehouseOutDate = [];
1038
       getWarehouseOutList(Params).then((response) => {
1064
       getWarehouseOutList(Params).then((response) => {
1062
         type: this.type,
1088
         type: this.type,
1063
         storehouse_id: this.storehouse_id,
1089
         storehouse_id: this.storehouse_id,
1064
         way_type: this.way_type,
1090
         way_type: this.way_type,
1091
+        check_type:this.check_type,
1065
       };
1092
       };
1066
       this.warehouseOutDate = [];
1093
       this.warehouseOutDate = [];
1067
       getWarehouseOutList(Params).then((response) => {
1094
       getWarehouseOutList(Params).then((response) => {
1195
           "&is_sys=" +
1222
           "&is_sys=" +
1196
           row.is_sys +
1223
           row.is_sys +
1197
           "&supply_cancel_out_id=" +
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
     handleDelete: function (index, row) {
1229
     handleDelete: function (index, row) {
1207
         this.$message.error("采购出库数据不能删除!");
1235
         this.$message.error("采购出库数据不能删除!");
1208
         return false;
1236
         return false;
1209
       }
1237
       }
1238
+      if(row.is_check == 1){
1239
+        this.$message.error("已审核的单据不能删除!")
1240
+        return false
1241
+      }
1210
       const ids = [];
1242
       const ids = [];
1211
       ids.push(row.id);
1243
       ids.push(row.id);
1212
       const idStr = ids.join(",");
1244
       const idStr = ids.join(",");
1271
       const ids = [];
1303
       const ids = [];
1272
       const idOne = [];
1304
       const idOne = [];
1273
       for (let i = 0; i < this.selectedTableData.length; i++) {
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
         if (this.selectedTableData[i].is_sys == 1) {
1310
         if (this.selectedTableData[i].is_sys == 1) {
1275
           this.$message.error("自动出库数据不能删除!");
1311
           this.$message.error("自动出库数据不能删除!");
1276
           return false;
1312
           return false;
1281
         }
1317
         }
1282
         if (this.selectedTableData[i].is_sys == 0) {
1318
         if (this.selectedTableData[i].is_sys == 0) {
1283
           ids.push(this.selectedTableData[i].id);
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
       if (idOne.length > 0) {
1326
       if (idOne.length > 0) {
1989
     changeWay() {
2028
     changeWay() {
1990
       this.GetWarehouseOut();
2029
       this.GetWarehouseOut();
1991
     },
2030
     },
2031
+    changeCheckType(){
2032
+      this.GetWarehouseOut()
2033
+    }
1992
   },
2034
   },
1993
 };
2035
 };
1994
 </script>
2036
 </script>

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

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

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

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

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

7
 
7
 
8
       <div style="float:right;">
8
       <div style="float:right;">
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
-        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0">保 存</el-button>
11
+       <el-button size="small" type="primary" @click="toCheck()" v-if="is_check == 2 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">审 核</el-button>
12
+       <el-button size="small" type="primary" @click="toReturnCheck()" v-if="is_check == 1 && parseInt(this.$route.query.is_sys) == 0"  class="filter-item">反 审 核</el-button>
11
       </div>
13
       </div>
12
     </div>
14
     </div>
13
 
15
 
257
             <span>批准文号<span style="color: red"></span></span>
259
             <span>批准文号<span style="color: red"></span></span>
258
           </template>
260
           </template>
259
           <template slot-scope="scope">
261
           <template slot-scope="scope">
260
-              <el-input placeholder="请输入批准文号" v-model="scope.row.license_number" ></el-input>
262
+              <el-input placeholder="请输入批准文号" v-model="scope.row.license_number" :disabled="stockShow"></el-input>
261
           </template>
263
           </template>
262
         </el-table-column>
264
         </el-table-column>
263
 
265
 
324
 <script>
326
 <script>
325
   import { uParseTime } from '@/utils/tools'
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
   import BreadCrumb from '../components/bread-crumb'
330
   import BreadCrumb from '../components/bread-crumb'
329
   import StockInDialog from './Dialog/stockInDialog'
331
   import StockInDialog from './Dialog/stockInDialog'
330
 
332
 
397
         storelist:[],
399
         storelist:[],
398
         storehouse_id:"",
400
         storehouse_id:"",
399
         doctorList:[],
401
         doctorList:[],
402
+        showCheck:false,
403
+        showReturnCheck:false,
400
       }
404
       }
401
     },
405
     },
402
     methods: {
406
     methods: {
484
           this.$message.error("采购出库数据不能新增!")
488
           this.$message.error("采购出库数据不能新增!")
485
           return
489
           return
486
         }
490
         }
491
+        if(this.is_check == 1){
492
+          this.$message.error("已审核的数据不能新增")
493
+          return
494
+        }
487
         this.stockTrue = false
495
         this.stockTrue = false
488
         if(this.stockShow == true){
496
         if(this.stockShow == true){
489
          this.$message.error("自动出库数据无法编辑")
497
          this.$message.error("自动出库数据无法编辑")
516
           return
524
           return
517
         }
525
         }
518
 
526
 
527
+        if(this.is_check == 1){
528
+          this.$message.error("已审核的数据不能删除!")
529
+          return
530
+        }
531
+
519
         if(this.stockShow == true){
532
         if(this.stockShow == true){
520
          this.$message.error("自动出库数据无法删除")
533
          this.$message.error("自动出库数据无法删除")
521
          return
534
          return
697
               } else {
710
               } else {
698
                 if(response.data.data.msg == 1){
711
                 if(response.data.data.msg == 1){
699
                   this.$message.success('保存成功')
712
                   this.$message.success('保存成功')
700
-                  this.$router.back(-1)
713
+                  // this.$router.back(-1)
701
                   loading.close()
714
                   loading.close()
702
                 }
715
                 }
703
 
716
 
904
           return
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
     created() {
980
     created() {
910
       // var nowDate = new Date();
981
       // var nowDate = new Date();
917
       //   (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
988
       //   (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
918
       //   "-" +
989
       //   "-" +
919
       //   (nowDay < 10 ? "0" + nowDay : nowDay);
990
       //   (nowDay < 10 ? "0" + nowDay : nowDay);
991
+      this.is_check = parseInt(this.$route.query.is_check) 
920
       this.propForm.goodUnit = this.$store.getters.good_unit
992
       this.propForm.goodUnit = this.$store.getters.good_unit
921
       const order_id = this.$route.query.id
993
       const order_id = this.$route.query.id
994
+      
922
       this.getSingleOutOrderDetail(order_id)
995
       this.getSingleOutOrderDetail(order_id)
923
       var is_sys = this.$route.query.is_sys
996
       var is_sys = this.$route.query.is_sys
924
       if(is_sys == 0){
997
       if(is_sys == 0){
925
         this.stockShow = false
998
         this.stockShow = false
926
       }
999
       }
927
-      if(is_sys == 1){
1000
+      if(is_sys == 1 ||  this.is_check == 1){
928
         this.stockShow = true
1001
         this.stockShow = true
929
       }
1002
       }
930
       if(is_sys == 12){
1003
       if(is_sys == 12){

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

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

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

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

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

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