|
@@ -905,7 +905,7 @@
|
905
|
905
|
},
|
906
|
906
|
|
907
|
907
|
handleSuccessTwo({ results, header }) {
|
908
|
|
- console.log("hhhhhhhh",results)
|
|
908
|
+
|
909
|
909
|
if (header != undefined && header.length > 0) {
|
910
|
910
|
|
911
|
911
|
var isHasDrugName = header.includes('*药品名称')
|
|
@@ -936,8 +936,8 @@
|
936
|
936
|
|
937
|
937
|
var isHasManufacturer = header.includes('*生产厂商')
|
938
|
938
|
|
939
|
|
- var isHasDealer = header.includes('*经销商')
|
940
|
|
- if (!(isHasDrugName && isHasDrugAlias && isHasDrugSpec && isHasDrugType && isHasDrugStockLimit && isHasDrugOriginPlace && isHasDrugDosageForm && isHasMaxUnit && isHasMinUnit && isHasUnitMatrixing && isHasRetailPrice && isHasLastPrice && isHasDrugClassifye && isHasManufacturer && isHasDealer)) {
|
|
939
|
+
|
|
940
|
+ if (!(isHasDrugName && isHasDrugAlias && isHasDrugSpec && isHasDrugType && isHasDrugStockLimit && isHasDrugOriginPlace && isHasDrugDosageForm && isHasMaxUnit && isHasMinUnit && isHasUnitMatrixing && isHasRetailPrice && isHasLastPrice && isHasDrugClassifye && isHasManufacturer)) {
|
941
|
941
|
this.dialogVisible = true
|
942
|
942
|
return
|
943
|
943
|
}
|
|
@@ -948,7 +948,7 @@
|
948
|
948
|
|
949
|
949
|
var tableData = []
|
950
|
950
|
for(let i=0;i<results.length;i++){
|
951
|
|
- let obj = {"drug_type_id":0,"drug_dosage_form_id":0,"medical_insurance_level_id":0,"drug_classify_id":0,"manufacturer_id":0,"dealer_id":0,"statistics_category_id":0,"drug_control_id":0,"pharmacology_category_id":0}
|
|
951
|
+ let obj = {"drug_type_id":0,"drug_dosage_form_id":0,"medical_insurance_level_id":0,"drug_classify_id":0,"manufacturer_id":0,"dealer_id":0,"statistics_category_id":0,"drug_control_id":0,"pharmacology_category_id":0,"drug_category_id":0}
|
952
|
952
|
for (var key in results[i]) {
|
953
|
953
|
|
954
|
954
|
if (results[i]['*药品名称'] === undefined) {
|
|
@@ -1101,11 +1101,13 @@
|
1101
|
1101
|
}
|
1102
|
1102
|
}
|
1103
|
1103
|
|
1104
|
|
- if (results[i]['药品别名'] === undefined) {
|
1105
|
|
- obj['drug_alias'] = ''
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+ if (results[i]['别名拼音'] === undefined) {
|
|
1107
|
+ obj['drug_alias_pinyin'] = ''
|
1106
|
1108
|
} else {
|
1107
|
|
- if (key == '药品别名') {
|
1108
|
|
- obj['drug_alias'] = results[i][key].replace(/\s/g,"")
|
|
1109
|
+ if (key == '别名拼音') {
|
|
1110
|
+ obj['drug_alias_pinyin'] = results[i][key].replace(/\s/g,"")
|
1109
|
1111
|
}
|
1110
|
1112
|
}
|
1111
|
1113
|
|
|
@@ -1117,6 +1119,22 @@
|
1117
|
1119
|
}
|
1118
|
1120
|
}
|
1119
|
1121
|
|
|
1122
|
+ if (results[i]['别名五笔'] === undefined) {
|
|
1123
|
+ obj['drug_alias_wubi'] = ''
|
|
1124
|
+ } else {
|
|
1125
|
+ if (key == '别名五笔') {
|
|
1126
|
+ obj['drug_alias_wubi'] = results[i][key].replace(/\s/g,"")
|
|
1127
|
+ }
|
|
1128
|
+ }
|
|
1129
|
+
|
|
1130
|
+ if (results[i]['药品类别'] === undefined) {
|
|
1131
|
+ obj['drug_category'] = ''
|
|
1132
|
+ } else {
|
|
1133
|
+ if (key == '药品类别') {
|
|
1134
|
+ obj['drug_category'] = results[i][key].replace(/\s/g,"")
|
|
1135
|
+ }
|
|
1136
|
+ }
|
|
1137
|
+
|
1120
|
1138
|
if (results[i]['开药控制'] === undefined) {
|
1121
|
1139
|
obj['drug_control'] = ''
|
1122
|
1140
|
} else {
|
|
@@ -1265,12 +1283,12 @@
|
1265
|
1283
|
var goodUnit = this.$store.getters.good_unit
|
1266
|
1284
|
|
1267
|
1285
|
var pharmacology_category = this.getDictionaryDataConfig('system','pharmacology_category')
|
1268
|
|
- console.log("药理分类",pharmacology_category)
|
1269
|
|
-
|
|
1286
|
+
|
1270
|
1287
|
var statistics_category = this.getDictionaryDataConfig('system','statistics_category')
|
1271
|
|
- console.log("统计分类",statistics_category)
|
|
1288
|
+
|
1272
|
1289
|
|
1273
|
|
-
|
|
1290
|
+ var drug_category = this.getDictionaryDataConfig('system','drug_category')
|
|
1291
|
+ console.log("药品分类",drug_category)
|
1274
|
1292
|
for(let i=0;i<tableData.length;i++){
|
1275
|
1293
|
for(let j=0;j<drugType.length;j++){
|
1276
|
1294
|
if(tableData[i].drug_type == drugType[j].name){
|
|
@@ -1296,13 +1314,13 @@
|
1296
|
1314
|
}
|
1297
|
1315
|
}
|
1298
|
1316
|
|
1299
|
|
- console.log("生产",this.manufacturers)
|
|
1317
|
+
|
1300
|
1318
|
for(let j=0;j<this.manufacturers.length;j++){
|
1301
|
1319
|
if(tableData[i].manufacturer == this.manufacturers[j].manufacturer_name){
|
1302
|
1320
|
tableData[i].manufacturer_id = this.manufacturers[j].id
|
1303
|
1321
|
}
|
1304
|
1322
|
}
|
1305
|
|
- console.log("经销商",this.dealer)
|
|
1323
|
+
|
1306
|
1324
|
for(let j=0;j<this.dealer.length;j++){
|
1307
|
1325
|
if(tableData[i].dealer == this.dealer[j].dealer_name){
|
1308
|
1326
|
tableData[i].dealer_id = this.dealer[j].id
|
|
@@ -1372,6 +1390,12 @@
|
1372
|
1390
|
if(tableData[i].hosp_appr_flag == "审批不通过"){
|
1373
|
1391
|
tableData[i].hosp_appr_flag = 3
|
1374
|
1392
|
}
|
|
1393
|
+
|
|
1394
|
+ for(let j=0;j<drug_category.length;j++){
|
|
1395
|
+ if(tableData[i].drug_category == drug_category[j].name ){
|
|
1396
|
+ tableData[i].drug_category_id = drug_category[j].id
|
|
1397
|
+ }
|
|
1398
|
+ }
|
1375
|
1399
|
|
1376
|
1400
|
}
|
1377
|
1401
|
}
|
|
@@ -1385,12 +1409,14 @@
|
1385
|
1409
|
let params = {
|
1386
|
1410
|
'drugs':tableData
|
1387
|
1411
|
}
|
1388
|
|
- console.log("params2222",params)
|
|
1412
|
+ console.log("导入数据",params)
|
1389
|
1413
|
|
1390
|
1414
|
postDrugInformation(params).then(response=>{
|
1391
|
1415
|
if(response.data.state == 1){
|
1392
|
1416
|
var msg = response.data.data.msg
|
|
1417
|
+ this.getList()
|
1393
|
1418
|
this.$message.success("导入成功!")
|
|
1419
|
+
|
1394
|
1420
|
}else{
|
1395
|
1421
|
this.$message.error("导入失败")
|
1396
|
1422
|
}
|