diff --git a/src/pages/questionnaire.vue b/src/pages/questionnaire.vue index 87412ee022b417b14cbcb1b1ce365ee5f7a4db53..da695843f787529acdb7c06b9afc6badf8440247 100644 --- a/src/pages/questionnaire.vue +++ b/src/pages/questionnaire.vue @@ -38,22 +38,27 @@ export default { } }, methods: { - login() { - this.$API.login().then((res) => { - console.log(res) - }) - }, + // login() { + // this.$API.login().then((res) => { + // console.log(res) + // }) + // }, getPatientInfo() { + // let data = 'NfQ4zQ+wWuvnPfQQgL6wHMQb5XGNtIbxXUiYHs5NmhnI7tSHpQob3FCUx59D/nPWbmKlW7pp5d00I/P9L0q9skLoGpXaf10EAwXJjyT8JFWwu5FFapdBHsjV0KLq+erWns7g70e4wYH2eTxQHpMwxj7+GOuPL5LtPR0x2RLJDyY=' + // data = data.replaceAll("+", "%2B") let params = { - idCard: 111111111, - patientName: "张三", - phone: 18888888888 + // data: data + data: this.$route.query.data } this.$API .getPatientInfo(params) .then((res) => { - this.baseInfo = { - ...res.data + if (res.code == 1) { + this.baseInfo = { + ...res.data + } + this.getQuestionList() + this.getQuestionnaireRecords() } }) .catch(() => { @@ -84,7 +89,7 @@ export default { getQuestionnaireRecords() { this.$API .getQuestionnaireRecords({ - patientId: 1 + patientId: this.baseInfo.id }) .then((res) => { if (res.code == 1) { @@ -125,13 +130,12 @@ export default { } }, created() { - this.login() - this.getPatientInfo() - this.getQuestionList() - }, - mounted() { - this.getQuestionnaireRecords() + // this.login() + if (this.$route.query.data) { + this.getPatientInfo() + } }, + mounted() {}, watch: {} } diff --git a/src/router/index.js b/src/router/index.js index 9a5013d2b46b189fcf3941fd5d6fbe82033d37e1..56a593a8dec032f543a14a8df70b56262565e9fe 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,7 +20,7 @@ const page = [ component: () => import("@/pages/feedback") }, { - path: `/questionnaire/:id`, + path: `/questionnaire`, meta: { index: 2, keepAlive: false }, name: "questionnaire", component: () => import("@/pages/questionnaire") diff --git a/vue.config.js b/vue.config.js index 5ffa793ed11231bb5491423c44b0fdde9df9d165..34c32a719507939b4c17a48120599b7a002ca776 100644 --- a/vue.config.js +++ b/vue.config.js @@ -65,7 +65,7 @@ module.exports = { proxy: { "/api": { // target: "https://ds.cixincloud.com/songjiang-api", - target: "http://192.168.0.105:11999/", + target: "http://192.168.0.200:11999/", // target: 'http://localhost:8201/', // target: 'http://192.168.3.221/8201/', changeOrigin: true,