Browse Source

2025 5 12

xmg123 4 days ago
parent
commit
a294c9ca21

+ 6 - 6
package-lock.json View File

@@ -43,9 +43,9 @@
43 43
       "dev": true
44 44
     },
45 45
     "@babel/runtime": {
46
-      "version": "7.27.1",
47
-      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz",
48
-      "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog=="
46
+      "version": "7.27.3",
47
+      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.3.tgz",
48
+      "integrity": "sha512-7EYtGezsdiDMyY80+65EzwiGmcJqpmcZCojSXaRgdrBaGtWTgDZKq69cPIVped6MkIM78cTQ2GOiEYjwOlG4xw=="
49 49
     },
50 50
     "@babel/template": {
51 51
       "version": "7.0.0-beta.31",
@@ -3875,9 +3875,9 @@
3875 3875
       "dev": true
3876 3876
     },
3877 3877
     "electron-to-chromium": {
3878
-      "version": "1.5.157",
3879
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.157.tgz",
3880
-      "integrity": "sha512-/0ybgsQd1muo8QlnuTpKwtl0oX5YMlUGbm8xyqgDU00motRkKFFbUJySAQBWcY79rVqNLWIWa87BGVGClwAB2w==",
3878
+      "version": "1.5.159",
3879
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.159.tgz",
3880
+      "integrity": "sha512-CEvHptWAMV5p6GJ0Lq8aheyvVbfzVrv5mmidu1D3pidoVNkB3tTBsTMVtPJ+rzRK5oV229mCLz9Zj/hNvU8GBA==",
3881 3881
       "dev": true
3882 3882
     },
