lincl %!s(int64=2) %!d(string=hai) anos
pai
achega
c3d02495c1

+ 5 - 8
mini-pro-web/.env.development

@ -1,13 +1,10 @@
#VUE_APP_BASE_API = 'http://172.26.0.107:10001'
#VUE_APP_IMAGE_SERVER = 'http://172.26.0.110:8888/'
#VUE_APP_SOCKET_URL = 'http://172.26.0.105:3000'
#VUE_APP_IM_API = 'http://172.26.0.105:3000/api/v2'
VUE_APP_BASE_API = 'http://172.26.0.107:10001'
VUE_APP_IMAGE_SERVER = 'http://172.26.0.110:8888/'
VUE_APP_SOCKET_URL = 'http://172.26.0.105:3000'
VUE_APP_IM_API = 'http://172.26.0.105:3000/api/v2'
VUE_APP_BASE_API = 'http://ehr.yihu.com/hlwyy'
VUE_APP_IMAGE_SERVER = 'http://ehr.yihu.com/fastdfs/'
VUE_APP_SOCKET_URL = 'http://ehr.yihu.com'
VUE_APP_IM_API = 'http://ehr.yihu.com/api/v2'
VUE_APP_PRE_PATH = '/hlwyy/intelligent-medicine-abinet'
VUE_APP_APPID = "wx79a7f451c8c30308"

+ 1 - 1
mini-pro-web/.env.production

@ -2,7 +2,7 @@ VUE_APP_BASE_API = 'http://10.95.22.10:9660'
VUE_APP_IMAGE_SERVER = 'http://10.95.22.10:9660/fastdfs/'
VUE_APP_SOCKET_URL = 'http://10.95.22.10:9660'
VUE_APP_IM_API = 'http://10.95.22.10:9660/api/v2'
VUE_APP_PRE_PATH = '/intelligent-medicine-abinet'
VUE_APP_PRE_PATH = '/intelligent-medicine-abinet-test'
VUE_APP_MACHINE_SOCKET_URL = 'ws://10.95.22.10:9660/cabinet/websocket/'
#VUE_APP_BASE_API = 'http://ehr.yihu.com/hlwyy'

+ 180 - 117
mini-pro-web/package-lock.json

@ -1746,6 +1746,63 @@
          "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
          "dev": true
        },
        "ansi-styles": {
          "version": "4.3.0",
          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
          "dev": true,
          "optional": true,
          "requires": {
            "color-convert": "^2.0.1"
          }
        },
        "chalk": {
          "version": "4.1.2",
          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
          "dev": true,
          "optional": true,
          "requires": {
            "ansi-styles": "^4.1.0",
            "supports-color": "^7.1.0"
          }
        },
        "color-convert": {
          "version": "2.0.1",
          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
          "dev": true,
          "optional": true,
          "requires": {
            "color-name": "~1.1.4"
          }
        },
        "color-name": {
          "version": "1.1.4",
          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
          "dev": true,
          "optional": true
        },
        "has-flag": {
          "version": "4.0.0",
          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
          "dev": true,
          "optional": true
        },
        "loader-utils": {
          "version": "2.0.2",
          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
          "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
          "dev": true,
          "optional": true,
          "requires": {
            "big.js": "^5.2.2",
            "emojis-list": "^3.0.0",
            "json5": "^2.1.2"
          }
        },
        "ssri": {
          "version": "8.0.1",
          "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
@ -1754,6 +1811,28 @@
          "requires": {
            "minipass": "^3.1.1"
          }
        },
        "supports-color": {
          "version": "7.2.0",
          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
          "dev": true,
          "optional": true,
          "requires": {
            "has-flag": "^4.0.0"
          }
        },
        "vue-loader-v16": {
          "version": "npm:vue-loader@16.8.3",
          "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
          "dev": true,
          "optional": true,
          "requires": {
            "chalk": "^4.1.0",
            "hash-sum": "^2.0.0",
            "loader-utils": "^2.0.0"
          }
        }
      }
    },
@ -3208,7 +3287,6 @@
      "version": "6.0.0",
      "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
      "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
      "dev": true,
      "requires": {
        "string-width": "^4.2.0",
        "strip-ansi": "^6.0.0",
@ -3219,7 +3297,6 @@
          "version": "4.3.0",
          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
          "dev": true,
          "requires": {
            "color-convert": "^2.0.1"
          }
@ -3228,7 +3305,6 @@
          "version": "2.0.1",
          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
          "dev": true,
          "requires": {
            "color-name": "~1.1.4"
          }
@ -3236,20 +3312,17 @@
        "color-name": {
          "version": "1.1.4",
          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
          "dev": true
          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
        },
        "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==",
          "dev": true
          "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
        },
        "string-width": {
          "version": "4.2.2",
          "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
          "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
          "dev": true,
          "requires": {
            "emoji-regex": "^8.0.0",
            "is-fullwidth-code-point": "^3.0.0",
@ -3260,7 +3333,6 @@
          "version": "6.2.0",
          "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
          "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
          "dev": true,
          "requires": {
            "ansi-styles": "^4.0.0",
            "string-width": "^4.1.0",
@ -4190,8 +4262,7 @@
    "decamelize": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
      "dev": true
      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
    },
    "decode-uri-component": {
      "version": "0.2.0",
@ -4484,6 +4555,11 @@
        }
      }
    },
    "dijkstrajs": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.2.tgz",
      "integrity": "sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg=="
    },
    "dir-glob": {
      "version": "2.2.2",
      "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz",
@ -4696,8 +4772,7 @@
    "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==",
      "dev": true
      "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
    },
    "emojis-list": {
      "version": "3.0.0",
@ -4705,6 +4780,11 @@
      "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
      "dev": true
    },
    "encode-utf8": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
      "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
    },
    "encodeurl": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
@ -5309,7 +5389,6 @@
      "version": "4.1.0",
      "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
      "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
      "dev": true,
      "requires": {
        "locate-path": "^5.0.0",
        "path-exists": "^4.0.0"
@ -5435,8 +5514,7 @@
    "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==",
      "dev": true
      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
    },
    "get-intrinsic": {
      "version": "1.1.1",
@ -6763,7 +6841,6 @@
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
      "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
      "dev": true,
      "requires": {
        "p-locate": "^4.1.0"
      }
@ -7633,7 +7710,6 @@
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
      "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
      "dev": true,
      "requires": {
        "p-try": "^2.0.0"
      }
@ -7642,7 +7718,6 @@
      "version": "4.1.0",
      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
      "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
      "dev": true,
      "requires": {
        "p-limit": "^2.2.0"
      }
@ -7665,8 +7740,7 @@
    "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==",
      "dev": true
      "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
    },
    "pako": {
      "version": "1.0.11",
@ -7769,8 +7843,7 @@
    "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==",
      "dev": true
      "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
    },
    "path-is-absolute": {
      "version": "1.0.1",
@ -7874,6 +7947,11 @@
        "find-up": "^4.0.0"
      }
    },
    "pngjs": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
      "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw=="
    },
    "pnp-webpack-plugin": {
      "version": "1.6.4",
      "resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz",
@ -9579,6 +9657,79 @@
      "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
      "dev": true
    },
    "qrcode": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.1.tgz",
      "integrity": "sha512-nS8NJ1Z3md8uTjKtP+SGGhfqmTCs5flU/xR623oI0JX+Wepz9R8UrRVCTBTJm3qGw3rH6jJ6MUHjkDx15cxSSg==",
      "requires": {
        "dijkstrajs": "^1.0.1",
        "encode-utf8": "^1.0.3",
        "pngjs": "^5.0.0",
        "yargs": "^15.3.1"
      },
      "dependencies": {
        "ansi-regex": {
          "version": "5.0.1",
          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
          "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
        },
        "camelcase": {
          "version": "5.3.1",
          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
          "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
        },
        "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=="
        },
        "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==",
          "requires": {
            "emoji-regex": "^8.0.0",
            "is-fullwidth-code-point": "^3.0.0",
            "strip-ansi": "^6.0.1"
          }
        },
        "strip-ansi": {
          "version": "6.0.1",
          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
          "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
          "requires": {
            "ansi-regex": "^5.0.1"
          }
        },
        "yargs": {
          "version": "15.4.1",
          "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
          "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
          "requires": {
            "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"
          }
        },
        "yargs-parser": {
          "version": "18.1.3",
          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
          "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
          "requires": {
            "camelcase": "^5.0.0",
            "decamelize": "^1.2.0"
          }
        }
      }
    },
    "qs": {
      "version": "6.5.2",
      "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
@ -9865,14 +10016,12 @@
    "require-directory": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
      "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
      "dev": true
      "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
    },
    "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==",
      "dev": true
      "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
    },
    "requires-port": {
      "version": "1.0.0",
@ -10186,8 +10335,7 @@
    "set-blocking": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
      "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
      "dev": true
      "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
    },
    "set-value": {
      "version": "2.0.1",
@ -10780,7 +10928,6 @@
      "version": "6.0.0",
      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
      "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
      "dev": true,
      "requires": {
        "ansi-regex": "^5.0.0"
      },
@ -10788,8 +10935,7 @@
        "ansi-regex": {
          "version": "5.0.0",
          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
          "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
          "dev": true
          "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
        }
      }
    },
