| | |
| | | <template> |
| | | <el-dialog |
| | | :title="dialogTitle" |
| | | :title="standalone ? '新建建档' : '选择建档类型'" |
| | | :visible.sync="dialogVisible" |
| | | width="750px" |
| | | width="640px" |
| | | :close-on-click-modal="false" |
| | | append-to-body |
| | | @close="handleClose" |
| | | top="3vh" |
| | | > |
| | | <!-- 已选患者预览(关联建档模式) --> |
| | | <div class="archive-section" v-if="selectedPatients.length > 0"> |
| | | <div class="archive-section" v-if="!standalone && selectedPatients.length > 0"> |
| | | <div class="section-title">已选患者({{ selectedPatients.length }}人)</div> |
| | | <el-table :data="selectedPatients" border size="small" max-height="180"> |
| | | <el-table-column prop="patname" label="姓名" width="80" align="center" /> |
| | |
| | | <el-divider /> |
| | | </div> |
| | | |
| | | <!-- 儿保科:家长信息(必填) --> |
| | | <div class="archive-section" v-if="mainCategory === 'child'"> |
| | | <div class="section-title">家长/监护人信息</div> |
| | | <el-form :model="parentInfo" label-width="100px" size="small" inline> |
| | | <el-form-item label="家长姓名" required> |
| | | <el-input v-model="parentInfo.parentName" placeholder="请输入" style="width:150px" /> |
| | | </el-form-item> |
| | | <el-form-item label="与儿童关系"> |
| | | <el-select v-model="parentInfo.relation" style="width:120px"> |
| | | <el-option label="父亲" value="father" /> |
| | | <el-option label="母亲" value="mother" /> |
| | | <el-option label="祖父" value="grandfather" /> |
| | | <el-option label="祖母" value="grandmother" /> |
| | | <el-option label="其他" value="other" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="联系电话" required> |
| | | <el-input v-model="parentInfo.parentPhone" placeholder="联系电话" style="width:150px" /> |
| | | </el-form-item> |
| | | <el-form-item label="身份证号"> |
| | | <el-input v-model="parentInfo.parentIdCard" placeholder="身份证号" style="width:200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="联系地址"> |
| | | <el-input v-model="parentInfo.address" placeholder="联系地址" style="width:300px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-divider /> |
| | | </div> |
| | | |
| | | <!-- 建档主分类 --> |
| | | <!-- 专案类型选择 --> |
| | | <div class="archive-section"> |
| | | <div class="section-title">选择建档类型</div> |
| | | <el-radio-group v-model="mainCategory" size="medium" @change="onMainCategoryChange"> |
| | | <el-radio-button label="child">儿保科建档</el-radio-button> |
| | | <el-radio-button label="maternal">妇保科建档</el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | | |
| | | <!-- 子类型 --> |
| | | <div class="archive-section" v-if="mainCategory"> |
| | | <div class="section-title">选择专案类型</div> |
| | | <el-radio-group v-model="subType" size="small" @change="onSubTypeChange"> |
| | | <template v-if="mainCategory === 'child'"> |
| | | <el-radio-button label="highRisk">高危儿专案管理</el-radio-button> |
| | | <el-radio-button label="nutrition">营养性疾病专案管理</el-radio-button> |
| | | <el-radio-button label="learning">学习困难专案管理</el-radio-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-radio-button label="pregnancy">孕妇随访</el-radio-button> |
| | | <el-radio-button label="menopause">更年期随访</el-radio-button> |
| | | </template> |
| | | <el-radio-group v-model="subType" size="medium"> |
| | | <el-radio-button v-for="t in typeOptions" :key="t.key" :label="t.key">{{ t.entryLabel }}</el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | | |
| | | <!-- 建档专属字段 --> |
| | | <div class="archive-section" v-if="subType"> |
| | | <div class="section-title">建档信息</div> |
| | | <el-form :model="archiveForm" label-width="120px" size="small"> |
| | | <!-- 儿保科 - 高危儿 --> |
| | | <template v-if="mainCategory === 'child' && subType === 'highRisk'"> |
| | | <el-form-item label="高危因素"> |
| | | <el-select v-model="archiveForm.riskFactor" multiple placeholder="可多选" style="width:100%"> |
| | | <el-option label="早产/低体重" value="preterm" /> |
| | | <el-option label="窒息史" value="asphyxia" /> |
| | | <el-option label="颅内出血" value="ich" /> |
| | | <el-option label="高胆红素血症" value="hyperbilirubinemia" /> |
| | | <el-option label="宫内感染" value="intrauterine" /> |
| | | <el-option label="先天畸形" value="malformation" /> |
| | | <el-option label="其他" value="other" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="出生体重(g)"> |
| | | <el-input-number v-model="archiveForm.birthWeight" :min="500" :max="6000" /> |
| | | </el-form-item> |
| | | <el-form-item label="出生孕周"> |
| | | <el-input-number v-model="archiveForm.gestationalWeek" :min="22" :max="42" :precision="1" /> 周 |
| | | </el-form-item> |
| | | <el-form-item label="建档医生"> |
| | | <el-input v-model="archiveForm.doctorName" placeholder="请输入建档医生" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="archiveForm.remark" type="textarea" :rows="2" /> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <!-- 儿保科 - 营养性疾病 --> |
| | | <template v-if="mainCategory === 'child' && subType === 'nutrition'"> |
| | | <el-form-item label="营养诊断" required> |
| | | <el-select v-model="archiveForm.nutritionDiagnosis" placeholder="请选择" style="width:100%"> |
| | | <el-option label="营养不良" value="malnutrition" /> |
| | | <el-option label="超重" value="overweight" /> |
| | | <el-option label="肥胖" value="obesity" /> |
| | | <el-option label="微量元素缺乏" value="micronutrient" /> |
| | | <el-option label="喂养困难" value="feeding" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="建档医生"> |
| | | <el-input v-model="archiveForm.doctorName" placeholder="请输入建档医生" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="archiveForm.remark" type="textarea" :rows="2" /> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <!-- 儿保科 - 学习困难 --> |
| | | <template v-if="mainCategory === 'child' && subType === 'learning'"> |
| | | <el-form-item label="学习问题" required> |
| | | <el-select v-model="archiveForm.learningIssue" placeholder="请选择" style="width:100%"> |
| | | <el-option label="阅读障碍" value="dyslexia" /> |
| | | <el-option label="书写障碍" value="dysgraphia" /> |
| | | <el-option label="计算障碍" value="dyscalculia" /> |
| | | <el-option label="注意力缺陷" value="adhd" /> |
| | | <el-option label="混合型" value="mixed" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="建档医生"> |
| | | <el-input v-model="archiveForm.doctorName" placeholder="请输入建档医生" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="archiveForm.remark" type="textarea" :rows="2" /> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <!-- 妇保科 - 孕妇随访 --> |
| | | <template v-if="mainCategory === 'maternal' && subType === 'pregnancy'"> |
| | | <el-form-item label="末次月经"> |
| | | <el-date-picker v-model="archiveForm.lmp" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width:100%" /> |
| | | </el-form-item> |
| | | <el-row :gutter="12"> |
| | | <el-col :span="8"><el-form-item label="孕周"><el-input-number v-model="archiveForm.gestationalWeek" :min="1" :max="42" :precision="1" /> 周</el-form-item></el-col> |
| | | <el-col :span="8"><el-form-item label="孕次"><el-input-number v-model="archiveForm.gravidity" :min="1" :max="20" /></el-form-item></el-col> |
| | | <el-col :span="8"><el-form-item label="产次"><el-input-number v-model="archiveForm.parity" :min="0" :max="20" /></el-form-item></el-col> |
| | | </el-row> |
| | | <el-form-item label="预产期"> |
| | | <el-date-picker v-model="archiveForm.edd" type="date" value-format="yyyy-MM-dd" placeholder="选择预产期" style="width:100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="高危妊娠"> |
| | | <el-switch v-model="archiveForm.highRiskPregnancy" active-text="是" inactive-text="否" /> |
| | | </el-form-item> |
| | | <el-form-item label="建档医生"> |
| | | <el-input v-model="archiveForm.doctorName" placeholder="请输入建档医生" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="archiveForm.remark" type="textarea" :rows="2" /> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <!-- 妇保科 - 更年期随访 --> |
| | | <template v-if="mainCategory === 'maternal' && subType === 'menopause'"> |
| | | <el-form-item label="月经状态"> |
| | | <el-select v-model="archiveForm.menstrualStatus" placeholder="请选择" style="width:100%"> |
| | | <el-option label="月经紊乱" value="irregular" /> |
| | | <el-option label="闭经(<12个月)" value="amenorrhea_short" /> |
| | | <el-option label="绝经(≥12个月)" value="menopause" /> |
| | | <el-option label="人工绝经" value="surgical" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="末次月经"> |
| | | <el-date-picker v-model="archiveForm.lmp" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width:100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="建档医生"> |
| | | <el-input v-model="archiveForm.doctorName" placeholder="请输入建档医生" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="archiveForm.remark" type="textarea" :rows="2" /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" :loading="submitting" @click="handleSubmit" :disabled="!canSubmit"> |
| | | 确认建档 |
| | | </el-button> |
| | | <el-button type="primary" :loading="submitting" @click="handleSubmit" :disabled="!canSubmit">确认建档</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ARCHIVE_TYPES, loadArchives, saveArchives, buildArchiveRecord } from "../types"; |
| | | |
| | | export default { |
| | | name: "ArchiveDialog", |
| | | props: { |
| | |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | mainCategory: "", |
| | | subType: "", |
| | | submitting: false, |
| | | standalonePatient: { patname: "", sex: 2, age: "", telcode: "", deptname: "", diagname: "" }, |
| | | parentInfo: { parentName: "", relation: "", parentPhone: "", parentIdCard: "", address: "" }, |
| | | archiveForm: { |
| | | riskFactor: [], birthWeight: null, gestationalWeek: null, |
| | | nutritionDiagnosis: "", learningIssue: "", |
| | | gravidity: 1, parity: 0, edd: "", lmp: "", |
| | | highRiskPregnancy: false, menstrualStatus: "", |
| | | doctorName: "", remark: "", |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | dialogTitle() { |
| | | return this.standalone ? "新建建档" : "患者建档"; |
| | | }, |
| | | typeOptions() { return ARCHIVE_TYPES; }, |
| | | canSubmit() { |
| | | if (!this.subType) return false; |
| | | if (this.mainCategory === 'child' && !this.parentInfo.parentName) return false; |
| | | if (this.standalone && !this.standalonePatient.patname) return false; |
| | | if (!this.standalone && this.selectedPatients.length === 0) return false; |
| | | return true; |
| | | }, |
| | | selectedPatients() { |
| | | return this.patients || []; |
| | | }, |
| | | selectedPatients() { return this.patients || []; }, |
| | | }, |
| | | watch: { |
| | | visible(val) { |
| | |
| | | }, |
| | | methods: { |
| | | resetForm() { |
| | | this.mainCategory = ""; |
| | | this.subType = ""; |
| | | this.standalonePatient = { patname: "", sex: 2, age: "", telcode: "", deptname: "", diagname: "" }; |
| | | this.parentInfo = { parentName: "", relation: "", parentPhone: "", parentIdCard: "", address: "" }; |
| | | this.archiveForm = { |
| | | riskFactor: [], birthWeight: null, gestationalWeek: null, |
| | | nutritionDiagnosis: "", learningIssue: "", |
| | | gravidity: 1, parity: 0, edd: "", lmp: "", |
| | | highRiskPregnancy: false, menstrualStatus: "", |
| | | doctorName: "", remark: "", |
| | | }; |
| | | }, |
| | | onMainCategoryChange() { this.subType = ""; }, |
| | | onSubTypeChange() {}, |
| | | |
| | | getSubTypeLabel() { |
| | | const map = { highRisk: "高危儿专案管理", nutrition: "营养性疾病专案管理", learning: "学习困难专案管理", pregnancy: "孕妇随访", menopause: "更年期随访" }; |
| | | return map[this.subType] || ""; |
| | | }, |
| | | getMainCategoryLabel() { |
| | | return this.mainCategory === "child" ? "儿保科建档" : "妇保科建档"; |
| | | }, |
| | | |
| | | handleSubmit() { |
| | | if (!this.subType) { this.$message.warning("请选择专案类型"); return; } |
| | | if (this.standalone && !this.standalonePatient.patname) { this.$message.warning("请输入姓名"); return; } |
| | | if (!this.standalone && this.selectedPatients.length === 0) { this.$message.warning("请选择患者"); return; } |
| | | this.submitting = true; |
| | | |
| | | const archives = JSON.parse(localStorage.getItem("patientArchives") || "[]"); |
| | | const now = new Date().toISOString().replace("T", " ").substring(0, 19); |
| | | |
| | | // 确定患者列表 |
| | | const patientList = this.standalone |
| | | ? [{ ...this.standalonePatient, patid: "sa_" + Date.now() }] |
| | | : this.selectedPatients; |
| | | |
| | | patientList.forEach((patient) => { |
| | | archives.push({ |
| | | id: "arc_" + Date.now() + "_" + Math.random().toString(36).substr(2, 6), |
| | | patientId: patient.patid || patient.id, |
| | | patname: patient.patname, |
| | | sex: patient.sex, |
| | | age: patient.age, |
| | | telcode: patient.telcode || patient.phone || "", |
| | | deptname: patient.deptname || "", |
| | | diagname: patient.diagname || "", |
| | | inhospno: patient.inhospno || "", |
| | | outhospno: patient.outhospno || "", |
| | | bedNo: patient.bedNo || "", |
| | | drname: patient.drname || "", |
| | | nurseName: patient.nurseName || "", |
| | | starttime: patient.starttime || patient.admitdate || "", |
| | | mainCategory: this.mainCategory, |
| | | mainCategoryLabel: this.getMainCategoryLabel(), |
| | | subType: this.subType, |
| | | subTypeLabel: this.getSubTypeLabel(), |
| | | archiveForm: JSON.parse(JSON.stringify(this.archiveForm)), |
| | | parentInfo: this.mainCategory === 'child' ? JSON.parse(JSON.stringify(this.parentInfo)) : {}, |
| | | sourcePage: this.standalone ? "standalone" : this.sourcePage, |
| | | status: "active", |
| | | createTime: now, |
| | | updateTime: now, |
| | | }); |
| | | }); |
| | | |
| | | localStorage.setItem("patientArchives", JSON.stringify(archives)); |
| | | const patientList = this.standalone ? [this.standalonePatient] : this.selectedPatients; |
| | | const sourcePage = this.standalone ? "standalone" : this.sourcePage; |
| | | const records = patientList.map((p) => buildArchiveRecord(p, this.subType, sourcePage)); |
| | | saveArchives([...loadArchives(), ...records]); |
| | | |
| | | this.submitting = false; |
| | | this.dialogVisible = false; |
| | | this.$message.success(`成功创建 ${patientList.length} 条建档记录`); |
| | | this.$message.success(`成功创建 ${records.length} 条建档记录`); |
| | | this.$emit("created"); |
| | | |
| | | // 跳转 |
| | | const routePath = this.mainCategory === "child" |
| | | ? "/filing/childHealth" |
| | | : "/filing/maternalHealth"; |
| | | this.$router.push({ path: routePath }); |
| | | // 进入详情页(编辑态) |
| | | const first = records[0]; |
| | | const type = ARCHIVE_TYPES.find((t) => t.key === this.subType); |
| | | if (first && type) { |
| | | this.$router.push({ path: type.detailRoute, query: { id: first.id, edit: 1 } }); |
| | | } |
| | | }, |
| | | handleClose() { this.resetForm(); }, |
| | | }, |