Browse Source

基本信息修改

master
aBin 4 years ago
parent
commit
09c366de77
  1. 133
      src/components/CaseTable/CaseTable.vue
  2. 135
      src/components/PatientInfo/PatientTable.vue
  3. 6
      src/config/api.js
  4. 2
      src/views/SelectPatient/SelectPatient.vue

133
src/components/CaseTable/CaseTable.vue

@ -26,7 +26,10 @@
</template>
<template slot="id" slot-scope="text, record">
<!-- <a-icon @click="showEditModal(record.id, record.inputStatus)" class="pointer pointerEdit" theme="twoTone" type="edit" /> -->
<a-button type="primary" @click="details(record.id, record.hospitalization, record.code)">查看详情</a-button>
<div class="d-flex flex-column">
<a-button type="primary" @click="details(record.id, record.hospitalization, record.code)">查看详情</a-button>
<a-button class="mt-4" type="primary" @click="changeInfo(record.id)"> 修改基本信息 </a-button>
</div>
</template>
</a-table>
</div>
@ -36,12 +39,66 @@
<a-select-option v-for="item in statusList" :value="item.id" :key="item.id"> {{ item.name }} </a-select-option>
</a-select>
</a-modal>
<a-modal title="修改基本信息" width="600px" v-model="visible1" :mask-closable="false" :closable="false" :footer="null">
<a-form :form="form" @submit="handleSubmit" ref="form" v-if="patientObj">
<!-- 研究编号 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="研究序号">
<a-input-number
style="width: 100%"
placeholder="研究序号"
:min="0"
:max="999"
v-decorator="[
'codeNum',
{
initialValue: patientObj.codeNum,
rules: [{ required: true, message: '研究序号不能为空' }],
},
]"
/>
</a-form-item>
<!-- 住院号 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="住院号">
<a-input
style="width: 100%"
placeholder="住院号"
v-decorator="[
'hospitalization',
{
initialValue: patientObj.hospitalization,
rules: [{ required: true, message: '住院号不能为空' }],
},
]"
/>
</a-form-item>
<!-- 组别 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="组别">
<a-select
placeholder="请选择组别"
v-decorator="[
'inpatientId',
{
initialValue: patientObj.inpatientId,
rules: [{ required: true, message: '组别不能为空' }],
},
]"
>
<a-select-option :key="index" :value="group.id" v-for="(group, index) in controlList">{{ group.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="visible1 = false" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">修改</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapMutations, mapState } from 'vuex';
import { upPatientMes } from 'config/api';
import { upPatientMes, getById, upPatient, queryEnable } from 'config/api';
const columns = [
{
title: '住院号',
@ -92,6 +149,11 @@ const columns = [
},
];
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'CaseTable',
@ -99,6 +161,9 @@ export default {
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
columns,
loading: false,
visible: false,
@ -125,6 +190,10 @@ export default {
id: 4,
},
],
visible1: false,
patientObj: null,
controlList: [],
updataId: '',
};
},
@ -138,10 +207,66 @@ export default {
};
},
},
created() {
this.getList();
},
methods: {
...mapMutations('home', ['setPatientId', 'setHospitalization', 'setRecordCode']),
async getList() {
try {
const res = await queryEnable({});
const { code, msg, data } = res.data;
if (code === 200) {
this.controlList = data;
} else {
console.log(msg);
}
} catch (error) {
console.error(error);
}
},
//
async changeInfo(patientId) {
try {
this.visible1 = true;
this.updataId = patientId;
const params = { param: { patientId } };
const res = await getById(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.patientObj = data;
} else {
console.log(msg);
}
} catch (error) {
console.log(error);
}
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const params = { param: { ...values, id: this.updataId } };
const res = await upPatient(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.visible1 = false;
this.$emit('setData');
//
this.form.resetFields();
} else {
throw msg;
}
} catch (error) {
// console.log('error: ', error);
this.$message.error(error || '修改失败');
}
}
});
},
//
chooseItem(id) {
this.setPatientId(id);

135
src/components/PatientInfo/PatientTable.vue

@ -70,6 +70,7 @@
修改状态
</a-button>
</a-popconfirm>
<a-button class="mt-4" size="small" type="primary" @click="changeInfo(record.id)"> 修改基本信息 </a-button>
</div>
</template>
@ -98,20 +99,72 @@
</a-table>
</div>
<a-empty v-else />
<!-- <a-modal title="选择病例" width="600px" v-model="visible" @ok="handleOk" @cancel="handleCancel">
是否要录入住院号为
<span style="color: green">{{ hospitalization }}</span>
, 研究编号为:
<span style="color: green">{{ recordCode }}</span>
, 的病例的相关数据
</a-modal> -->
<a-modal title="修改基本信息" width="600px" v-model="visible" :mask-closable="false" :closable="false" :footer="null">
<a-form :form="form" @submit="handleSubmit" ref="form" v-if="patientObj">
<!-- 研究编号 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="研究序号">
<a-input-number
style="width: 100%"
placeholder="研究序号"
:min="0"
:max="999"
v-decorator="[
'codeNum',
{
initialValue: patientObj.codeNum,
rules: [{ required: true, message: '研究序号不能为空' }],
},
]"
/>
</a-form-item>
<!-- 住院号 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="住院号">
<a-input
style="width: 100%"
placeholder="住院号"
v-decorator="[
'hospitalization',
{
initialValue: patientObj.hospitalization,
rules: [{ required: true, message: '住院号不能为空' }],
},
]"
/>
</a-form-item>
<!-- 组别 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="组别">
<a-select
placeholder="请选择组别"
v-decorator="[
'inpatientId',
{
initialValue: patientObj.inpatientId,
rules: [{ required: true, message: '组别不能为空' }],
},
]"
>
<a-select-option :key="index" :value="group.id" v-for="(group, index) in controlList">{{ group.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="visible = false" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">修改</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapMutations, mapState } from 'vuex';
import { checkPatientComplete, upPatientMes } from 'config/api';
import { checkPatientComplete, upPatientMes, getById, upPatient, queryEnable } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'PatientTable',
@ -119,6 +172,9 @@ export default {
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
columns: [],
loading: false,
hasPatientId: false,
@ -141,6 +197,10 @@ export default {
lineHeight: '30px',
},
isMobile: false,
visible: false,
patientObj: null,
controlList: [],
updataId: '',
};
},
@ -233,8 +293,67 @@ export default {
}
},
created() {
this.getList();
},
methods: {
...mapMutations('home', ['setPatientId', 'setHospitalization', 'setRecordCode', 'setShowTable']),
async getList() {
try {
const res = await queryEnable({});
const { code, msg, data } = res.data;
if (code === 200) {
this.controlList = data;
} else {
console.log(msg);
}
} catch (error) {
console.error(error);
}
},
//
async changeInfo(patientId) {
try {
this.visible = true;
this.updataId = patientId;
const params = { param: { patientId } };
const res = await getById(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.patientObj = data;
} else {
console.log(msg);
}
} catch (error) {
console.log(error);
}
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const params = { param: { ...values, id: this.updataId } };
const res = await upPatient(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('修改成功');
this.visible = false;
this.$emit('searchPatientMes');
//
this.form.resetFields();
} else {
throw msg;
}
} catch (error) {
// console.log('error: ', error);
this.$message.error(error || '修改失败');
}
}
});
},
showModal(id, hospitalization, recordCode) {
this.patientId = id;
this.hospitalization = hospitalization;

6
src/config/api.js

@ -115,3 +115,9 @@ export const basic = params => axios.post(`${tcm}/ocr/general/basic`, params);
export const getHospitalTask = params => axios.post(`${tcm}/statistics/hospitalAdjacentTasks`, params);
export const simpleMsg = params => axios.post(`${tcm}/doctor/simpleMsg`, params);
// 查询病例的创建信息
export const getById = params => axios.post(`${patient}/getById`, params);
// 修改病例的信息
export const upPatient = params => axios.post(`${patient}/upPatient`, params);

2
src/views/SelectPatient/SelectPatient.vue

@ -2,7 +2,7 @@
<div class="d-flex flex-column main">
<div v-if="showTable === 0">
<search @searchPatientMes="searchPatientMes" />
<patient-table :lists="lists" @handleSelPatientMes="handleSelPatientMes" class="mt-3" />
<patient-table @searchPatientMes="searchPatientMes" :lists="lists" @handleSelPatientMes="handleSelPatientMes" class="mt-3" />
</div>
<div v-else style="position: relative">
<!-- <a-tabs default-active-key="OTHER" @tabClick="changeShow">

Loading…
Cancel
Save