28169 пре 1 недеља
родитељ
комит
e75211be92

+ 1 - 1
build/cdn.json Прегледај датотеку

@@ -1,3 +1,3 @@
1 1
 {
2
-  "version": "2999.999.1315"
2
+  "version": "2999.999.1316"
3 3
 }

+ 9 - 0
src/api/pharmacy.js Прегледај датотеку

@@ -191,3 +191,12 @@ export function changeDrugCode(params){
191 191
     params:params,
192 192
   })
193 193
 }
194
+
195
+export function getDrugTocalCount(params){
196
+
197
+  return request({
198
+    url:"/api/pharmacy/getdrugtocalcount",
199
+    method:"get",
200
+    params:params
201
+  })
202
+}

+ 217 - 22
src/xt_pages/Pharmacy/PatientDispensing.vue Прегледај датотеку

@@ -228,7 +228,7 @@
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)"><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)"><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">
@@ -354,7 +354,8 @@ import {
354 354
   drugwithdrawal,
355 355
   getpartitionlist,
356 356
   changeDrugCode,
357
-  changeZeroFlag
357
+  changeZeroFlag,
358
+  getDrugTocalCount
358 359
 
359 360
 } from "@/api/pharmacy";
360 361
 import dataDruguse from "../../router/modules/dataDruguse";
@@ -415,8 +416,10 @@ export default {
415 416
       currentIndex:0,
416 417
       is_drug_open:"2",
417 418
       textarea:"",
418
-      patientList:[]
419
-
419
+      patientList:[],
420
+      drug_id:0,
421
+      total_count:0,
422
+      newArrList:[]
420 423
     };
421 424
   },
422 425
   watch: {},
@@ -1238,20 +1241,98 @@ export default {
1238 1241
        }
1239 1242
        return spc
1240 1243
     },
1241
-    getDrugCode(id,DataSources,DrugCode,index){
1242
-      this.id = id
1243
-      var is_source =0
1244
-       if (DataSources == "his处方"){
1245
-        is_source = 1
1246
-       }
1247
-       if (DataSources == "临时医嘱"){
1248
-         is_source = 2
1249
-       }
1250
-       this.is_source = is_source
1251
-       this.textarea = DrugCode
1252
-       this.currentIndex = index
1244
+    getDrugCode(id,DataSources,DrugCode,index,DrugId){
1253 1245
       
1254
-       this.dialogVisibleOne = true
1246
+     // 针对百霖
1247
+       if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id == 0){
1248
+          var params = {
1249
+            drug_id:DrugId,
1250
+            start_time:moment().subtract(15, 'days').format("YYYY-MM-DD")
1251
+          }
1252
+          console.log("params-------------",params)
1253
+         getDrugTocalCount(params).then(response=>{
1254
+           if(response.data.state == 1){
1255
+             
1256
+            var adviceList = response.data.data.adviceList
1257
+
1258
+            var str = ""
1259
+            if(adviceList!=null && adviceList.length>0){
1260
+              for(let i=0;i<adviceList.length;i++){
1261
+                if(adviceList[i].drug_code!=""){
1262
+                  str+=adviceList[i].drug_code 
1263
+                }
1264
+               
1265
+              }
1266
+            }
1267
+            var new_arr = str.split(",");
1268
+
1269
+            console.log("adviceList==========",new_arr)
1270
+
1271
+            if(new_arr!=null && new_arr.length>0){
1272
+               
1273
+               let dataInfo = {}
1274
+               new_arr.forEach((item, index) => {
1275
+                if (!dataInfo[item]) {
1276
+                    dataInfo[item] = {
1277
+                    drug_code:item,
1278
+                    child: [], 
1279
+                  }
1280
+                 }
1281
+               })
1282
+               let arr = Object.values(dataInfo)
1283
+
1284
+               if(arr!=null && arr.length>0){
1285
+                
1286
+                 for(let i=0;i<arr.length;i++){
1287
+                   for(let j=0;j<new_arr.length;j++){
1288
+                      if(arr[i].drug_code == new_arr[j]){
1289
+                         arr[i].child.push(new_arr[j])
1290
+                      }
1291
+                   }
1292
+                 }
1293
+               }
1294
+               
1295
+               this.newArrList = []
1296
+               this.newArrList = arr
1297
+
1298
+
1299
+            }
1300
+              
1301
+            this.drug_id = DrugId
1302
+            this.id = id
1303
+            var is_source =0
1304
+            if (DataSources == "his处方"){
1305
+              is_source = 1
1306
+            }
1307
+            if (DataSources == "临时医嘱"){
1308
+              is_source = 2
1309
+            }
1310
+            this.is_source = is_source
1311
+            this.textarea = DrugCode
1312
+            this.currentIndex = index
1313
+            
1314
+            this.dialogVisibleOne = true
1315
+           }
1316
+         })
1317
+       }else{
1318
+        
1319
+        this.drug_id = DrugId
1320
+        this.id = id
1321
+        var is_source =0
1322
+        if (DataSources == "his处方"){
1323
+          is_source = 1
1324
+        }
1325
+        if (DataSources == "临时医嘱"){
1326
+          is_source = 2
1327
+        }
1328
+        this.is_source = is_source
1329
+        this.textarea = DrugCode
1330
+        this.currentIndex = index
1331
+        
1332
+        this.dialogVisibleOne = true
1333
+       }
1334
+
1335
+     
1255 1336
 
1256 1337
     },
