|
@@ -49,7 +49,7 @@
|
49
|
49
|
</el-form-item>
|
50
|
50
|
<span style="margin-bottom:20px;font-size:20px;padding:0 10px;">*</span>
|
51
|
51
|
<el-form-item prop="min_number" class="noMargin">
|
52
|
|
- <el-input v-model="form.min_number" style="width:100px;margin-right:5px;" :disabled="dosageShow" type="number" placeholder="拆零"> </el-input>
|
|
52
|
+ <el-input v-model="form.min_number" style="width:100px;margin-right:5px;" :disabled="minNumberShow" type="number" placeholder="拆零"> </el-input>
|
53
|
53
|
</el-form-item>
|
54
|
54
|
<el-form-item prop="min_unit" class="noMargin">
|
55
|
55
|
<el-select v-model="form.min_unit" style="width:160px;" placeholder="拆零单位" @change="changeMinUnit">
|
|
@@ -120,10 +120,18 @@
|
120
|
120
|
</el-select>
|
121
|
121
|
</el-form-item>
|
122
|
122
|
<el-form-item label="默认开药数量:" prop="prescribing_number">
|
123
|
|
- <el-input v-model="form.prescribing_number" style="width:160px;" placeholder=""
|
|
123
|
+ <el-input v-model="form.prescribing_number" style="width:70px;margin-right:5px;" placeholder=""
|
124
|
124
|
maxlength="30"></el-input>
|
|
125
|
+ <el-select v-model="form.prescribing_number_unit" style="width:80px;" placeholder="开药数量单位">
|
|
126
|
+ <el-option
|
|
127
|
+ v-for="(item,index) in packingUnit"
|
|
128
|
+ :key="index"
|
|
129
|
+ :label="item.name"
|
|
130
|
+ :value="item.name">
|
|
131
|
+ </el-option>
|
|
132
|
+ </el-select>
|
125
|
133
|
</el-form-item>
|
126
|
|
- <el-form-item label="开药数量单位:" prop="prescribing_number">
|
|
134
|
+ <!-- <el-form-item label="开药数量单位:" prop="prescribing_number">
|
127
|
135
|
<el-select v-model="form.prescribing_number_unit" style="width:160px;" placeholder="开药数量单位">
|
128
|
136
|
<el-option
|
129
|
137
|
v-for="(item,index) in getDataConfig('hemodialysis','units')"
|
|
@@ -132,7 +140,7 @@
|
132
|
140
|
:value="item.name">
|
133
|
141
|
</el-option>
|
134
|
142
|
</el-select>
|
135
|
|
- </el-form-item>
|
|
143
|
+ </el-form-item> -->
|
136
|
144
|
<el-form-item label="默认开药天数:" prop="prescribing_number">
|
137
|
145
|
<el-input v-model="form.drug_day" style="width:160px;" placeholder=""
|
138
|
146
|
maxlength="30"></el-input>
|
|
@@ -593,7 +601,9 @@
|
593
|
601
|
statisticsCategoryList:[],
|
594
|
602
|
pharmacologyCategoryList:[],
|
595
|
603
|
dosageShow:false,
|
596
|
|
- unitList:[]
|
|
604
|
+ unitList:[],
|
|
605
|
+ minNumberShow:false,
|
|
606
|
+ packingUnit:[]
|
597
|
607
|
}
|
598
|
608
|
},
|
599
|
609
|
props: {
|
|
@@ -654,16 +664,17 @@
|
654
|
664
|
show(id, obj) {
|
655
|
665
|
|
656
|
666
|
this.unitList = []
|
|
667
|
+ this.packingUnit = []
|
657
|
668
|
var arr = getDataConfig('hemodialysis','units')
|
658
|
669
|
for(let i=0;i<arr.length;i++){
|
659
|
|
- if(obj.max_unit == arr[i].name){
|
660
|
|
- this.unitList.push(arr[i])
|
661
|
|
- }
|
662
|
|
- }
|
663
|
|
- for(let i=0;i<arr.length;i++){
|
664
|
|
- if(obj.min_unit == arr[i].name){
|
665
|
|
- this.unitList.push(arr[i])
|
666
|
|
- }
|
|
670
|
+ if(obj.min_unit == arr[i].name){
|
|
671
|
+ this.unitList.push(arr[i])
|
|
672
|
+ this.packingUnit.push(arr[i])
|
|
673
|
+ }
|
|
674
|
+ if(obj.max_unit == arr[i].name){
|
|
675
|
+ this.unitList.push(arr[i])
|
|
676
|
+ this.packingUnit.push(arr[i])
|
|
677
|
+ }
|
667
|
678
|
}
|
668
|
679
|
console.log('this.unitList',this.unitList)
|
669
|
680
|
this.getInitializtion()
|
|
@@ -907,12 +918,12 @@
|
907
|
918
|
this.form.min_number = 1
|
908
|
919
|
this.dosageShow = true
|
909
|
920
|
}
|
910
|
|
- if(val != this.form.max_unit){
|
911
|
|
- this.dosageShow = false
|
912
|
|
- }
|
|
921
|
+ // if(val != this.form.max_unit){
|
|
922
|
+ // this.dosageShow = false
|
|
923
|
+ // }
|
913
|
924
|
if(val == this.form.max_unit){
|
914
|
925
|
this.form.min_number = 1
|
915
|
|
- this.dosageShow = true
|
|
926
|
+ this.minNumberShow = true
|
916
|
927
|
}
|
917
|
928
|
|
918
|
929
|
// if(this.form.dosage == "" || this.form.max_unit == ""){
|
|
@@ -920,16 +931,26 @@
|
920
|
931
|
// }
|
921
|
932
|
var arr = getDataConfig('hemodialysis','units')
|
922
|
933
|
this.unitList = []
|
|
934
|
+ this.packingUnit = []
|
923
|
935
|
for(let i=0;i<arr.length;i++){
|
924
|
936
|
if(val == arr[i].name){
|
925
|
937
|
this.unitList.push(arr[i])
|
|
938
|
+ this.packingUnit.push(arr[i])
|
926
|
939
|
}
|
927
|
940
|
if(this.form.max_unit == arr[i].name){
|
928
|
941
|
this.unitList.push(arr[i])
|
|
942
|
+ this.packingUnit.push(arr[i])
|
929
|
943
|
}
|
930
|
944
|
if(this.form.drug_dose_unit == arr[i].id){
|
931
|
945
|
this.unitList.push(arr[i])
|
932
|
946
|
}
|
|
947
|
+ if(this.form.prescribing_number_unit == arr[i].id){
|
|
948
|
+ this.packingUnit.push(arr[i])
|
|
949
|
+ }
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
933
|
954
|
let idArr = []
|
934
|
955
|
this.unitList.map(item => {
|
935
|
956
|
idArr.push(item.id)
|
|
@@ -939,6 +960,15 @@
|
939
|
960
|
this.unitList.push(arr[i])
|
940
|
961
|
}
|
941
|
962
|
}
|
|
963
|
+ let packingIdArr = []
|
|
964
|
+ this.packingUnit.map(item => {
|
|
965
|
+ packingIdArr.push(item.id)
|
|
966
|
+ })
|
|
967
|
+ if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
|
|
968
|
+ if(this.form.prescribing_number_unit == arr[i].id){
|
|
969
|
+ this.packingUnit.push(arr[i])
|
|
970
|
+ }
|
|
971
|
+ }
|
942
|
972
|
}
|
943
|
973
|
let ojb = {};
|
944
|
974
|
this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
|
|
@@ -947,12 +977,46 @@
|
947
|
977
|
return prevArr
|
948
|
978
|
}, [])
|
949
|
979
|
|
|
980
|
+ let newojb = {};
|
|
981
|
+ this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
|
|
982
|
+ //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
|
|
983
|
+ newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
|
|
984
|
+ return prevArr
|
|
985
|
+ }, [])
|
|
986
|
+
|
950
|
987
|
},
|
951
|
988
|
changeMaxUnit(val){
|
952
|
989
|
if(val == this.form.min_unit){
|
953
|
990
|
this.form.min_number = 1
|
954
|
|
- this.dosageShow = true
|
|
991
|
+ this.minNumberShow = true
|
955
|
992
|
}
|
|
993
|
+ var arr = getDataConfig('hemodialysis','units')
|
|
994
|
+ this.packingUnit = []
|
|
995
|
+ for(let i=0;i<arr.length;i++){
|
|
996
|
+ if(val == arr[i].name){
|
|
997
|
+ this.packingUnit.push(arr[i])
|
|
998
|
+ }
|
|
999
|
+ if(this.form.min_unit == arr[i].name){
|
|
1000
|
+ this.packingUnit.push(arr[i])
|
|
1001
|
+ }
|
|
1002
|
+ let packingIdArr = []
|
|
1003
|
+ this.packingUnit.map(item => {
|
|
1004
|
+ packingIdArr.push(item.id)
|
|
1005
|
+ })
|
|
1006
|
+ if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
|
|
1007
|
+ if(this.form.prescribing_number_unit == arr[i].id){
|
|
1008
|
+ this.packingUnit.push(arr[i])
|
|
1009
|
+ }
|
|
1010
|
+ }
|
|
1011
|
+ }
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+ let newojb = {};
|
|
1015
|
+ this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
|
|
1016
|
+ //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
|
|
1017
|
+ newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
|
|
1018
|
+ return prevArr
|
|
1019
|
+ }, [])
|
956
|
1020
|
}
|
957
|
1021
|
}, watch: {
|
958
|
1022
|
visible(val) {
|