@ -1,7 +1,7 @@
<template>
<a-config-provider :locale="zh_CN">
<div class="d-flex flex-row flex-nowrap" id="app">
<!-- <btn-con /> -->
<btn-con />
<router-view class="flex-1 bg pa-3"></router-view>
</div>
</a-config-provider>
@ -10,12 +10,12 @@
<script>
import { mapState, mapActions, mapMutations } from 'vuex';
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
// import BtnCon from 'components/BtnCom/BtnCon.vue';
import BtnCon from 'components/BtnCom/BtnCon.vue';
import { getHId } from 'config/api';
export default {
name: 'App',
// components: { BtnCon },
components: { BtnCon },
data() {
return { zh_CN };
},
@ -32,11 +32,11 @@ export default {
}
created() {
// const userId = '1218763410024566784';
// const params = { userId };
// await this.getUserId(params);
// await this.getToken();
async created() {
const userId = '1218763410024566784';
const params = { userId };
await this.getUserId(params);
await this.getToken();
if (localStorage.getItem('patientId')) {
this.setPatientId(localStorage.getItem('patientId'));
@ -43,7 +43,7 @@
import { mapMutations, mapState } from 'vuex';
import { generatePatientReport } from 'config/api';
const columns = [
{
title: '序号',
@ -108,11 +108,25 @@ export default {
...mapMutations('home', ['setPatientId']),
// 选择病患
chooseItem(id) {
this.setPatientId(id);
localStorage.setItem('patientId', id);
this.$message.success('选择成功');
async chooseItem(id) {
try {
const params = { param: { patientId: id } };
const res = await generatePatientReport(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data);
localStorage.setItem('reportId', data.id);
if (localStorage.getItem('reportId')) {
this.$message.success('生成报告单成功');
} catch (error) {
console.log(error);
@ -9,6 +9,7 @@ import axios from 'axios';
let { proxyUrl, msgUrl } = require('@/config/setting');
const tcm = `${proxyUrl}/tcm`;
const question = `${proxyUrl}/question`;
const patient = `${tcm}/patient`; // 患者相关接口
const imp = `${tcm}/import`; // 试题相关接口
const inpatient = `${tcm}/inpatient`; // 对照组接口
@ -86,3 +87,6 @@ export const patientProgress = params => axios.post(`${statistics}/selPatientPro
// 临近任务统计
export const adjacentTasks = params => axios.post(`${statistics}/adjacentTasks`, params);
// 生成报告单
export const generatePatientReport = params => axios.post(`${question}/generatePatientReport`, params);