3883 3883
     "elegant-spinner": {

+ 1 - 1
src/api/patient.js View File

@@ -182,7 +182,7 @@ export function createCourseOfDiseaseRecord(patient_id, content, record_time, ti
182 182
 }
183 183
 
184 184
 export function modifyCourseOfDiseaseRecord(patient_id, content, record_time, id, title) {
185
-  console.log(title)
185
+  
186 186
   var params = {
187 187
     patient_id: patient_id,
188 188
     content: content,

+ 3 - 3
src/api/pharmacy.js View File

@@ -183,12 +183,12 @@ export function changeZeroFlag(params){
183 183
   })
184 184
 }
185 185
 
186
-export function changeDrugCode(params){
186
+export function changeDrugCode(data){
187 187
 
188 188
   return request({
189 189
     url:"/api/pharmacy/changedrugcode",
190
-    method:"get",
191
-    params:params,
190
+    method:"post",
191
+    data:data,
192 192
   })
193 193
 }
194 194
 

+ 20 - 0
src/xt_pages/Pharmacy/DrugDispensing.vue View File

@@ -674,12 +674,32 @@ export default {
674 674
     },
675 675
     saveTextArea(){
676 676
 
677
+      var str = this.textarea.replace(/\s+/g, '')
678
+       console.log("str000000000000000",str)
679
+
680
+       // 1. 分割字符串并过滤空值
681
+      const numbers = str.split(',').filter(item => item.trim() !== '');
682
+
683
+      // 2. 统计每个数字出现的次数
684
+      const countMap = numbers.reduce((acc, num) => {
685
+        // 由于数字很大,用字符串作为键
686
+        const key = num.trim();
687
+        acc[key] = (acc[key] || 0) + 1;
688
+        return acc;
689
+      }, {});
690
+
691
+      // 3. 转换为要求的格式数组
692
+      const result = Object.entries(countMap).map(([name, count]) => ({
693
+        name,  // 保持字符串形式,因为数字太大可能丢失精度
694
+        count
695
+      }));
677 696
 
678 697
 
679 698
        var params = {
680 699
         id:this.id,
681 700
         data_source:this.is_source,
682 701
         drug_code:this.textarea,
702
+        codeinfo:result
683 703
        }
684 704
        console.log("paramss",params)
685 705
 

+ 28 - 15
src/xt_pages/Pharmacy/PatientDispensing.vue View File

@@ -269,7 +269,7 @@
269 269
             </el-table-column>
270 270
           </el-table>
271 271
         </div>
272
-        <!--        <div v-if="state == 2" style="margin-top: 25px">诊断时间:{{ timedate }}</div>-->
272
+       
273 273
       </div>
274 274
       <el-dialog title="设置" :visible.sync="dialogVisible" width="30%">
275 275
         <span style="font-size: 17px">请选择药品是否要通过药房管理出库</span>
@@ -1326,13 +1326,39 @@ export default {
1326 1326
 
1327 1327
     },
1328 1328
     saveTextArea(){
1329
+
1330
+       var str = this.textarea.replace(/\s+/g, '')
1331
+       console.log("str000000000000000",str)
1332
+
1333
+       // 1. 分割字符串并过滤空值
1334
+      const numbers = str.split(',').filter(item => item.trim() !== '');
1335
+
1336
+      // 2. 统计每个数字出现的次数
1337
+      const countMap = numbers.reduce((acc, num) => {
1338
+        // 由于数字很大,用字符串作为键
1339
+        const key = num.trim();
1340
+        acc[key] = (acc[key] || 0) + 1;
1341
+        return acc;
1342
+      }, {});
1343
+
1344
+      // 3. 转换为要求的格式数组
1345
+      const result = Object.entries(countMap).map(([name, count]) => ({
1346
+        name,  // 保持字符串形式,因为数字太大可能丢失精度
1347
+        count
1348
+      }));
1349
+
1350
+      console.log("result-----",result);
1351
+
1329 1352
        var params = {
1330 1353
         id:this.id,
1331 1354
         data_source:this.is_source,
1332 1355
         drug_code:this.textarea,
1356
+        codeinfo:result,
1333 1357
        }
1334 1358
        console.log("paramss",params)
1335 1359
 
1360
+  
1361
+
1336 1362
       changeDrugCode(params).then(response=>{
1337 1363
          if(response.data.state == 1){
1338 1364
             this.$message.success("保存成功!")
@@ -1352,21 +1378,8 @@ export default {
1352 1378
 
1353 1379
           var textarea = ""
1354 1380
           textarea += this.textarea.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
1355
-          // var  textAreaList = this.textarea.split(",")
1356
-          // var textarea = ""
1357
-          // textarea += this.textarea.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
1358
-          // var  parts = textarea.split(',')
1359
-          // for(let i=0;i<textAreaList.length;i++){
1360
-          //   if(parts[parts.length-2] == textAreaList[i]){
1361
-          //       this.$message.error("该条码已经存在,不能重复扫码")
1362
-          //   }
1363
-          // }
1364
-
1365
-          // const uniqueStr = [...new Set(textarea.split(','))].join(',');
1366
-
1367
-          // var textarea = uniqueStr
1368 1381
         
1369
-
1382
+        
1370 1383
           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){
1371 1384
 
1372 1385
             var drugindentificaitoncode = this.getDrugIdentificationCode(this.drug_id)

+ 24 - 0
src/xt_pages/Pharmacy/drugCode.vue View File

@@ -476,10 +476,32 @@ export default {
476 476
       this.dialogVisibleOne = true
477 477
     },
478 478
     saveTextArea() {
479
+      var str = this.textarea.replace(/\s+/g, '')
480
+       console.log("str000000000000000",str)
481
+
482
+       // 1. 分割字符串并过滤空值
483
+      const numbers = str.split(',').filter(item => item.trim() !== '');
484
+
485
+      // 2. 统计每个数字出现的次数
486
+      const countMap = numbers.reduce((acc, num) => {
487
+        // 由于数字很大,用字符串作为键
488
+        const key = num.trim();
489
+        acc[key] = (acc[key] || 0) + 1;
490
+        return acc;
491
+      }, {});
492
+
493
+      // 3. 转换为要求的格式数组
494
+      const result = Object.entries(countMap).map(([name, count]) => ({
495
+        name,  // 保持字符串形式,因为数字太大可能丢失精度
496
+        count
497
+      }));
498
+
499
+      console.log("result-----",result);
479 500
       var params = {
480 501
         id: this.id,
481 502
         data_source: 1,
482 503
         drug_code: this.textarea,
504
+        codeinfo:result
483 505
       }
484 506
       console.log("paramss", params)
485 507
       if(this.is_type == 1){
@@ -500,6 +522,7 @@ export default {
500 522
           id: this.id,
501 523
           data_source: 2,
502 524
           drug_code: this.textarea,
525
+          codeinfo:result
503 526
          }
504 527
         changeDrugCode(params).then(response=>{
505 528
           this.$message.success("保存成功!")
@@ -517,6 +540,7 @@ export default {
517 540
           id: this.id,
518 541
           data_source: 3,
519 542
           drug_code: this.textarea,
543
+          codeinfo:result
520 544
         }
521 545
         changeDrugCode(params).then(response=>{
522 546
           this.$message.success("保存成功!")

+ 22 - 0
src/xt_pages/drugSourceCode/drugChange.vue View File

@@ -270,10 +270,32 @@ export default {
270 270
             this.dialogVisibleOne = true
271 271
       },
272 272
       saveTextArea(){
273
+        var str = this.textarea.replace(/\s+/g, '')
274
+       console.log("str000000000000000",str)
275
+
276
+       // 1. 分割字符串并过滤空值
277
+      const numbers = str.split(',').filter(item => item.trim() !== '');
278
+
279
+      // 2. 统计每个数字出现的次数
280
+      const countMap = numbers.reduce((acc, num) => {
281
+        // 由于数字很大,用字符串作为键
282
+        const key = num.trim();
283
+        acc[key] = (acc[key] || 0) + 1;
284
+        return acc;
285
+      }, {});
286
+
287
+      // 3. 转换为要求的格式数组
288
+      const result = Object.entries(countMap).map(([name, count]) => ({
289
+        name,  // 保持字符串形式,因为数字太大可能丢失精度
290
+        count
291
+      }));
292
+
293
+      console.log("result-----",result);
273 294
        var params = {
274 295
         id:this.id,
275 296
         data_source:1,
276 297
         drug_code:this.textarea,
298
+        codeinfo:result
277 299
        }
278 300
        console.log("paramss",params)
279 301
       changeDrugCode(params).then(response=>{

+ 22 - 0
src/xt_pages/drugSourceCode/drugCodeQuery.vue View File

@@ -265,10 +265,32 @@
265 265
             this.dialogVisibleOne = true
266 266
       },
267 267
       saveTextArea(){
268
+      var str = this.textarea.replace(/\s+/g, '')
269
+       console.log("str000000000000000",str)
270
+
271
+       // 1. 分割字符串并过滤空值
272
+      const numbers = str.split(',').filter(item => item.trim() !== '');
273
+
274
+      // 2. 统计每个数字出现的次数
275
+      const countMap = numbers.reduce((acc, num) => {
276
+        // 由于数字很大,用字符串作为键
277
+        const key = num.trim();
278
+        acc[key] = (acc[key] || 0) + 1;
279
+        return acc;
280
+      }, {});
281
+
282
+      // 3. 转换为要求的格式数组
283
+      const result = Object.entries(countMap).map(([name, count]) => ({
284
+        name,  // 保持字符串形式,因为数字太大可能丢失精度
285
+        count
286
+      }));
287
+
288
+      console.log("result-----",result);
268 289
        var params = {
269 290
         id:this.id,
270 291
         data_source:1,
271 292
         drug_code:this.textarea,
293
+        codeinfo:result
272 294
        }
273 295
        console.log("paramss",params)
274 296
       changeDrugCode(params).then(response=>{

+ 77 - 45
src/xt_pages/stock/stockInOrderAdd.vue View File

@@ -350,6 +350,8 @@
350 350
          inputmode="verbatim"
351 351
          @keyup.native="changeText"
352 352
          @paste.native.prevent="handlePaste"
353
+         @compositionstart="handleCompositionStart"
354
+          @compositionend="handleCompositionEnd"
353 355
           type="textarea"
354 356
           placeholder="请输入内容"
355 357
           v-model="textarea"
@@ -548,23 +550,24 @@
548 550
         showDuplicateAlert:false,
549 551
         showDuplicateAlertOne:false,
550 552
         good_id:0,
551
-        isComposing: false
553
+        isComposing: false,
554
+        msg:"",
555
+        isChineseIME: false
552 556
       }
553 557
     },
554 558
     methods: {
555 559
     
556
-      handleKeyDown(e) {
557
-     
560
+      handleCompositionStart() {
561
+        this.isChineseIME = true
558 562
       },
559
-  
560
-      handlePaste(e) {
561
-        e.preventDefault(); // 完全禁止粘贴,避免绕过输入限制
562
-        this.$message.warning('扫码输入不支持粘贴');
563
+      handleCompositionEnd() {
564
+        this.isChineseIME = false
563 565
       },
566
+  
567
+     
564 568
       getTotal(){
565 569
         if(this.textarea!=null){
566 570
           var  textAreaList = this.textarea.split(",")
567
-          console.log("textArrleti",textAreaList)
568 571
           var arr = []
569 572
           if(textAreaList!=null && textAreaList.length>0){
570 573
             for(let i=0;i<textAreaList.length;i++){
@@ -1174,6 +1177,32 @@
1174 1177
      },
1175 1178
      changeText(event){
1176 1179
 
1180
+     
1181
+
1182
+      // if (this.isChineseIME == false) {
1183
+      //    console.log("因为======英文",)
1184
+      // }
1185
+
1186
+      // if (this.isChineseIME == true) {
1187
+      //    console.log("因为======中文")
1188
+      // }
1189
+
1190
+
1191
+      // var str = this.toHalfWidth(this.textarea)
1192
+
1193
+      // console.log("str===============",this.convertToHalfWidth(str))
1194
+ 
1195
+
1196
+      // var newArr = []
1197
+
1198
+      // newArr.push(this.convertToHalfWidth(str).replace(/\s+/g, ""))
1199
+
1200
+      // console.log("newArr------",newArr)
1201
+
1202
+      // var normalizedSpace = this.fullWidthToHalfWidth(this.textarea);
1203
+      // console.log("halfWidthStr",normalizedSpace);
1204
+
1205
+      // this.textarea = normalizedSpace
1177 1206
       //  1. 转换为半角字符(英文输入法标准)
1178 1207
         const halfWidth = this.textarea.replace(/[\uff01-\uff5e]/g, ch => 
1179 1208
           String.fromCharCode(ch.charCodeAt(0) - 0xfee0)
@@ -1182,40 +1211,12 @@
1182 1211
         // 2. 移除中文空格(全角空格转半角)
1183 1212
       const normalizedSpace = halfWidth.replace(/\u3000/g, ' ');
1184 1213
 
1185
-
1186
-      //   const fullToHalfMap = {
1187
-      //     '(': '(', ')': ')',
1188
-      //     '0': '0', '1': '1', '2': '2', '3': '3', '4': '4',
1189
-      //     '5': '5', '6': '6', '7': '7', '8': '8', '9': '9',
1190
-      //     'A': 'A', 'B': 'B', 'C': 'C', 'D': 'D', 'E': 'E',
1191
-      //     'F': 'F', 'G': 'G', 'H': 'H', 'I': 'I', 'J': 'J',
1192
-      //     'K': 'K', 'L': 'L', 'M': 'M', 'N': 'N', 'O': 'O',
1193
-      //     'P': 'P', 'Q': 'Q', 'R': 'R', 'S': 'S', 'T': 'T',
1194
-      //     'U': 'U', 'V': 'V', 'W': 'W', 'X': 'X', 'Y': 'Y',
1195
-      //     'Z': 'Z', 'a': 'a', 'b': 'b', 'c': 'c', 'd': 'd',
1196
-      //     'e': 'e', 'f': 'f', 'g': 'g', 'h': 'h', 'i': 'i',
1197
-      //     'j': 'j', 'k': 'k', 'l': 'l', 'm': 'm', 'n': 'n',
1198
-      //     'o': 'o', 'p': 'p', 'q': 'q', 'r': 'r', 's': 's',
1199
-      //     't': 't', 'u': 'u', 'v': 'v', 'w': 'w', 'x': 'x',
1200
-      //     'y': 'y', 'z': 'z'
1201
-      // };
1202
-
1203
-      // // 2. 执行转换
1204
-      // let result = '';
1205
-      // for (const char of this.textarea) {
1206
-      //     result += fullToHalfMap[char] || char;
1207
-      // }
1208
-
1209
-      // // 3. 提取标准格式数据
1210
-      // const normalizedSpace = result.match(/(\(\d{2}\)[\dA-Za-z]+)+/g);
1211
-      
1212
-      // console.log("normalizedSpace---",normalizedSpace[0])
1213
-
1214
-
1215 1214
       var  textAreaList = normalizedSpace.split(",")
1215
+
1216
+      console.log("textarealist====",textAreaList)
1216 1217
       if (event.key === 'Enter') {
1217 1218
         var textarea = ""
1218
-         textarea += normalizedSpace.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
1219
+        textarea += normalizedSpace + ","
1219 1220
          var  parts = textarea.split(',')
1220 1221
          for(let i=0;i<textAreaList.length;i++){
1221 1222
            if(parts[parts.length-2] == textAreaList[i]){
@@ -1250,11 +1251,11 @@
1250 1251
           return
1251 1252
         }
1252 1253
 
1253
-        // if(this.org_id == 10164 || this.org_id == 0){
1254
+        if(this.org_id == 10164 || this.org_id == 0){
1254 1255
           
1255
-        //   this.getRepatGood(this.textarea)
1256
-        //   this.showDuplicateAlertOne = true
1257
-        // }
1256
+          this.getRepatGood(this.textarea)
1257
+          this.showDuplicateAlertOne = true
1258
+        }
1258 1259
       
1259 1260
         this.dialogVisible = false
1260 1261
       },
@@ -1307,13 +1308,44 @@
1307 1308
            var msg = response.data.data.msg
1308 1309
          }else{
1309 1310
             var msg = response.data.msg
1311
+            console.log("msg-------------------",msg)
1310 1312
             this.msg = msg
1311 1313
             this.$message.error(msg)
1312 1314
          }
1313 1315
        })
1316
+     },
1317
+     
1318
+   toHalfWidth(str) {
1319
+      return str.replace(/[0-9]/g, function(c) { // 转换数字
1320
+        return String.fromCharCode(c.charCodeAt(0) - 0xfee0);
1321
+      }).replace(/[A-zA-Z]/g, function(c) { // 转换英文字母
1322
+        return String.fromCharCode(c.charCodeAt(0) - 0xfee0);
1323
+      });
1324
+    },
1325
+   convertToHalfWidth(str) {
1326
+         // 1. 替换所有全角括号为半角
1327
+          str = str.replace(/[()]/g, c => c === '(' ? '(' : ')');
1328
+          
1329
+          // 2. 处理特殊格式转换
1330
+          str = str
1331
+            // 处理 (01) 开头的特殊情况
1332
+            .replace(/^\(11\)/, '(01)')
1333
+            .replace(/^\(01\)/, '(01)')
1334
+            // 处理 ()1) 转换为 (11)
1335
+            .replace(/\(\)1\)/g, '(11)')
1336
+            // 处理 ()7) 转换为 (17)
1337
+            .replace(/\(\)7\)/g, '(17)')
1338
+            // 处理 ()X) 的一般情况
1339
+            .replace(/\(\)(\d)\)/g, '(1$1)');
1340
+          
1341
+          // 3. 移除末尾多余的括号和数字
1342
+          str = str.replace(/[)\d]+$/, '');
1343
+          
1344
+          return str;
1314 1345
      }
1315
-    }
1316
-    ,
1346
+
1347
+    },
1348
+    
1317 1349
     created() {
1318 1350
       this.org_id = this.$store.getters.xt_user.org.id
1319 1351
       var nowDate = new Date()

+ 8 - 2
src/xt_pages/user/courseOfDisease_new.vue View File

@@ -64,7 +64,7 @@
64 64
               <div style="flex: 1;">
65 65
                 记录时间:
66 66
                 <el-date-picker v-model="record_date" prefix-icon="el-icon-date" :editable="false"
67
-                              style="width: 250px;"
67
+                              style="width: 200px;"
68 68
                               format="yyyy-MM-dd HH:mm:ss"
69 69
                                value-format="yyyy-MM-dd HH:mm:ss"
70 70
                               type="datetime" placeholder="选择日期时间" align="right" 
@@ -81,6 +81,10 @@
81 81
                   </el-option>
82 82
                 </el-select>
83 83
               </div>
84
+              <div style="flex: 1;">
85
+                病程标题:
86
+                <el-input style="width: 150px;" v-model="title"></el-input>
87
+              </div>
84 88
             </div>
85 89
             <div>
86 90
               <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;margin-bottom: 5px;">
@@ -1378,13 +1382,14 @@
1378 1382
         }else{
1379 1383
           this.record_date  = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
1380 1384
         }
1381
-        console.log("record_date----------------",this.record_date)
1385
+        // console.log("record_date----------------",this.record_date)
1382 1386
         this.admin_user_id = val.recorder
1383 1387
         if(this.admin_user_id == 0){
1384 1388
            this.admin_user_id = ""
1385 1389
         }
1386 1390
         this.id = val.id
1387 1391
         this.ids = val.id
1392
+        this.title = val.title
1388 1393
       },
1389 1394
       getCurrentChangeTwo(val){
1390 1395
 
@@ -1508,6 +1513,7 @@
1508 1513
           record_date:this.record_date,
1509 1514
           content:this.new_content,
1510 1515
           admin_user_id:this.admin_user_id,
1516
+          title:this.title
1511 1517
         }
1512 1518
        
1513 1519
         console.log("params",params)