挂号补单功能的完善

This commit is contained in:
2026-01-13 13:26:09 +08:00
parent ebd2e8aa75
commit e20e2b637f
7 changed files with 614 additions and 67 deletions

View File

@@ -33,6 +33,8 @@
"pinia": "^2.2.0",
"pinyin": "^4.0.0-alpha.2",
"province-city-china": "^8.5.8",
"qrcode": "^1.5.4",
"qrcodejs2": "^0.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"segmentit": "^2.0.3",
@@ -2145,7 +2147,6 @@
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
@@ -2555,6 +2556,15 @@
"node": ">=6"
}
},
"node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001761",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001761.tgz",
@@ -2702,6 +2712,38 @@
"integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==",
"license": "MIT"
},
"node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/cliui/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/cliui/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/clone": {
"version": "2.1.2",
"resolved": "https://registry.npmmirror.com/clone/-/clone-2.1.2.tgz",
@@ -2729,7 +2771,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
@@ -2742,7 +2783,6 @@
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"license": "MIT"
},
"node_modules/combined-stream": {
@@ -3455,6 +3495,15 @@
}
}
},
"node_modules/decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/decimal.js": {
"version": "10.6.0",
"resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz",
@@ -3566,6 +3615,12 @@
"node": ">=8"
}
},
"node_modules/dijkstrajs": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
"license": "MIT"
},
"node_modules/dom-serializer": {
"version": "0.2.2",
"resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-0.2.2.tgz",
@@ -3784,6 +3839,12 @@
}
}
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz",
@@ -4200,6 +4261,19 @@
"node": ">=8"
}
},
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"license": "MIT",
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/follow-redirects": {
"version": "1.15.11",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.11.tgz",
@@ -4363,6 +4437,15 @@
"node": ">= 0.4"
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -5043,6 +5126,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/is-generator-function": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/is-generator-function/-/is-generator-function-1.1.2.tgz",
@@ -5467,6 +5559,18 @@
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"license": "MIT",
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
@@ -6128,6 +6232,42 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"license": "MIT",
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"license": "MIT",
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/pako/-/pako-2.1.0.tgz",
@@ -6187,6 +6327,15 @@
"dev": true,
"license": "MIT"
},
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmmirror.com/path-parse/-/path-parse-1.0.7.tgz",
@@ -6337,6 +6486,15 @@
"pathe": "^2.0.1"
}
},
"node_modules/pngjs": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
"license": "MIT",
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmmirror.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
@@ -6481,6 +6639,29 @@
"@province-city-china/types": "8.5.8"
}
},
"node_modules/qrcode": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
"license": "MIT",
"dependencies": {
"dijkstrajs": "^1.0.1",
"pngjs": "^5.0.0",
"yargs": "^15.3.1"
},
"bin": {
"qrcode": "bin/qrcode"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/qrcodejs2": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
"integrity": "sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA==",
"license": "MIT"
},
"node_modules/quansync": {
"version": "0.2.11",
"resolved": "https://registry.npmmirror.com/quansync/-/quansync-0.2.11.tgz",
@@ -6752,6 +6933,15 @@
"node": ">=0.10"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/require-from-string": {
"version": "2.0.2",
"resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz",
@@ -6761,6 +6951,12 @@
"node": ">=0.10.0"
}
},
"node_modules/require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"license": "ISC"
},
"node_modules/resolve": {
"version": "1.22.11",
"resolved": "https://registry.npmmirror.com/resolve/-/resolve-1.22.11.tgz",
@@ -7068,6 +7264,12 @@
"node": ">=10"
}
},
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
"license": "ISC"
},
"node_modules/set-function-length": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz",
@@ -7560,6 +7762,41 @@
"safe-buffer": "~5.2.0"
}
},
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/string-width/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/string-width/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/string.prototype.trim": {
"version": "1.2.10",
"resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz",
@@ -8900,6 +9137,12 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/which-module": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
"license": "ISC"
},
"node_modules/which-typed-array": {
"version": "1.1.19",
"resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.19.tgz",
@@ -8922,6 +9165,47 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"license": "ISC"
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmmirror.com/yaml/-/yaml-1.10.2.tgz",
@@ -8931,6 +9215,41 @@
"node": ">= 6"
}
},
"node_modules/yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"license": "MIT",
"dependencies": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
},
"engines": {
"node": ">=8"
}
},
"node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"license": "ISC",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/zrender": {
"version": "5.4.4",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.4.4.tgz",

View File

@@ -43,6 +43,8 @@
"pinia": "^2.2.0",
"pinyin": "^4.0.0-alpha.2",
"province-city-china": "^8.5.8",
"qrcode": "^1.5.4",
"qrcodejs2": "^0.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"segmentit": "^2.0.3",

View File

@@ -102,16 +102,24 @@
{{ scope.row.registerTime ? parseTime(scope.row.registerTime, '{y}.{m}.{d} {h}时{i}分') : '-' }}
</template>
</el-table-column>
<el-table-column label="挂号科室" prop="organizationName" align="center" />
<el-table-column label="医生姓名" prop="practitionerName" align="center" />
<el-table-column label="挂号科室" prop="organizationName" align="center">
<template #default="scope">
{{ scope.row.organizationName ? scope.row.organizationName.trim() || '-' : '-' }}
</template>
</el-table-column>
<el-table-column label="医生姓名" prop="practitionerName" align="center">
<template #default="scope">
{{ scope.row.practitionerName ? scope.row.practitionerName.trim() || '-' : '-' }}
</template>
</el-table-column>
<el-table-column label="流水号" prop="encounterNo" align="center">
<template #default="scope">
{{ scope.row.encounterNo || scope.row.visitNo || scope.row.serialNo || '-' }}
{{ calculateSerialNo(scope.row) }}
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<template #footer>
<div class="dialog-footer">
<el-button @click="selectDialogVisible = false">取消(C)</el-button>
<el-button type="primary" @click="handleConfirmSelect" :disabled="!selectedRecord">确认(O)</el-button>
</div>
@@ -228,19 +236,27 @@
<div class="print-footer">
<div class="reminder">温馨提示: 请妥善保管此凭条就诊时请携带</div>
</div>
<!-- 二维码区域 -->
<div class="qr-code-section">
<div class="qr-code-container">
<div id="qrcode" ref="qrcodeRef"></div>
<div class="qr-code-label">扫码查看挂号信息</div>
</div>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="printPreviewVisible = false">关闭</el-button>
<el-button type="primary" @click="handleBrowserPrint">打印</el-button>
</div>
</template>
</div>
</template>
</el-dialog>
</el-dialog>
</template>
<script setup>
import {getCurrentInstance, reactive, ref, watch} from 'vue';
import {getCurrentInstance, reactive, ref, watch, nextTick, onMounted} from 'vue';
import {getOutpatientRegistrationCurrent, reprintRegistration} from './outpatientregistration';
import {parseTime} from '@/utils/his';
import {formatDateStr} from '@/utils/index';
@@ -264,6 +280,7 @@ const recordList = ref([]);
const selectedRecord = ref(null);
const currentRecord = ref(null); // 保存当前选择的记录,用于打印
const printPreviewVisible = ref(false); // 打印预览对话框显示状态
const qrcodeRef = ref(null); // 二维码容器引用
const searchForm = reactive({
cardNo: '',
@@ -315,6 +332,24 @@ watch(dialogVisible, (newVal) => {
}
});
// 监听打印预览对话框显示状态,生成二维码
watch(printPreviewVisible, (newVal) => {
if (newVal) {
// 对话框打开后等待DOM更新完成再生成二维码
nextTick(() => {
setTimeout(() => {
generateQRCode();
}, 200);
});
} else {
// 对话框关闭时清空二维码
const qrcodeElement = document.getElementById('qrcode');
if (qrcodeElement) {
qrcodeElement.innerHTML = '';
}
}
});
// 搜索挂号记录并确认补打
async function handleSearch() {
if (!searchForm.cardNo) {
@@ -344,6 +379,14 @@ async function handleSearch() {
if (response.code === 200) {
let records = response.data.records || response.data || [];
// 过滤掉挂号科室或医生姓名为空的记录
records = records.filter(record => {
const orgName = record.organizationName ? record.organizationName.trim() : '';
const pracName = record.practitionerName ? record.practitionerName.trim() : '';
// 只保留挂号科室和医生姓名都不为空的记录
return orgName && pracName;
});
if (records.length > 0) {
if (records.length === 1) {
// 只有一条记录,直接使用
@@ -444,21 +487,8 @@ function fillForm(row) {
// 病历费 - API 未返回,暂时设为 0.00
form.medicalRecordFee = row.medicalRecordFee ? parseFloat(row.medicalRecordFee).toFixed(2) : '0.00';
// 流水号 - 使用 encounterId 的后3位如果为空则生成001-999的序列号
let serialNo = '';
if (row.encounterId) {
// 使用 encounterId 的后3位作为流水号
const idStr = String(row.encounterId);
const lastThree = idStr.slice(-3);
const num = parseInt(lastThree) || 0;
serialNo = String((num % 999) + 1).padStart(3, '0');
} else {
// 如果 encounterId 为空生成一个001-999的序列号
const timestamp = Date.now();
const serial = (timestamp % 999) + 1;
serialNo = String(serial).padStart(3, '0');
}
form.serialNo = serialNo;
// 流水号 - 使用 calculateSerialNo 函数计算
form.serialNo = calculateSerialNo(row);
// 合计 - 优先使用 totalPrice否则计算各项费用之和
if (row.totalPrice) {
@@ -475,8 +505,8 @@ function fillForm(row) {
form.visitTime = formatDateTime(new Date());
}
// 就诊地点 - 暂时设为空,后续可根据实际需求填充
form.visitLocation = row.visitLocation || row.locationName || '';
// 就诊地点 - 使用科室名称作为就诊地点
form.visitLocation = row.visitLocation || row.locationName || row.organizationName || '';
// 预约状态 - 从 statusEnum_enumText 字段获取,如果没有则根据 statusEnum 判断
if (row.statusEnum_enumText) {
@@ -515,6 +545,31 @@ function formatDateTime(date) {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
// 计算流水号(与 fillForm 中的逻辑一致)
function calculateSerialNo(row) {
if (!row) {
return '-';
}
// 优先使用已有的 serialNo如果存在
if (row.serialNo) {
return row.serialNo;
}
// 使用 encounterId 的后3位计算流水号
if (row.encounterId) {
const idStr = String(row.encounterId);
const lastThree = idStr.slice(-3);
const num = parseInt(lastThree) || 0;
return String((num % 999) + 1).padStart(3, '0');
}
// 如果 encounterId 为空生成一个001-999的序列号
const timestamp = Date.now();
const serial = (timestamp % 999) + 1;
return String(serial).padStart(3, '0');
}
// 提交补打挂号
async function handleSubmit() {
if (!form.encounterId) {
@@ -537,38 +592,38 @@ async function handleSubmit() {
// 在提交前,验证表单数据是否已正确填充
console.log('handleSubmit form before submit:', form); // 调试日志
const submitData = {
encounterId: form.encounterId,
cardNo: form.cardNo,
name: form.name,
organizationName: form.organizationName,
practitionerName: form.practitionerName,
const submitData = {
encounterId: form.encounterId,
cardNo: form.cardNo,
name: form.name,
organizationName: form.organizationName,
practitionerName: form.practitionerName,
price: parseFloat(form.price) || 0,
activityPrice: parseFloat(form.activityPrice) || 0,
medicalRecordFee: parseFloat(form.medicalRecordFee || 0),
totalPrice: parseFloat(form.totalPrice) || 0,
visitTime: form.visitTime,
};
visitTime: form.visitTime,
};
console.log('handleSubmit submitData:', submitData); // 调试日志
const res = await reprintRegistration(submitData);
if (res.code === 200) {
proxy.$modal.msgSuccess('补打挂号成功');
if (res.code === 200) {
proxy.$modal.msgSuccess('补打挂号成功');
// 不关闭补打对话框,直接显示打印预览
// 这样可以确保 form 数据不会丢失
loading.value = false;
showPrintPreview();
} else {
proxy.$modal.msgError(res.msg || '补打挂号失败');
} else {
proxy.$modal.msgError(res.msg || '补打挂号失败');
loading.value = false;
}
}
} catch (error) {
console.error('补打挂号失败:', error);
console.error('补打挂号失败:', error);
proxy.$modal.msgError('补打挂号失败: ' + (error.message || '未知错误'));
loading.value = false;
}
loading.value = false;
}
}
// 取消(实际执行提交操作,因为确认按钮触发搜索)
@@ -606,6 +661,61 @@ function resetSearch() {
searchForm.cardNo = '';
}
// 生成二维码
async function generateQRCode() {
nextTick(async () => {
const qrcodeElement = document.getElementById('qrcode');
if (!qrcodeElement) {
console.warn('二维码容器不存在');
return;
}
// 清空之前的二维码
qrcodeElement.innerHTML = '';
try {
// 动态导入 qrcode 库
const QRCode = await import('qrcode');
// 构建二维码内容(包含关键就诊信息)
const qrData = {
type: 'outpatient_registration',
encounterId: form.encounterId || '',
cardNo: form.cardNo || '',
serialNo: form.serialNo || '',
patientName: form.name || '',
visitTime: form.visitTime || '',
organizationName: form.organizationName || ''
};
// 将对象转换为JSON字符串作为二维码内容
const qrText = JSON.stringify(qrData);
// 使用 qrcode 库生成二维码(生成为 data URL
const qrDataUrl = await QRCode.default.toDataURL(qrText, {
width: 120,
margin: 1,
color: {
dark: '#000000',
light: '#ffffff'
}
});
// 创建 img 元素显示二维码
const img = document.createElement('img');
img.src = qrDataUrl;
img.alt = '二维码';
img.style.display = 'block';
img.style.margin = '0 auto';
qrcodeElement.appendChild(img);
} catch (error) {
console.error('生成二维码失败:', error);
qrcodeElement.innerHTML = '<div style="text-align:center;color:#999;padding:20px;font-size:12px;">二维码生成失败</div>';
}
});
}
// 显示打印预览
function showPrintPreview() {
// 直接使用浏览器打印预览,避免 hiprint 连接错误
@@ -730,10 +840,36 @@ function handleBrowserPrint() {
font-size: 12px;
color: #666;
}
.qr-code-section {
margin-top: 20px;
display: flex;
justify-content: center;
align-items: center;
padding: 15px;
}
.qr-code-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
#qrcode {
display: flex;
justify-content: center;
align-items: center;
}
.qr-code-label {
font-size: 12px;
color: #666;
text-align: center;
}
@media print {
body {
padding: 0;
}
.qr-code-section {
page-break-inside: avoid;
}
}
</style>
</head>
@@ -793,7 +929,7 @@ async function handleConfirmSelect() {
console.error('确认选择记录失败:', error);
proxy.$modal.msgError('处理失败: ' + (error.message || '未知错误'));
loading.value = false;
}
}
}
</script>
@@ -928,4 +1064,37 @@ async function handleConfirmSelect() {
background-color: #f9f9f9;
border-radius: 4px;
}
.qr-code-section {
margin-top: 20px;
display: flex;
justify-content: center;
align-items: center;
padding: 15px;
}
.qr-code-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
#qrcode {
display: flex;
justify-content: center;
align-items: center;
}
.qr-code-label {
font-size: 12px;
color: #666;
text-align: center;
}
@media print {
.qr-code-section {
page-break-inside: avoid;
}
}
</style>