@ -11866,87 +12012,6 @@
        }
      }
    },
    "vue-loader-v16": {
      "version": "npm:vue-loader@16.2.0",
      "resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.2.0.tgz",
      "integrity": "sha1-BGpTMI3Ufljv4g3ewe3sAnzjtG4=",
      "dev": true,
      "optional": true,
      "requires": {
        "chalk": "^4.1.0",
        "hash-sum": "^2.0.0",
        "loader-utils": "^2.0.0"
      },
      "dependencies": {
        "ansi-styles": {
          "version": "4.3.0",
          "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1618995625950&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz",
          "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
          "dev": true,
          "optional": true,
          "requires": {
            "color-convert": "^2.0.1"
          }
        },
        "chalk": {
          "version": "4.1.1",
          "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.1.tgz?cache=0&sync_timestamp=1618995297666&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.1.tgz",
          "integrity": "sha1-yAs/qyi/Y3HmhjMl7uZ+YYt35q0=",
          "dev": true,
          "optional": true,
          "requires": {
            "ansi-styles": "^4.1.0",
            "supports-color": "^7.1.0"
          }
        },
        "color-convert": {
          "version": "2.0.1",
          "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz",
          "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
          "dev": true,
          "optional": true,
          "requires": {
            "color-name": "~1.1.4"
          }
        },
        "color-name": {
          "version": "1.1.4",
          "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
          "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
          "dev": true,
          "optional": true
        },
        "has-flag": {
          "version": "4.0.0",
          "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz",
          "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
          "dev": true,
          "optional": true
        },
        "loader-utils": {
          "version": "2.0.0",
          "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
          "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
          "dev": true,
          "optional": true,
          "requires": {
            "big.js": "^5.2.2",
            "emojis-list": "^3.0.0",
            "json5": "^2.1.2"
          }
        },
        "supports-color": {
          "version": "7.2.0",
          "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1622293579301&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
          "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
          "dev": true,
          "optional": true,
          "requires": {
            "has-flag": "^4.0.0"
          }
        }
      }
    },
    "vue-router": {
      "version": "3.5.1",
      "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.1.tgz",
@ -12677,8 +12742,7 @@
    "which-module": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
      "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
      "dev": true
      "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
    },
    "worker-farm": {
      "version": "1.7.0",
@ -12767,8 +12831,7 @@
    "y18n": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
      "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
      "dev": true
      "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="
    },
    "yallist": {
      "version": "3.1.1",

+ 1 - 0
mini-pro-web/package.json

@ -19,6 +19,7 @@
    "js-cookie": "^2.2.1",
    "lodash": "^4.17.20",
    "moment": "^2.29.1",
    "qrcode": "^1.5.1",
    "vant": "^2.12.6",
    "vue": "^2.6.11",
    "vue-i18n": "^8.24.2",

+ 66 - 0
mini-pro-web/src/api/api-medicineAbinet.js

@ -673,6 +673,72 @@ let service = {
		});
    },
	
	getSettlementInfoFirst: function(data) {
		return request({
			url: `${BASE}/baseOrder/open/getSettlementInfoFirst`,
			method: "get",
			params: data,
		});
	},
	getSettlementInfo: function(data) {
		return request({
			url: `${BASE}/baseOrder/open/getSettlementInfo`,
			method: "get",
			params: data
		});
	},
	getSettlementInfoList: function(data) {
		return request({
			url: `${BASE}/baseOrder/open/getSettlementInfoList`,
			method: "get",
			params: data
		});
	},
	getSettlementInfoSecode: function(data) {
		return request({
			url: `${BASE}/baseOrder/open/getSettlementInfoSecode`,
			method: "get",
			params: data
		});
	},
	saveCheckHttpLog: function(data) {
		return request({
			url: `${BASE}/open/noLogin/saveCheckHttpLog`,
			method: "post",
			data
		});
	},
	hlwyyRecharge: function(params) {
		return request({
			url: `${BASE}/baseOrder/open/hlwyyRecharge`,
			method: "get",
			params
		});
	},
	executeSickSettleMultiNew: function(params) {
		return request({
			url: `${BASE}/baseOrder/open/executeSickSettleMultiNew`,
			method: "get",
			params
		});
	},
	hlwyyRechargePatient: function(params) {
		return request({
			url: `${BASE}/baseOrder/open/patient/hlwyyRecharge`,
			method: "get",
			params
		});
	},
};
export default service;

+ 70 - 0
mini-pro-web/src/api/api-yb.js

@ -0,0 +1,70 @@
import { ybService } from "@/utils/request";
import cryptoUtils from "@/utils/cryptoUtils";
import Vue from "vue";
var $vue = new Vue()
var url = "http://127.0.0.1:9000/api/Mi"
// var url = "http://192.168.131.173:9000/api/Mi"
// var url = "http://192.168.131.105:9000/api/Mi"
var pool = {}
window.sendToWeb = function(msg, uuid){
	console.log('-----msg', msg, '------' , uuid)
	console.log('------ doGet end ------')
	try{
		var promise = pool[uuid]
		if(promise){
			delete  pool[uuid]
			msg = JSON.parse(cryptoUtils.Decrypt(msg))
			var data = cryptoUtils.Decrypt(msg.data)
			if(msg.code == 200){
				promise.resolve(data)
			} else {
				promise.reject(data)
			}
		}
	}catch(e){
		console.error(e)
	}
}
let service = {
	get: function(params) {
		return new Promise((resolve, reject)=>{
			var uuid = $vue.$generateUUID()
			pool[uuid] = {resolve, reject}
			console.log('------ doGet start ------')
			console.log('params    ', params, '------' , uuid)
			var nUrl = url + "?_t=1" 
			for(var k in params){
				nUrl += `&${k}=${encodeURIComponent(params[k])}`
			}
			apps.doGet(nUrl, uuid);
		})
    },
	// get: function(params) {
	// 	return axios({
	// 		url: "http://127.0.0.1:9000/api/Mi",
	// 		method: 'get',
	// 		params: params
	// 	})
		
	// 	return ybService({
	// 		url: `/api/Mi`,
	// 		method: "get",
	// 		params,
	// 		responseType: 'text'
	// 	});
    // },
	getDemo: function(params) {
		return ybService({
			url: ``,
			method: "get",
			params,
			// responseType: 'json'
		});
    },
	
};
export default service;

+ 2 - 1
mini-pro-web/src/api/apiGateway.js

@ -1,2 +1,3 @@
export const BASE = '/cityihealth/base'
// export const BASE = '/cityihealth/base'
export const BASE = '/cityihealth/baseygTest'
export const AUTH = "/cityihealth"

+ 12 - 0
mini-pro-web/src/mixins/common.js

@ -213,6 +213,18 @@ Vue.mixin({
                return temp
            } 
            return func(temp, url2, true)
        },
        $generateUUID() {
            var d = new Date().getTime();
            if(window.performance && typeof window.performance.now === "function"){
                d += performance.now(); //use high-precision timer if available
            }
            var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
                var r = (d + Math.random()*16)%16 | 0;
                d = Math.floor(d/16);
                return (c=='x' ? r : (r&0x3|0x8)).toString(16);
            });
            return uuid;
        }
    }
})

+ 3 - 1
mini-pro-web/src/utils/request.js

@ -1,12 +1,13 @@
import { isSupportHtml5Plus } from '@/utils/platform'
import appService, { imService as appImService } from "./app-ajax"
import webService, { imService as webImService} from "./web-ajax"
import webService, { imService as webImService, ybService as webYbService} from "./web-ajax"
// 采用本地http://192.168.131.xx服务进行调试时,未避免跨域开启下面的配置
let forceCrossDomain = false
let service = webService
let imService = webImService
let ybService = webYbService
let originAnchor = document.createElement('a');
    originAnchor.href = window.location.href;
