|
@@ -69,13 +69,13 @@
|
69
|
69
|
>
|
70
|
70
|
<el-table-column prop="date" label="患者姓名" width="100">
|
71
|
71
|
<template slot-scope="scope">
|
72
|
|
- <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
|
|
72
|
+ <span>{{ scope.row.name ? scope.row.name : "" }}</span>
|
73
|
73
|
</template>
|
74
|
74
|
</el-table-column>
|
75
|
75
|
<el-table-column prop="name" label="透析号" width="100">
|
76
|
76
|
<template slot-scope="scope">
|
77
|
77
|
<span>{{
|
78
|
|
- scope.row.DialysisNo ? scope.row.DialysisNo : ""
|
|
78
|
+ scope.row.dialysis_no ? scope.row.dialysis_no : ""
|
79
|
79
|
}}</span>
|
80
|
80
|
</template>
|
81
|
81
|
</el-table-column>
|
|
@@ -97,13 +97,13 @@
|
97
|
97
|
>
|
98
|
98
|
<el-table-column prop="date" label="患者姓名" width="100">
|
99
|
99
|
<template slot-scope="scope">
|
100
|
|
- <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
|
|
100
|
+ <span>{{ scope.row.name ? scope.row.name : "" }}</span>
|
101
|
101
|
</template>
|
102
|
102
|
</el-table-column>
|
103
|
103
|
<el-table-column prop="name" label="透析号" width="100">
|
104
|
104
|
<template slot-scope="scope">
|
105
|
105
|
<span>{{
|
106
|
|
- scope.row.DialysisNo ? scope.row.DialysisNo : ""
|
|
106
|
+ scope.row.dialysis_no ? scope.row.dialysis_no : ""
|
107
|
107
|
}}</span>
|
108
|
108
|
</template>
|
109
|
109
|
</el-table-column>
|
|
@@ -189,7 +189,7 @@
|
189
|
189
|
</el-table-column>
|
190
|
190
|
<el-table-column label="规格" width="100" align="center">
|
191
|
191
|
<template slot-scope="scope">
|
192
|
|
- <span>{{getSpecaiName(scope.row.DrugId)}}</span>
|
|
192
|
+ <span>{{ scope.row.Spec}}</span>
|
193
|
193
|
</template>
|
194
|
194
|
</el-table-column>
|
195
|
195
|
<el-table-column label="单次用量" width="100" align="center">
|
|
@@ -223,12 +223,12 @@
|
223
|
223
|
</el-table-column>
|
224
|
224
|
<el-table-column label="生产厂商" width="100" align="center">
|
225
|
225
|
<template slot-scope="scope">
|
226
|
|
- <span>{{ getManutuer(scope.row.DrugId) }}</span>
|
|
226
|
+ <span>{{ (scope.row.MName) }}</span>
|
227
|
227
|
</template>
|
228
|
228
|
</el-table-column>
|
229
|
229
|
<el-table-column label="药品追溯码" width="162" align="center">
|
230
|
230
|
<template slot-scope="scope">
|
231
|
|
- <div @click="getDrugCode(scope.row.ID,scope.row.DataSources,scope.row.DrugCode,scope.$index,scope.row.DrugId)"><el-input style="width: 100;" v-model="scope.row.DrugCode"></el-input></div>
|
|
231
|
+ <div @click="getDrugCode(scope.row.ID,scope.row.DataSources,scope.row.DrugCode,scope.$index,scope.row.DrugId,scope.row.Type)"><el-input style="width: 100;" v-model="scope.row.DrugCode"></el-input></div>
|
232
|
232
|
</template>
|
233
|
233
|
</el-table-column>
|
234
|
234
|
<el-table-column label="开立医生" width="150" align="center">
|
|
@@ -245,7 +245,7 @@
|
245
|
245
|
</el-table-column>
|
246
|
246
|
<el-table-column label="国家编码" width="162" align="center">
|
247
|
247
|
<template slot-scope="scope">
|
248
|
|
- <span>{{getDrugName(scope.row.DrugId)}}</span>
|
|
248
|
+ <span>{{ scope.row.Bm}}</span>
|
249
|
249
|
</template>
|
250
|
250
|
</el-table-column>
|
251
|
251
|
|
|
@@ -426,17 +426,15 @@ export default {
|
426
|
426
|
textAreaList:[],
|
427
|
427
|
scan_code:"",
|
428
|
428
|
printShow:false,
|
|
429
|
+ drug_type:1, //1是药品,2耗材
|
429
|
430
|
};
|
430
|
431
|
},
|
431
|
|
-
|
|
432
|
+
|
432
|
433
|
created() {
|
433
|
434
|
this.init();
|
434
|
|
- this.gettodaynumber();
|
435
|
|
- this.fun3();
|
436
|
435
|
this.getgetpartitionlist();
|
|
436
|
+ this.fun3();
|
437
|
437
|
this.org_id = this.$store.getters.xt_user.org.id
|
438
|
|
- // this.getwaitmount();//fun3
|
439
|
|
- // this.selectedbydefault();
|
440
|
438
|
},
|
441
|
439
|
methods: {
|
442
|
440
|
getTotal(){
|
|
@@ -455,9 +453,9 @@ export default {
|
455
|
453
|
}else{
|
456
|
454
|
return ""
|
457
|
455
|
}
|
458
|
|
-
|
|
456
|
+
|
459
|
457
|
}
|
460
|
|
-
|
|
458
|
+
|
461
|
459
|
},
|
462
|
460
|
openDialog(){
|
463
|
461
|
this.$nextTick(() => {
|
|
@@ -493,7 +491,6 @@ export default {
|
493
|
491
|
console.log("this.alreadmount", this.alreadmount);
|
494
|
492
|
},
|
495
|
493
|
async fun3() {
|
496
|
|
- console.log("fun3");
|
497
|
494
|
this.fun1().then((val) => {
|
498
|
495
|
this.fun2();
|
499
|
496
|
});
|
|
@@ -539,7 +536,7 @@ export default {
|
539
|
536
|
console.log("state--",this.state)
|
540
|
537
|
this.currentRow = val;
|
541
|
538
|
console.log("this.currentRow", this.currentRow);
|
542
|
|
-
|
|
539
|
+
|
543
|
540
|
if (this.state == 1) {
|
544
|
541
|
this.tableData = []
|
545
|
542
|
this.patients = {}
|
|
@@ -577,21 +574,27 @@ export default {
|
577
|
574
|
},
|
578
|
575
|
//包装selectedbydefault
|
579
|
576
|
fun2() {
|
580
|
|
- console.log("3333333this.waitmount_data", this.waitmount_data);
|
581
|
|
- // return new Promise((resolve, reject) => {
|
582
|
577
|
if (this.state == 1 && this.waitmount_data.length > 0) {
|
583
|
578
|
this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
|
|
579
|
+ this.currentRow = this.waitmount_data[0]
|
584
|
580
|
this.handleCurrentChange(this.waitmount_data[0]);
|
|
581
|
+ console.log(" this.currentRow111")
|
|
582
|
+ console.log( this.currentRow)
|
|
583
|
+
|
|
584
|
+
|
585
|
585
|
}
|
586
|
586
|
if (this.state == 2 && this.alreadmount_data.length > 0) {
|
587
|
587
|
this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
|
|
588
|
+ this.currentRow = this.alreadmount_data[0]
|
588
|
589
|
this.handleCurrentChange(this.alreadmount_data[0]);
|
|
590
|
+ console.log(" this.currentRow222")
|
|
591
|
+ console.log( this.currentRow)
|
589
|
592
|
}
|
590
|
593
|
// });
|
591
|
594
|
},
|
592
|
595
|
changeTimes() {
|
593
|
596
|
this.gettodaynumber();
|
594
|
|
- this.getwaitmount();
|
|
597
|
+ // this.getwaitmount();
|
595
|
598
|
this.fun3();
|
596
|
599
|
},
|
597
|
600
|
//获取当天发药的人数
|
|
@@ -623,8 +626,7 @@ export default {
|
623
|
626
|
if (res.data.state == 1) {
|
624
|
627
|
this.waitmount_data=[]
|
625
|
628
|
var list = res.data.data.list;
|
626
|
|
- this.baseList =[]
|
627
|
|
- this.baseList = res.data.data.baseList
|
|
629
|
+
|
628
|
630
|
if (this.shift != 0 || this.partition != 0) {
|
629
|
631
|
if (this.waitmount_data == null) {
|
630
|
632
|
this.waitmount = 0;
|
|
@@ -736,7 +738,6 @@ export default {
|
736
|
738
|
},
|
737
|
739
|
//包装getwaitmount
|
738
|
740
|
async fun1() {
|
739
|
|
- // return new Promise((resolve, reject) => {
|
740
|
741
|
var params = {
|
741
|
742
|
keyword: this.keywords,
|
742
|
743
|
time: this.start_time,
|
|
@@ -746,86 +747,21 @@ export default {
|
746
|
747
|
await waitingdrug(params).then((res) => {
|
747
|
748
|
if (res.data.state == 1) {
|
748
|
749
|
this.waitmount_data=[]
|
749
|
|
- var list = res.data.data.list;
|
750
|
750
|
this.patientList = []
|
751
|
|
- this.patientList = res.data.data.patientList
|
752
|
|
- var listTwo = res.data.data.listTwo
|
753
|
|
- var newArr =[]
|
754
|
|
- if(listTwo!=null && listTwo.length>0){
|
755
|
|
- for(let i=0;i<listTwo.length;i++){
|
756
|
|
- listTwo[i].PatientID = 0
|
757
|
|
- listTwo[i].Name=""
|
758
|
|
- listTwo[i].DialysisNo=""
|
759
|
|
- listTwo[i].PatientID = listTwo[i].patient_id
|
760
|
|
- listTwo[i].Name = listTwo[i].patient.name
|
761
|
|
- listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
|
762
|
|
- newArr.push(listTwo[i])
|
763
|
|
- }
|
764
|
|
- }
|
765
|
|
- if(list!=null && list.length>0){
|
766
|
|
- for(let i=0;i<list.length;i++){
|
767
|
|
- this.waitmount_data.push(list[i])
|
768
|
|
- }
|
769
|
|
- if(newArr!=null && newArr.length>0){
|
770
|
|
- for(let i=0;i<newArr.length;i++){
|
771
|
|
- this.waitmount_data.push(newArr[i])
|
772
|
|
- }
|
773
|
|
- }
|
774
|
|
- }
|
775
|
|
- if(list==null){
|
776
|
|
- if(newArr!=null && newArr.length>0){
|
777
|
|
- for(let i=0;i<newArr.length;i++){
|
778
|
|
- this.waitmount_data.push(newArr[i])
|
779
|
|
- }
|
780
|
|
- }
|
|
751
|
+ this.patientList = res.data.data.wait_patientList
|
|
752
|
+ this.waitmount_data = this.patientList
|
|
753
|
+ this.waitmount =this.waitmount_data.length
|
781
|
754
|
|
782
|
|
- }
|
783
|
|
-
|
784
|
|
- console.log("1111111");
|
785
|
755
|
}
|
786
|
756
|
});
|
787
|
757
|
await issueddrugs(params).then((res) => {
|
788
|
758
|
if (res.data.state == 1) {
|
789
|
759
|
this.alreadmount_data = []
|
790
|
|
- var list = res.data.data.list;
|
791
|
|
- var listTwo = res.data.data.listTwo
|
792
|
|
- var newArr =[]
|
793
|
|
- if(listTwo!=null && listTwo.length>0){
|
794
|
|
- for(let i=0;i<listTwo.length;i++){
|
795
|
|
- listTwo[i].PatientID = 0
|
796
|
|
- listTwo[i].Name=""
|
797
|
|
- listTwo[i].DialysisNo=""
|
798
|
|
- listTwo[i].PatientID = listTwo[i].patient_id
|
799
|
|
- listTwo[i].Name = listTwo[i].patient.name
|
800
|
|
- listTwo[i].DialysisNo = listTwo[i].patient.dialysis_no
|
801
|
|
- newArr.push(listTwo[i])
|
802
|
|
- }
|
803
|
|
- }
|
804
|
|
- if(list!=null && list.length>0){
|
805
|
|
- for(let i=0;i<list.length;i++){
|
806
|
|
- this.alreadmount_data.push(list[i])
|
807
|
|
- }
|
808
|
|
- if(newArr!=null && newArr.length>0){
|
809
|
|
- for(let i=0;i<newArr.length;i++){
|
810
|
|
- this.alreadmount_data.push(newArr[i])
|
811
|
|
- }
|
812
|
|
- }
|
813
|
|
- }
|
814
|
|
- if(list==null){
|
815
|
|
- if(newArr!=null && newArr.length>0){
|
816
|
|
- for(let i=0;i<newArr.length;i++){
|
817
|
|
- this.alreadmount_data.push(newArr[i])
|
818
|
|
- }
|
819
|
|
- }
|
820
|
|
-
|
821
|
|
- }
|
822
|
|
-
|
823
|
|
- console.log("1111111s");
|
|
760
|
+ this.alreadmount_data = res.data.data.user_patientList
|
|
761
|
+ this.alreadmount = this.alreadmount_data.length
|
824
|
762
|
}
|
825
|
763
|
});
|
826
|
|
- console.log("222222222");
|
827
|
764
|
|
828
|
|
- // })
|
829
|
765
|
},
|
830
|
766
|
getPatientName(patient_id){
|
831
|
767
|
var name = ""
|
|
@@ -855,14 +791,14 @@ export default {
|
855
|
791
|
// });
|
856
|
792
|
console.log("val2332323223",this.currentRow)
|
857
|
793
|
var params = {
|
858
|
|
- patient_id: this.currentRow.PatientID,
|
|
794
|
+ patient_id: this.currentRow.id,
|
859
|
795
|
is_medicine: val,
|
860
|
796
|
time: this.start_time,
|
861
|
797
|
};
|
862
|
798
|
getpharmacycontent(params).then((res) => {
|
863
|
799
|
if (res.data.state == 1) {
|
864
|
800
|
// loading.close()
|
865
|
|
-
|
|
801
|
+
|
866
|
802
|
var list = res.data.data.list;
|
867
|
803
|
console.log("hhhhawoowowow",res.data.data)
|
868
|
804
|
this.baseList =[]
|
|
@@ -987,11 +923,8 @@ export default {
|
987
|
923
|
// 搜索患者
|
988
|
924
|
searchAction() {
|
989
|
925
|
this.tableData = null;
|
990
|
|
- this.getwaitmount();
|
991
|
|
- if (this.shift != 0 || this.partition != 0) {
|
992
|
|
- } else {
|
993
|
|
- this.gettodaynumber();
|
994
|
|
- }
|
|
926
|
+ this.fun3();
|
|
927
|
+ // this.gettodaynumber();
|
995
|
928
|
},
|
996
|
929
|
|
997
|
930
|
// 药品发药
|
|
@@ -1012,6 +945,7 @@ export default {
|
1012
|
945
|
return false
|
1013
|
946
|
} else {
|
1014
|
947
|
var tmp = that.currentRow.PatientID;
|
|
948
|
+ console.log(that.currentRow)
|
1015
|
949
|
var params = {
|
1016
|
950
|
patient_id: that.currentRow.PatientID,
|
1017
|
951
|
time: that.start_time,
|
|
@@ -1080,9 +1014,11 @@ export default {
|
1080
|
1014
|
})
|
1081
|
1015
|
|
1082
|
1016
|
}else{
|
1083
|
|
- var tmp = this.currentRow.PatientID;
|
|
1017
|
+ var tmp = this.currentRow.id;
|
|
1018
|
+ console.log(this.currentRow)
|
|
1019
|
+
|
1084
|
1020
|
var params = {
|
1085
|
|
- patient_id: this.currentRow.PatientID,
|
|
1021
|
+ patient_id: this.currentRow.id,
|
1086
|
1022
|
time: this.start_time,
|
1087
|
1023
|
};
|
1088
|
1024
|
this.$confirm("确定是否对该患者进行发药?", "患者发药", {
|
|
@@ -1156,9 +1092,9 @@ export default {
|
1156
|
1092
|
});
|
1157
|
1093
|
return false
|
1158
|
1094
|
} else {
|
1159
|
|
- var tmp = that.currentRow.PatientID;
|
|
1095
|
+ var tmp = that.currentRow.id;
|
1160
|
1096
|
var params = {
|
1161
|
|
- patient_id: that.currentRow.PatientID,
|
|
1097
|
+ patient_id: that.currentRow.id,
|
1162
|
1098
|
admin_user_id: that.$store.getters.xt_user.user.id,
|
1163
|
1099
|
time: that.start_time,
|
1164
|
1100
|
};
|
|
@@ -1227,9 +1163,9 @@ export default {
|
1227
|
1163
|
.catch(() => {});
|
1228
|
1164
|
})
|
1229
|
1165
|
}else{
|
1230
|
|
- var tmp = this.currentRow.PatientID;
|
|
1166
|
+ var tmp = this.currentRow.id;
|
1231
|
1167
|
var params = {
|
1232
|
|
- patient_id: this.currentRow.PatientID,
|
|
1168
|
+ patient_id: this.currentRow.id,
|
1233
|
1169
|
time: this.start_time,
|
1234
|
1170
|
};
|
1235
|
1171
|
this.$confirm("确定是否对该患者进行退药?", "患者退药", {
|
|
@@ -1285,102 +1221,107 @@ export default {
|
1285
|
1221
|
}
|
1286
|
1222
|
return spc
|
1287
|
1223
|
},
|
1288
|
|
- getDrugCode(id,DataSources,DrugCode,index,DrugId){
|
1289
|
|
-
|
1290
|
|
- // 针对百霖
|
1291
|
|
- if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id==0|| this.$store.getters.xt_user.org.id==10726){
|
|
1224
|
+ getDrugCode(id,DataSources,DrugCode,index,DrugId,type){
|
|
1225
|
+ this.drug_type = type
|
|
1226
|
+ if (type == 1){
|
|
1227
|
+ // 针对百霖
|
|
1228
|
+ if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id==0|| this.$store.getters.xt_user.org.id==10726){
|
1292
|
1229
|
var params = {
|
1293
|
1230
|
drug_id:DrugId,
|
1294
|
1231
|
start_time:moment().subtract(15, 'days').format("YYYY-MM-DD")
|
1295
|
1232
|
}
|
1296
|
|
- getDrugTocalCount(params).then(response=>{
|
1297
|
|
- if(response.data.state == 1){
|
1298
|
|
-
|
1299
|
|
- var adviceList = response.data.data.adviceList
|
1300
|
|
-
|
1301
|
|
- var drug = response.data.data.drug
|
1302
|
|
-
|
1303
|
|
- this.scan_code = drug.scan_code
|
1304
|
|
-
|
1305
|
|
-
|
1306
|
|
- var str = ""
|
1307
|
|
- if(adviceList!=null && adviceList.length>0){
|
1308
|
|
- for(let i=0;i<adviceList.length;i++){
|
1309
|
|
- if(adviceList[i].drug_code!=""){
|
1310
|
|
- str+=adviceList[i].drug_code
|
|
1233
|
+ getDrugTocalCount(params).then(response=>{
|
|
1234
|
+ if(response.data.state == 1){
|
|
1235
|
+ var adviceList = response.data.data.adviceList
|
|
1236
|
+ var drug = response.data.data.drug
|
|
1237
|
+ this.scan_code = drug.scan_code
|
|
1238
|
+ var str = ""
|
|
1239
|
+ if(adviceList!=null && adviceList.length>0){
|
|
1240
|
+ for(let i=0;i<adviceList.length;i++){
|
|
1241
|
+ if(adviceList[i].drug_code!=""){
|
|
1242
|
+ str+=adviceList[i].drug_code
|
|
1243
|
+ }
|
1311
|
1244
|
}
|
1312
|
|
-
|
1313
|
1245
|
}
|
1314
|
|
- }
|
1315
|
|
- var new_arr = str.split(",");
|
|
1246
|
+ var new_arr = str.split(",");
|
1316
|
1247
|
|
1317
|
|
- console.log("adviceList==========",new_arr)
|
|
1248
|
+ console.log("adviceList==========",new_arr)
|
1318
|
1249
|
|
1319
|
|
- if(new_arr!=null && new_arr.length>0){
|
1320
|
|
-
|
1321
|
|
- let dataInfo = {}
|
1322
|
|
- new_arr.forEach((item, index) => {
|
1323
|
|
- if (!dataInfo[item]) {
|
|
1250
|
+ if(new_arr!=null && new_arr.length>0){
|
|
1251
|
+
|
|
1252
|
+ let dataInfo = {}
|
|
1253
|
+ new_arr.forEach((item, index) => {
|
|
1254
|
+ if (!dataInfo[item]) {
|
1324
|
1255
|
dataInfo[item] = {
|
1325
|
|
- drug_code:item,
|
1326
|
|
- child: [],
|
|
1256
|
+ drug_code:item,
|
|
1257
|
+ child: [],
|
|
1258
|
+ }
|
1327
|
1259
|
}
|
1328
|
|
- }
|
1329
|
|
- })
|
1330
|
|
- let arr = Object.values(dataInfo)
|
|
1260
|
+ })
|
|
1261
|
+ let arr = Object.values(dataInfo)
|
1331
|
1262
|
|
1332
|
|
- if(arr!=null && arr.length>0){
|
1333
|
|
-
|
1334
|
|
- for(let i=0;i<arr.length;i++){
|
1335
|
|
- for(let j=0;j<new_arr.length;j++){
|
|
1263
|
+ if(arr!=null && arr.length>0){
|
|
1264
|
+
|
|
1265
|
+ for(let i=0;i<arr.length;i++){
|
|
1266
|
+ for(let j=0;j<new_arr.length;j++){
|
1336
|
1267
|
if(arr[i].drug_code == new_arr[j]){
|
1337
|
|
- arr[i].child.push(new_arr[j])
|
|
1268
|
+ arr[i].child.push(new_arr[j])
|
1338
|
1269
|
}
|
1339
|
|
- }
|
1340
|
|
- }
|
1341
|
|
- }
|
1342
|
|
-
|
1343
|
|
- this.newArrList = []
|
1344
|
|
- this.newArrList = arr
|
1345
|
|
- console.log("newARRlIST----------",this.newArrList)
|
1346
|
|
- }
|
1347
|
|
-
|
1348
|
|
- this.drug_id = DrugId
|
1349
|
|
- this.id = id
|
1350
|
|
- var is_source =0
|
1351
|
|
- if (DataSources == "his处方"){
|
1352
|
|
- is_source = 1
|
1353
|
|
- }
|
1354
|
|
- if (DataSources == "临时医嘱"){
|
1355
|
|
- is_source = 2
|
|
1270
|
+ }
|
|
1271
|
+ }
|
|
1272
|
+ }
|
|
1273
|
+
|
|
1274
|
+ this.newArrList = []
|
|
1275
|
+ this.newArrList = arr
|
|
1276
|
+ console.log("newARRlIST----------",this.newArrList)
|
|
1277
|
+ }
|
|
1278
|
+
|
|
1279
|
+ this.drug_id = DrugId
|
|
1280
|
+ this.id = id
|
|
1281
|
+ var is_source =0
|
|
1282
|
+ if (DataSources == "his处方"){
|
|
1283
|
+ is_source = 1
|
|
1284
|
+ }
|
|
1285
|
+ if (DataSources == "临时医嘱"){
|
|
1286
|
+ is_source = 2
|
|
1287
|
+ }
|
|
1288
|
+ this.is_source = is_source
|
|
1289
|
+ this.textarea = DrugCode
|
|
1290
|
+ this.currentIndex = index
|
|
1291
|
+
|
|
1292
|
+ this.dialogVisibleOne = true
|
1356
|
1293
|
}
|
1357
|
|
- this.is_source = is_source
|
1358
|
|
- this.textarea = DrugCode
|
1359
|
|
- this.currentIndex = index
|
1360
|
|
-
|
1361
|
|
- this.dialogVisibleOne = true
|
1362
|
|
- }
|
1363
|
|
- })
|
1364
|
|
- }else{
|
1365
|
|
-
|
|
1294
|
+ })
|
|
1295
|
+ }else{
|
|
1296
|
+
|
|
1297
|
+ this.drug_id = DrugId
|
|
1298
|
+ this.id = id
|
|
1299
|
+ var is_source =0
|
|
1300
|
+ if (DataSources == "his处方"){
|
|
1301
|
+ is_source = 1
|
|
1302
|
+ }
|
|
1303
|
+ if (DataSources == "临时医嘱"){
|
|
1304
|
+ is_source = 2
|
|
1305
|
+ }
|
|
1306
|
+ this.is_source = is_source
|
|
1307
|
+ this.textarea = DrugCode
|
|
1308
|
+ this.currentIndex = index
|
|
1309
|
+ this.dialogVisibleOne = true
|
|
1310
|
+ }
|
|
1311
|
+ this.$nextTick(()=>{
|
|
1312
|
+ this.$refs.inputRef.focus()
|
|
1313
|
+ })
|
|
1314
|
+
|
|
1315
|
+ }else{
|
1366
|
1316
|
this.drug_id = DrugId
|
1367
|
1317
|
this.id = id
|
1368
|
|
- var is_source =0
|
1369
|
|
- if (DataSources == "his处方"){
|
1370
|
|
- is_source = 1
|
1371
|
|
- }
|
1372
|
|
- if (DataSources == "临时医嘱"){
|
1373
|
|
- is_source = 2
|
1374
|
|
- }
|
1375
|
|
- this.is_source = is_source
|
|
1318
|
+
|
|
1319
|
+ this.is_source = 1
|
1376
|
1320
|
this.textarea = DrugCode
|
1377
|
1321
|
this.currentIndex = index
|
1378
|
1322
|
this.dialogVisibleOne = true
|
1379
|
|
- }
|
1380
|
|
- this.$nextTick(()=>{
|
1381
|
|
- this.$refs.inputRef.focus()
|
1382
|
|
- })
|
1383
|
|
-
|
|
1323
|
+
|
|
1324
|
+ }
|
1384
|
1325
|
|
1385
|
1326
|
},
|
1386
|
1327
|
saveTextArea(){
|
|
@@ -1388,6 +1329,7 @@ export default {
|
1388
|
1329
|
id:this.id,
|
1389
|
1330
|
data_source:this.is_source,
|
1390
|
1331
|
drug_code:this.textarea,
|
|
1332
|
+ type: this.drug_type,
|
1391
|
1333
|
}
|
1392
|
1334
|
console.log("paramss",params)
|
1393
|
1335
|
|
|
@@ -1408,19 +1350,18 @@ export default {
|
1408
|
1350
|
console.log("event------------",event.key)
|
1409
|
1351
|
// 检查是否为特定的按键,例如回车键,来确认扫码枪输入完成
|
1410
|
1352
|
if (event.key === 'Enter') {
|
1411
|
|
-
|
|
1353
|
+
|
1412
|
1354
|
var textarea = ""
|
1413
|
1355
|
textarea += this.textarea.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
|
1414
|
|
-
|
1415
|
1356
|
|
1416
|
|
-
|
1417
|
1357
|
|
1418
|
|
-
|
1419
|
|
-
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
|
1420
|
1362
|
if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 10278|| this.$store.getters.xt_user.org.id == 10537 || this.$store.getters.xt_user.org.id == 10610 || this.$store.getters.xt_user.org.id == 10726){
|
1421
|
1363
|
|
1422
|
1364
|
var drugindentificaitoncode = this.getDrugIdentificationCode(this.drug_id)
|
1423
|
|
-
|
1424
|
1365
|
var total_one = 0
|
1425
|
1366
|
var total_two = 0
|
1426
|
1367
|
|
|
@@ -1433,14 +1374,14 @@ export default {
|
1433
|
1374
|
if (!dataInfo[item]) {
|
1434
|
1375
|
dataInfo[item] = {
|
1435
|
1376
|
drug_code:item,
|
1436
|
|
- child: [],
|
|
1377
|
+ child: [],
|
1437
|
1378
|
}
|
1438
|
1379
|
}
|
1439
|
1380
|
})
|
1440
|
1381
|
let new_arr = Object.values(dataInfo)
|
1441
|
1382
|
|
1442
|
1383
|
if(new_arr!=null && new_arr.length>0){
|
1443
|
|
-
|
|
1384
|
+
|
1444
|
1385
|
for(let i=0;i<new_arr.length;i++){
|
1445
|
1386
|
for(let j=0;j<arr.length;j++){
|
1446
|
1387
|
if(new_arr[i].drug_code == arr[j]){
|
|
@@ -1450,13 +1391,13 @@ export default {
|
1450
|
1391
|
}
|
1451
|
1392
|
}
|
1452
|
1393
|
arrList = new_arr
|
1453
|
|
-
|
|
1394
|
+
|
1454
|
1395
|
}
|
1455
|
1396
|
|
1456
|
1397
|
var is_err_check = false
|
1457
|
1398
|
var i_index = ""
|
1458
|
1399
|
var drug_code = ""
|
1459
|
|
-
|
|
1400
|
+
|
1460
|
1401
|
if(arr!=null && arr.length>0){
|
1461
|
1402
|
for(let i=0;i<arr.length;i++){
|
1462
|
1403
|
|
|
@@ -1478,8 +1419,8 @@ export default {
|
1478
|
1419
|
}
|
1479
|
1420
|
}
|
1480
|
1421
|
|
1481
|
|
-
|
1482
|
|
-
|
|
1422
|
+
|
|
1423
|
+
|
1483
|
1424
|
|
1484
|
1425
|
}
|
1485
|
1426
|
|
|
@@ -1488,7 +1429,7 @@ export default {
|
1488
|
1429
|
if(is_err_check == true){
|
1489
|
1430
|
arr.splice(i_index,1)
|
1490
|
1431
|
}
|
1491
|
|
-
|
|
1432
|
+
|
1492
|
1433
|
for(let i=0;i<this.newArrList.length;i++){
|
1493
|
1434
|
if(drug_code == this.newArrList[i].drug_code){
|
1494
|
1435
|
total_one = this.newArrList[i].child.length
|
|
@@ -1504,24 +1445,24 @@ export default {
|
1504
|
1445
|
|
1505
|
1446
|
console.log("数量1--------------",total_one)
|
1506
|
1447
|
console.log("数量2---------------",total_two)
|
1507
|
|
-
|
1508
|
|
-
|
1509
|
|
-
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
1510
|
1451
|
if(this.scan_code>0){
|
1511
|
1452
|
if((total_one + total_two)>this.scan_code){
|
1512
|
1453
|
this.$message.error("扫码次数已经超过限制!")
|
1513
|
1454
|
arr.splice(i_index,1)
|
1514
|
1455
|
}
|
1515
|
1456
|
}
|
1516
|
|
-
|
|
1457
|
+
|
1517
|
1458
|
var is_arr = this.hasDuplicates(arr)
|
1518
|
1459
|
|
1519
|
1460
|
this.textarea = arr.join(",")
|
1520
|
1461
|
}else{
|
1521
|
1462
|
// console.log("haaaaaaaaaaaaaaaaaaa",textarea)
|
1522
|
|
-
|
|
1463
|
+
|
1523
|
1464
|
var arr = textarea.split(",");
|
1524
|
|
-
|
|
1465
|
+
|
1525
|
1466
|
var lastElement = arr[arr.length - 2];
|
1526
|
1467
|
|
1527
|
1468
|
if(lastElement.length!=20){
|
|
@@ -1529,26 +1470,26 @@ export default {
|
1529
|
1470
|
arr.splice(arr.length-2,1)
|
1530
|
1471
|
}
|
1531
|
1472
|
console.log("arr-------------",arr)
|
1532
|
|
-
|
|
1473
|
+
|
1533
|
1474
|
this.textarea = ""
|
1534
|
1475
|
this.textarea = arr.join(",")
|
1535
|
1476
|
|
1536
|
1477
|
// this.textarea = textarea
|
1537
|
1478
|
}
|
1538
|
|
-
|
1539
|
1479
|
|
1540
|
|
-
|
|
1480
|
+
|
|
1481
|
+
|
1541
|
1482
|
}
|
1542
|
1483
|
|
1543
|
1484
|
this.getTotal()
|
1544
|
1485
|
},
|
1545
|
|
-
|
|
1486
|
+
|
1546
|
1487
|
hasDuplicates(arr) {
|
1547
|
1488
|
const uniqueNumbers = [...new Set(arr)];
|
1548
|
1489
|
return uniqueNumbers.length !== arr.length;
|
1549
|
1490
|
},
|
1550
|
1491
|
getDrugIdentificationCode(id){
|
1551
|
|
-
|
|
1492
|
+
|
1552
|
1493
|
var drug_identification_code = ""
|
1553
|
1494
|
for(let i=0;i<this.baseList.length;i++){
|
1554
|
1495
|
if(id == this.baseList[i].id){
|
|
@@ -1557,23 +1498,12 @@ export default {
|
1557
|
1498
|
}
|
1558
|
1499
|
return drug_identification_code
|
1559
|
1500
|
},
|
1560
|
|
- getDrugScanCode(drug_id){
|
1561
|
|
- var scan_code = ""
|
1562
|
|
- for(let i=0;i<this.baseList.length;i++){
|
1563
|
|
- if(drug_id == this.baseList[i].id){
|
1564
|
|
- scan_code = this.baseList[i].scan_code
|
1565
|
|
- }
|
1566
|
|
- }
|
1567
|
|
- return scan_code
|
1568
|
|
- }
|
1569
|
|
-
|
1570
|
|
-
|
1571
|
1501
|
|
1572
|
1502
|
},
|
1573
|
1503
|
watch:{
|
1574
|
1504
|
|
1575
|
1505
|
}
|
1576
|
|
-
|
|
1506
|
+
|
1577
|
1507
|
};
|
1578
|
1508
|
</script>
|
1579
|
1509
|
|