|
|
@ -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); |
|
|
|