@ -23,4 +24,5 @@ if(isSupportHtml5Plus && (crossDomain || wkWebkit || forceCrossDomain)) {
export default service
export {
    imService,
    ybService
}

+ 44 - 0
mini-pro-web/src/utils/web-ajax.js

@ -216,3 +216,47 @@ imService.interceptors.response.use(
export {
	imService
};
// 医保 9000端口
const ybService = axios.create({
	// baseURL: 'http://192.168.131.105:9090',
	baseURL: 'http://127.0.0.1:9000', // url = base url + request url //192.168.131.173
	// withCredentials: true, // send cookies when cross-domain requests
	timeout: 20000 // request timeout
})
ybService.interceptors.request.use(
	config => {
		if (config.method === 'post') {
			config.data = {
				...config.data,
				_t: new Date().getTime()
			}
		} else if (config.method == 'get') {
			config.params = {
				_t: new Date().getTime(),
				...config.params
			}
		}
		return config
	},
	error => {
		console.log(error) 
		return Promise.reject(error)
	}
)
ybService.interceptors.response.use(
	response => {
		const res = response.data
		return res
	},
	error => {
		Message("服务端异常")
		console.log('err' + error) // for debug
		return Promise.reject(error)
	}
)
export {
	ybService
};

+ 421 - 196
mini-pro-web/src/views/machine/components/DrugTaking.vue

@ -1,250 +1,233 @@
<template>
	<div class="machine-drug-taking c-333 fs-13" :class="'machine-drug-taking-'+ contentType">
		<van-popup v-model="isShow">
			<div class="machine-drug-taking-content c-333">
				<img v-show="hasClose" @click="onClose()" class="close" src="../img/i-guanbi.png" alt="">
				<div :class="'content-type-'+ contentType">
					<div v-if="contentType==1" >
						<div class="title fs-17 c-333 tc ptb20">请选择一种方式验证取药</div>
						<div class="pick-content plr20 pt14">
							<div class="pick-item">
								<div><img src="../img/d-chaka.gif" alt=""></div>
								<div class="pick-item-text">请插入医保卡</div>
							</div>
							<div class="pick-item">
								<div><img src="../img/d-saomiao.gif" alt=""></div>
								<div class="pick-item-text">扫描取药码、医保凭证<br>或电子健康卡取药</div>
							</div>
						</div>
					</div>
					<div v-else-if="contentType==2" >
						<div><img src="../img/i-chaxunzhong.png" alt=""></div>
						<div class="tc fs-17 c-333 pt12">正在查询中,请稍等…</div>
					</div>
					<div v-else-if="contentType==3" class="tc pb40">
						<div class="icon"><img src="../img/i-tishi.png" alt=""></div>
						<div class=" fs-20  ">温馨提示</div>
						<div class=" fs-13  pt20">{{message}}</div>
					</div>
					<div v-else-if="contentType==6" class="tc pt25">
						<div class=" fs-17  ">请选择支付方式</div>
						<van-radio-group v-model="checked">
							<div class="pay-type-group pt24 pb25">
								<div class="pay-type-item">
									<div><img src="../img/i-weixin.png" alt=""></div>
									<div class="lh30">微信支付</div>
									<div><van-radio name="1"></van-radio></div>
								</div>
								<div class="pay-type-item">
									<div><img src="../img/i-zhifubao.png" alt=""></div>
									<div class="lh30">支付宝支付</div>
									<div><van-radio name="1"></van-radio></div>
								</div>
							</div>
						</van-radio-group>
						<div class="bottom-button ">
							<div><van-button color="#22a9fa" block type="primary">立即支付</van-button></div>
						</div>
					</div>
					<div v-else-if="contentType==7" class="tc fs-17 pt18">
						<template v-if="true">
							<div><img class="icon" src="../img/i-weixin.png" alt=""></div>
							<div class="lh30 ptb5">打开微信扫一扫</div>
						</template>
						<template v-else>
							<div><img class="icon" src="../img/i-zhifubao.png" alt=""></div>
							<div class="lh30 ptb5">打开支付宝扫一扫</div>
						</template>
						
						<div><img class="qrcode" src="../img/i-weixin.png" alt=""></div>
						<div class="lh30 pt5 pb18"><span class="c-ff2626 mr5">58s</span> 后失效</div>
					</div>
					<div v-else-if="contentType==8" class="tc fs-13 pt50">
						<div><img class="icon" src="../img/i-chenggong.png" alt=""></div>
						<div class="lh30 pt10 pb40">结算成功!</div>
						<div class="bottom-button ">
							<div class=""><van-button class="c-999" color="#fff" block type="primary">返回</van-button></div>
							<div><van-button color="#22a9fa" block type="primary">立即取药</van-button></div>
		<div v-show="contentType==4||contentType==13||contentType==5" class="pt42 order-panel">
			<div  class="panel " :class="{'panel-no-data': (contentType==4)&&(!showSettleInfoList||!showSettleInfoList.length)}">
				<div class="banner">
					<div class="back-icon" @click="back">
						<div>
							<img class="" src="../img/i-fanhui.png" alt="">
						</div>
						<div class="ml5">{{closeTimes}}s</div>
					</div>
					<div v-else-if="contentType==9" class="tc fs-13 pt50">
						<div><img class="icon" src="../img/i-shibao.png" alt=""></div>
						<div class="lh30 pt10 pb40">结算失败!</div>
						<div class="bottom-button ">
							<div class=""><van-button class="c-999" color="#fff" block type="primary">返回</van-button></div>
							<div><van-button color="#22a9fa" block type="primary">重试</van-button></div>
					<img class="bg-icon" src="../img/i-banner.png" alt="">
					<div class="text">{{contentType==13? "自助取药": contentType==4? "门诊结算" : "门诊结算清单"}}</div>
				</div>
				
				<template v-if="contentType==4||contentType==13">
					<div v-if="contentType==13" class="plr17 ptb15">
						<div  class="pay-status-banner">
							<div @click="isPayed=1" :class="{active: isPayed==1}" class="pay-status-banner-item ">已缴费</div>
							<div @click="isPayed=0" :class="{active: isPayed==0}" class="pay-status-banner-item">待缴费</div>
						</div>
					</div>
					<div v-else-if="contentType==10" class="tc ">
						<div><img class="icon" src="../img/i-chuyaozhong.png" alt=""></div>
						<div class="lh30 pt13 pb40">正在出药请勿离开!</div>
					</div>
					<div v-else-if="contentType==11" class="tc ">
						<div><img class="icon" src="../img/i-chenggong-1.png" alt=""></div>
						<div class="lh25 pt13 ">出药成功 请立即领取</div>
						<div class="lh25  pb20">如有遗漏请联系工作人员</div>
					</div>
					<div v-else-if="contentType==12" class="tc ">
						<div><img class="icon" src="../img/i-quyaoshibai.png" alt=""></div>
						<div class="lh30 pt13 pb40">出药失败,请联系工作人员</div>
					<div v-if="contentType==4&&!showSettleInfoList.length" class="nodata">
						<img src="../img/i-quesheng.png" alt="">
						<div class="pt20 tc">无就诊结算信息</div>
					</div>
				</div>
				<div v-show="hasTimer" class="timer-panel">{{closeTimes}}s</div>
			</div>
		</van-popup>
		<div class="pt42">
			<div v-if="contentType==4||contentType==13" class="panel " :class="{'panel-no-data': !list||!list.length}">
				<div class="banner">
					<img class="back-icon" src="../img/i-fanhui.png" alt="">
					<img class="bg-icon" src="../img/i-banner.png" alt="">
					<div class="text">{{contentType==13? "自助取药": "门诊结算"}}</div>
				</div>
				<div v-if="contentType==13" class="plr17 ptb15">
					<div  class="pay-status-banner">
						<div class="pay-status-banner-item active">已缴费</div>
						<div class="pay-status-banner-item">待缴费</div>
					</div>
				</div>
				
				<template v-if="list&&list.length">
					<van-checkbox-group v-model="checked">
						<div class="order-list fs-13 plr10 pb15">
							<div v-if="contentType==4" class="h15"></div>
							<div v-for="k in 3" :key="k" class="item ">
								<div class="plr10">
									<div class="title ">
										<div class="box-flex-1"><van-checkbox icon-size="3.46667vw" name="a">就诊日期:2022-2-25  10:46:51</van-checkbox></div>
										<div v-if="contentType==4" class="c-ff2626 ">64元</div>
										<div v-else class="c-4ecc8f ">已缴费</div>
									</div>
									<div>
										<div class="lh25 ptb10">
											<div>接诊医生:张军</div>
											<div class="c-bold">费用详情:</div>
					<template v-else>
						<van-checkbox-group v-model="checkedList">
							<div class="order-list fs-13 plr10 pb15">
								<div v-if="contentType==4" class="h15"></div>
								<template v-if="showSettleInfoList.length">
								<div v-for="(item, i) in showSettleInfoList" :key="i" class="item ">
									<div class="plr10">
										<div class="title ">
											<div class="box-flex-1"><van-checkbox icon-size="3.46667vw" :name="item">就诊日期:{{item.date}}</van-checkbox></div>
											<div v-if="contentType==4||isPayed==0" class="c-ff2626 ">{{item.totalAmount}}元</div>
											<div v-else class="c-4ecc8f ">已缴费</div>
											<!-- <div v-else class="c-4ecc8f ">未缴费</div> -->
										</div>
										<div class="drug-list plr10 ptb5 bgc-f6f6f9">
											<div>
												<div v-for="i in 5" :key="i" class="drug ">
													<div class="">复方盐酸伪麻黄碱缓释</div>
													<div class="pl5">x3盒</div>
													<div class="box-flex-1"></div>
													<div>32元</div>
										<div>
											<div class="lh25 ptb10">
												<div>接诊医生:{{item.drName}}</div>
												<div>支付类型:{{item.medicalState==1? '医保' : '自费'}}</div>
												<div class="c-bold">费用详情:</div>
											</div>
											<div class="drug-list plr10 ptb5 bgc-f6f6f9">
												<div>
													<template v-for="(citem, i) in item.ylzMedicalMxDOList">
													<div v-if="i<2||showMore" :key="citem.id" class="drug ">
														<div class="">{{citem.hisItemName || citem.itemName}}</div>
														<div class="pl5">x{{citem.amount}}{{citem.chargeUnitName}}</div>
														<div class="box-flex-1"></div>
														<div>{{citem.totalMoney}}元</div>
													</div>
													</template>
												</div>
												<div v-if="item.ylzMedicalMxDOList.length>2" @click="showMore=!showMore" class="mt15 pb4 tc c-999 "><div class="more">{{showMore? '点击收起' : '点击查看更多'}}<span></span></div></div>
											</div>
											<div class="botton-group kitbox pt17 pb13">
												<div class="box-flex-1">
													<van-button v-if="isPayed==0" @click="toSettleInfoDetail(item)" color="#2bd3dd" size="small" block round type="primary">立即结算</van-button>
													<van-button v-else @click="toSendShipment(item)" color="#2bd3dd" size="small" block round type="primary">立即取药</van-button>
												</div>
												<!-- <div v-else class="plr7 box-flex-1"><van-button @click="toSettleInfoDetail(item)" color="#22a9fa" size="small" block round type="primary">医保结算</van-button></div> -->
											</div>
											<div class="mt15 pb4 tc c-999 "><div class="more">点击查看更多<span></span></div></div>
										</div>
										<div class="botton-group kitbox pt17 pb13">
											<div class="pr7 box-flex-1"><van-button color="#2bd3dd" size="small" block round type="primary">自费结算</van-button></div>
											<div class="pl7 box-flex-1"><van-button color="#22a9fa" size="small" block round type="primary">医保结算</van-button></div>
										</div>
									</div>
								</div>
								</template>
								<div v-else class="nodata">
									<img src="../img/i-quesheng.png" alt="">
									<div class="pt20 tc">无就诊结算信息</div>
								</div>
							</div>
						</van-checkbox-group>
						<div v-if="isPayed==0||contentType==4" class="bottom-button">
							<div class="select"><van-checkbox v-model="isAllCheck" @change="onAllCheckChange" icon-size="3.46667vw">全选</van-checkbox></div>
							<div class="">
								<van-button v-if="contentType==4||isPayed==0" @click="toSettleInfoDetail(1)" color="#2bd3dd" block type="primary">立即结算</van-button>
								<van-button v-else @click="$emit('startSendShipment', item)" color="#2bd3dd" block type="primary">立即取药</van-button>
							</div>
						</div>
					</van-checkbox-group>
					<div class="bottom-button">
						<div class="select"><van-checkbox icon-size="3.46667vw" name="a">全选</van-checkbox></div>
						<div class=""><van-button color="#2bd3dd" block type="primary">自费结算</van-button></div>
						<div><van-button color="#22a9fa" block type="primary">医保结算</van-button></div>
					</div>
					</template>
					
				</template>
				<div class="nodata">
					<img src="../img/i-quesheng.png" alt="">
					<div class="pt20 tc">无就诊结算信息</div>
				</div>
			</div>
			<div v-else-if="contentType==5" class="panel " >
				<div class="banner">
					<img class="back-icon" src="../img/i-fanhui.png" alt="">
					<img class="bg-icon" src="../img/i-banner.png" alt="">
					<div class="text">门诊结算清单</div>
				</div>
				<div class="order-list fs-13 plr15 pt7 pb15">
					<div v-for="k in 3" :key="k" class="item ">
						<div class="plr10">
							<div class="title ">
								<div class="box-flex-1">结算详情</div>
							</div>
							<div>
								<div class="drug-list  ptb5">
									<div>
										<div v-for="(item, i) in list" :key="i" class="drug ">
											<div class="c-999">{{item.name}}</div>
											<div class="pl5"></div>
											<div class="box-flex-1"></div>
											<div class="pl5" :class="item.clz">{{item.value}}</div>
				<template v-else-if="contentType==5" class="panel " >
					<div class="order-list fs-13 plr15 pt7 pb15">
						<div v-for="(item) in curSettleList" :key="item.getSettleInfo.id" class="item ">
							<div class="plr10">
								<div class="title ">
									<div class="box-flex-1">结算详情</div>
								</div>
								<div>
									<div class="drug-list  ptb5">
										<div>
											<div v-for="(citem, i) in item.list" :key="citem.code" class="drug ">
												<div class="c-999">{{citem.name}}</div>
												<div class="pl5"></div>
												<div class="box-flex-1"></div>
												<div class="pl5" :class="citem.clz">{{citem.value}}</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="count-panel">
					<div>总计:560.00元</div>
					<div>总的还需支付:0元</div>
				</div>
				<div class="bottom-button">
					<div class="c-22a9fa"><van-button color="#ffffff" block type="primary">返回</van-button></div>
					<div><van-button color="#22a9fa" block type="primary">立即结算</van-button></div>
				</div>
					<div class="count-panel">
						<div>总计:{{allMoney}}元</div>
						<div>总的还需支付:{{allNeedOnlinePay}}元</div>
					</div>
					<div class="bottom-button">
						<div class="c-22a9fa"><van-button @click="back()" color="#ffffff" block type="primary">返回</van-button></div>
						<div><van-button @click="jiesuan" color="#22a9fa" block type="primary">立即结算</van-button></div>
					</div>
				</template>
			</div>
			
		</div>
	</div>
</template>
<script>
var closeThread
import medicineAbinetApi from '@/api/api-medicineAbinet'
import ybUtils from '../utils/ybUtils'
var closeThread, checkPayThread
export default {
	props: ['orgCode', 'isTest', 'deviceNum'],
  	data() {
    	return {
			isShow: false,
			num: '',//64022149  628476381  102792849
			keyboardShow: false,
			contentType: 5, //1选择取药方式  2订单查询中  3提示  4门诊结算  5结算清单 6选择支付方式  7支付二维码 8结算成功 9结算失败  10出药中 11出药成功 12出药失败  13自助取药
			contentType: 0, //1选择取药方式  2订单查询中  3提示  4门诊结算  5结算清单 6选择支付方式  7支付二维码 8结算成功 9结算失败  10出药中 11出药成功 12出药失败  13自助取药 14结算中
			nextContentType: 0,
			hasTimer: false,
			hasClose: true,
			closeTimes: 0,
			message: '请插入医保卡重试',
			list: [
				{value: '小陈', name: '就诊人:', clz: ''},
				{value: '门诊单号:', name: '门诊单号:', clz: ''},
				{value: '门诊卡号:', name: '门诊卡号:', clz: ''},
				{value: '科室名称:', name: '科室名称:', clz: ''},
				{value: '处方时间:', name: '处方时间:', clz: ''},
				{value: '自费支付:', name: '自费支付:', clz: 'c-ff2626'},
				{value: '医保个人账户支付:', name: '医保个人账户支付:', clz: 'c-ff2626'},
				{value: '医保基金支付:', name: '医保基金支付:', clz: 'c-ff2626'},
				{value: '还需线上支付:', name: '还需线上支付:', clz: 'c-ff2626'},
				{value: '消费总额:', name: '消费总额:', clz: 'c-ff2626'},
			]
			message: '',
			waitPayList: [],
			payedList: [],
			checkedList: [],
			isAllCheck: false,
			curSettleList: [],
			allNeedOnlinePay: 0,
			allMoney: 0,
			lastContentType: [],
			isPayed: 1, //1已结算  0未结算
			cardSn: '',
			cardNo: '',
			idcard: '',
			userName: '',
    	}
  	},
	computed:{
		showSettleInfoList(){
			if(this.contentType == 4){
				return this.waitPayList
			}
			if(this.contentType == 13){
				return this.isPayed==1?  this.payedList : this.waitPayList
			}
			return []
		},
		title(){
			return this.num
		}
	},
	created(){
		this.$EventBus.$on('DrugTakingEvent', (item)=>{
			if(item.type == 'settleSuccessBack'){
				this.back()
				if(item.params == 1){
					this.isPayed = 1
				}
				this.$loading()
				if(this.contentType == 13){
					this.checkOrderAndReturn({
						cardNum: this.cardNo,
					});
				} 
				ybUtils.getSettlementInfoList.call(this);
			} else if(item.type == 'hlwyyRecharge'){
				this.hlwyyRecharge(item.params)
			} else if(item.type == 'shipComplete'){
				this.payedList.splice(this.payedList.indexOf(item.params), 1)
			} 
		})
		this.$EventBus.$on('MachineTipsDialogOnClose', (item)=>{
			if(this.contentType){
				this.initCloseTimer()
				if(checkPayThread){
					clearInterval(checkPayThread)
				}
			}
		})
	},
  	methods: {
		back(){
			this.lastContentType.pop()
			if(this.lastContentType.length){
				var p = this.lastContentType[this.lastContentType.length-1]
				p.isBack = true
				this.show(p)
			} else {
				this.onClose()
			}
		},
		showTipsDialog(item){
			this.removeInterval(closeThread)
			this.$EventBus.$emit('MachineTipsDialog', item)
		},
		show({
			contentType,
			hasTimer = true,
			hasClose = true
			hasClose = true,
			message = "",
			isBack = false
		}){
			if(!isBack){
				this.lastContentType.push(arguments[0])
			} 
			this.message = message
			this.hasTimer = hasTimer
			this.hasClose = hasClose
			this.contentType = contentType
			this.initCloseTimer()
			this.isShow = true
			this.showTipsDialog({
				close: true
			})
		},
		removeInterval(thread){
			if(thread){
@ -258,7 +241,7 @@ export default {
				closeThread = setInterval(()=>{
					if(this.closeTimes <= 0){
						this.removeInterval()
						this.onClose()
						this.back()
					} else {
						this.closeTimes--
					}
@ -266,7 +249,17 @@ export default {
			}
		},
		onClose(){
			this.isShow = false
			this.allNeedOnlinePay = 0
			this.allMoney = 0
			this.waitPayList = []
			this.payedList = []
			this.checkedList = []
			this.curSettleList = []
			this.isAllCheck = false
			this.isPayed = 1
			this.removeInterval(closeThread)
			this.contentType = 0
			this.lastContentType = []
			this.$emit('onClose', this.contentType)
		},
		onCheckOrder(){
@ -277,6 +270,238 @@ export default {
			this.$emit('onComplete', this.num)
			this.num = ''
			this.keyboardShow = false
		},
		getNeedOnlinePay(item){
			var personCash = Number(item.personCash),//个人现金支付
				balance = Number(item.balance) //预缴金余额
			// personCash//个人现金支付
			// balance//预缴金余额
			if(balance > personCash){
				return 0
			}
			return (personCash - balance).toFixed(2)
		},
		toSettleInfoDetail(item){
			var curSettleList
			if(item == 1){
				if(!this.checkedList.length){
					return
				}
				curSettleList = this.checkedList
			} else {
				curSettleList = [item]
			}
			this.curSettleList = JSON.parse(JSON.stringify(curSettleList))
			ybUtils.getSettlementInfoFirst.call(this);
		},
		onAllCheckChange(e){
			if(e){
				this.checkedList = this.showSettleInfoList
			} else {
				this.checkedList = []
			}
		},
		readcard(){
			this.showTipsDialog({
				contentType: 2,
			})
			this.$emit('readcard')
		},
		toolReadcardMsg(msgobj, nextContentType){
			this.nextContentType = nextContentType
            try{
                if(msgobj.mess.indexOf("异常") != -1 || msgobj.mess.indexOf("读取信息失败") != -1) {
					this.showTipsDialog({
						contentType: 3,
						message: msgobj.mess
					})
                    return
                }
                var arr = msgobj.mess.split("\n");
                var json = {}
                arr.forEach(v => {
                    var tmp = v.split(":")
                    json[tmp[0]] = tmp[1]
                });
				this.cardSn = json['卡识别码']
				this.cardNo = json['卡号']
				this.idcard = json['身份证号']
				this.userName = json['姓名']
				if(this.nextContentType == 13){
					//取药
					this.checkOrderAndReturn({
						cardNum: this.cardNo,
						contentType: 13
					});
					ybUtils.getSettlementInfoList.call(this);
				} else {
					//结算
					ybUtils.getSettlementInfoList.call(this, 4);
				}
            }catch(e){
                console.error(e)
            }
		},
		jiesuan(){
			var needPay = this.allNeedOnlinePay
			// needPay = 10
			if(needPay > 0){
				this.showTipsDialog({
					contentType: 6
				})
			} else {
				this.hlwyyRecharge("")
			}
		},
		hlwyyRecharge(res){
			this.$loading("确认结算中..")
			var no = _.map(this.curSettleList, v=>{
				return v.RECIPE_NO
			})
			var p = {
				recipe_no: no.join(","),
				equ_num: this.deviceNum,
				depositType: res,
				returnUrl: '',
			}
			console.log('hlwyyRecharge params', p)
			medicineAbinetApi
				.hlwyyRecharge(p)
				.then(res=>{
					this.$toast.clear()
					console.log('hlwyyRecharge', res)
					if(res.status == 200){
						new Promise((resolve, reject)=>{
							if(!res.obj.errorMsg){
								this.showTipsDialog({
									contentType: 3,
									message: res.obj.errorMsg
								})
								reject()
								// this.$dialog.alert({
								// 	title: '提示',
								// 	message: res.obj.errorMsg
								// }).then(()=>{
								// 	resolve(res)
								// })
							} else {
								resolve(res)
							}
						}).then(res=>{
							// res.obj.payUrl = "dsdas"
							if(res.obj.payUrl){
								this.showTipsDialog({
									contentType: 7,
									payUrl: res.obj.payUrl
								})
								checkPayThread = setInterval(()=>{
									this.checkpay()
								}, 1000)
							} else {
								this.checkpay()
							}
						})
					}
				})
				.catch(err=>{
					console.error(err)
				})
		},
		checkpay(){
			// this.$loading("确认结算中..")
			ybUtils.getSettlementInfoByNew.call(this, this.curSettleList, true)
				.then(res=>{
					this.$toast.clear()
					var exist = _.filter(res, v=>{
						return v.getSettleInfo.state == 1
					})
					if(exist){
						ybUtils.getSettlementInfoList.call(this);
						this.showTipsDialog({
							contentType: 8
						})
						if(checkPayThread){
							clearInterval(checkPayThread)
						}
					} else {
						this.$toast('您还未结算')
					}
				})
				.catch(err=>{
					console.error(err)
					this.$toast.clear()
					this.showTipsDialog({
						contentType: 9
					})
					if(checkPayThread){
						clearInterval(checkPayThread)
					}
				})
		},
		checkOrderAndReturn({pickUpNum="", cardNum="", ehcCard="", contentType}){
			return new Promise((resolve, reject)=>{
				this.shippingType = pickUpNum? 1 : 2
				this.oldCardNo = cardNum || ''
				let p = {
					deviceId: this.deviceNum, //设备编号
					pickUpNum, //取药码
					cardNum, //社保卡号 //"DA7292254" ||
					ehcCard  //电子社保卡
				}
				// p = {
				// 	deviceId: this.deviceNum, //设备编号
				// 	cardNum: '',
				// 	ehcCard: "2AA15E2786973077D40FF5DEFFB5E7B12D79E3BD50BE59F22559FF361667E22C:0:445D0CE646F8F9DFEF648D36910287B5:3502A0001GZHA0002"
				// }
				console.log('params', p)
				medicineAbinetApi
					.checkOrderAndReturnOrderList(p)
					.then(res=>{
						console.log('checkOrderAndReturnOrderList', res)
						this.$toast.clear()
						var list = []
						if(res.obj && res.obj.orderList){
							list = _.filter(res.obj.orderList, v=>{
								return v.status===0
							}) 
							if(list.length){
								list.forEach(v=>{
									var allPrice = 0
									v.drugList.forEach(d=>{
										allPrice += d.price * ((d.quantity&&Number(d.quantity)) || 1)
									})
									v.price = allPrice.toFixed(2)
								})
							}
						}
						this.payedList = list || []
						if(contentType){
							this.show({
								contentType: 13,
							})
						}
						resolve()
					})
					.catch(err=>{
						console.error(err)
						this.$toast.clear()
						if(contentType){
							this.showTipsDialog({
								contentType: 3,
								message: '获取订单失败'
							})
						}
						resolve()
					})
			})
		},
		toSendShipment(){
		}
    },
}

+ 551 - 0
mini-pro-web/src/views/machine/components/TipsDialog.vue

@ -0,0 +1,551 @@
<template>
	<div class="machine-tips-dialog c-333 fs-13" :class="'machine-tips-dialog-'+ contentType">
		<van-popup v-model="isShow" :duration="0">
			<div class="machine-tips-dialog-content c-333">
				<div v-show="hasClose" class="close-panel ">
					<div v-show="hasTimer" class="timer-panel">{{closeTimes}}s</div>
					<div><img  @click="onClose()" class="close" src="../img/i-guanbi.png" alt=""></div>
				</div>
				<div :class="'content-type-'+ contentType">
					<div v-if="contentType==1" >
						<div class="title fs-17 c-333 tc ptb20">请选择一种方式验证取药</div>
						<div class="pick-content plr20 pt14">
							<div @click="readcard" class="pick-item">
								<div><img src="../img/d-chaka.gif" alt=""></div>
								<div class="pick-item-text">请插入医保卡</div>
							</div>
							<div class="pick-item">
								<div><img src="../img/d-saomiao.gif" alt=""></div>
								<div class="pick-item-text">扫描取药码、医保凭证<br>或电子健康卡取药</div>
							</div>
						</div>
					</div>
					<div v-else-if="contentType==2||contentType==14" class="pb30">
						<div><img src="../img/i-chaxunzhong.png" alt=""></div>
						<div class="tc fs-17 c-333 pt12">{{contentType==14? '确认结算中..' : '正在查询中,请稍等…'}}</div>
					</div>
					<div v-else-if="contentType==3" class="tc pb40">
						<div class="icon"><img src="../img/i-tishi.png" alt=""></div>
						<div class=" fs-20  ">温馨提示</div>
						<div class=" fs-13  pt20 plr30">{{message}}</div>
					</div>
					<div v-else-if="contentType==6" class="tc pt25">
						<div class=" fs-17  ">请选择支付方式</div>
						<van-radio-group v-model="payType">
							<div class="pay-type-group pt24 pb25">
								<div @click="payType='WX_QR'" class="pay-type-item">
									<div><img src="../img/i-weixin.png" alt=""></div>
									<div class="lh30">微信支付</div>
									<div><van-radio name="WX_QR"></van-radio></div>
								</div>
								<div @click="payType='ALI_QR'" class="pay-type-item">
									<div><img src="../img/i-zhifubao.png" alt=""></div>
									<div class="lh30">支付宝支付</div>
									<div><van-radio name="ALI_QR"></van-radio></div>
								</div>
							</div>
						</van-radio-group>
						<div class="bottom-button ">
							<div><van-button @click="emitDrugTakingEvent('hlwyyRecharge', payType)" color="#22a9fa" block type="primary">立即支付</van-button></div>
						</div>
					</div>
					<div v-else-if="contentType==7" class="tc fs-17 pt18 pb20">
						<template v-if="payType=='WX_QR'">
							<div><img class="icon" src="../img/i-weixin.png" alt=""></div>
							<div class="lh30 ptb5">打开微信扫一扫</div>
						</template>
						<template v-else>
							<div><img class="icon" src="../img/i-zhifubao.png" alt=""></div>
							<div class="lh30 ptb5">打开支付宝扫一扫</div>
						</template>
						<div>
							<canvas class="qrcode" id="qrcode" ></canvas>
							<!-- <img class="qrcode" src="../img/i-weixin.png" alt=""> -->
						</div>
						<!-- <div class="lh30 pt5 pb18"><span class="c-ff2626 mr5">58s</span> 后失效</div> -->
					</div>
					<div v-else-if="contentType==8" class="tc fs-13 pt50">
						<div><img class="icon" src="../img/i-chenggong.png" alt=""></div>
						<div class="lh30 pt10 pb40">结算成功!</div>
						<div class="bottom-button ">
							<div class=""><van-button @click="emitDrugTakingEvent('settleSuccessBack')" class="c-999" color="#fff" block type="primary">返回</van-button></div>
							<div><van-button @click="emitDrugTakingEvent('settleSuccessBack', 1)" color="#22a9fa" block type="primary">立即取药</van-button></div>
						</div>
					</div>
					<div v-else-if="contentType==9" class="tc fs-13 pt50">
						<div><img class="icon" src="../img/i-shibao.png" alt=""></div>
						<div class="lh30 pt10 pb40">结算失败!</div>
						<div class="bottom-button ">
							<div class=""><van-button class="c-999" color="#fff" block type="primary">返回</van-button></div>
							<div><van-button color="#22a9fa" block type="primary">重试</van-button></div>
						</div>
					</div>
					<div v-else-if="contentType==10" class="tc ">
						<div><img class="icon" src="../img/i-chuyaozhong.png" alt=""></div>
						<div class="lh30 pt13 pb40">正在出药请勿离开!</div>
					</div>
					<div v-else-if="contentType==11" class="tc ">
						<div><img class="icon" src="../img/i-chenggong-1.png" alt=""></div>
						<div class="lh25 pt13 ">出药成功 请立即领取</div>
						<div class="lh25  pb20">如有遗漏请联系工作人员</div>
					</div>
					<div v-else-if="contentType==12" class="tc ">
						<div><img class="icon" src="../img/i-quyaoshibai.png" alt=""></div>
						<div class="lh30 pt13 pb40">出药失败,请联系工作人员</div>
					</div>
				</div>
				<!-- <div v-show="hasTimer" class="timer-panel">{{closeTimes}}s</div> -->
			</div>
		</van-popup>
	</div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
import QRCode from "qrcode";
import ybUtils from '../utils/ybUtils'
var closeThread
export default {
	props: ['orgCode', 'isTest', 'deviceNum'],
  	data() {
    	return {
			isShow: false,
			num: '',//64022149  628476381  102792849
			keyboardShow: false,
			contentType: 1, //1选择取药方式  2订单查询中  3提示  4门诊结算  5结算清单 6选择支付方式  7支付二维码 8结算成功 9结算失败  10出药中 11出药成功 12出药失败  13自助取药 14结算中
			nextContentType: 0,
			hasTimer: false,
			hasClose: true,
			closeTimes: 0,
			message: '',
			waitPayList: [],
			payedList: [],
			checkedList: [],
			isAllCheck: false,
			curSettleList: [],
			allNeedOnlinePay: 0,
			allMoney: 0,
			lastContentType: 0,
			payType: '',
			isPayed: 1, //1已结算  0未结算
			cardSn: '',
			cardNo: '',
			idcard: '',
			userName: '',
    	}
  	},
	computed:{
		showSettleInfoList(){
			if(this.contentType == 4){
				return this.waitPayList
			}
			if(this.contentType == 13){
				return this.isPayed==1?  this.payedList : this.waitPayList
			}
			return []
		},
		title(){
			return this.num
		}
	},
	created(){
		this.$EventBus.$on('MachineTipsDialog', (item)=>{
			this.show(item)
		})
	},
  	methods: {
		show({
			contentType,
			hasTimer = true,
			hasClose = true,
			message = "",
			payUrl = "",
			nextContentType,
			close = false
		}){
			if(close){
				this.onClose()
				return
			}
			this.lastContentType = this.contentType
			
			this.message = message
			this.hasTimer = hasTimer
			this.hasClose = hasClose
			this.contentType = contentType
			this.initCloseTimer()
			if(contentType == 1){
				this.nextContentType = nextContentType
			}
			if(contentType==4 || contentType==5 || contentType==13){
				this.isShow = false
			} else {
				this.isShow = true
				if(contentType == 7){
					this.$nextTick(()=>{
						QRCode.toCanvas(
							document.getElementById('qrcode'),
							payUrl,
							{ 
								width: 83, 
								height: 83, 
								toSJISFunc: QRCode.toSJIS
							},
							error => {
								console.log(error)
							}
						);
					})
				}
			}
		},
		removeInterval(thread){
			if(thread){
				clearInterval(thread)
			}
		},
		initCloseTimer(){
			if(this.hasTimer){
				this.removeInterval(closeThread)
				this.closeTimes = 30
				closeThread = setInterval(()=>{
					if(this.closeTimes <= 0){
						this.removeInterval()
						if(this.contentType == 2){
							this.show({
								contentType: 3,
								message: '读取医保卡超时'
							})
						} else {
							this.onClose()
						}
					} else {
						this.closeTimes--
					}
				}, 1000)
			}
		},
		onClose(){
			this.removeInterval(closeThread)
			this.isShow = false
			this.$EventBus.$emit('MachineTipsDialogOnClose')
			this.$emit('onClose', this.contentType)
		},
		emitDrugTakingEvent(event, params){
			this.$EventBus.$emit('DrugTakingEvent', {type: event, params})
			this.onClose()
		},
		onCheckOrder(){
			if(!this.num){
				return
			}
			this.$loading('获取订单..')
			this.$emit('onComplete', this.num)
			this.num = ''
			this.keyboardShow = false
		},
		getNeedOnlinePay(item){
			var personCash = Number(item.personCash),//个人现金支付
				balance = Number(item.balance) //预缴金余额
			// personCash//个人现金支付
			// balance//预缴金余额
			if(balance > personCash){
				return 0
			}
			return (personCash - balance).toFixed(2)
		},
		toSettleInfoDetail(item){
			var curSettleList
			if(item == 1){
				if(!this.checkedList.length){
					return
				}
				curSettleList = this.checkedList
			} else {
				curSettleList = [item]
			}
			this.curSettleList = JSON.parse(JSON.stringify(curSettleList))
			ybUtils.getSettlementInfoFirst.call(this);
		},
		onAllCheckChange(e){
			if(e){
				this.checkedList = this.showSettleInfoList
			} else {
				this.checkedList = []
			}
		},
		readcard(){
			this.show({
				contentType: 2,
			})
			this.$emit('readcard')
		},
		toolReadcardMsg(msgobj){
			if(this.contentType != 2){
				return
			}
			
            try{
                if(msgobj.mess.indexOf("异常") != -1 || msgobj.mess.indexOf("读取信息失败") != -1) {
					this.show({
						contentType: 3,
						message: msgobj.mess
					})
                    return
                }
                var arr = msgobj.mess.split("\n");
                var json = {}
                arr.forEach(v => {
                    var tmp = v.split(":")
                    json[tmp[0]] = tmp[1]
                });
				this.cardSn = json['卡识别码']
				this.cardNo = json['卡号']
				this.idcard = json['身份证号']
				this.userName = json['姓名']
				if(this.nextContentType == 13){
					//取药
					this.checkOrderAndReturn({
						cardNum: this.cardNo,
						contentType: 13
					});
					ybUtils.getSettlementInfoList.call(this);
				} else {
					//结算
					ybUtils.getSettlementInfoList.call(this, 4);
				}
            }catch(e){
                console.error(e)
            }
		},
		jiesuan(){
			var needPay = 0
			this.curSettleList.forEach(v=>{
				needPay += this.getNeedOnlinePay(v.getSettleInfo)
			})
			if(needPay > 0){
				this.show({
					contentType: 6
				})
			} else {
				this.hlwyyRecharge("")
			}
			return
			
			new Promise((resolve, reject)=>{
				if(needPay > 0){
					this.show({
						contentType: 6
					})
					// this.$dialog.confirm({
					// 	title: '',
					// 	message: '选择支付方式',
					// 	confirmButtonText: '支付宝',
					// 	cancelButtonText: '微信'
					// }).then(res=>{
					// 	resolve('ALI_QR')
					// }).catch(err=>{
					// 	resolve('WX_QR')
					// })
				} else {
					resolve('')
				}
			}).then(res=>{
				var no = _.map(this.curSettleList, v=>{
					return v.RECIPE_NO
				})
				var p = {
					recipe_no: no.join(","),
					equ_num: this.deviceNum,
					depositType: res,
					returnUrl: '',
				}
				console.log('hlwyyRecharge params', p)
				medicineAbinetApi
					.hlwyyRecharge(p)
					.then(res=>{
						console.log('hlwyyRecharge', res)
						if(res.status == 200){
							new Promise((resolve, reject)=>{
								if(res.obj.errorMsg){
									this.$dialog.alert({
										title: '提示',
										message: res.obj.errorMsg
									}).then(res=>{
										resolve()
									})
								} else {
									resolve()
								}
							}).then(res=>{
								if(res.obj.payUrl){
									this.payUrl = res.obj.payUrl
									this.step = 6
									this.$nextTick(()=>{
										QRCode.toCanvas(
											document.getElementById('qrcode'),
											res.obj.payUrl,
											{ 
												width: 300, 
												height: 300, 
												toSJISFunc: QRCode.toSJIS
											},
											error => {
												console.log(error)
												debugger
											}
										);
									})
								} else {
									this.checkpay()
								}
							})
						}
					})
					.catch(err=>{
						console.error(err)
					})
			})
		},
		hlwyyRecharge(res){
			this.$loading("确认结算中..")
			var no = _.map(this.curSettleList, v=>{
				return v.RECIPE_NO
			})
			var p = {
				recipe_no: no.join(","),
				equ_num: this.deviceNum,
				depositType: res,
				returnUrl: '',
			}
			console.log('hlwyyRecharge params', p)
			medicineAbinetApi
				.hlwyyRecharge(p)
				.then(res=>{
					this.$toast.clear()
					console.log('hlwyyRecharge', res)
					if(res.status == 200){
						new Promise((resolve, reject)=>{
							if(res.obj.errorMsg){
								this.$dialog.alert({
									title: '提示',
									message: res.obj.errorMsg
								}).then(()=>{
									resolve(res)
								})
							} else {
								resolve(res)
							}
						}).then(res=>{
							if(res.obj.payUrl){
								this.show({
									contentType: 7,
									payUrl: res.obj.payUrl
								})
							} else {
								this.checkpay()
							}
						})
					}
				})
				.catch(err=>{
					console.error(err)
				})
		},
		checkpay(){
			this.$loading("确认结算中..")
			ybUtils.getSettlementInfoByNew.call(this, this.curSettleList, true)
				.then(res=>{
					this.$toast.clear()
					var exist = _.filter(res, v=>{
						return v.getSettleInfo.state == 1
					})
					if(exist){
						ybUtils.getSettlementInfoList.call(this);
						this.show({
							contentType: 8
						})
					} else {
						this.$toast('您还未结算')
					}
				})
				.catch(err=>{
					console.error(err)
					this.$toast.clear()
					this.show({
						contentType: 9
					})
				})
		},
		checkOrderAndReturn({pickUpNum="", cardNum="", ehcCard="", contentType}){
			this.shippingType = pickUpNum? 1 : 2
			this.oldCardNo = cardNum || ''
            let p = {
                deviceId: this.deviceNum, //设备编号
				pickUpNum, //取药码
				cardNum, //社保卡号 //"DA7292254" ||
				ehcCard  //电子社保卡
            }
			// p = {
			// 	deviceId: this.deviceNum, //设备编号
			// 	cardNum: '',
			// 	ehcCard: "2AA15E2786973077D40FF5DEFFB5E7B12D79E3BD50BE59F22559FF361667E22C:0:445D0CE646F8F9DFEF648D36910287B5:3502A0001GZHA0002"
			// }
            console.log('params', p)
            medicineAbinetApi
                .checkOrderAndReturnOrderList(p)
                .then(res=>{
                    console.log('checkOrderAndReturnOrderList', res)
					this.$toast.clear()
					var list = []
					if(res.obj && res.obj.orderList){
						list = _.filter(res.obj.orderList, v=>{
							return v.status===0
						}) 
						if(list.length){
							list.forEach(v=>{
								var allPrice = 0
								v.drugList.forEach(d=>{
									allPrice += d.price * ((d.quantity&&Number(d.quantity)) || 1)
								})
								v.price = allPrice.toFixed(2)
							})
						}
					}
					this.payedList = list || []
					if(contentType){
						this.show({
							contentType: 13,
						})
					}
                })
                .catch(err=>{
					console.error(err)
					this.$toast.clear()
					if(contentType){
						this.show({
							contentType: 3,
							message: '获取订单失败'
						})
					}
                })
        },
    },
}
</script>
<style lang="scss" scoped>
@import "../scss/TipsDialog";
</style>

+ 62 - 33
mini-pro-web/src/views/machine/index.vue

@ -34,17 +34,17 @@
							</van-swipe-item>
						</template>
						<van-swipe-item v-else>
							<video class="swipe-item-video" loop autoplay muted src="./img/default.mp4"></video>
							<video class="swipe-item-video" controls loop autoplay muted src="./img/default.mp4"></video>
						</van-swipe-item>
					</van-swipe>
				</div>
				<div class="banner-list kitbox">
					<div @click="$refs.DrugTaking.show({contentType: 1})" class="banner-list-item-1">
					<div @click="showTipsDialog({contentType: 1, nextContentType: 13})" class="banner-list-item-1">
						<div>自助</div><div>取药</div>
					</div>
					<div>
						<div class="banner-list-item-2">门诊结算</div>
						<div @click="showTipsDialog({contentType: 1, nextContentType: 4})" class="banner-list-item-2">门诊结算</div>
						<div class="banner-list-item-3">预缴金充值</div>
					</div>
				</div>
@ -92,7 +92,8 @@
			</template>
		</div>
		<DrugTaking ref="DrugTaking"/>
		<DrugTaking ref="DrugTaking" :orgCode="orgCode" :deviceNum="deviceNum" @startSendShipment="startSendShipment" />
		<TipsDialog ref="TipsDialog" @readcard="readcard"/>
		<Dialog ref="Dialog" v-if="showPrintComplete" @back="onPrev"/>
		<Scan @onComplete="onComplete" v-show="step==2" @onBack="step=1"/>
		<Result @showOrderDetail="checkCardNo" @outDrug="sendShipment" @onPrint="SetPrintPage" :rsType.sync="rsType" :orderList="orderList" :orderdetail="orderdetail" v-show="step==3" @onBack="step=2" @onBackIndex="step=1"/>
@ -100,6 +101,7 @@
</template>
<script>
import DrugTaking from './components/DrugTaking.vue';
import TipsDialog from './components/TipsDialog.vue';
import Dialog from './components/Dialog.vue';
import Scan from './components/Scan.vue';
import Result from './components/Result.vue';
@ -112,13 +114,14 @@ export default {
		Scan,
		Result,
		Dialog,
		DrugTaking
		DrugTaking,
		TipsDialog
  	},
  	data() {
    	return {
			isErr: 0, //1设备维护  2正常使用
			deviceNum: this.$route.query.deviceNum || '',//14912202107000001500000000000000    14912202111000001000000000000000
			step: 4, //0启动页  1首页  2扫码页  3订单页
			isErr: 2, //1设备维护  2正常使用
			deviceNum: this.$route.query.deviceNum || '14912202107000001500000000000000',//14912202107000001500000000000000    14912202111000001000000000000000
			step: 1, //0启动页  1首页  2扫码页  3订单页
			curImg: '',
			illustrationMskShow: false,
			socketUrl: '',
@ -143,6 +146,8 @@ export default {
			nextOrderDetail: '',
			oldCardNo: '',
			reconnect: false,
			orgCode: '',
			isTest: true,
    	}
  	},
	watch:{
@ -165,8 +170,18 @@ export default {
	created(){
		window.vm = this
		this.init()
		window.socketUtils = socketUtils
	},
  	methods: {
		startSendShipment: function(item) {
			socketUtils.sendShipment(item, 1)
		},
		showTipsDialog(item){
			this.$EventBus.$emit('MachineTipsDialog', item)
		},
		readcard(){
			socketUtils.sendReadCard()
		},
		init() {
			if(!this.deviceNum){
				return
@ -176,9 +191,22 @@ export default {
			socketUtils.$on('inited', ()=>{
				this.step = 1
				console.log('inited')
			})
			socketUtils.$on('onMessage', (msg)=>{
				if(msg.type == 'CardInfo'){
					var TipsDialog = this.$refs.TipsDialog
					if(TipsDialog.contentType == 2){
						//等待读卡的时候 才处理
						this.$refs.DrugTaking.toolReadcardMsg(msg, TipsDialog.nextContentType)
					}
				}
			})
			
			socketUtils.init({
				deviceNum: this.deviceNum
				deviceNum: this.deviceNum,
				isTest: this.isTest
			})
		},
		findById(){
@ -193,6 +221,7 @@ export default {
                    this.$toast.clear()
					// this.isErr = res.obj.saleStatus==1? 2 : 1
					this.isErr = 2
					this.orgCode = res.obj.belongCommunity
                })
                .catch(err=>{
                    console.error(err)
@ -617,31 +646,31 @@ export default {
			// 	devid:"设备号"+"_T"
			// }
		},
		sendReadCard: function() {
			this.$loading('读取中..')
			this.clearReadCardCountDown()
			readCardCountDown = setTimeout(()=>{
				if(this.nextOrderDetail){
					this.$toast.loading({
						duration: 0,
						forbidClick: true, // 禁用背景点击
						loadingType: 'loading',
						message: "读取医保卡超时",
						onClose: ()=>{
							this.onPrev()
						}
					});
				} else {
					this.$toast('读取医保卡超时')
				}
			}, 20 * 1000)
		// sendReadCard: function() {
		// 	this.$loading('读取中..')
		// 	this.clearReadCardCountDown()
		// 	readCardCountDown = setTimeout(()=>{
		// 		if(this.nextOrderDetail){
		// 			this.$toast.loading({
		// 				duration: 0,
		// 				forbidClick: true, // 禁用背景点击
		// 				loadingType: 'loading',
		// 				message: "读取医保卡超时",
		// 				onClose: ()=>{
		// 					this.onPrev()
		// 				}
		// 			});
		// 		} else {
		// 			this.$toast('读取医保卡超时')
		// 		}
		// 	}, 20 * 1000)
			var obj = {
				type: "ReadCard",
				mess: ""
			}
			this.send(obj);
		},
		// 	var obj = {
		// 		type: "ReadCard",
		// 		mess: ""
		// 	}
		// 	this.send(obj);
		// },
		sendShipment: function() {
			clearInterval(countDownFunc)

+ 23 - 2
mini-pro-web/src/views/machine/scss/DrugTaking.scss

@ -36,6 +36,7 @@
                img{
                    display: block;
                    width: 102px;
                    height: 98px;
                    margin: 0 auto;
                }
            }
@ -45,6 +46,7 @@
            padding-top: 40px;
            img{
                width: 77px;
                height: 64px;
                display: block;
                margin: 0 auto;
            }
@ -88,6 +90,7 @@
                display: block;
                margin: 0 auto;
                width: 83px;
                height: 83PX;
            }
        }
@ -101,6 +104,7 @@
                display: block;
                margin: 0 auto;
                width: 83px;
                height: 83PX;
            }
        }
@ -162,6 +166,7 @@
        }
        .banner{
            position: relative;
            height: 42px;
            .bg-icon{
                width: 100%;
                display: block;
@ -172,8 +177,13 @@
                left: 17px;
                top: 50%;
                transform: translateY(-50%);
                width: 17px;
                display: block;
                display: -webkit-box;
                -webkit-box-align: center;
                color: #fff;
                img{
                    width: 17px;
                    display: block;
                }
            }
            .text{
                font-size: 22px;
@ -271,6 +281,7 @@
            img{
                display: block;
                width: 199px;
                height: 114px;
                margin: 45px auto 0;
            }
        }
@ -328,5 +339,15 @@
            }
        }
    }
    .order-panel{
        width: 100vw;
        height: 100vh;
        background: url('../img/bg_img.png') no-repeat;
        background-size: 100% ;
        position: fixed;
        top: 0;
        left: 0;
    }
    
}

+ 156 - 0
mini-pro-web/src/views/machine/scss/TipsDialog.scss

@ -0,0 +1,156 @@
.machine-tips-dialog {
    .van-popup{
        border-radius: 12px;
        top: 97px;
        transform: translate3d(-50%, 0%, 0);
    }
    .machine-tips-dialog-content{
        width: 333px;
        .close-panel{
            position: absolute;
            top: 10px;
            right: 10px;
            display: -webkit-box;
            -webkit-box-align: center;
            .close{
                width: 17px;
                height: 17px;
                display: block;
            }
            .timer-panel{
                color: #ff2626;
                font-size: 17px;
                text-align: center;
                margin-right: 5px;
            }
        }
        
        
        .content-type-1 {
            .pick-content{
                display: -webkit-box;
                -webkit-box-pack: justify;
                .pick-item{
                    width: 50%;
                    font-size: 13px;
                    text-align: center;
                    .pick-item-text{
                        margin-top: 10px;
                        padding-bottom: 15px;
                    }
                }
                img{
                    display: block;
                    width: 102px;
                    height: 98px;
                    margin: 0 auto;
                }
            }
        }
        .content-type-2{
            padding-top: 40px;
            img{
                width: 77px;
                height: 64px;
                display: block;
                margin: 0 auto;
            }
        }
        .content-type-3{
            // padding-top: 46px;
            .icon{
                height: 50px;
            }
            img{
                width: 83px;
                display: block;
                margin: 0 auto;
                transform: translateY(-50%);
            }
        }
        .pay-type-group{
            display: -webkit-box;
            .pay-type-item{
                text-align: center;
                -webkit-box-flex: 1;
                img{
                    display: block;
                    width: 35px;
                    margin: 0 auto;
                }
                .van-radio{
                    display: inline-block;
                }
            }
        }
        .content-type-7{
            .icon{
                display: block;
                margin: 0 auto;
                width: 35px;
            }
            .qrcode{
                display: block;
                margin: 0 auto;
                width: 83px;
                height: 83PX;
            }
        }
        .content-type-8, .content-type-9{
            .icon{
                display: block;
                margin: 0 auto;
                width: 45px;
            }
            .qrcode{
                display: block;
                margin: 0 auto;
                width: 83px;
                height: 83PX;
            }
        }
        .content-type-10, .content-type-11, .content-type-12{
            color: #000;
            font-size: 17px;
            padding-top: 30px;
            .icon{
                display: block;
                margin: 0 auto;
                width: 99px;
            }
        }
        .bottom-button{
            display: -webkit-box;
            >div{
                -webkit-box-flex: 1;
            }
            .van-button{
                border-radius: 0 ;
                &.c-999{
                    border-top: 1px solid #f2f3f5!important;
                    .van-button__text{
                        color: #999; 
                    }
                }
            }
        }
    }
   
    
    
    &.machine-tips-dialog-3{
        ::v-deep{
            .van-popup{
                overflow: visible;
            }
        }
    }
}

+ 105 - 30
mini-pro-web/src/views/machine/utils/socket.js

@ -1,3 +1,4 @@
import medicineAbinetApi from '@/api/api-medicineAbinet'
class SocketUtils extends Vue {
    constructor() {
        super()
@ -15,8 +16,9 @@ class SocketUtils extends Vue {
  		})
    }
    init({deviceNum}) {
    init({deviceNum, isTest}) {
        this.deviceNum = deviceNum
        this.isTest = isTest
        if(this.reconnect === true){
            this.reconnect = 1
        }
@ -75,7 +77,7 @@ class SocketUtils extends Vue {
                    .then(res=>{
                        this.currindex++;
                        if (this.orderdetail.length > this.currindex) {
                            this.$loading(`正在出第${this.currindex+1}个药..`)
                            // this.$loading(`正在出第${this.currindex+1}个药..`)
                            this.nextShipment(this.orderdetail[this.currindex]);
                        } else {
                            this.$toast.clear()
@ -114,6 +116,8 @@ class SocketUtils extends Vue {
                this.checkOrderAndReturn({pickUpNum: msgobj.mess})
            }
        } else if(msgobj.type == 'CardInfo'){
            this.$emit('onMessage', msgobj)
            return
            if(!readCardCountDown){
                return
            }
@ -174,23 +178,23 @@ class SocketUtils extends Vue {
    }
    sendReadCard() {
        this.$loading('读取中..')
        this.clearReadCardCountDown()
        readCardCountDown = setTimeout(()=>{
            if(this.nextOrderDetail){
                this.$toast.loading({
                    duration: 0,
                    forbidClick: true, // 禁用背景点击
                    loadingType: 'loading',
                    message: "读取医保卡超时",
                    onClose: ()=>{
                        this.onPrev()
                    }
                });
            } else {
                this.$toast('读取医保卡超时')
            }
        }, 20 * 1000)
        // this.$loading('读取中..')
        // this.clearReadCardCountDown()
        // readCardCountDown = setTimeout(()=>{
        //     if(this.nextOrderDetail){
        //         this.$toast.loading({
        //             duration: 0,
        //             forbidClick: true, // 禁用背景点击
        //             loadingType: 'loading',
        //             message: "读取医保卡超时",
        //             onClose: ()=>{
        //                 this.onPrev()
        //             }
        //         });
        //     } else {
        //         this.$toast('读取医保卡超时')
        //     }
        // }, 20 * 1000)
        var obj = {
            type: "ReadCard",
@ -199,12 +203,18 @@ class SocketUtils extends Vue {
        this.send(obj);
    }
    sendShipment(orderdetail) {
        this.orderdetail = orderdetail
        clearInterval(countDownFunc)
    showTipsDialog(item){
        this.$EventBus.$emit('MachineTipsDialog', item)
    }
    sendShipment(item, shippingType) {
        item.drugList.forEach(v=>{
            v.success = false
        })
        this.shippingType = shippingType
        this.orderdetail = item.drugList
        this.orderInfo = item
        this.currindex = 0;
        this.$loading(`正在出第${this.currindex+1}个药..`)
        //循环订单返回的列表,读取第一个
        if (this.orderdetail.length > this.currindex) {
            this.inOut = true
            this.nextShipment(this.orderdetail[this.currindex]);
@ -214,7 +224,11 @@ class SocketUtils extends Vue {
    }
    nextShipment(row) {
        this.resetTimeoutInterval()
        this.showTipsDialog({
            hasClose: false,
            contentType: 10,
            message: `正在出第${this.currindex+1}个药..`
        })
        //检查刷新是否已经完成数据,没有完成继续,这个设计是为了防断网
        var obj = {
            type: "Shipment",
@ -226,12 +240,26 @@ class SocketUtils extends Vue {
    }
    send(obj) {
        if(obj.type != 'heart'){
            //发送消息时  重置重连定时器时间
            // this.reconnectTimeout()
        if(this.isTest){
            setTimeout(()=>{
                if(obj.type == 'ReadCard'){
                    this.getMessage({
                        data: JSON.stringify({
                            type: 'CardInfo',
                            // mess: '读取信息失败',
                            mess: '卡号:DD2781527\n姓名:王志南\n身份证号:350524199405230613\n类型:01\n电话:\n发卡机构编号:3502\n性别:1\n生日:19940523\n公司:\n地址:\n卡基本信息警告:\n卡识别码:350200D156000005F314ECAA51F5F34D'
                        })
                    })
                } 
            }, 2000)
        } else {
            if(obj.type != 'heart'){
                //发送消息时  重置重连定时器时间
                // this.reconnectTimeout()
            }
            
            this.socket.send(JSON.stringify(obj));
        }
        
        this.socket.send(JSON.stringify(obj));
    }
    send2() {
@ -376,8 +404,55 @@ class SocketUtils extends Vue {
    }
    shipComplete(msg){
        if(!this.inOut){
            //已出药完成
            return
        }
        this.inOut = false
        this.$EventBus.$emit('DrugTakingEvent', {
            type: 'shipComplete',
            params: this.orderInfo
        })
        // this.orderList.splice(this.orderList.indexOf(this.orderInfo), 1)
        if(msg){
            this.showTipsDialog({
                contentType: 12,
                message: msg
            })
            return
        }
        this.showTipsDialog({
            contentType: 11,
            message: msg
        })
        this.$emit('shipComplete', msg)
    }
    updateOrderOutStatus(shipmentLogId, status, msg){
        return new Promise((resolve, reject)=>{
            var p = {
                shipmentLogId: shipmentLogId || '',
                status: status || '',
                msg: msg || '',
                shippingType: this.shippingType //取药方式(1、扫码,2、医保卡)
            }
            console.log('updateOrderOutStatus', p)
            medicineAbinetApi
                .updateOrderOutStatus(p)
                .then(res=>{
                    console.log('updateOrderOutStatus', res)
                    if(res.status == 200){
                        resolve()
                        return
                    }
                    reject()
                })
                .catch(err=>{
                    console.error(err)
                    reject()
                })
        })
    }
}
var socketUtils = new SocketUtils()
export default socketUtils

+ 421 - 0
mini-pro-web/src/views/machine/utils/ybUtils.js

@ -0,0 +1,421 @@
import medicineAbinetApi from '@/api/api-medicineAbinet'
import ybApi from '@/api/api-yb'
var api = {
    getSettlementInfoList(contentType){
        return new Promise((resolve, reject)=>{
            var p = {
                cardNo: this.cardNo || 'DJ4746508',
                orgCode: this.orgCode || '3502060500'
            }
            console.log('getSettlementInfoList params', p)
            medicineAbinetApi
                .getSettlementInfoList(p)
                .then(res=>{
                    this.$toast.clear()
                    console.log('getSettlementInfoList', res)
                    if(res.status == 200){
                        this.waitPayList = _.map(res.detailModelList, v=>{
                            return v.getSettleInfo
                        })
                        if(contentType){
                            this.show({
                                contentType: 4,
                            })
                        }
                    } else {
                        if(contentType){
                            this.showTipsDialog({
                                contentType: 3,
                                message: res.message
                            })
                        }
                    }
                    resolve()
                })
                .catch(err=>{
                    this.$toast.clear()
                    console.error(err)
                    if(contentType){
                        this.showTipsDialog({
                            contentType: 3,
                            message: "获取结算订单失败"
                        })
                    }
                    resolve()
                })
        })
    },
    getSettlementInfoFirst(){
        new Promise((resolve, reject)=>{
            Promise.all(_.map(this.curSettleList, v=>{
                var p = {
                    recipe_no: v.logNo,
                    card_sn: this.cardSn
                }
                return  medicineAbinetApi.getSettlementInfoFirst(p)
            }))
            .then(data=>{
                console.log('getSettlementInfoFirst', data)
                var exist = _.find(data, v=>{
                    return v.status != 200 || !v.detailModelList || !v.detailModelList.length
                })
                if(exist){
                    reject(exist.status!=200? exist.message : "无待结算数据")
                    return
                }
                resolve(_.map(data, v=>{
                    return v.detailModelList[0]
                }))
            })
            .catch(err=>{
                console.error(err)
                reject(err)
            })
        }).then(list=>{
            api.readcardByYb.call(this, list)
                .then(res=>{
                    console.log('readcardByYb', res)
                    return api.registerByYb.call(this, res)
                })
                .then(res=>{
                    console.log('registerByYb', res)
                    return api.getSettlementInfoSecode.call(this, res)
                })
                .then(res=>{
                    console.log('getSettlementInfoSecode', res)
                    return api.chargeByYb.call(this, res)
                })
                .then(res=>{
                    console.log('chargeByYb', res)
                    return api.getSettlementInfoByNew.call(this, res)
                })
                .then(res=>{
                    console.log('getSettlementInfoByNew', res)
                    this.$toast.clear()
                    var allNeedOnlinePay = 0, allMoney = 0
                    res.forEach(v=>{
                        var getSettleInfo = v.getSettleInfo
                        var needPay = this.getNeedOnlinePay(getSettleInfo)
                        allNeedOnlinePay += needPay
                        allMoney += Number(getSettleInfo.totalAmount)
                        v.list = [
                            {value: getSettleInfo.name, name: '就诊人:', clz: '', code: 'name'},
                            {value: getSettleInfo.relationCode, name: '门诊单号:', clz: '', code: 'relationCode'},
                            {value: getSettleInfo.cardNo, name: '门诊卡号:', clz: '', code: 'cardNo'},
                            {value: getSettleInfo.deptName, name: '科室名称:', clz: '', code: 'deptName'},
                            {value: getSettleInfo.applyTime, name: '处方时间:', clz: '', code: 'applyTime'},
                            {value: getSettleInfo.personCash, name: '自费支付:', clz: 'c-ff2626', code: 'personCash'},
                            {value: getSettleInfo.personAccount, name: '医保个人账户支付:', clz: 'c-ff2626', code: 'personAccount'},
                            {value: getSettleInfo.medicalPrice, name: '医保基金支付:', clz: 'c-ff2626', code: 'medicalPrice'},
                            {value: needPay, name: '还需线上支付:', clz: 'c-ff2626', code: 'needPay'},
                            {value: getSettleInfo.totalAmount, name: '消费总额:', clz: 'c-ff2626', code: 'totalAmount'},
                        ]
                    })
                    this.allNeedOnlinePay = allNeedOnlinePay.toFixed(2)
                    this.allMoney = allMoney.toFixed(2)
                    this.curSettleList = res
                    this.show({
                        contentType: 5,
                    })
                })
                .catch(err=>{
                    this.$toast(err)
                    console.error(err)
                })
        }).catch(err=>{
            console.error(err)
            this.showTipsDialog({
                contentType: 3,
                message: typeof err=="string"? err : ((err&&err.message) || '获取结算信息失败')
            })
        })
    },
    readcardByYb(list){
        return new Promise((resolve, reject)=>{
            if(this.isTest){
                return resolve(_.map(list, v=>{
                    if(v.needRegister){
                        var registerParam = JSON.parse(v.registerParam),
                            readcardResult = JSON.parse(v.readcardResult)
                        registerParam.data.input.data.psn_no = readcardResult.output.baseinfo.psn_no
                        v.registerParam = JSON.stringify(registerParam)
                    } else {
                    }
                    return v
                }))
            }
            
            var reqParams = []
            Promise.all(_.map(list, v=>{
                if(v.needCharge){
                    reqParams.push(v.readcardParam)
                    return ybApi.get({strin: v.readcardParam})
                } else {
                    reqParams.push(JSON.stringify({retCode: '0000'}))
                    return Promise.resolve({retCode: '0000'})
                }
            }))
            .then(data=>{
                console.log('ybApi', data)
                var isErr = false
                list = _.map(list, (v, i)=>{
                    var rs = data[i]
                    api.saveCheckHttpLog.call(this, rs, 'readcardByYb', reqParams[i], v.RECIPE_NO)
                    if(typeof rs ==  "string"){
                        rs = JSON.parse(rs)
                    }
                    if(typeof rs ==  "string"){
                        rs = JSON.parse(rs)
                    }
                    if(rs.retCode === '0000'){
                        if(v.needRegister){
                            var tmp = JSON.parse(v.registerParam)
                            tmp.data.input.data.psn_no = rs.data.output.baseinfo.psn_no
                            v.registerParam = JSON.stringify(tmp)
                        } else {
                        }
                        v.readcardResult = JSON.stringify(rs)
                    } else {
                        isErr = rs.retMsg || '读取卡数据出错'
                    }
                    return v
                })
                if(isErr){
                    return reject(isErr)
                } 
                resolve(list)
            })
            .catch(err=>{
                console.error(err)
                api.saveCheckHttpLog.call(this, (err&&err.message) || err, 'readcardByYb', reqParams, _.map(list, v=>{return v.RECIPE_NO}).join(","))
                reject(err)
            })
        })
    },
    registerByYb(list){
        return new Promise((resolve, reject)=>{
            if(this.isTest){
                return resolve(list)
            }
            var reqParams = []
            Promise.all(_.map(list, v=>{
                if(v.needRegister){
                    reqParams.push(v.registerParam)
                    return ybApi.get({strin: v.registerParam})
                } else {
                    reqParams.push(JSON.stringify({retCode: '0000'}))
                    return Promise.resolve({retCode: '0000'})
                }
            }))
            .then(data=>{
                console.log('ybApi', data)
                var isErr = false
                list = _.map(list, (v, i)=>{
                    var rs = data[i]
                    api.saveCheckHttpLog.call(this, rs, 'registerByYb', reqParams, v.RECIPE_NO)
                    if(typeof rs ==  "string"){
                        rs = JSON.parse(rs)
                    }
                    if(typeof rs ==  "string"){
                        rs = JSON.parse(rs)
                    }
                    if(rs.retCode === '0000'){
                        v.registerResult = JSON.stringify(rs)
                    } else {
                        isErr = rs.retMsg || '读取卡数据出错'
                    }
                    return v
                })
                if(isErr){
                    return reject(isErr)
                } 
                resolve(list)
            })
            .catch(err=>{
                api.saveCheckHttpLog.call(this, (err&&err.message) || err, 'registerByYb', reqParams, _.map(list, v=>{return v.RECIPE_NO}).join(","))
                console.error(err)
                reject(err)
            })
        })
    },
    getSettlementInfoSecode(list){
        return new Promise((resolve, reject)=>{
            Promise.all(_.map(list, v=>{
                if(v.needRegister || v.needCharge){
                    var p = {
                        recipe_no: v.RECIPE_NO,
                        readcardResult: v.readcardResult,
                        registerResult: v.needRegister? v.registerResult : ''
                    }
                    console.log('getSettlementInfoSecode params', p)
                    return medicineAbinetApi.getSettlementInfoSecode(p)
                } else {
                    return Promise.resolve({status: 200})
                }
            }))
            .then(data=>{
                console.log('ybApi', data)
                var isErr
                _.each(list, (v, i)=>{
                    var rs = data[i]
                    if(rs.status == 200){
                        v.chargeList = rs.detailModelList || []
                    } else {
                        isErr = v.msg || '获取结算信息失败:getSettlementInfoSecode'
                    }
                })
                if(isErr){
                    return reject(isErr)
                }
                resolve(list)
            })
            .catch(err=>{
                reject(err)
            })
        })
    },
    chargeByYb(list){
        return new Promise((resolve, reject)=>{
            if(this.isTest){
                return resolve(list)
            }
            var req = []
            var reqParams = []
            list.forEach(v=>{
                if(v.needCharge){
                    v.chargeList.forEach(m => {
                        reqParams.push(m.chargeParam)
                        req.push(ybApi.get({strin: m.chargeParam}))
                    })
                } else {
                    reqParams.push(JSON.stringify({retCode: '0000'}))
                    req.push(Promise.resolve({retCode: '0000'}))
                }
            })
            Promise.all(req)
            .then(data=>{
                console.log('ybApi', data)
                var isErr = false, i = 0, tmp
                list.forEach(v=>{
                    tmp = data[i]
                    api.saveCheckHttpLog.call(this, tmp, 'chargeByYb', reqParams, v.RECIPE_NO)
                    if(typeof tmp == "string"){
                        tmp = JSON.parse(tmp)
                    }
                    if(typeof tmp == "string"){
                        tmp = JSON.parse(tmp)
                    }
                    if(tmp.retCode !== '0000'){
                        isErr = tmp.retMsg || '读取卡数据出错'
                    } 
                    if(v.needCharge){
                        v.chargeList.forEach(m => {
                            m.chargeResult = JSON.stringify(tmp)
                            i++
                        })
                    } else {
                        i++
                    }
                })
                if(isErr){
                    return reject(isErr) 
                } 
                resolve(list)
            })
            .catch(err=>{
                console.error(err)
                api.saveCheckHttpLog.call(this, (err&&err.message) || err, 'chargeByYb', reqParams, _.map(list, v=>{return v.RECIPE_NO}).join(","))
                reject(err)
            })
        })
    },
    getSettlementInfoByNew(list, isCheckPay){
        return new Promise((resolve, reject)=>{
            Promise.all(_.map(list, v=>{
                var chargeArr = ''
                if(!isCheckPay){
                    if(v.needCharge){
                        chargeArr = JSON.stringify(_.map(v.chargeList, m=>{
                            return JSON.parse(m.chargeResult)
                        }))
                    }
                }
                return  medicineAbinetApi.getSettlementInfo({
                    chargeArr,
                    recipe_no: v.RECIPE_NO
                })
            }))
            .then(data=>{
                console.log('ybApi', data)
                var tmp
                list.forEach((v, i)=>{
                    tmp = data[i]
                    v.getSettleInfo = tmp.obj.getSettleInfo
                })
                resolve(list)
            })
            .catch(err=>{
                console.error(err)
                reject(err)
            })
        })
    },
    saveCheckHttpLog(data, code, req, patient){
        try{
            // var patient = this.curSettle.logNo
            var name = code =='readcardByYb'? '药柜医保读卡返回值' : code =='registerByYb'? '药柜医保挂号返回值' : '药柜医保结算返回值'
            code = 'fsi.terminal.'+ code.replace('ByYb', '')
            if(_.isArray(data)){
                data.forEach((v, i)=>{
                    var p = {
                        code,
                        name,
                        patient,
                        doctor: '',
                        request: req[i],
                        response: JSON.stringify(v),
                        status: ''
                    }
                    console.log('saveCheckHttpLog params', p)
                    medicineAbinetApi
                        .saveCheckHttpLog(p)
                        .then(res=>{
                            console.log('saveCheckHttpLog', res)
                        })
                        .catch(err=>{
                            console.error(err)
                        })
                })
            } else {
                var p = {
                    code,
                    name,
                    patient,
                    doctor: '',
                    request: JSON.stringify(req),
                    response: JSON.stringify(data),
                    status: ''
                }
                console.log('saveCheckHttpLog params', p)
                medicineAbinetApi
                    .saveCheckHttpLog(p)
                    .then(res=>{
                        console.log('saveCheckHttpLog', res)
                    })
                    .catch(err=>{
                        console.error(err)
                    })
            }
        }catch(e){
            console.error('saveCheckHttpLog', e)
        }
    }
}
export default api

+ 1 - 1
mini-pro-web/vue.config.js

@ -8,7 +8,7 @@ function resolve(dir) {
module.exports = {
  publicPath: process.env.NODE_ENV==='production'||process.env.NODE_ENV==='test'?process.env.VUE_APP_PRE_PATH:"/",
  outputDir: 'intelligent-medicine-abinet',
  outputDir: 'intelligent-medicine-abinet-test',
  productionSourceMap:false,
  devServer: {
    port: 8080,