diff --git a/src/components/PatientInfo/PatientAdd.vue b/src/components/PatientInfo/PatientAdd.vue new file mode 100644 index 0000000..16f7388 --- /dev/null +++ b/src/components/PatientInfo/PatientAdd.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/components/PatientInfo/PatientTable.vue b/src/components/PatientInfo/PatientTable.vue index f0bd25e..5b4792d 100644 --- a/src/components/PatientInfo/PatientTable.vue +++ b/src/components/PatientInfo/PatientTable.vue @@ -36,6 +36,8 @@ diff --git a/src/components/PatientInfo/Search.vue b/src/components/PatientInfo/Search.vue index f5dc826..43cf199 100644 --- a/src/components/PatientInfo/Search.vue +++ b/src/components/PatientInfo/Search.vue @@ -1,48 +1,57 @@ diff --git a/src/config/api.js b/src/config/api.js index bfc084d..4a2819d 100644 --- a/src/config/api.js +++ b/src/config/api.js @@ -3,6 +3,7 @@ let { proxyUrl, msgUrl } = require('@/config/setting'); const tcm = `${proxyUrl}/tcm`; const patient = `${tcm}/patient`; // 患者相关接口 +const inpatient = `${tcm}/inpatient`; // 对照组接口 // 保存患者病例信息 export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params); @@ -18,3 +19,6 @@ export const selPatientMesList = params => axios.post(`${patient}/selPatientMesL // 通过查询搜索条件 export const selSearchCriteriaList = params => axios.post(`${patient}/selSearchCriteriaList`, params); + +// 查询所有对照组的信息 +export const getQuery = params => axios.post(`${inpatient}/query`, params); diff --git a/src/store/modules/home/actions.js b/src/store/modules/home/actions.js index 1b9113f..1ad22a3 100644 --- a/src/store/modules/home/actions.js +++ b/src/store/modules/home/actions.js @@ -1,6 +1,7 @@ import axios from 'axios'; import { message } from 'ant-design-vue'; import { getUserId } from 'config/api-user'; +import { getQuery } from 'config/api'; const actions = { /** @@ -23,6 +24,25 @@ const actions = { throw error || '获取个人信息失败'; } }, + + /** + * 查询所有对照组的信息 + * @param {any} commit + * @param {object} params 提交的参数 + */ + async getControlGroups({ commit }) { + try { + const res = await getQuery(); + const { code, msg, data } = res.data; + if (code === 200) { + commit('setControlGroups', data); + } else { + throw msg; + } + } catch (error) { + throw error || '获取对照组信息失败'; + } + }, }; export default actions; diff --git a/src/store/modules/home/mutations.js b/src/store/modules/home/mutations.js index cd03500..1230dd4 100644 --- a/src/store/modules/home/mutations.js +++ b/src/store/modules/home/mutations.js @@ -19,6 +19,24 @@ const mutations = { state.user = { ...user }; sessionStorage.setItem('user', JSON.stringify(user)); }, + + /** + * 设置user用户信息 + * @param {object} state + * @param {Array} data + */ + setControlGroups(state, data) { + state.controlGroups = data; + }, + + /** + * 设置病患id + * @param {object} state + * @param {string} data + */ + setPatientId(state, data) { + state.patientId = data; + }, }; export default mutations; diff --git a/src/store/modules/home/state.js b/src/store/modules/home/state.js index f941d72..dd90d75 100644 --- a/src/store/modules/home/state.js +++ b/src/store/modules/home/state.js @@ -1,6 +1,8 @@ const state = { anyringToken: '', user: { id: '', phone: '', account: '' }, + controlGroups: [], // 对照组 + patientId: '', // 病患id }; export default state; diff --git a/src/views/SelectPatient/SelectPatient.vue b/src/views/SelectPatient/SelectPatient.vue index ae2b609..f47f75b 100644 --- a/src/views/SelectPatient/SelectPatient.vue +++ b/src/views/SelectPatient/SelectPatient.vue @@ -9,6 +9,7 @@ import Search from 'components/PatientInfo/Search.vue'; import PatientTable from 'components/PatientInfo/PatientTable.vue'; import { selPatientMes } from 'config/api'; +import { mapState, mapActions } from 'vuex'; export default { name: 'SelectPatient', @@ -23,12 +24,17 @@ export default { created() { this.handleSelPatientMes(); + this.getControlGroups(); }, methods: { + ...mapActions('home', ['getControlGroups']), + searchPatientMes(value) { - this.hospitalization = value.inpatientNumber; - this.inpatientId = value.groupValue; + if (value) { + this.hospitalization = value.inpatientNumber; + this.inpatientId = value.groupValue; + } this.handleSelPatientMes(); },