1257 1338
     saveTextArea(){
@@ -1274,6 +1355,7 @@ export default {
1274 1355
       })
1275 1356
     },
1276 1357
     changeText(event){
1358
+
1277 1359
      
1278 1360
       // 检查是否为特定的按键,例如回车键,来确认扫码枪输入完成
1279 1361
       if (event.key === 'Enter') {
@@ -1281,30 +1363,118 @@ export default {
1281 1363
         var textarea = ""
1282 1364
         textarea += this.textarea.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
1283 1365
          
1284
-      
1285
-
1286 1366
         if(this.$store.getters.xt_user.org.id == 10138 || this.$store.getters.xt_user.org.id==0){
1367
+
1368
+          var drugindentificaitoncode = this.getDrugIdentificationCode(this.drug_id)
1369
+          console.log("drugindentification===================",drugindentificaitoncode)
1370
+
1371
+          var scan_code = this.getDrugScanCode(this.drug_id)
1372
+          
1373
+          console.log("scan_code============",scan_code)
1374
+
1375
+          var total_one = 0
1376
+          var total_two = 0
1377
+
1378
+          console.log("newArr-------------",this.newArrList)
1379
+
1380
+         
1381
+
1287 1382
           var arr= []
1288 1383
           arr = textarea.split(",")
1384
+          var arrList = []
1385
+          if(arr!=null && arr.length>0){
1386
+            let dataInfo = {}
1387
+               arr.forEach((item, index) => {
1388
+                if (!dataInfo[item]) {
1389
+                    dataInfo[item] = {
1390
+                    drug_code:item,
1391
+                    child: [], 
1392
+                  }
1393
+                 }
1394
+               })
1395
+               let new_arr = Object.values(dataInfo)
1396
+
1397
+               if(new_arr!=null && new_arr.length>0){
1398
+                
1399
+                 for(let i=0;i<new_arr.length;i++){
1400
+                   for(let j=0;j<arr.length;j++){
1401
+                      if(new_arr[i].drug_code == arr[j]){
1402
+                         new_arr[i].child.push(arr[j])
1403
+                      }
1404
+                   }
1405
+                 }
1406
+               }
1407
+            arrList = new_arr
1408
+            
1409
+          }
1410
+
1289 1411
           var is_err_check = false
1290 1412
           var i_index = ""
1413
+          var drug_code = ""
1414
+       
1291 1415
           if(arr!=null && arr.length>0){
1292 1416
             for(let i=0;i<arr.length;i++){
1417
+
1293 1418
                if(arr[i]!=""){
1419
+                 drug_code = arr[i]
1420
+                 i_index = i
1294 1421
                  if(arr[i].length!=20){
1295 1422
                    this.$message.error("药品追溯码长度没有满足20位!")
1296 1423
                    is_err_check = true
1297
-                   i_index = i
1298 1424
                  }
1425
+                 if(drugindentificaitoncode>0){
1426
+                  if(arr[i].substring(0,7)!= drugindentificaitoncode){
1427
+                    this.$message.error("药品标识码格式不正确,请重新扫码")
1428
+                    is_err_check = true
1429
+                  }
1430
+                 }
1431
+                
1432
+
1299 1433
                }
1300 1434
 
1301 1435
             }
1302 1436
           }
1303
-          console.log("is_err_check+++++++++++++",is_err_check)
1304 1437
           if(is_err_check == true){
1305 1438
               arr.splice(i_index,1)
1306 1439
           }
1307
-          console.log("arr-------------------------",arr)
1440
+         
1441
+          for(let i=0;i<this.newArrList.length;i++){
1442
+             if(drug_code == this.newArrList[i].drug_code){
1443
+                 total_one = this.newArrList[i].child.length
1444
+             }
1445
+          }
1446
+
1447
+          for(let i=0;i<arrList.length;i++){
1448
+             if(drug_code == arrList[i].drug_code){
1449
+                 total_two = arrList[i].child.length
1450
+             }
1451
+          }
1452
+
1453
+
1454
+          console.log("数量1--------------",total_one)
1455
+          console.log("数量2---------------",total_two)
1456
+        
1457
+          console.log("scan_code=====",scan_code)
1458
+          
1459
+          if(scan_code>0){
1460
+            if((total_one + total_two)>scan_code){
1461
+              this.$message.error("扫码次数已经超过限制!")
1462
+              arr.splice(i_index,1)
1463
+            }
1464
+          }
1465
+         
1466
+
1467
+
1468
+
1469
+         var is_arr = this.hasDuplicates(arr)
1470
+
1471
+         if(is_arr == true){
1472
+           this.$message.error("药品追溯码已经存在,不能重复扫码!")
1473
+           arr.splice(i_index,1)
1474
+         }
1475
+
1476
+         console.log("is_arr-=--------------",is_arr)
1477
+
1308 1478
           this.textarea = arr.join(",")
1309 1479
         }else{
1310 1480
 
@@ -1317,6 +1487,31 @@ export default {
1317 1487
 
1318 1488
 
1319 1489
     },
1490
+    
1491
+    hasDuplicates(arr) {
1492
+      const uniqueNumbers = [...new Set(arr)];
1493
+      return uniqueNumbers.length !== arr.length;
1494
+    },
1495
+    getDrugIdentificationCode(id){
1496
+       
1497
+      var drug_identification_code = ""
1498
+      for(let i=0;i<this.baseList.length;i++){
1499
+          if(id == this.baseList[i].id){
1500
+            drug_identification_code = this.baseList[i].drug_identification_code
1501
+          }
1502
+      }
1503
+      return drug_identification_code
1504
+    },
1505
+    getDrugScanCode(drug_id){
1506
+      var scan_code = ""
1507
+      for(let i=0;i<this.baseList.length;i++){
1508
+       if(drug_id == this.baseList[i].id){
1509
+          scan_code = this.baseList[i].scan_code
1510
+       }
1511
+      }
1512
+      return scan_code
1513
+    }
1514
+
1320 1515
 
1321 1516
 
1322 1517
   },

+ 8 - 0
src/xt_pages/dialysis/details/consumable/dialysisGood.vue Прегледај датотеку

@@ -97,6 +97,8 @@
97 97
            </template>
98 98
         </el-table-column>
99 99
 
100
+       
101
+
100 102
         <el-table-column
101 103
           align="center"
102 104
           prop="name"
@@ -184,6 +186,12 @@
184 186
            </template>
185 187
         </el-table-column>
186 188
 
189
+        <el-table-column  align="center"  width="60" label="钙"  v-if="org_id ==10610 || org_id == 10610">
190
+           <template slot-scope="scope">
191
+            {{scope.row.dialysis_solution.calcium}}
192
+           </template>
193
+        </el-table-column>
194
+
187 195
         <el-table-column
188 196
           align="center"
189 197
           prop="name"

+ 5 - 0
src/xt_pages/dialysis/details/consumable/dialysisGoodPrint.vue Прегледај датотеку

@@ -30,6 +30,7 @@
30 30
                 <td width="100">姓名</td>
31 31
                 <td width="100">透析号</td>
32 32
                 <td width="100">透析模式</td>
33
+               
33 34
                 <td width="200" v-for="(item,index) in rowList" :key="index">
34 35
                   {{item.filed_name_cn}} 
35 36
                 </td>
@@ -45,6 +46,7 @@
45 46
                  <td>{{item.patient.name}}</td>
46 47
                 <td>{{item.patient.dialysis_no}}</td>
47 48
                 <td>{{ getModeId(item.mode_id) }}</td>
49
+               
48 50
                 <td v-for="(it,index) in rowList" :key="index">
49 51
                   <!-- {{getName(item.rowList[index].filed_name_cn,item.dialysis_solution)}} -->
50 52
                   <span v-if="org_id !=10599">
@@ -68,6 +70,7 @@
68 70
                 <td width="100">姓名</td>
69 71
                 <td width="100">透析机号</td>
70 72
                 <td width="100">透析模式</td>
73
+                <td width="100" v-if="org_id == 10610 || org_id == 0">钙</td>
71 74
                 <td width="200" v-for="(item,index) in typeList" :key="index">
72 75
                   {{item.type_name}} 
73 76
                 </td>
@@ -82,6 +85,7 @@
82 85
                  <td>{{item.patient.name}}</td>
83 86
                 <td>{{item.patient.dialysis_no}}</td>
84 87
                 <td>{{ getModeId(item.mode_id) }}</td>
88
+                <td v-if="org_id == 0 || org_id == 10610">{{ item.dialysis_solution.calcium }}</td>
85 89
                 <td v-for="(it,index) in typeList" :key="index">
86 90
                   <span v-if="item.his_prescription_project.length>0"> {{getStr(item.typeList[index].id,item.his_prescription_project,item.patient_id)}}</span>
87 91
                   <span v-if="item.his_prescription_project.length==0">{{getStr(item.typeList[index].id,item.projectList,item.patient_id)}}</span>
@@ -105,6 +109,7 @@
105 109
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
106 110
   import print from 'print-js'
107 111
   import { getDataConfig } from '@/utils/data'
112
+import org from '../../../../router/modules/org'
108 113
   export default {
109 114
     name: 'SchedulePrint',
110 115
     data() {

+ 1 - 0
src/xt_pages/dialysis/details/consumable/dialysisParameter.vue Прегледај датотеку

@@ -138,6 +138,7 @@
138 138
             {{scope.row.patient.dialysis_no}}
139 139
            </template>
140 140
         </el-table-column>
141
+      
141 142
         <el-table-column align="center" label="住院(门诊)号"  v-if="dialysisSett.admission_number==1">
142 143
            <template slot-scope="scope">
143 144
              {{scope.row.xt_receive_treatment_asses.admission_number}}

+ 1 - 1
src/xt_pages/user/deathSummary.vue Прегледај датотеку

@@ -238,7 +238,7 @@
238 238
             {id:2,name:"心血管"},
239 239
             {id:3,name:"感染"},
240 240
             {id:4,name:"营养不良"},
241
-            {id:5,name:"全衰竭"},
241
+            {id:5,name:"全衰竭"},
242 242
             {id:6,name:"肿瘤"},
243 243
             {id:7,name:"出血"},
244 244
             {id:8,name:"呼吸衰竭"},

+ 1 - 0
src/xt_pages/user/patient.vue Прегледај датотеку

@@ -98,6 +98,7 @@
98 98
         <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
99 99
         <el-table-column  label="透析号" min-width="80" property="dialysis_no" align="center"></el-table-column>
100 100
         <el-table-column  label="住院号" min-width="80"  property="admission_number" align="center"> </el-table-column>
101
+        
101 102
         <el-table-column property="name" label="姓名" min-width="80" align="center">
102 103
           <template slot-scope="scope" >
103 104
             <router-link :to="'/patients/edit/'+scope.row.id" style="color:#409eff;width:100%;display:block;" >{{scope.row.name}}</router-link>

+ 31 - 0
src/xt_pages/user/patients.vue Прегледај датотеку

@@ -416,6 +416,13 @@
416 416
           align="center"
417 417
         >
418 418
         </el-table-column>
419
+        <el-table-column
420
+          label="年龄"
421
+          min-width="70"
422
+          property="age"
423
+          align="center"
424
+        >
425
+        </el-table-column>
419 426
         <el-table-column
420 427
           property="name"
421 428
           label="姓名"
@@ -1651,6 +1658,9 @@
1651 1658
             return false
1652 1659
           } else {
1653 1660
             this.tableData = response.data.data.patients
1661
+            for(let i=0;i<this.tableData.length;i++){
1662
+              this.tableData[i].age = this.getAge(this.tableData[i])
1663
+            }
1654 1664
             console.log("wowowowo",this.tableData)
1655 1665
             console.log('2222222',response.data.data)
1656 1666
             this.pageTotal = this.tableData.length
@@ -1659,6 +1669,27 @@
1659 1669
           }
1660 1670
         })
1661 1671
       },
1672
+      getAge: function(val) {
1673
+          if (val.id_card_no == undefined) {
1674
+            return false
1675
+          }
1676
+          var thisLen = val.id_card_no.length
1677
+          var birth = ''
1678
+          if (thisLen == 15) {
1679
+            birth = '19' + val.id_card_no.substr(6, 6)
1680
+          } else {
1681
+            birth = val.id_card_no.substr(6, 8)
1682
+          }
1683
+          var birthtwo =
1684
+            birth.substr(0, 4) +
1685
+            '-' +
1686
+            birth.substr(4, 2) +
1687
+            '-' +
1688
+            birth.substr(6, 2)
1689
+
1690
+          var age = jsGetAge(birthtwo, '-')
1691
+          return age
1692
+      },
1662 1693
 
1663 1694
       OpenView(name, number, id) {
1664 1695
         this.name = name